/* ---------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   --------------------------------------------------------------- */
:root {
    /* Brand colours */
    --primary:        #0055a5;   /* deep school blue */
    --primary-dark:   #003d7a;
    --primary-light:  #3a7fd4;
    --accent:         #e8a000;   /* gold accent */
    --accent-light:   #ffd44d;

    /* Neutrals */
    --white:          #ffffff;
    --bg-light:       #f4f7fb;
    --bg-grey:        #e9eef5;
    --text-dark:      #1a2035;
    --text-mid:       #3d4f6e;
    --text-light:     #6b7fa3;
    --border:         #d5dce8;

    /* Typography */
    --font-heading:   'Montserrat', 'Arial', sans-serif;
    --font-body:      'Open Sans', 'Arial', sans-serif;
    --base-size:      16px;

    /* Fluid Spacing tokens */
    --sp-xs:  clamp(3px, 0.35vw, 5px);
    --sp-sm:  clamp(6px, 0.75vw, 10px);
    --sp-md:  clamp(12px, 1.3vw, 18px);
    --sp-lg:  clamp(18px, 2vw, 28px);
    --sp-xl:  clamp(26px, 3.2vw, 44px);
    --sp-2xl: clamp(38px, 4.8vw, 68px);

    /* Radii */
    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  16px;
    --radius-xl:  24px;

    /* Shadows */
    --shadow-sm:  0 1px 4px rgba(0,60,140,.08);
    --shadow-md:  0 4px 16px rgba(0,60,140,.12);
    --shadow-lg:  0 8px 32px rgba(0,60,140,.16);
    --shadow-hover: 0 8px 24px rgba(0,85,165,.20);

    /* Transitions */
    --transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ---------------------------------------------------------------
   2. RESET & BASE
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    /* Fluid typography base: scales smoothly between 14px on mobile and 18px on large desktop */
    font-size: clamp(14px, 0.85rem + 0.35vw, 18px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-dark);
    background: var(--bg-light);
    overflow-x: hidden;
    width: 100%;
}

/* Font-size switcher utility classes */
body.font-size-large  { font-size: 1.15rem; }
body.font-size-xlarge { font-size: 1.3rem; }

img { max-width: 100%; height: auto; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--primary-dark); text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-dark);
    margin-top: 0;
}
h1 { font-size: clamp(1.45rem, 2.4vw + 0.6rem, 2.3rem); }
h2 { font-size: clamp(1.25rem, 1.8vw + 0.5rem, 1.85rem); }
h3 { font-size: clamp(1.1rem, 1.4vw + 0.4rem, 1.5rem); }
h4 { font-size: clamp(0.98rem, 1.1vw + 0.35rem, 1.25rem); }
h5 { font-size: 1.05rem; }
h6 { font-size: 0.95rem; }

/* Skip link */
.skip-to-main {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-to-main:focus {
    position: fixed;
    top: 0; left: 0;
    width: auto; height: auto;
    padding: var(--sp-sm) var(--sp-md);
    background: var(--primary);
    color: var(--white);
    z-index: 9999;
    font-size: .9rem;
    border-radius: 0 0 var(--radius-md) 0;
}

/* ---------------------------------------------------------------
   3. LAYOUT HELPERS (100% FULL-WIDTH FLUID)
   --------------------------------------------------------------- */
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    padding: 0 clamp(8px, 1vw, 24px);
    box-sizing: border-box;
}

/* Bootstrap-compatible row/span stays unchanged */

/* ---------------------------------------------------------------
   4. TOPBAR
   --------------------------------------------------------------- */
.topbar {
    background: var(--primary-dark);
    color: rgba(255,255,255,.85);
    font-size: .78rem;
    padding: 5px 0;
    border-bottom: 2px solid var(--accent);
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-sm);
}
.topbar-icon { margin-right: 3px; }
.topbar-left { display: flex; align-items: center; gap: var(--sp-xs); flex-wrap: wrap; }
.topbar-right { display: flex; align-items: center; gap: var(--sp-sm); }

