/*
 * Public site styles (base.html.tera). Linked as site.css?v=<version>:
 * browsers keep it for a year, so change ?v= in base.html.tera after editing.
 */

/* CSS Variables - Modern Spiritual Palette */
:root {
    /* Header - Violet (keeping original) */
    --primary-purple: #51263b;
    --primary-purple-light: #9c4d7e;
    --primary-navy: #402867;
    --primary-navy-light: #703f6a;

    /* Golden tones */
    --gold-dark: #b8860b;
    --gold: #d4a853;
    --gold-light: #f0c674;
    --gold-text: #8a6508;  /* gold for text on white or gold-pale (AA) */
    --gold-pale: #fdf5e6;

    /* Pink tones */
    --pink-dark: #c2185b;
    --pink: #e91e63;
    --pink-light: #f48fb1;
    --pink-pale: #fce4ec;

    /* Blue tones */
    --blue-dark: #1565c0;
    --blue: #2196f3;
    --blue-light: #64b5f6;
    --blue-pale: #e3f2fd;

    /* Accent colors */
    --accent-blue: #4990e2;
    --link-color: #1976d2;
    --link-hover: #0d47a1;

    /* Base colors */
    --bg-color: #fafafa;
    --bg-sidebar: rgba(220, 220, 220, 0.5);
    --text-color: #333;
    --text-muted: #666;
    --white: #fff;
    --border-color: #e0e0e0;
    --shadow: 0 1px 2px rgba(45, 27, 78, 0.05), 0 4px 14px rgba(45, 27, 78, 0.07);
    --shadow-hover: 0 2px 4px rgba(45, 27, 78, 0.07), 0 12px 28px rgba(45, 27, 78, 0.13);
    --radius: 10px;
    --line-soft: #ece7f2;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    /* Block headers, footer and buttons: dark purple */
    --block-gradient: linear-gradient(135deg, #2d1b4e 0%, #4a2c6a 30%, #6b3a7d 70%, #8b4a6b 100%);
    --block-gradient-hover: linear-gradient(135deg, #3a2463 0%, #5a3680 30%, #7d4790 70%, #9c5679 100%);
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-size: cover;
    background-position: top center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Background image classes */
body.bg-white {
    background-image: url('/static/images/bg_white.png');
}
body.bg-pink {
    background-image: url('/static/images/bg_pink.png');
}
body.bg-yellow {
    background-image: url('/static/images/bg_yellow.png');
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Comfortaa', cursive;
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

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

/* Header */
/* The sky photo stays; the band behind the title is darkest where the title is */
.site-header {
    background: linear-gradient(90deg, rgba(30, 16, 56, 0.7) 0%, rgba(30, 16, 56, 0.58) 30%, rgba(30, 16, 56, 0.26) 65%, rgba(30, 16, 56, 0.12) 100%);
    color: var(--white);
    position: relative;
    z-index: 100;
}

.header-top {
    width: 90%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--white);
}

.site-logo:hover {
    text-decoration: none;
    color: var(--white);
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--white);
}

.site-title {
    font-family: 'Comfortaa', cursive;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(45, 27, 78, 0.7);
}

.site-tagline {
    font-size: 14px;
    margin-top: 4px;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(30, 15, 55, 0.85);
}

/* Main Navigation */
.main-nav {
    background: linear-gradient(135deg, rgba(45, 27, 78, 0.55) 0%, rgba(74, 44, 106, 0.5) 30%, rgba(107, 58, 125, 0.45) 70%, rgba(139, 74, 107, 0.45) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    width: 90%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    flex-wrap: wrap;
}

.nav-menu li a {
    display: block;
    padding: 12px 18px;
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius) var(--radius) 0 0;
    transition: background 0.2s ease;
}

.nav-menu li a:hover {
    background: rgba(20, 10, 40, 0.25);
    text-decoration: none;
}

.nav-menu li.active a,
.nav-menu li a[aria-current] {
    background: rgba(20, 10, 40, 0.3);
    box-shadow: inset 0 -3px 0 var(--gold-light);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    background: var(--white);
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.mobile-menu-overlay.active .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-header {
    background: linear-gradient(135deg, #5b2cb8 0%, #6c3ce0 50%, #8b5cf6 100%);
    color: var(--white);
    padding: 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-header .site-name {
    font-family: 'Comfortaa', cursive;
    font-size: 18px;
    font-weight: 600;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.mobile-menu-section {
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-section-header {
    color: var(--white);
    padding: 12px 15px;
    font-family: 'Comfortaa', cursive;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Different colors for each mobile menu section */
/* Note: nth-child(2) = first section because mobile-menu-header is child(1) */
.mobile-menu-section:nth-child(2) .mobile-menu-section-header {
    background: linear-gradient(135deg, #0d47a1 0%, var(--blue-dark) 100%);
}
/* Gold surfaces carry dark text */
.mobile-menu-section:nth-child(3) .mobile-menu-section-header {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: #2d1b4e;
    text-shadow: none;
}
.mobile-menu-section:nth-child(4) .mobile-menu-section-header {
    background: linear-gradient(135deg, #ad1457 0%, var(--pink-dark) 100%);
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-list li {
    border-bottom: 1px solid #eee;
}

.mobile-menu-list li:last-child {
    border-bottom: none;
}

.mobile-menu-list li a {
    display: block;
    padding: 14px 15px;
    color: var(--text-color);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.mobile-menu-list li a:hover {
    background: var(--gold-pale);
    color: var(--gold-text);
}

.mobile-menu-list li a[aria-current] {
    background: var(--gold-pale);
    color: var(--gold-text);
    font-weight: 600;
    box-shadow: inset 4px 0 0 var(--gold);
}

.mobile-menu-list li a svg {
    margin-right: 10px;
    vertical-align: middle;
}

/* Main Layout - Three Column with CSS Grid */
.main-wrapper {
    width: 90%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 0;
    display: grid;
    grid-template-columns: 24% 1fr 20%;
    gap: 20px;
}

.sidebar-left {
    overflow: hidden;
}

.content-main {
    min-width: 0;
}

.sidebar-right {
    overflow: hidden;
}

/* Sidebar Boxes */
.sidebar-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.sidebar-box-header {
    background: var(--block-gradient);
    color: var(--white);
    padding: 12px 15px;
    font-family: 'Comfortaa', cursive;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(20, 10, 40, 0.35);
    box-shadow: inset 0 -2px 0 rgba(212, 168, 83, 0.55);
}

/* Support box header - violet-purple to match YooMoney button */
/* The header violets, light end past the text */
.sidebar-box-header.support-header {
    background: linear-gradient(135deg, #5b2cb8 0%, #6c3ce0 45%, #8b5cf6 80%, #a78bfa 100%);
}

.sidebar-box-content {
    padding: 15px;
    overflow: hidden;
}

/* Side panels are translucent over the sky, as on the old site; the news box
   stays white, the support box is a little brighter than the rest */
.sidebar-left .sidebar-box,
.sidebar-right .sidebar-box {
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 1px 2px rgba(45, 27, 78, 0.04), 0 4px 14px rgba(45, 27, 78, 0.05);
}

.sidebar-right .sidebar-box.support-box {
    background: rgba(255, 255, 255, 0.78);
}

.sidebar-right #news-box {
    background: var(--white);
    box-shadow: var(--shadow);
}

.sidebar-left .sidebar-menu li,
.sidebar-right .sidebar-menu li {
    border-bottom-color: rgba(45, 27, 78, 0.09);
}

/* Support: amount and button in one row, payment method below */
.support-form {
    padding: 12px 15px 10px;
}

.support-row {
    display: flex;
    gap: 8px;
}

.support-sum {
    position: relative;
    flex: 1;
    min-width: 0;
}

.support-sum input {
    width: 100%;
    height: 36px;
    padding: 0 24px 0 10px;
    border: 1px solid rgba(91, 44, 184, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
    font-size: 14px;
    color: var(--text-color);
    -moz-appearance: textfield;
    appearance: textfield;
}

.support-sum input::-webkit-outer-spin-button,
.support-sum input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.support-sum input:focus {
    outline: none;
    border-color: #6c3ce0;
    box-shadow: 0 0 0 3px rgba(108, 60, 224, 0.18);
}

.support-currency {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.support-btn {
    flex: none;
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #5b2cb8 0%, #6c3ce0 60%, #8b5cf6 100%);
    color: var(--white);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.support-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 2px 8px rgba(91, 44, 184, 0.3);
}

.support-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 8px;
    border: none;
    font-size: 12.5px;
    color: #4a4458;
}

.support-methods label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.support-methods input {
    accent-color: #6c3ce0;
    margin: 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    border-bottom: 1px solid #eee;
}

.sidebar-menu li:last-child {
    border-bottom: none;
}

.sidebar-menu li a {
    display: block;
    padding: 10px 0;
    color: var(--text-color);
    font-size: 13.5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: color 0.2s ease, padding-left 0.2s var(--ease), box-shadow 0.2s ease;
}

.sidebar-menu li a:hover {
    color: #6c3ce0;
    padding-left: 6px;
    text-decoration: none;
}

.sidebar-menu li a[aria-current] {
    color: #5b2cb8;
    font-weight: 600;
    padding-left: 10px;
    box-shadow: inset 3px 0 0 var(--gold);
}

/* Content Box */
.content-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    width: 100%;
}

.content-box-header {
    padding: 18px 24px 16px;
    border-bottom: 1px solid var(--line-soft);
}

.content-box-header h1,
.content-box-header h2 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: var(--blue-dark);
}

/* Page titles: larger, with a thin gold rule */
@media screen {
    .content-box-header h1 {
        font-size: 26px;
        line-height: 1.25;
        overflow-wrap: break-word;
    }

    .content-box-header h1::after {
        content: '';
        display: block;
        width: 64px;
        height: 2px;
        margin-top: 12px;
        border-radius: 2px;
        background: linear-gradient(90deg, var(--gold-dark), var(--gold-light) 70%, transparent);
    }
}

.content-box-body {
    padding: 22px 24px;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease, border-color 0.25s ease;
    border: 1px solid var(--line-soft);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--blue-light);
}

.card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--pink) 0%, var(--pink-light) 100%);
}

.card-body {
    padding: 15px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
    color: var(--blue-dark);
    overflow-wrap: break-word;
}

.card-title a {
    color: inherit;
}

.card-title a:hover {
    color: var(--blue);
}

.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.card-text {
    font-size: 13.5px;
    color: #4a4458;
    line-height: 1.55;
}

/* Section Title (no box) */
.section-title {
    font-size: 21px;
    font-weight: 600;
    color: var(--blue-dark);
    margin: 0 0 16px 0;
}

@media screen {
    .section-title::after {
        content: '';
        display: block;
        width: 48px;
        height: 2px;
        margin-top: 10px;
        border-radius: 2px;
        background: linear-gradient(90deg, var(--gold-dark), var(--gold-light) 70%, transparent);
    }
}

/* Minimal Card Style for Categories */
.cards-grid-categories {
    margin-bottom: 25px;
}

.card-minimal {
    background: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.card-minimal:hover {
    transform: none;
    box-shadow: var(--shadow);
    border-color: var(--gold);
}

.card-minimal .card-body {
    padding: 12px 15px;
}

.card-minimal .card-title {
    font-size: 15px;
    margin-bottom: 4px;
}

.card-minimal .card-meta {
    margin-bottom: 0;
}

/* Article Content (as before; print keeps these, refined for screens below) */
.article-content {
    line-height: 1.8;
    font-size: 15px;
}

.article-content p {
    margin-bottom: 1em;
}

.article-content h2 {
    font-size: 22px;
    color: var(--blue-dark);
    margin: 1.5em 0 0.75em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--blue-light);
}

.article-content h3 {
    font-size: 18px;
    color: var(--gold-dark);
    margin: 1.25em 0 0.5em;
}

.article-content ul, .article-content ol {
    margin: 1em 0 1em 2em;
}

.article-content blockquote {
    margin: 1em 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--gold-pale) 0%, rgba(255,255,255,0.8) 100%);
    border-left: 4px solid var(--gold);
    font-style: italic;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

@media screen {
    /* Comfortable reading */
    .article-content {
        line-height: 1.75;
        font-size: 16.5px;
        color: #2e2a38;
        max-width: 46em;
        overflow-wrap: break-word;
    }

    /* Many texts are justified inline: hyphenation keeps their word gaps even */
    .article-content [style*="justify"],
    .article-content [align="justify"] {
        hyphens: auto;
        -webkit-hyphens: auto;
    }

    .article-content p {
        margin-bottom: 1.05em;
    }

    .article-content > :first-child {
        margin-top: 0;
    }

    .article-content a {
        text-decoration: underline;
        text-decoration-color: rgba(25, 118, 210, 0.35);
        text-decoration-thickness: 1px;
        text-underline-offset: 3px;
    }

    .article-content a:hover {
        text-decoration-color: currentColor;
    }

    .article-content h2 {
        font-size: 23px;
        line-height: 1.3;
        color: var(--blue-dark);
        margin: 1.6em 0 0.7em;
        padding-bottom: 10px;
        border-bottom: 2px solid var(--blue-light);
        hyphens: manual;
    }

    .article-content h3 {
        font-size: 17.5px;
        line-height: 1.5;
        color: var(--gold-text);
        margin: 1.4em 0 0.6em;
        hyphens: manual;
    }

    .article-content h4 {
        font-size: 16.5px;
        line-height: 1.45;
        color: var(--primary-navy);
        margin: 1.3em 0 0.5em;
    }

    .article-content ul, .article-content ol {
        margin: 0 0 1.05em 1.4em;
        padding-left: 0.4em;
    }

    .article-content li {
        margin-bottom: 0.4em;
    }

    .article-content li::marker {
        color: var(--gold-text);
    }

    .article-content img {
        border-radius: 8px;
    }

    .article-content iframe,
    .article-content video,
    .article-content table {
        max-width: 100%;
    }

    .article-content hr {
        border: 0;
        height: 1px;
        margin: 2em 0;
        background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
    }

    .article-content blockquote {
        margin: 1.4em 0;
        padding: 18px 22px;
        background: linear-gradient(135deg, var(--gold-pale) 0%, rgba(255,255,255,0.85) 100%);
        border-left: 3px solid var(--gold);
        font-style: italic;
        border-radius: 0 var(--radius) var(--radius) 0;
        box-shadow: 0 1px 3px rgba(120, 90, 30, 0.08);
    }

    .article-content blockquote > :last-child {
        margin-bottom: 0;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 2px;
    padding: 12px 16px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    font-size: 13px;
}

.breadcrumbs a {
    color: var(--link-color);
}

.breadcrumbs .separator {
    margin: 0 8px;
    color: var(--gold);
}

.breadcrumbs .current {
    color: var(--text-muted);
}

/* Banner Section */
.hero-banner {
    background: var(--white);
    color: #2d1b4e;
    text-align: center;
    margin-bottom: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 250px;
    object-fit: cover;
    object-position: center bottom;
}

.hero-text {
    padding: 30px 20px;
}

.hero-banner h1 {
    font-size: 32px;
    margin-bottom: 15px;
}

.hero-banner h1::after {
    content: '';
    display: block;
    width: 64px;
    height: 2px;
    margin: 14px auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-dark) 25%, var(--gold-light) 50%, var(--gold-dark) 75%, transparent);
}

.hero-banner p {
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
    color: #4a4458;
}

/* News/Updates Section */
.news-list {
    list-style: none;
}

.news-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.news-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.news-excerpt {
    font-size: 13px;
    color: var(--text-muted);
}

/* Sidebar news: smaller type, so the three newest items show in full */
#news-box .news-item {
    padding: 10px 0;
}

#news-box .news-date {
    font-size: 11px;
    margin-bottom: 3px;
}

#news-box .news-title {
    font-size: 12.5px;
    line-height: 1.4;
    margin-bottom: 3px;
}

#news-box .news-excerpt {
    font-size: 12px;
    line-height: 1.5;
}

.sidebar-more-link {
    display: block;
    text-align: center;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
}

/* Banner Styles */
.banner-box {
    margin-bottom: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.banner-box a {
    display: block;
}

.banner-box img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.banner-box:hover img {
    transform: scale(1.02);
}

.banner-text {
    background: var(--white);
    padding: 12px 15px;
    text-align: center;
}

.banner-text h4 {
    font-size: 14px;
    color: var(--primary-navy);
    margin: 0;
}

.banner-text p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 5px 0 0;
}

/* News Link Styles */
.news-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 8px;
    margin: -8px;
    border-radius: var(--radius);
    transition: background-color 0.2s ease;
}

