/* =============================================================
   SOSH31 Template — Main Stylesheet
   Школа №31 г.Чебоксары | Antigravity AI — 2026
   ============================================================= */

/* ---------------------------------------------------------------
   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;

    /* Spacing */
    --sp-xs:  4px;
    --sp-sm:  8px;
    --sp-md:  16px;
    --sp-lg:  24px;
    --sp-xl:  40px;
    --sp-2xl: 64px;

    /* 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 {
    font-size: var(--base-size);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 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);
}

/* 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;
}

/* 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
   --------------------------------------------------------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-md);
}

/* 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-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: var(--white);
    box-shadow: 0 2px 12px rgba(0,55,140,.10);
    padding: var(--sp-md) 0;
    position: sticky;
    top: 0;
    z-index: 800;
}

.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(--text-dark) !important;
}
.site-logo:hover { text-decoration: none !important; }

.logo-emblem {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--accent);
}
.logo-emblem.small {
    width: 40px; height: 40px;
    font-size: 1rem !important;
    flex-shrink: 0;
}
.logo-number {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
}
.logo-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.logo-school-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}
.logo-school-desc {
    font-size: .78rem;
    color: var(--text-mid);
    line-height: 1.2;
}
.logo-school-city {
    font-size: .75rem;
    color: var(--text-light);
    font-weight: 600;
}

.header-emblem {
    opacity: .7;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.2));
}

/* ---------------------------------------------------------------
   6. NAVIGATION
   --------------------------------------------------------------- */
.site-nav {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    box-shadow: 0 3px 12px rgba(0,55,140,.25);
    position: relative;
    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: 14px 18px;
    color: rgba(255,255,255,.92);
    font-family: var(--font-heading);
    font-size: .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;
}
.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);
}

/* Blog layout */
.content-area .items-row .item {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--sp-lg);
    margin-bottom: var(--sp-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-light);
    transition: box-shadow var(--transition), border-color var(--transition);
}
.content-area .items-row .item:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

/* 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: var(--sp-sm) var(--sp-md);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: .2px;
    border-bottom: 3px solid var(--accent);
}
.sosh31-card-body {
    padding: var(--sp-md);
}

/* Sidebar nav */
.sidebar .nav.menu {
    list-style: none;
    padding: 0; margin: 0;
}
.sidebar .nav.menu li a {
    display: block;
    padding: 8px var(--sp-md) 8px var(--sp-sm);
    font-size: .85rem;
    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: var(--sp-md);
    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;
}

/* ---------------------------------------------------------------
   15. FOOTER
   --------------------------------------------------------------- */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,.82);
    margin-top: 0;
}
.footer-main {
    padding: var(--sp-2xl) 0;
}
.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; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    margin-bottom: var(--sp-lg);
}
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
   --------------------------------------------------------------- */
@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); }

    .sidebar { padding: 0; margin-top: var(--sp-xl); }
    .sidebar-left { padding: 0; margin-top: 0; margin-bottom: var(--sp-xl); }

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

@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); }
}

/* ---------------------------------------------------------------
   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; }
}