.topbar-phone {
    color: rgba(255,255,255,.9);
    text-decoration: none;
    transition: color var(--transition);
}
.topbar-phone:hover {
    color: var(--white);
    text-decoration: underline;
}

.topbar-link {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}
.topbar-link:hover {
    background: rgba(255,255,255,.15);
    color: var(--white);
    text-decoration: none;
}

.font-size-switcher {
    font-weight: 600;
    letter-spacing: .5px;
    border: 1px solid rgba(255,255,255,.25);
    cursor: pointer;
}

/* ---------------------------------------------------------------
   5. HEADER
   --------------------------------------------------------------- */
.site-header {
    background: linear-gradient(90deg, rgb(5 33 73) 0%, rgb(10 48 102 / 0%) 65%, rgb(13 62 128 / 0%) 100%), url(../images/header-bg.jpg) center center / cover no-repeat;
    box-shadow: 0 4px 18px rgba(0, 35, 80, 0.20);
    padding: clamp(120px, 8vw, 120px) 0;
    position: relative;
    z-index: 600;
    border-bottom: 2px solid var(--accent);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-md);
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    text-decoration: none !important;
    color: var(--white) !important;
}
.site-logo:hover { text-decoration: none !important; }

.logo-emblem {
    width: clamp(48px, 4.5vw, 64px);
    height: clamp(48px, 4.5vw, 64px);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--accent-light);
}
.logo-emblem.small {
    width: 40px; height: 40px;
    font-size: 1rem !important;
    flex-shrink: 0;
}
.logo-number {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.logo-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.logo-school-name {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}
.logo-school-desc {
    font-size: clamp(0.78rem, 1.8vw, 0.85rem);
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.logo-school-city {
    font-size: 0.78rem;
    color: var(--accent-light);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.header-emblem {
    opacity: 0.9;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

/* ---------------------------------------------------------------
   6. NAVIGATION
   --------------------------------------------------------------- */
.site-nav {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    box-shadow: 0 4px 14px rgba(0,55,140,.25);
    position: sticky;
    top: 0;
    z-index: 700;
}
.site-nav .container {
    display: flex;
    align-items: stretch;
    position: relative;
}

/* Hamburger */
.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 36px; height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin: var(--sp-sm) 0;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.nav-burger:hover { background: rgba(255,255,255,.15); }
.nav-burger span {
    display: block;
    width: 100%; height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}

/* Site menu */
.site-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.site-menu li {
    position: relative;
}
.site-menu > li > a {
    display: block;
    padding: clamp(10px, 1.1vw, 14px) clamp(11px, 1.2vw, 18px);
    color: rgba(255,255,255,.92);
    font-family: var(--font-heading);
    font-size: clamp(0.8rem, 0.9vw, 0.875rem);
    font-weight: 600;
    letter-spacing: .3px;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}
.site-menu > li > a:hover,
.site-menu > li.active > a,
.site-menu > li.current > a {
    background: rgba(255,255,255,.15);
    color: var(--white);
    text-decoration: none;
}
.site-menu > li.current > a,
.site-menu > li.active > a {
    border-bottom: 3px solid var(--accent);
    padding-bottom: 11px;
}

/* Dropdown */
.site-menu li ul {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    min-width: 240px;
    background: var(--white);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    list-style: none;
    padding: var(--sp-xs) 0;
    margin: 0;
    z-index: 1000;
    border-top: 3px solid var(--accent);
}
.site-menu li:hover > ul { display: block; }
.site-menu li ul li a {
    display: block;
    padding: 10px var(--sp-md);
    color: var(--text-dark);
    font-size: .875rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}
.site-menu li ul li a:hover {
    background: var(--bg-light);
    color: var(--primary);
    text-decoration: none;
    padding-left: var(--sp-lg);
}

/* ---------------------------------------------------------------
   7. BREADCRUMB
   --------------------------------------------------------------- */
.breadcrumb-bar {
    padding: var(--sp-sm) 0;
    background: var(--bg-grey);
    border-bottom: 1px solid var(--border);
}
.breadcrumb {
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: .82rem;
    color: var(--text-light);
}
.breadcrumb li::after { content: '›'; margin-left: 4px; color: var(--text-light); }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb a { color: var(--primary); }
.breadcrumb .active { color: var(--text-dark); font-weight: 600; }

/* ---------------------------------------------------------------
   8. HERO SECTION
   --------------------------------------------------------------- */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: var(--sp-2xl) 0;
    color: var(--white);
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 400'%3E%3Ccircle cx='900' cy='200' r='300' fill='rgba(255,255,255,0.03)'/%3E%3Ccircle cx='1100' cy='50' r='200' fill='rgba(255,255,255,0.04)'/%3E%3C/svg%3E") no-repeat right center;
    background-size: contain;
    pointer-events: none;
}

/* ---------------------------------------------------------------
   9. QUICK LINKS BAR
   --------------------------------------------------------------- */
.quick-links-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-md) 0;
}

/* ---------------------------------------------------------------
   10. MAIN LAYOUT
   --------------------------------------------------------------- */
.main-wrapper {
    padding: var(--sp-xl) 0;
}

/* ---------------------------------------------------------------
   11. CONTENT AREA
   --------------------------------------------------------------- */
.content-area {
    min-height: 400px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.content-area a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Responsive media in content */
.content-area img,
.item-page img,
article img {
    max-width: 100% !important;
    height: auto !important;
}

.content-area iframe,
.content-area embed,
.content-area object,
.content-area video {
    max-width: 100%;
}

.video-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: var(--sp-md);
    border-radius: var(--radius-sm);
}
.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}
.content-area .page-header {
    border-bottom: 3px solid var(--primary);
    margin-bottom: var(--sp-lg);
    padding-bottom: var(--sp-sm);
}
.content-area .page-header h2 {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin: 0;
}