.news-link:hover {
    background-color: var(--pink-pale);
    text-decoration: none;
}

.news-link:hover .news-title {
    color: var(--pink-dark);
}

/* Site Links Cards */
.site-link-card {
    display: block;
    padding: 15px 18px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--link-color);
    font-weight: 500;
    font-size: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-link-card:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-decoration: none;
}

.site-link-card:last-child {
    margin-bottom: 0;
}

/* Gradient backgrounds for site links - matching screenshot */
.site-link-card:nth-child(12n+1) { background: linear-gradient(135deg, #e8f4fc 0%, #f0f8ff 100%); }
.site-link-card:nth-child(12n+2) { background: linear-gradient(135deg, #f5f0e8 0%, #faf8f5 100%); }
.site-link-card:nth-child(12n+3) { background: linear-gradient(135deg, #fff5e6 0%, #fffaf5 100%); }
.site-link-card:nth-child(12n+4) { background: linear-gradient(135deg, #fff0f0 0%, #fff8f8 100%); }
.site-link-card:nth-child(12n+5) { background: linear-gradient(135deg, #f5f5e8 0%, #fafaf5 100%); }
.site-link-card:nth-child(12n+6) { background: linear-gradient(135deg, #e8f5e8 0%, #f5faf5 100%); }
.site-link-card:nth-child(12n+7) { background: linear-gradient(135deg, #f0e8f5 0%, #f8f5fa 100%); }
.site-link-card:nth-child(12n+8) { background: linear-gradient(135deg, #e8f0f5 0%, #f5f8fa 100%); }
.site-link-card:nth-child(12n+9) { background: linear-gradient(135deg, #f5e8f0 0%, #faf5f8 100%); }
.site-link-card:nth-child(12n+10) { background: linear-gradient(135deg, #f0f5e8 0%, #f8faf5 100%); }
.site-link-card:nth-child(12n+11) { background: linear-gradient(135deg, #e8e8f5 0%, #f5f5fa 100%); }
.site-link-card:nth-child(12n+12) { background: linear-gradient(135deg, #f5f0f5 0%, #faf8fa 100%); }

/* Footer */
.site-footer {
    background: linear-gradient(135deg, #2d1b4e 0%, #4a2c6a 30%, #6b3a7d 70%, #8b4a6b 100%);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-container {
    width: 90%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
}

/* Flex rather than grid: columns hidden for visitors in Russia leave no gaps */
.footer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px 40px;
    margin-bottom: 30px;
}

.footer-section {
    flex: 1 1 200px;
}

.footer-section.footer-topics {
    flex: 2 1 340px;
}

.footer-topics ul {
    columns: 2;
    column-gap: 28px;
}

.footer-topics li {
    break-inside: avoid;
}

.footer-section h3 {
    position: relative;
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.18);
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 40px;
    height: 2px;
    background: var(--gold);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255,255,255,0.85);
    font-size: 13.5px;
}

.footer-section a:hover {
    color: var(--white);
    text-decoration: underline;
    text-decoration-color: var(--gold-light);
    text-underline-offset: 3px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 13px;
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--white);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.social-links a:hover {
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 0 2px rgba(240, 198, 116, 0.7);
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    text-decoration: none;
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-navy);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f5f5f5;
    text-decoration: none;
}

/* Search */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.search-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(73, 144, 226, 0.2);
}

.search-btn {
    width: 100%;
    padding: 10px 20px;
    background: var(--block-gradient);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 2px rgba(45, 27, 78, 0.5);
}

.search-btn:hover {
    background: var(--block-gradient-hover);
}

.search-btn:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar-left {
        order: 2;
    }

    .content-main {
        order: 1;
    }

    .sidebar-right {
        order: 3;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    /* Hide desktop navigation on mobile - use mobile menu overlay instead */
    .main-nav {
        display: none;
    }

    /* Narrow header: the title spans most of it, so the band is even */
    .site-header {
        background: linear-gradient(180deg, rgba(30, 16, 56, 0.74) 0%, rgba(30, 16, 56, 0.6) 100%);
    }

    /* Hide left sidebar on mobile - content is in mobile menu */
    .sidebar-left {
        display: none;
    }

    .site-title {
        font-size: 22px;
    }

    .hero-banner h1 {
        font-size: 24px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .mobile-menu-toggle {
        min-width: 44px;
        min-height: 44px;
    }

    .content-box-header {
        padding: 16px 18px 14px;
    }

    .content-box-header h1 {
        font-size: 22px;
    }

    .content-box-body {
        padding: 18px;
    }

    /* Narrow column: hyphenate everything, or lines gape */
    .article-content {
        font-size: 16px;
        line-height: 1.7;
        hyphens: auto;
        -webkit-hyphens: auto;
    }

    /* Long category names: one line each, the current page in full */
    .breadcrumbs {
        font-size: 12.5px;
    }

    .breadcrumbs a {
        display: inline-block;
        max-width: 10.5em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }

    /* Footer links: finger-sized */
    .footer-section li {
        margin-bottom: 0;
    }

    .footer-section li a {
        display: inline-block;
        padding: 7px 0;
    }

    .footer-topics ul {
        column-gap: 20px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }

/* ============================================
   ACCESSIBILITY STYLES
   ============================================ */

/* Admin preview of the site as seen from Russia */
.ru-preview {
    background: #2d1b4e;
    color: var(--white);
    text-align: center;
    font-size: 14px;
    padding: 8px 16px;
}

.ru-preview a {
    color: #ffd54f;
    font-weight: 600;
    margin-left: 8px;
}

/* Skip to Main Content Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-navy);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius);
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 10px;
    outline: 3px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Enhanced Focus Styles */
*:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--accent-blue);
    outline-offset: 2px;
}

.btn:focus-visible,
button:focus-visible {
    box-shadow: 0 0 0 3px rgba(73, 144, 226, 0.4);
}

/* On the dark header, menus, footer and banners a light ring shows better */
.site-header :focus-visible,
.site-footer :focus-visible,
.sidebar-box-header :focus-visible,
.cookie-consent :focus-visible,
.ru-preview :focus-visible {
    outline-color: var(--gold-light);
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s linear infinite;
}

.loading-spinner.lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 15px;
}

.loading-text {
    color: var(--text-muted);
    font-size: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Page load: content boxes rise in, the columns a moment apart */
@keyframes rise-in {
    from { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: no-preference) {
    .content-main > *,
    .sidebar-left > *,
    .sidebar-right > * {
        animation: rise-in 0.45s var(--ease) backwards;
    }

    .content-main > :nth-child(2) { animation-delay: 0.05s; }
    .content-main > :nth-child(n+3) { animation-delay: 0.1s; }
    .sidebar-left > * { animation-delay: 0.08s; }
    .sidebar-right > * { animation-delay: 0.12s; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .loading-spinner {
        animation: none;
        border-top-color: var(--accent-blue);
        border-right-color: var(--accent-blue);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
    :root {
        --text-color: #000;
        --text-muted: #333;
        --border-color: #000;
        --link-color: #0000ee;
        --link-hover: #551a8b;
    }

    .content-box,
    .sidebar-box,
    .card {
        border: 2px solid #000;
    }

    a {
        text-decoration: underline;
    }

    *:focus-visible {
        outline: 3px solid #000;
        outline-offset: 2px;
    }
}

/* Dark Mode Support (optional, user preference) */
@media (prefers-color-scheme: dark) {
    /* Only activate if user explicitly prefers dark */
}

/* Print Styles */
.print-copyright {
    display: none;
}

@media print {
    /* Hide non-essential elements */
    .site-header,
    .sidebar-left,
    .sidebar-right,
    .site-footer,
    .breadcrumbs,
    .mobile-menu-toggle,
    .skip-link,
    .search-form,
    .pagination,
    .filters-bar,
    .articles-toolbar,
    .mobile-menu-overlay,
    .main-nav,
    .related-articles,
    .share-buttons {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Reset layout for print */
    body {
        background: white !important;
        background-image: none !important;
        color: black;
        font-size: 12pt;
        line-height: 1.5;
        min-height: auto !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    html {
        background: white !important;
    }

    .main-wrapper {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: auto !important;
    }

    .content-main {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .content-box {
        box-shadow: none;
        border: none;
        margin: 0 !important;
    }

    .content-box-header {
        background: none !important;
        color: black !important;
        padding: 10px 0 !important;
        border-bottom: 2px solid #333;
    }

    .content-box-header h1 {
        color: black !important;
        text-shadow: none !important;
    }

    /* Links - show URL */
    a[href]:after {
        content: none;
    }

    /* Show print copyright */
    .print-copyright {
        display: block !important;
        margin-top: 30px;
        padding-top: 15px;
        border-top: 1px solid #ccc;
        font-size: 10pt;
        color: #333;
        text-align: center;
    }

    .print-copyright p {
        margin: 5px 0;
    }

    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    .content-box, .card {
        page-break-inside: avoid;
    }
}

/* Cookie consent banner */
.cookie-consent {
    position: fixed;
    left: 20px;
    bottom: 20px;
    max-width: 420px;
    background: linear-gradient(135deg, #2d1b4e 0%, #4a2c6a 100%);
    color: var(--white);
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(212, 168, 83, 0.35);
    z-index: 9999;
    box-shadow: 0 18px 40px -12px rgba(20, 10, 40, 0.55);
}

.cookie-consent-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.cookie-consent-content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.cookie-consent-content a {
    color: var(--gold-light);
    text-decoration: underline;
}

.cookie-consent-content a:hover {
    color: var(--gold);
}

.cookie-consent-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    min-height: 40px;
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.cookie-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cookie-btn-accept {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: #2d1b4e;
}

.cookie-btn-decline {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.3);
}

.cookie-btn-decline:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 600px) {
    .cookie-consent {
        left: 0;
        right: 0;
        bottom: 0;
        max-width: none;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        border-radius: 12px 12px 0 0;
        border-width: 1px 0 0;
    }

    .cookie-consent-content {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .cookie-consent-content p {
        flex: 1;
        font-size: 12px;
        line-height: 1.4;
    }

    .cookie-consent-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .cookie-btn {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Print: articles print as before (their print rules are in article.html.tera);
   the reading refinements above are screen-only */
@media print {
    .article-content {
        hyphens: manual;
        -webkit-hyphens: manual;
    }

    .content-main > *,
    .sidebar-left > *,
    .sidebar-right > * {
        animation: none;
    }
}