/* Article styles */
.content-area article,
.content-area .item-page {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--sp-xl);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--sp-lg);
}

/* Fluid typography normalization for article content (neutralizes hardcoded Word/TinyMCE sizes) */
.content-area p,
.content-area li,
.content-area td,
.content-area th {
    font-size: 1rem;
    line-height: 1.65;
}
.content-area span[style*="font-size"],
.content-area p[style*="font-size"] {
    font-size: 1rem !important;
    line-height: 1.65 !important;
}
.content-area h1[style*="font-size"] { font-size: clamp(1.45rem, 2.4vw + 0.6rem, 2.3rem) !important; }
.content-area h2[style*="font-size"] { font-size: clamp(1.25rem, 1.8vw + 0.5rem, 1.85rem) !important; }
.content-area h3[style*="font-size"] { font-size: clamp(1.1rem, 1.4vw + 0.4rem, 1.5rem) !important; }

/* ---------------------------------------------------------------
   11.1 NEWS CARDS & GRID
   --------------------------------------------------------------- */
.news-grid-module {
    margin: var(--sp-md) 0 var(--sp-xl) 0;
}

.news-grid {
    display: grid;
    /* Ровно 3 равные колонки, занимающие всё доступное пространство */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* Адаптивный промежуток между карточками */
    gap: clamp(14px, 1.8vw, 24px);
    margin: var(--sp-md) 0 var(--sp-xl) 0;
    width: 100%;
}

.news-card {
    min-width: 0;   /* Защита от переполнения колонок длинными заголовками */
    width: 100%;
}

/* Планшеты: 2 карточки в ряд */
@media (max-width: 980px) {
    .news-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Смартфоны: 1 карточка в ряд (на всю ширину) */
@media (max-width: 640px) {
    .news-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

/* Photo / Media wrapper */
.news-card-media {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-grey);
    text-decoration: none !important;
}
.news-card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.35s ease;
}
.news-card:hover .news-card-img {
    transform: scale(1.05);
}

/* Placeholder when news has no photo */
.news-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--white);
    position: relative;
    user-select: none;
}
.news-card-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.18) 0%, transparent 60%);
    pointer-events: none;
}
.news-placeholder-emblem {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.news-placeholder-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.92);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Card content */
.news-card-content {
    padding: clamp(14px, 1.4vw, 20px);
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
.news-card-meta {
    margin-bottom: 8px;
}
.news-card-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 600;
}
.news-card-date .news-icon {
    stroke: var(--accent);
}

.news-card-title {
    margin: 0 0 10px 0;
    font-family: var(--font-heading);
    font-size: clamp(0.98rem, 1.05vw, 1.1rem);
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color var(--transition);
}
.news-card-title a:hover {
    color: var(--primary);
    text-decoration: none;
}

.news-card-snippet {
    margin: 0 0 16px 0;
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--text-mid);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--bg-grey);
}
.news-card-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none !important;
    transition: color var(--transition), gap var(--transition);
}
.news-card-more:hover {
    color: var(--primary-dark);
    gap: 9px;
    text-decoration: none !important;
}
.news-more-arrow {
    transition: transform var(--transition);
}
.news-card:hover .news-more-arrow {
    transform: translateX(3px);
}

/* Fallback news list */
.category-module.mod-list {
    list-style: none;
    padding: 0; margin: 0;
}
.category-module.mod-list li {
    border-bottom: 1px solid var(--border);
    padding: var(--sp-sm) 0;
}
.category-module.mod-list li:last-child { border-bottom: none; }
.category-module .mod-articles-category-date {
    display: block;
    font-size: .78rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* ---------------------------------------------------------------
   12. SIDEBAR
   --------------------------------------------------------------- */
.sidebar {
    padding-left: var(--sp-md);
}
.sidebar-left { padding-left: 0; padding-right: var(--sp-md); }

/* Module card (style="sosh31card") */
.sosh31-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--sp-md);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow var(--transition);
}
.sosh31-card:hover { box-shadow: var(--shadow-md); }
.sosh31-card-header {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: clamp(11px, 1.1vw, 15px) clamp(12px, 1.2vw, 18px);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(0.92rem, 1vw, 1.05rem);
    line-height: 1.35;
    letter-spacing: .2px;
    border-bottom: 3px solid var(--accent);
}
.sosh31-card-body {
    padding: clamp(10px, 1.2vw, 16px);
}

/* Sidebar nav */
.sidebar .nav.menu {
    list-style: none;
    padding: 0; margin: 0;
}
.sidebar .nav.menu li {
    margin-bottom: 5px;
}
.sidebar .nav.menu li:last-child {
    margin-bottom: 0;
}
.sidebar .nav.menu li a {
    display: block;
    padding: 12px var(--sp-md) 12px 14px;
    font-size: clamp(0.88rem, 0.95vw, 0.94rem);
    line-height: 1.5;
    color: var(--text-mid);
    border-bottom: 1px solid var(--bg-grey);
    transition: background var(--transition), color var(--transition), padding var(--transition);
    border-radius: var(--radius-sm);
}
.sidebar .nav.menu li a:hover,
.sidebar .nav.menu li.active a {
    background: var(--bg-light);
    color: var(--primary);
    padding-left: calc(var(--sp-md) + 2px);
    text-decoration: none;
}
.sidebar .nav.menu li.active a {
    font-weight: 700;
    color: var(--primary-dark);
}

/* ---------------------------------------------------------------
   13. MODULE STYLES (sosh31xhtml)
   --------------------------------------------------------------- */
.sosh31-module {
    margin-bottom: var(--sp-lg);
}
.sosh31-module-header {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    border-left: 4px solid var(--accent);
    padding-left: var(--sp-sm);
    margin-bottom: var(--sp-md);
}

/* ---------------------------------------------------------------
   14. BOTTOM MODULES
   --------------------------------------------------------------- */
.bottom-modules {
    background: var(--bg-grey);
    border-top: 1px solid var(--border);
    padding: var(--sp-xl) 0;
}
.bottom-modules .row-fluid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-lg);
}
.bottom-modules .row-fluid > [class*="span"] {
    flex: 1 1 280px;
    width: auto !important;
    margin-left: 0 !important;
    float: none !important;
}

/* ---------------------------------------------------------------
   15. FOOTER
   --------------------------------------------------------------- */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,.82);
    margin-top: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.footer-main {
    padding: var(--sp-2xl) 0;
}
.footer-main .row-fluid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-lg);
}
.footer-main .row-fluid > [class*="span"] {
    flex: 1 1 280px;
    width: auto !important;
    margin-left: 0 !important;
    float: none !important;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    margin-bottom: var(--sp-md);
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--white);
    font-size: .95rem;
    line-height: 1.3;
}
.footer-desc {
    font-size: .82rem;
    color: rgba(255,255,255,.65);
    line-height: 1.6;
}
.footer-heading {
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--sp-md);
    padding-bottom: var(--sp-xs);
    border-bottom: 2px solid rgba(255,255,255,.15);
}
.footer-contacts {
    list-style: none;
    padding: 0; margin: 0;
}
.footer-contacts li {
    padding: 4px 0;
    font-size: .85rem;
    color: rgba(255,255,255,.78);
}
.footer-links {
    list-style: none;
    padding: 0; margin: 0;
}
.footer-links li { padding: 4px 0; }
.footer-links a {
    color: rgba(255,255,255,.75);
    font-size: .85rem;
    transition: color var(--transition), padding var(--transition);
    display: inline-block;
}
.footer-links a:hover {
    color: var(--accent-light);
    text-decoration: none;
    padding-left: 4px;
}

.footer-bottom {
    background: rgba(0,0,0,.25);
    border-top: 1px solid rgba(255,255,255,.1);
    padding: var(--sp-md) 0;
}
.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-sm);
    font-size: .8rem;
    color: rgba(255,255,255,.55);
}
.footer-joomla a { color: rgba(255,255,255,.55); }
.footer-joomla a:hover { color: var(--accent-light); }

/* ---------------------------------------------------------------
   16. JOOMLA COMPONENT OVERRIDES
   --------------------------------------------------------------- */

/* Buttons */
.btn-primary,
.btn.btn-primary {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 8px 20px;
    transition: background var(--transition), box-shadow var(--transition);
}
.btn-primary:hover, .btn.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

/* Pagination */
.pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-xs);
    list-style: none;
    padding: 0; margin: var(--sp-lg) 0;
}
.pagination ul li a,
.pagination ul li span {
    display: block;
    padding: 6px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-mid);
    font-size: .85rem;
    transition: background var(--transition), color var(--transition);
}
.pagination ul li a:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    text-decoration: none;
}
.pagination ul li.active span {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Search */
.search input[type="search"],
.search input[type="text"] {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: .9rem;
    transition: border-color var(--transition);
    width: 100%;
}
.search input:focus {
    outline: none;
    border-color: var(--primary);
}
.search .btn { margin-top: var(--sp-sm); }

/* Alert / System messages */
#system-message-container .alert {
    border-radius: var(--radius-md);
    border-left: 4px solid;
    margin-bottom: var(--sp-md);
    padding: var(--sp-md);
}
.alert-message { border-color: var(--primary); background: #e8f0fc; color: var(--primary-dark); }
.alert-error   { border-color: #c0392b; background: #fdecea; color: #922b21; }
.alert-warning { border-color: var(--accent); background: #fff8e1; color: #7d5000; }
.alert-success { border-color: #27ae60; background: #eafaf1; color: #1e8449; }

/* Form controls responsiveness */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
select,
textarea {
    max-width: 100%;
    box-sizing: border-box;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    margin-bottom: var(--sp-lg);
}
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--sp-lg);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 1px var(--border);
}
.table-responsive > table {
    margin-bottom: 0;
}
th {
    background: var(--primary);
    color: var(--white);
    padding: 10px 12px;
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 600;
}
td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
tr:nth-child(even) td { background: var(--bg-light); }

/* ---------------------------------------------------------------
   17. ACCESSIBILITY & FOCUS STYLES
   --------------------------------------------------------------- */
*:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------
   18. RESPONSIVE & FLUID LAYOUT
   --------------------------------------------------------------- */
/* Desktop fluid columns */
@media (min-width: 981px) {
    .main-wrapper .row-fluid {
        display: flex;
        gap: clamp(18px, 2vw, 36px);
        align-items: flex-start;
        width: 100%;
    }
    .main-wrapper .sidebar-left {
        flex: 0 0 clamp(400px, 26vw, 560px);
        width: auto !important;
        margin-left: 0 !important;
        padding: 0 !important;
        float: none !important;
    }
    .main-wrapper .content-area {
        flex: 1 1 0;
        min-width: 0;
        width: auto !important;
        margin-left: 0 !important;
        float: none !important;
    }
    .main-wrapper .sidebar-right {
        flex: 0 0 clamp(240px, 18vw, 320px);
        width: auto !important;
        margin-left: 0 !important;
        padding: 0 !important;
        float: none !important;
    }
}

@media (max-width: 980px) {
    .topbar .container { flex-direction: column; align-items: flex-start; }
    .topbar-right { margin-top: var(--sp-xs); }
    .logo-school-name { font-size: 1rem; }

    .site-nav .container { flex-direction: column; align-items: flex-start; }
    .nav-burger { display: flex; }
    .site-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(0,0,0,.1);
        border-top: 1px solid rgba(255,255,255,.15);
        padding: var(--sp-sm) 0;
    }
    .site-menu.is-open { display: flex; }
    .site-menu > li > a { padding: 12px var(--sp-md); }

    .site-menu li ul {
        position: static;
        display: none !important;
        box-shadow: none;
        border-radius: 0;
        background: rgba(0,0,0,.1);
        border-top: 1px solid rgba(255,255,255,.1);
        padding-left: var(--sp-md);
    }
    .site-menu li.open > ul { display: block !important; }
    .site-menu li ul li a { color: rgba(255,255,255,.85); }

    /* Flex ordering: article content is shown first on mobile, sidebars below */
    .main-wrapper .row-fluid {
        display: flex;
        flex-direction: column;
    }
    .content-area {
        order: 1;
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
    }
    .sidebar-left {
        order: 2;
        padding: 0;
        margin-top: var(--sp-xl);
        margin-bottom: 0;
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
    }
    .sidebar-right {
        order: 3;
        padding: 0;
        margin-top: var(--sp-lg);
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
    }

    /* Stack spans on mobile */
    [class*="span"] { float: none !important; width: 100% !important; margin-left: 0 !important; display: block; }
}

@media (max-width: 768px) {
    /* Reset image floats inside content so mobile text doesn't get squeezed */
    .content-area img,
    .content-area img[style*="float"],
    .content-area .pull-left,
    .content-area .pull-right {
        float: none !important;
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
        height: auto !important;
    }

    /* Stack table cells that contain images (e.g. poster gallery on homepage) */
    .content-area table td:has(img) {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 8px 0 !important;
    }
}

@media (max-width: 640px) {
    .logo-emblem { width: 48px; height: 48px; }
    .logo-number { font-size: 1.2rem; }
    .logo-school-name { font-size: .95rem; }
    .logo-school-desc { display: none; }
    .header-emblem { display: none; }
    .footer-main .container [class*="span"] { margin-bottom: var(--sp-lg); }
    .footer-bottom .container { flex-direction: column; text-align: center; }
    .content-area article,
    .content-area .item-page { padding: var(--sp-md); }
}

@media (max-width: 480px) {
    .topbar .container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--sp-xs);
    }
    .topbar-left {
        justify-content: center;
    }
    .topbar-right {
        justify-content: center;
        flex-wrap: wrap;
    }
    .pagination ul {
        justify-content: center;
    }
    .pagination ul li a,
    .pagination ul li span {
        padding: 5px 10px;
        font-size: .8rem;
    }
    .sosh31-card-body {
        padding: var(--sp-sm);
    }
}

/* ---------------------------------------------------------------
   19. PRINT
   --------------------------------------------------------------- */
@media print {
    .topbar, .site-nav, .site-footer, .breadcrumb-bar, .quick-links-bar,
    .nav-burger, .sidebar-right { display: none !important; }
    .main-wrapper { padding: 0; }
    body { font-size: 12pt; color: #000; }
    a { color: #000; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; }
}