/* =====================================================================
   Maritime / Nautical — Library Site Design Variant 7
   Scientific-Technical Library of SGUWT
   Deep navy, ocean blue, sand, brass gold. Wave decorations, compass/anchor accents.
   ===================================================================== */

/* -- CSS Variables -- */
:root {
    --navy: #0a1628;
    --navy-light: #0f1f3a;
    --navy-mid: #132847;
    --ocean: #1565c0;
    --ocean-light: #1e88e5;
    --ocean-dark: #0d47a1;
    --white: #ffffff;
    --sand: #f5e6c8;
    --sand-light: #faf3e6;
    --sand-dark: #e8d4a8;
    --gold: #c9a84c;
    --gold-light: #dbc06e;
    --gold-dark: #a88a32;
    --text-primary: #e8edf5;
    --text-secondary: #b0bdd0;
    --text-muted: #6b7d96;
    --text-dark: #1a2332;
    --text-light: #c8d3e2;
    --navy-dark: #060f1e;
    --bg-card: rgba(15, 31, 58, 0.7);
    --bg-card-hover: rgba(21, 40, 71, 0.85);
    --border-subtle: rgba(201, 168, 76, 0.15);
    --border-gold: rgba(201, 168, 76, 0.35);
    --shadow-navy: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.3);
    --shadow-gold: 0 0 20px rgba(201, 168, 76, 0.1);
    --brass-gold: #c9a84c;
    --navy-deep: #060f1e;
    --border-light: rgba(201, 168, 76, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
    --radius-lg: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --max-width: 1200px;
    --header-height: 76px;
    --nav-height: 52px;
}

/* -- Reset & Base -- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--navy);
    color: var(--text-primary);
    line-height: 1.7;
    font-weight: 400;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle ocean gradient background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 10% 90%, rgba(21, 101, 192, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 20%, rgba(201, 168, 76, 0.04) 0%, transparent 50%),
        linear-gradient(180deg, var(--navy) 0%, #0c1a30 50%, #081220 100%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--gold-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--white);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }

.section { display: none; position: relative; z-index: 1; }
.section.active { display: block; animation: fadeSection 0.5s ease; }

@keyframes fadeSection {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- Header -- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(180deg, rgba(10, 22, 40, 0.95) 0%, rgba(10, 22, 40, 0.88) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-gold);
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    color: var(--gold);
    flex-shrink: 0;
    animation: spinSlow 30s linear infinite;
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.logo-text { display: flex; flex-direction: column; }

.logo-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.04em;
}

.logo-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* -- Mobile menu button -- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-xs);
    cursor: pointer;
    padding: 7px;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* -- Navigation (bridge control panel style) -- */
.site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: linear-gradient(180deg, var(--navy-mid) 0%, var(--navy-light) 100%);
    border-bottom: 2px solid var(--border-gold);
    z-index: 99;
    overflow: visible;
    transition: top 0.35s ease;
}

/* Decorative brass strip above nav */
.site-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 20%, var(--gold-light) 50%, var(--gold) 80%, transparent 100%);
    opacity: 0.5;
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
    position: relative;
}

.nav-link:hover {
    color: var(--gold-light);
    background: rgba(201, 168, 76, 0.08);
    border-color: rgba(201, 168, 76, 0.15);
}

.nav-link.active {
    color: var(--gold);
    background: rgba(201, 168, 76, 0.12);
    border-color: var(--border-gold);
}

/* Indicator light effect on active link */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--gold);
}

/* Nav dropdown */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: rgba(10, 22, 40, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    padding: 4px 0;
    z-index: 1000;
}
.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown:focus-within > .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: all var(--transition);
}
.nav-dropdown-item:hover {
    color: var(--gold-light);
    background: rgba(201, 168, 76, 0.1);
}

.nav-admin {
    color: var(--ocean-light);
}

.nav-admin:hover {
    color: var(--ocean);
    background: rgba(21, 101, 192, 0.1);
    border-color: rgba(21, 101, 192, 0.3);
}

.nav-admin.active {
    color: var(--ocean-light);
    background: rgba(21, 101, 192, 0.15);
    border-color: rgba(21, 101, 192, 0.4);
}

/* -- Main -- */
.site-main {
    padding-top: calc(var(--header-height) + var(--nav-height));
    min-height: calc(100vh - 120px);
    transition: padding-top 0.35s ease;
}

/* -- Section inner container -- */
.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 24px 64px;
}

/* -- Section title with anchor decoration -- */
.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--white);
    margin-bottom: 36px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-gold);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Anchor icon before section titles */
.title-anchor {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--gold);
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='5' r='2.5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3Cline x1='12' y1='7.5' x2='12' y2='22' stroke='%23000' stroke-width='1.5'/%3E%3Cpath d='M6,16 Q12,22 18,16' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3Cline x1='8' y1='12' x2='16' y2='12' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='5' r='2.5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3Cline x1='12' y1='7.5' x2='12' y2='22' stroke='%23000' stroke-width='1.5'/%3E%3Cpath d='M6,16 Q12,22 18,16' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3Cline x1='8' y1='12' x2='16' y2='12' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    flex-shrink: 0;
    opacity: 0.7;
}

/* ===================================================================
   HERO BANNER
   =================================================================== */
.hero-banner {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(10, 22, 40, 0.3) 0%,
            rgba(13, 71, 161, 0.15) 40%,
            rgba(10, 22, 40, 0.7) 80%,
            var(--navy) 100%),
        url('images/PhotoG_1.jpg') center / cover no-repeat;
    filter: brightness(0.5) saturate(0.7);
}

.hero-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 2;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
}

.wave-1 { animation: waveMove1 8s ease-in-out infinite; }
.wave-2 { animation: waveMove2 6s ease-in-out infinite; }
.wave-3 { animation: waveMove3 4s ease-in-out infinite; }

@keyframes waveMove1 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-20px); }
}

@keyframes waveMove2 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(15px); }
}

@keyframes waveMove3 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 750px;
    padding: 60px 24px 100px;
}

.hero-compass {
    margin-bottom: 24px;
    animation: compassSpin 60s linear infinite;
}

@keyframes compassSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.compass-rose { opacity: 0.8; }

.hero-content h1 {
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
    margin-bottom: 16px;
}

.hero-lead {
    font-size: 1.1rem;
    color: var(--sand);
    margin-bottom: 32px;
    line-height: 1.7;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* -- Buttons -- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: var(--font-heading);
}

.btn-icon { flex-shrink: 0; }

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--navy);
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    color: var(--navy);
    box-shadow: 0 6px 24px rgba(201, 168, 76, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, #38a169 0%, #276749 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(56, 161, 105, 0.3);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: #fff;
    box-shadow: 0 6px 24px rgba(56, 161, 105, 0.4);
    transform: translateY(-2px);
}

.btn-accent:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--border-gold);
    padding: 8px 20px;
    font-size: 0.82rem;
}

.btn-outline:hover {
    background: rgba(201, 168, 76, 0.1);
    color: var(--gold-light);
    border-color: var(--gold);
}

.btn-danger {
    background: #c0392b;
    color: var(--white);
}

.btn-danger:hover {
    background: #e74c3c;
    color: var(--white);
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.78rem;
}

/* ===================================================================
   HOME SEARCH
   =================================================================== */
.home-search {
    max-width: var(--max-width);
    margin: -40px auto 0;
    padding: 0 24px;
    position: relative;
    z-index: 4;
    text-align: center;
}

.home-search h2 {
    color: var(--sand);
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.home-search .catalog-search-form {
    max-width: 600px;
    margin: 0 auto;
}

.home-search .catalog-search-fields {
    max-width: 600px;
    margin: -0.4rem auto 0;
    text-align: center;
}

/* ===================================================================
   QUICK LINKS
   =================================================================== */
.home-quick-links {
    max-width: var(--max-width);
    margin: 56px auto 0;
    padding: 0 24px 64px;
}

.home-quick-links h2 {
    text-align: center;
    margin-bottom: 28px;
    color: var(--sand);
    font-size: 1.3rem;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.quick-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-align: center;
}

.quick-link-icon {
    flex-shrink: 0;
    border-radius: 3px;
    background: #fff;
    padding: 1px;
}

.quick-link:hover {
    color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
    border-color: var(--border-gold);
    transform: translateY(-2px);
}

/* -- Quick Links Style Variants -- */

/* pills: rounded pill buttons with filled background */
.quick-links-grid[data-style="pills"] { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.quick-links-grid[data-style="pills"] .quick-link {
    border-radius: 50px;
    background: var(--navy-light, #1a2a4a);
    border-color: transparent;
    color: var(--sand);
    padding: 10px 20px;
    font-size: 0.82rem;
}
.quick-links-grid[data-style="pills"] .quick-link:hover {
    background: var(--gold);
    color: var(--navy);
    transform: translateY(-1px);
}

/* minimal: text-only, no borders */
.quick-links-grid[data-style="minimal"] .quick-link {
    border: none;
    background: transparent;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
}
.quick-links-grid[data-style="minimal"] .quick-link:hover {
    text-decoration: underline;
    background: transparent;
    transform: none;
    color: var(--gold);
}

/* list: single column vertical list */
.quick-links-grid[data-style="list"] {
    grid-template-columns: 1fr;
    gap: 4px;
}
.quick-links-grid[data-style="list"] .quick-link {
    justify-content: flex-start;
    padding: 10px 16px;
    border-radius: var(--radius-xs, 4px);
    font-size: 0.88rem;
}
.quick-links-grid[data-style="list"] .quick-link:hover {
    transform: none;
    padding-left: 20px;
}

/* chips: compact tag-like chips */
.quick-links-grid[data-style="chips"] { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(120px, auto)); }
.quick-links-grid[data-style="chips"] .quick-link {
    padding: 6px 14px;
    font-size: 0.78rem;
    border-radius: 16px;
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--border-gold, #c9a84c);
    color: var(--gold);
}
.quick-links-grid[data-style="chips"] .quick-link:hover {
    background: var(--gold);
    color: var(--navy);
    transform: scale(1.05);
}

/* outlined: prominent outlined buttons */
.quick-links-grid[data-style="outlined"] .quick-link {
    border: 2px solid var(--sand);
    background: transparent;
    color: var(--sand);
    font-weight: 700;
    padding: 12px 18px;
}
.quick-links-grid[data-style="outlined"] .quick-link:hover {
    background: var(--sand);
    color: var(--navy);
    border-color: var(--sand);
}

/* gradient: subtle gradient background */
.quick-links-grid[data-style="gradient"] .quick-link {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(26, 42, 74, 0.15));
    border: 1px solid rgba(201, 168, 76, 0.2);
    color: var(--sand);
}
.quick-links-grid[data-style="gradient"] .quick-link:hover {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.2), rgba(26, 42, 74, 0.3));
    border-color: var(--gold);
    transform: translateY(-2px);
}

/* shadow: elevated cards with shadow, no border */
.quick-links-grid[data-style="shadow"] .quick-link {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    background: var(--bg-card);
    padding: 16px 18px;
}
.quick-links-grid[data-style="shadow"] .quick-link:hover {
    box-shadow: 0 6px 20px rgba(201, 168, 76, 0.25);
    transform: translateY(-3px);
    border: none;
}

/* compact: smaller, tighter grid */
.quick-links-grid[data-style="compact"] { gap: 6px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.quick-links-grid[data-style="compact"] .quick-link {
    padding: 8px 10px;
    font-size: 0.78rem;
    border-radius: var(--radius-xs, 4px);
}
.quick-links-grid[data-style="compact"] .quick-link:hover {
    transform: translateY(-1px);
}

/* rounded: large rounded cards */
.quick-links-grid[data-style="rounded"] { gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.quick-links-grid[data-style="rounded"] .quick-link {
    border-radius: 20px;
    padding: 18px 22px;
    font-size: 0.9rem;
    border: 1px solid var(--border-subtle);
}
.quick-links-grid[data-style="rounded"] .quick-link:hover {
    border-radius: 20px;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.15);
}

/* -- Quick Links Admin Styles -- */
.ql-admin-list { display: flex; flex-direction: column; gap: 4px; }
.ql-admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    gap: 12px;
}
.ql-admin-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ql-admin-item-title { font-weight: 600; font-size: 0.88rem; }
.ql-admin-item-url { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-admin-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ql-form-actions { display: flex; gap: 8px; align-items: center; }
.ql-style-preview { margin-top: 16px; padding: 16px; border: 1px dashed var(--border-subtle); border-radius: var(--radius-sm); }
.ql-style-preview .quick-links-grid { margin: 0; }

/* ===================================================================
   NEWS
   =================================================================== */
.news-list { display: flex; flex-direction: column; gap: 20px; }

.news-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--ocean);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 24px;
    transition: all var(--transition);
}

.news-item:hover {
    border-left-color: var(--gold);
    background: var(--bg-card-hover);
}

.news-date {
    font-size: 0.78rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    font-weight: 600;
}

.news-item h3 {
    font-size: 1.1rem;
    color: var(--sand);
    margin-bottom: 8px;
}

.news-body {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.news-body h2 {
    font-size: 1.15rem;
    color: var(--sand);
    margin: 16px 0 8px;
}
.news-body h3 {
    font-size: 1.05rem;
    color: var(--sand);
    margin: 12px 0 6px;
}
.news-body p {
    margin: 0 0 8px;
}
.news-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    display: block;
}
.news-body a {
    color: var(--gold);
    text-decoration: underline;
}
.news-body a:hover {
    color: var(--gold-light);
}
.news-body ul, .news-body ol {
    padding-left: 24px;
    margin: 8px 0;
}
.news-body li {
    margin-bottom: 4px;
}
.news-body blockquote {
    border-left: 3px solid var(--gold);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--text-muted);
    font-style: italic;
}
.news-body pre {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 12px 16px;
    overflow-x: auto;
    margin: 12px 0;
}
.news-body code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.88rem;
}
.news-body pre code {
    background: none;
    padding: 0;
}
.news-body strong, .news-body b {
    color: var(--white);
}

/* ===================================================================
   QUILL EDITOR — Dark Theme Overrides
   =================================================================== */
.ql-toolbar.ql-snow {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px 8px 0 0;
}
.ql-container.ql-snow {
    background: var(--navy-light, #0a1929);
    color: var(--white, #f0f0f0);
    border-color: rgba(255, 255, 255, 0.15);
    border-radius: 0 0 8px 8px;
    font-family: inherit;
    font-size: 0.95rem;
}
.ql-editor {
    min-height: 150px;
    line-height: 1.7;
}
.ql-editor.ql-blank::before {
    color: rgba(255, 255, 255, 0.5);
    font-style: normal;
}
/* Toolbar icons & buttons */
.ql-snow .ql-stroke {
    stroke: rgba(255, 255, 255, 0.7);
}
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill {
    fill: rgba(255, 255, 255, 0.7);
}
.ql-snow .ql-picker {
    color: rgba(255, 255, 255, 0.7);
}
.ql-snow .ql-picker-label:hover,
.ql-snow button:hover .ql-stroke,
.ql-snow .ql-picker-label:hover .ql-stroke {
    stroke: var(--gold, #c9a84c);
}
.ql-snow button:hover .ql-fill,
.ql-snow .ql-picker-label:hover .ql-fill {
    fill: var(--gold, #c9a84c);
}
.ql-snow button.ql-active .ql-stroke {
    stroke: var(--gold, #c9a84c);
}
.ql-snow button.ql-active .ql-fill {
    fill: var(--gold, #c9a84c);
}
.ql-snow .ql-picker.ql-expanded .ql-picker-label {
    color: var(--gold, #c9a84c);
}
/* Dropdown */
.ql-snow .ql-picker-options {
    background: var(--bg-card, #0d2137);
    border-color: rgba(255, 255, 255, 0.15);
}
.ql-snow .ql-picker-item {
    color: rgba(255, 255, 255, 0.8);
}
.ql-snow .ql-picker-item:hover {
    color: var(--gold, #c9a84c);
}
/* Tooltip (link input) */
.ql-snow .ql-tooltip {
    background: var(--bg-card, #0d2137);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--white, #f0f0f0);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.ql-snow .ql-tooltip input[type=text] {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--white, #f0f0f0);
}
.ql-snow .ql-tooltip a {
    color: var(--gold, #c9a84c);
}
/* Editor content styles */
.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
.ql-editor blockquote {
    border-left: 3px solid var(--gold, #c9a84c);
    padding-left: 16px;
    color: rgba(255, 255, 255, 0.6);
}
.ql-editor pre.ql-syntax {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
}

/* News form actions */
.news-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}
.admin-news-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ===================================================================
   RESOURCES
   =================================================================== */
.resources-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 8px;
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    background: rgba(15, 31, 58, 0.4);
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}
.resource-link:hover {
    background: rgba(201, 168, 76, 0.08);
    border-color: var(--border-gold);
    color: var(--text-primary);
}
.resource-link-title {
    color: var(--sand);
    font-weight: 600;
    white-space: nowrap;
}
.resource-link-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.resource-favicon {
    flex-shrink: 0;
    border-radius: 3px;
    background: #fff;
    padding: 1px;
}
.resource-page-icon {
    flex-shrink: 0;
    font-size: 1.15rem;
    line-height: 1;
    width: 22px;
    text-align: center;
}

.resource-category-group {
    margin-bottom: 28px;
}

.resource-category-heading {
    font-size: 1.1rem;
    color: var(--gold);
    padding: 10px 16px;
    background: rgba(201, 168, 76, 0.06);
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    margin-bottom: 16px;
    font-weight: 700;
}
.resource-category-divider {
    border: none;
    border-top: 1px solid var(--border-gold);
    margin: 8px 0 16px;
}

/* Resource tree (admin) */
.admin-form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}
.admin-form-inline input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: rgba(10, 22, 40, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition);
}
.admin-form-inline input[type="text"]:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}
.admin-form-inline input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.res-tree {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.res-tree-cat {
    background: rgba(10, 22, 40, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.res-tree-cat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(201, 168, 76, 0.06);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    color: var(--sand);
}
.res-tree-cat-head strong {
    flex: 1;
    min-width: 0;
}
.res-tree-icon {
    font-size: 0.7rem;
    color: var(--gold);
    flex-shrink: 0;
}
.res-tree-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}
.res-tree-children {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
}
.res-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    transition: background var(--transition);
}
.res-tree-item:hover {
    background: rgba(201, 168, 76, 0.05);
}
.res-tree-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.res-tree-item-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.res-tree-item-url {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.res-tree-uncategorized {
    border-style: dashed;
}
.res-tree-uncategorized .res-tree-cat-head {
    background: transparent;
    border-bottom-style: dashed;
    color: var(--text-muted);
}

.btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-icon-sm:hover:not(:disabled) {
    color: var(--gold);
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--border-gold);
}
.btn-icon-sm:disabled {
    opacity: 0.3;
    cursor: default;
}
.btn-icon-danger:hover:not(:disabled) {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.1);
    border-color: rgba(229, 62, 62, 0.3);
}

/* Resource context menu */
.res-ctx-menu {
    position: fixed;
    z-index: 9999;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    padding: 4px 0;
}
.res-ctx-icon {
    display: inline-block;
    width: 18px;
    text-align: center;
    font-size: 0.82rem;
}
.res-ctx-item {
    padding: 8px 14px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}
.res-ctx-item:hover {
    background: rgba(201, 168, 76, 0.1);
    color: var(--text-primary);
}
.res-ctx-active {
    color: var(--gold);
    font-weight: 600;
}
.res-ctx-danger:hover {
    background: rgba(229, 62, 62, 0.12);
    color: #e53e3e;
}
.res-ctx-sep {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}
.res-ctx-has-sub {
    padding-right: 24px;
}
.res-ctx-has-sub::after {
    content: '\25B6';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
}
.res-ctx-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -4px;
    min-width: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    padding: 4px 0;
}
.res-ctx-has-sub:hover > .res-ctx-submenu {
    display: block;
}

/* ===================================================================
   DOCUMENTS
   =================================================================== */
.docs-year-group {
    margin-bottom: 32px;
}

.docs-year-heading {
    font-size: 1.1rem;
    color: var(--gold);
    padding: 10px 16px;
    background: rgba(201, 168, 76, 0.06);
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    margin-bottom: 16px;
    font-weight: 700;
}

.docs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 8px;
    padding-left: 16px;
}

.doc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    background: rgba(15, 31, 58, 0.5);
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}

.doc-link:hover {
    background: rgba(201, 168, 76, 0.08);
    border-color: var(--border-gold);
    color: var(--sand);
}

.doc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 26px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    border-radius: 3px;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Color coding for document types */
.doc-icon {
    background: rgba(21, 101, 192, 0.2);
    color: var(--ocean-light);
    border: 1px solid rgba(21, 101, 192, 0.3);
}

/* PPT/PPSX */
a[href$=".ppt"] .doc-icon,
a[href$=".ppsx"] .doc-icon {
    background: rgba(211, 84, 0, 0.2);
    color: #e67e22;
    border-color: rgba(211, 84, 0, 0.3);
}

/* DOC/DOCX */
a[href$=".doc"] .doc-icon,
a[href$=".docx"] .doc-icon {
    background: rgba(41, 128, 185, 0.2);
    color: #5dade2;
    border-color: rgba(41, 128, 185, 0.3);
}

/* XLS */
a[href$=".xls"] .doc-icon,
a[href$=".xlsx"] .doc-icon {
    background: rgba(39, 174, 96, 0.2);
    color: #52be80;
    border-color: rgba(39, 174, 96, 0.3);
}

/* -- Exhibitions flat list (public) -- */
.exhibitions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.exhibition-link {
    display: block;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(15, 31, 58, 0.4);
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}

.exhibition-link:hover {
    background: rgba(201, 168, 76, 0.08);
    border-color: var(--border-gold);
    color: var(--sand);
}

/* -- Badge "скрыта" in admin -- */
.badge-hidden {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #e67e22;
    background: rgba(211, 84, 0, 0.15);
    border: 1px solid rgba(211, 84, 0, 0.3);
    border-radius: 3px;
    vertical-align: middle;
}

.doc-hidden-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.doc-hidden-label input[type="checkbox"] {
    accent-color: var(--gold);
}

/* ===================================================================
   ABOUT
   =================================================================== */
.about-content {
    max-width: 900px;
}

.about-text h3 {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.about-image {
    float: right;
    width: 320px;
    margin: 0 0 20px 28px;
    border-radius: var(--radius);
    border: 2px solid var(--border-gold);
    box-shadow: var(--shadow-card);
}

.about-text p {
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.about-text h4 {
    font-size: 1.15rem;
    color: var(--sand);
    margin: 28px 0 16px;
}

/* -- About: lead intro -- */
.about-lead {
    font-size: 1.1rem;
    color: var(--sand);
    line-height: 1.9;
    border-left: 3px solid var(--gold);
    padding-left: 20px;
    margin-bottom: 32px;
}

/* -- About: era blocks -- */
.about-era {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-subtle);
}

.about-era:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.about-era-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.about-era-year {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 32px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--gold);
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 4px;
}

.about-era-title {
    font-size: 1.2rem;
    color: var(--sand);
    font-weight: 700;
    margin: 0;
}

.about-photo-row {
    display: flex;
    gap: 16px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.about-photo {
    border-radius: var(--radius-sm);
    border: 2px solid rgba(201, 168, 76, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 280px;
    height: auto;
    transition: border-color 0.3s, transform 0.3s;
}

.about-photo:hover {
    border-color: var(--gold);
    transform: scale(1.02);
}

.about-photo-caption {
    font-size: 0.8rem;
    color: var(--text-muted, rgba(232,224,212,0.4));
    font-style: italic;
    margin-top: 6px;
    text-align: center;
}

.about-photo-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about-quote {
    margin: 20px 0;
    padding: 16px 20px;
    background: rgba(201, 168, 76, 0.04);
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 28px 0;
}

.about-stat {
    text-align: center;
    padding: 20px 12px;
    background: rgba(15, 31, 58, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.about-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 6px;
}

.about-stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Timeline with nautical rope styling */
.timeline {
    list-style: none;
    padding: 0;
    position: relative;
    margin-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: repeating-linear-gradient(
        180deg,
        var(--gold) 0px,
        var(--gold) 8px,
        transparent 8px,
        transparent 12px
    );
    opacity: 0.5;
}

.timeline li {
    padding: 8px 0 8px 24px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    position: relative;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 16px;
    width: 12px;
    height: 12px;
    background: var(--navy);
    border: 2px solid var(--gold);
    border-radius: 50%;
}

.timeline li strong {
    color: var(--gold);
    font-weight: 700;
}

/* ===================================================================
   STRUCTURE
   =================================================================== */
.structure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.structure-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
}

.structure-card:hover {
    border-color: var(--border-gold);
    background: var(--bg-card-hover);
}

.structure-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.structure-icon {
    color: var(--gold);
    flex-shrink: 0;
}

.structure-card-header h3 {
    font-size: 1.05rem;
    color: var(--sand);
}

.person-name {
    color: var(--gold-light);
    font-weight: 600;
    margin-bottom: 8px;
}

.structure-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===================================================================
   READERS (Читателям) — объединённый раздел
   =================================================================== */
/* ===================================================================
   SCHEDULE
   =================================================================== */
.schedule-wrapper {
    overflow-x: auto;
    margin-bottom: 16px;
}

.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
}

.schedule-table thead {
    background: linear-gradient(135deg, var(--navy-mid) 0%, rgba(201, 168, 76, 0.1) 100%);
}

.schedule-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid var(--border-gold);
}

.schedule-table td {
    padding: 14px 18px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.schedule-table tbody tr:last-child td { border-bottom: none; }

.schedule-table tbody tr:hover {
    background: rgba(201, 168, 76, 0.04);
}

.schedule-note {
    font-size: 0.88rem;
    color: var(--gold);
    font-style: italic;
    padding: 12px 18px;
    background: rgba(201, 168, 76, 0.06);
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

/* ===================================================================
   RULES
   =================================================================== */
.rules-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.rules-block {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
}

/* Decorative wave-top on rules blocks */
.rules-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ocean), var(--gold), var(--ocean));
}

.rules-block h3 {
    font-size: 1.1rem;
    color: var(--sand);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.rules-block ul {
    list-style: none;
    padding: 0;
}

.rules-block li {
    padding: 6px 0 6px 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
    line-height: 1.6;
}

.rules-block li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 8px;
    height: 8px;
    border: 1.5px solid var(--gold);
    border-radius: 50%;
}

/* -- Rules: download button & summary -- */
.rules-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.rules-download:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
    color: var(--sand);
}

.rules-summary {
    max-width: 850px;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: rgba(201, 168, 76, 0.04);
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.rules-summary strong {
    color: var(--sand);
}

/* ===================================================================
   GALLERY — Porthole-shaped photo frames
   =================================================================== */
.gallery-subtitle {
    font-size: 1.15rem;
    color: var(--sand);
    margin: 28px 0 20px;
    padding-left: 4px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 12px;
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition);
    outline: none;
}

/* Porthole styling */
.gallery-item.porthole {
    border-radius: 50%;
    aspect-ratio: 1;
    border: 3px solid var(--gold-dark);
    box-shadow:
        inset 0 0 0 3px var(--navy),
        inset 0 0 0 5px rgba(201, 168, 76, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.4);
    position: relative;
}

/* Brass rivets on porthole */
.gallery-item.porthole::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 3px solid transparent;
    background:
        radial-gradient(circle 3px at 50% 2%, var(--gold) 2px, transparent 3px),
        radial-gradient(circle 3px at 50% 98%, var(--gold) 2px, transparent 3px),
        radial-gradient(circle 3px at 2% 50%, var(--gold) 2px, transparent 3px),
        radial-gradient(circle 3px at 98% 50%, var(--gold) 2px, transparent 3px);
    z-index: 2;
    pointer-events: none;
}

/* Glass reflection effect */
.gallery-item.porthole::after {
    content: '';
    position: absolute;
    top: 8%;
    left: 15%;
    width: 35%;
    height: 25%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.gallery-item:hover {
    transform: scale(1.06);
    box-shadow:
        inset 0 0 0 3px var(--navy),
        inset 0 0 0 5px rgba(201, 168, 76, 0.5),
        0 8px 32px rgba(201, 168, 76, 0.15);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

/* ===================================================================
   CONTACTS
   =================================================================== */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition);
}

.contact-card:hover {
    border-color: var(--border-gold);
    background: var(--bg-card-hover);
}

.contact-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid var(--border-gold);
    border-radius: 50%;
}

.contact-card h3 {
    font-size: 0.95rem;
    color: var(--sand);
    margin-bottom: 10px;
}

.contact-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.contact-card a {
    color: var(--gold-light);
}

.contact-card a:hover {
    color: var(--gold);
}

/* Feedback form */
.feedback-form-wrapper {
    margin-top: 2.5rem;
    max-width: 600px;
}
.feedback-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--gold-light);
    margin-bottom: 1rem;
}
.feedback-row {
    margin-bottom: 0.8rem;
}
.feedback-row label {
    display: block;
    font-size: 0.9rem;
    color: var(--sand-light);
    margin-bottom: 4px;
}
.feedback-row .required {
    color: #e57373;
}
.feedback-row input,
.feedback-row textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
}
.feedback-row input:focus,
.feedback-row textarea:focus {
    outline: none;
    border-color: var(--brass-gold);
    box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}
.feedback-row textarea {
    resize: vertical;
    min-height: 80px;
}
.feedback-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.feedback-status {
    font-size: 0.9rem;
}
.feedback-status.success {
    color: #81c784;
}
.feedback-status.error {
    color: #e57373;
}

/* ===================================================================
   ADMIN
   =================================================================== */
.admin-panel {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.admin-block {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 28px 24px;
}

.admin-block h3 {
    font-size: 1.1rem;
    color: var(--sand);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-form input:not([type="checkbox"]),
.admin-form textarea {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: rgba(10, 22, 40, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition);
}

.admin-form input:not([type="checkbox"]):focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.admin-form input:not([type="checkbox"])::placeholder,
.admin-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.admin-form textarea {
    resize: vertical;
    min-height: 80px;
}

.admin-news-list,
.admin-news-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(10, 22, 40, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.admin-news-item:hover {
    border-color: var(--border-gold);
}

.muted { color: var(--text-muted); font-size: 0.82rem; }

/* Admin documents */
.admin-doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(10, 22, 40, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.admin-doc-item:hover {
    border-color: var(--border-gold);
}

.doc-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.doc-info strong {
    color: var(--sand);
}

.doc-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.doc-icon-small {
    font-size: 0.7rem;
    padding: 2px 5px;
}

.admin-doc-group-heading {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold);
    padding: 8px 0 4px;
    border-bottom: 1px solid var(--border-subtle);
    margin-top: 8px;
}
.admin-doc-group-heading:first-child {
    margin-top: 0;
}

.doc-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Document upload area */
.doc-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    position: relative;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.doc-upload-area:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.04);
}
.doc-upload-area.drag-over {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
}
.doc-upload-area.uploading {
    opacity: 0.7;
    pointer-events: none;
}
.doc-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.doc-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}
.doc-upload-hint {
    font-size: 0.78rem;
    color: var(--text-muted, rgba(232,224,212,0.4));
    margin-top: 2px;
}
.doc-upload-info {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    pointer-events: none;
    position: relative;
    z-index: 3;
}
.doc-upload-icon {
    flex-shrink: 0;
    font-size: 1.5rem;
}
.doc-upload-name {
    flex: 1;
    font-size: 0.92rem;
    color: var(--text-primary);
    word-break: break-all;
}
.doc-upload-size {
    flex-shrink: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.doc-upload-replace {
    flex-shrink: 0;
    font-size: 1.2rem;
    color: var(--gold);
    cursor: pointer;
    pointer-events: auto;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
    z-index: 4;
}
.doc-upload-replace:hover {
    background: rgba(212, 175, 55, 0.15);
}

/* ===================================================================
   ADMIN: Content Editor (page sections)
   =================================================================== */
.content-editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.content-editor-header label {
    font-size: 0.9rem;
    color: var(--sand, #c4a86b);
}
.content-page-select {
    padding: 8px 14px;
    background: rgba(10, 22, 40, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 200px;
    cursor: pointer;
}
.content-page-select option {
    background: var(--navy, #0a1628);
    color: var(--text-primary, #e8e0d4);
}
.content-status {
    font-size: 0.82rem;
    padding: 3px 10px;
    border-radius: 12px;
}
.content-status.default { color: var(--text-secondary); }
.content-status.saved { color: var(--gold, #c9a84c); }
.content-status.loading { color: var(--text-secondary); font-style: italic; }
.content-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

/* Quill editor for content pages */
#contentEditor {
    min-height: 300px;
    background: rgba(10, 22, 40, 0.4);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
#contentEditor .ql-editor {
    min-height: 280px;
    color: var(--text-primary, #e8e0d4);
}
#contentWysiwygArea .ql-toolbar {
    border-color: var(--border-subtle) !important;
    background: rgba(10, 22, 40, 0.6);
}
#contentWysiwygArea .ql-container {
    border-color: var(--border-subtle) !important;
}

/* Structure cards in admin */
.admin-struct-card {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}
.struct-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.struct-card-num {
    font-weight: 600;
    color: var(--gold, #c9a84c);
}
.struct-card-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.struct-card-fields .struct-title {
    grid-column: 1 / -1;
}
.struct-card-fields .struct-desc {
    grid-column: 1 / -1;
}

/* Schedule rows in admin */
.admin-sched-row {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.sched-row-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    color: var(--gold, #c9a84c);
    font-weight: 600;
}

/* Contacts fields in admin */
.admin-contacts-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.admin-contacts-fields .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-contacts-fields label {
    font-size: 0.85rem;
    color: var(--sand, #c4a86b);
}

/* Shared admin form input */
.admin-form-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(10, 22, 40, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary, #e8e0d4);
    font-size: 0.88rem;
    font-family: inherit;
    box-sizing: border-box;
}
.admin-form-input:focus {
    outline: none;
    border-color: var(--gold, #c9a84c);
}
.admin-form-input::placeholder {
    color: rgba(232,224,212,0.35);
}

@media (max-width: 600px) {
    .struct-card-fields,
    .admin-sched-row,
    .admin-contacts-fields {
        grid-template-columns: 1fr;
    }
}

/* Select (dark theme) */
.admin-form select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(10, 22, 40, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-body);
    appearance: auto;
    cursor: pointer;
    transition: border-color var(--transition);
}

.admin-form select:focus {
    outline: none;
    border-color: var(--gold);
}

.admin-form select option {
    background: var(--navy);
    color: var(--text-primary);
}

/* Sync block */
.sync-status {
    margin-bottom: 20px;
}
.sync-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    background: rgba(10, 22, 40, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.sync-driver { color: var(--sand); }
.sync-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}
.sync-action-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sync-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-left: 2px;
}
label.btn {
    cursor: pointer;
    display: inline-block;
}
label.btn.disabled {
    opacity: 0.6;
    pointer-events: none;
}
.sync-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}
.sync-result-success {
    background: rgba(39, 103, 73, 0.2);
    border: 1px solid rgba(39, 103, 73, 0.5);
    color: #68d391;
}
.sync-result-error {
    background: rgba(192, 86, 33, 0.15);
    border: 1px solid rgba(192, 86, 33, 0.5);
    color: #fc8181;
}

/* DB mode selector */
.db-mode-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.db-mode-row select {
    background: var(--navy-light, #1a2332);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.88rem;
    cursor: pointer;
}
.db-mode-row select option {
    background: var(--navy-light, #1a2332);
    color: var(--text-primary, #e8e0d4);
}
.db-mode-row select:focus {
    border-color: var(--gold);
    outline: none;
}
.db-mode-current {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Migrate block */
.migrate-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}
.migrate-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.migrate-form label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.migrate-form input[type="text"] {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 7px 12px;
    font-size: 0.88rem;
    width: 180px;
}
.migrate-form input[type="text"]:focus {
    border-color: var(--gold);
    outline: none;
}
.migrate-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 8px;
}

/* ===================================================================
   FOOTER — Wave silhouette
   =================================================================== */
.site-footer {
    position: relative;
    background: #06101e;
    margin-top: 40px;
}

.footer-wave {
    position: relative;
    top: -1px;
    width: 100%;
    height: 60px;
    overflow: hidden;
    background: var(--navy);
}

.footer-wave svg {
    width: 100%;
    height: 100%;
    display: block;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 24px 36px;
}

.footer-content {
    text-align: center;
}

.footer-anchor {
    margin-bottom: 14px;
    color: var(--gold);
    opacity: 0.5;
}

.footer-anchor svg {
    margin: 0 auto;
}

.site-footer p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.site-footer a {
    color: var(--gold-light);
}

.footer-links {
    margin-top: 8px;
    opacity: 0.7;
}

/* ===================================================================
   SITEMAP (visual)
   =================================================================== */
.sitemap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.sitemap-group h3 {
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-gold);
}

.sitemap-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sitemap-group li {
    margin-bottom: 8px;
}

.sitemap-group a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}

.sitemap-group a:hover {
    color: var(--gold-light);
}

/* ===================================================================
   LIGHTBOX
   =================================================================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
    border: 2px solid var(--gold-dark);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    width: 48px;
    height: 48px;
    font-size: 2rem;
    color: var(--white);
    background: rgba(201, 168, 76, 0.2);
    border: 1px solid var(--border-gold);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.lightbox-close:hover {
    background: rgba(201, 168, 76, 0.4);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--gold);
    border: 1px solid var(--gold-dark);
    font-size: 2rem;
    width: 52px;
    height: 72px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-nav:hover {
    background: rgba(201, 168, 76, 0.35);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light);
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 16px;
    border-radius: 12px;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .lightbox-nav { width: 40px; height: 56px; font-size: 1.5rem; }
    .lightbox-prev { left: 6px; }
    .lightbox-next { right: 6px; }
}

/* -- Scroll to top button -- */
.scroll-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--navy-dark);
    color: var(--gold);
    border: 1px solid var(--gold-dark);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background 0.3s;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.scroll-top-btn.visible {
    opacity: 0.8;
    visibility: visible;
}
.scroll-top-btn:hover {
    opacity: 1;
    background: var(--gold-dark);
    color: var(--navy);
}

/* -- Pageview Stats widget -- */
.stats-cards {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.stats-card {
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid var(--gold-dark);
    border-radius: var(--radius);
    padding: 12px 20px;
    text-align: center;
    min-width: 90px;
}
.stats-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gold);
}
.stats-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 2px;
}
.stats-bars {
    margin-top: 8px;
}
.stats-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.stats-bar-label {
    width: 110px;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-shrink: 0;
}
.stats-bar-track {
    flex: 1;
    height: 18px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}
.stats-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    border-radius: 4px;
    transition: width 0.4s ease;
}
.stats-bar-val {
    width: 50px;
    font-size: 0.85rem;
    color: var(--text-light);
}
.stats-loading {
    color: var(--text-light);
    font-style: italic;
}

/* ===================================================================
   LOADING & EMPTY STATES
   =================================================================== */
.loading, .empty {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.loading {
    position: relative;
}

.loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 14px auto 0;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 900px) {
    .about-image {
        float: none;
        width: 100%;
        max-width: 400px;
        margin: 0 auto 20px;
    }

    .about-photo { max-width: 100%; }
    .about-photo-row { flex-direction: column; align-items: center; }
    .about-stats { grid-template-columns: repeat(2, 1fr); }

    .structure-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 14px;
    }

    .docs-list {
        grid-template-columns: 1fr;
    }

    .hero-banner {
        min-height: 420px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
        --nav-height: 0px;
    }

    .mobile-menu-btn { display: flex; }

    .site-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        height: auto;
        max-height: 0;
        overflow: hidden;
        background: rgba(10, 22, 40, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: none;
        transition: max-height 0.35s ease, border-bottom 0.35s ease;
    }

    .site-nav.open {
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        border-bottom: 2px solid var(--border-gold);
    }

    .nav-inner {
        flex-direction: column;
        padding: 12px 24px;
        gap: 4px;
    }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.88rem;
        border-radius: var(--radius-sm);
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-dropdown-menu {
        position: static;
        background: transparent;
        backdrop-filter: none;
        border: none;
        box-shadow: none;
        padding: 0 0 0 20px;
        display: none;
    }
    .nav-dropdown.open > .nav-dropdown-menu {
        display: block;
    }
    .nav-dropdown-item {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .site-main {
        padding-top: var(--header-height);
    }
    body.has-banner .site-nav {
        top: calc(var(--header-height) + var(--banner-offset, 0px));
    }
    body.has-banner .site-nav.open {
        max-height: calc(100vh - var(--header-height) - var(--banner-offset, 0px));
    }
    body.has-banner .site-main {
        padding-top: calc(var(--header-height) + var(--banner-offset, 0px));
    }

    .hero-banner {
        min-height: 380px;
    }

    .hero-content {
        padding: 40px 20px 80px;
    }

    .hero-lead {
        font-size: 0.95rem;
    }

    .home-cards {
        grid-template-columns: 1fr;
        margin-top: -20px;
    }

    .section-inner {
        padding: 32px 16px 48px;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .rules-content {
        grid-template-columns: 1fr;
    }

    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    .logo-title { font-size: 1rem; }
    .logo-subtitle { font-size: 0.65rem; }
    .logo-icon svg { width: 38px; height: 38px; }

    .quick-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }

    .gallery-item.porthole {
        border-width: 2px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.4rem; }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        justify-content: center;
    }

    .hero-compass svg {
        width: 56px;
        height: 56px;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .admin-news-item,
    .admin-resource-item,
    .admin-doc-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .resource-actions,
    .doc-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ===================================================================
   SCROLLBAR STYLING
   =================================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--navy);
}

::-webkit-scrollbar-thumb {
    background: var(--navy-mid);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, 0.3);
}

/* ===================================================================
   WAVE BORDER DECORATIONS (reusable)
   =================================================================== */
/* -- Subtle background pattern (rope knot texture) -- */
.section-inner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background:
        radial-gradient(circle at center, rgba(201, 168, 76, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

/* ===================================================================
   PRINT STYLES
   =================================================================== */
@media print {
    .site-header,
    .site-nav,
    .mobile-menu-btn,
    .hero-waves,
    .hero-compass,
    .lightbox,
    .footer-wave,
    .footer-anchor,
    .admin-panel { display: none !important; }

    body {
        background: white;
        color: #333;
    }

    .section { display: block !important; }

    .site-main { padding-top: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   A11y TOOLBAR
   ═══════════════════════════════════════════════════════════════════════ */

.a11y-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--sand);
    cursor: pointer;
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    transition: border-color 0.2s, color 0.2s;
    margin-right: 8px;
}
.a11y-toggle-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.a11y-toolbar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    background: var(--navy-light);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 24px;
}
.a11y-toolbar.open {
    max-height: 100px;
    padding: 12px 24px;
}

/* When a11y toolbar is open, push nav and content down */
.a11y-toolbar.open ~ .site-nav {
    top: calc(var(--header-height) + 55px);
    transition: top 0.35s ease;
}
body.has-banner .a11y-toolbar.open ~ .site-nav {
    top: calc(var(--header-height) + var(--banner-offset) + 55px);
    transition: top 0.35s ease;
}
.a11y-toolbar.open ~ .site-main {
    padding-top: calc(var(--header-height) + var(--nav-height) + 55px);
    transition: padding-top 0.35s ease;
}
body.has-banner .a11y-toolbar.open ~ .site-main {
    padding-top: calc(var(--header-height) + var(--nav-height) + var(--banner-offset) + 55px);
    transition: padding-top 0.35s ease;
}
.a11y-toolbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.a11y-control {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--sand);
    font-size: 0.85rem;
    white-space: nowrap;
}
.a11y-control label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.a11y-control input[type="range"] {
    width: 100px;
    accent-color: var(--gold);
}
.a11y-control input[type="checkbox"] {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
}
#a11yFontSizeVal {
    min-width: 36px;
    text-align: center;
    font-weight: 600;
    color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════════════
   A11y HIGH CONTRAST LIGHT THEME
   ═══════════════════════════════════════════════════════════════════════ */

body.a11y-high-contrast {
    --navy: #ffffff;
    --navy-light: #f0f0f0;
    --text-primary: #000000;
    --text-secondary: #222222;
    --bg-card: rgba(240,240,240,0.95);
    --sand: #333333;
    --gold: #8B6914;
    color-scheme: light;
    background: #ffffff !important;
    color: #000000 !important;
}
body.a11y-high-contrast .site-header {
    background: #e8e8e8 !important;
    border-bottom: 2px solid #8B6914;
}
body.a11y-high-contrast .site-header,
body.a11y-high-contrast .header-logo .logo-title,
body.a11y-high-contrast .header-logo .logo-subtitle {
    color: #000 !important;
}
body.a11y-high-contrast .logo-icon {
    color: #8B6914 !important;
}
body.a11y-high-contrast .site-nav {
    background: #d8d8d8 !important;
    border-bottom: 1px solid #aaa;
}
body.a11y-high-contrast .nav-link {
    color: #000 !important;
}
body.a11y-high-contrast .nav-link.active,
body.a11y-high-contrast .nav-link:hover {
    color: #8B6914 !important;
    border-bottom-color: #8B6914 !important;
}
body.a11y-high-contrast .site-main {
    background: #fff !important;
}
body.a11y-high-contrast .section {
    background: #fff !important;
}
body.a11y-high-contrast .section-title {
    color: #000 !important;
}
body.a11y-high-contrast .news-item,
body.a11y-high-contrast .resource-link,
body.a11y-high-contrast .doc-group,
body.a11y-high-contrast .admin-block {
    background: #f5f5f5 !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
}
body.a11y-high-contrast .news-item h3 {
    color: #000 !important;
}
body.a11y-high-contrast .btn {
    border: 2px solid #8B6914 !important;
    color: #000 !important;
}
body.a11y-high-contrast .btn-primary {
    background: #8B6914 !important;
    color: #fff !important;
}
body.a11y-high-contrast .site-footer {
    background: #e0e0e0 !important;
    color: #000 !important;
}
body.a11y-high-contrast .footer-wave svg path {
    fill: #e0e0e0 !important;
}
body.a11y-high-contrast .a11y-toolbar {
    background: #d0d0d0 !important;
}
body.a11y-high-contrast .a11y-control,
body.a11y-high-contrast .a11y-control label {
    color: #000 !important;
}
body.a11y-high-contrast .a11y-toggle-btn {
    color: #000 !important;
    border-color: #666 !important;
}
body.a11y-high-contrast .mobile-menu-btn span {
    background: #000 !important;
}
body.a11y-high-contrast .admin-tab-buttons {
    background: #e0e0e0 !important;
}
body.a11y-high-contrast .admin-tab-btn {
    color: #000 !important;
}
body.a11y-high-contrast .admin-tab-btn.active {
    background: #8B6914 !important;
    color: #fff !important;
}
/* ═══════════════════════════════════════════════════════════════════════
   A11y SERIF FONT
   ═══════════════════════════════════════════════════════════════════════ */

body.a11y-serif {
    --font-heading: Georgia, 'Times New Roman', serif;
    --font-body: Georgia, 'Times New Roman', serif;
}
body.a11y-serif * {
    font-family: Georgia, 'Times New Roman', serif !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   A11y HIDE IMAGES
   ═══════════════════════════════════════════════════════════════════════ */

body.a11y-hide-images img,
body.a11y-hide-images .gallery-item,
body.a11y-hide-images .hero-bg,
body.a11y-hide-images .about-image,
body.a11y-hide-images .hero-compass {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   ADMIN TABS
   ═══════════════════════════════════════════════════════════════════════ */

.admin-tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: rgba(0,0,0,0.3);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 24px;
}
.admin-tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--sand);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.admin-tab-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--gold);
}
.admin-tab-btn.active {
    background: var(--gold);
    color: var(--navy);
    font-weight: 600;
}
.admin-tab-content {
    display: none;
}
.admin-tab-content.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════
   NEWS DURATION & BADGES
   ═══════════════════════════════════════════════════════════════════════ */

.news-duration-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}
.news-duration-row label {
    color: var(--sand);
    font-size: 0.85rem;
    white-space: nowrap;
}
.news-duration-row select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.3);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.news-expired-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(220,53,69,0.2);
    color: #ff6b6b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.news-active-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(40,167,69,0.2);
    color: #51cf66;
    letter-spacing: 0.3px;
}
.news-permanent-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(108,117,125,0.15);
    color: #adb5bd;
    letter-spacing: 0.3px;
}
.admin-news-expired {
    opacity: 0.65;
    border-left: 3px solid #ff6b6b !important;
}

@media (max-width: 768px) {
    .a11y-toolbar.open {
        max-height: 200px;
        padding: 10px 12px;
    }
    .a11y-toolbar-inner {
        gap: 10px;
    }
    .a11y-control input[type="range"] {
        width: 70px;
    }
    .admin-tab-buttons {
        padding: 3px;
        gap: 2px;
    }
    .admin-tab-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }
    .news-duration-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* =====================================================================
   Catalog Search Section
   ===================================================================== */

.catalog-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 1.2rem;
    max-width: 800px;
}

.catalog-search-form input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 0;
}

.catalog-search-form input[type="text"]::placeholder {
    color: var(--text-muted);
}

.catalog-search-form input[type="text"]:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.2);
}

.catalog-search-btn {
    padding: 10px 24px;
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.catalog-search-btn:hover {
    background: rgba(201, 168, 76, 0.1);
    color: var(--gold-light);
    border-color: var(--gold);
}

.catalog-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.catalog-search-hint {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.catalog-search-hint a {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-color: rgba(201, 168, 76, 0.4);
}

.catalog-search-hint a:hover {
    color: var(--gold-light);
    text-decoration-color: var(--gold);
}

.catalog-search-fields {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -0.6rem 0 1rem;
    max-width: 800px;
}

/* Popular queries */
.catalog-popular {
    max-width: 800px;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
}
.catalog-popular-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-right: 8px;
}
.catalog-popular-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.catalog-popular-tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.82rem;
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 12px;
    color: var(--sand-light);
    cursor: pointer;
    transition: background 0.2s;
}
.catalog-popular-tag:hover {
    background: rgba(201,168,76,0.25);
    color: var(--gold-light);
}

/* Advanced search */
.catalog-mode-switcher {
    display: inline-flex;
    background: rgba(15, 35, 60, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.catalog-mode-btn {
    padding: 0.5rem 1.3rem;
    background: transparent;
    color: var(--sand-light);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.catalog-mode-btn:hover {
    background: rgba(201, 168, 76, 0.1);
}
.catalog-mode-btn.active {
    background: var(--brass-gold);
    color: var(--navy-deep);
    font-weight: 600;
}
.catalog-advanced-toggle {
    margin: -0.4rem 0 0.8rem;
    max-width: 800px;
}
.catalog-advanced-toggle a {
    color: var(--brass-gold);
    font-size: 0.9rem;
    text-decoration: none;
    border-bottom: 1px dashed var(--brass-gold);
}
.catalog-advanced-toggle a:hover {
    color: var(--sand-light);
}
.catalog-advanced-toggle a.active {
    color: var(--text-muted);
}
.catalog-advanced {
    max-width: 800px;
    background: rgba(15, 35, 60, 0.6);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}
.catalog-advanced-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.6rem;
}
.catalog-advanced-row label {
    min-width: 100px;
    font-size: 0.9rem;
    color: var(--sand-light);
    text-align: right;
}
.catalog-advanced-row input[type="text"],
.catalog-advanced-row input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.95rem;
}
.catalog-advanced-row input:focus {
    outline: none;
    border-color: var(--brass-gold);
    box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}
.catalog-advanced-row-inline {
    display: flex;
    gap: 16px;
}
.catalog-advanced-row-inline > div {
    display: flex;
    align-items: center;
    gap: 10px;
}
.catalog-advanced-row-inline input[type="number"] {
    width: 100px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.95rem;
}
.catalog-advanced-actions {
    display: flex;
    gap: 10px;
    margin-top: 0.8rem;
}
@media (max-width: 768px) {
    .catalog-advanced-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .catalog-advanced-row label {
        text-align: left;
        min-width: 0;
    }
    .catalog-advanced-row-inline {
        flex-direction: column;
        gap: 8px;
    }
    .catalog-advanced-row-inline > div {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .catalog-advanced-row-inline input[type="number"] {
        width: 100%;
    }
}

/* CAPTCHA */
.catalog-captcha {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    padding: 12px 16px;
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    max-width: 500px;
}

.catalog-captcha img {
    border-radius: var(--radius-xs);
    height: 60px;
}

.catalog-captcha input {
    padding: 8px 12px;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-xs);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 120px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.catalog-captcha-refresh {
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.catalog-captcha-refresh:hover {
    border-color: var(--gold);
    color: var(--gold);
}
.captcha-error {
    color: #e53e3e;
    font-size: 0.85rem;
}

/* Site Banner */
.site-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 20px;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 101;
}
body.has-banner {
    --banner-offset: 42px;
}
body.has-banner .site-header {
    top: var(--banner-offset);
}
body.has-banner .site-nav {
    top: calc(var(--header-height) + var(--banner-offset));
}
body.has-banner .a11y-toolbar {
    top: calc(var(--header-height) + var(--banner-offset));
}
body.has-banner .site-main {
    padding-top: calc(var(--header-height) + var(--nav-height) + var(--banner-offset));
}
.site-banner.banner-info {
    background: linear-gradient(135deg, #1a365d, #2a4a7f);
    color: #bee3f8;
    border-bottom: 2px solid #3182ce;
}
.site-banner.banner-warning {
    background: linear-gradient(135deg, #744210, #975a16);
    color: #fefcbf;
    border-bottom: 2px solid #d69e2e;
}
.site-banner.banner-success {
    background: linear-gradient(135deg, #22543d, #276749);
    color: #c6f6d5;
    border-bottom: 2px solid #38a169;
}
.site-banner-text {
    flex: 1;
}
.site-banner-text a {
    color: inherit;
    text-decoration: underline;
}
.site-banner-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 4px;
    line-height: 1;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.site-banner-close:hover {
    opacity: 1;
}

/* Maintenance banner (автоматический, при перестройке словарей) */
.maintenance-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 20px;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(135deg, #744210, #975a16);
    color: #fefcbf;
    border-bottom: 2px solid #d69e2e;
}
.maintenance-icon {
    font-size: 1.1rem;
    animation: maintenance-spin 3s linear infinite;
    flex-shrink: 0;
}
@keyframes maintenance-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.maintenance-text {
    flex: 1;
}

/* Book detail card */
.book-detail-card {
    max-width: 800px;
    margin: 24px auto;
    padding: 32px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
}
.book-detail-close {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    margin-bottom: 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.book-detail-close:hover {
    opacity: 1;
}
.book-detail-cover {
    float: right;
    margin: 0 0 16px 20px;
    max-width: 150px;
}
.book-detail-cover img {
    max-width: 150px;
    max-height: 220px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.book-detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 8px;
    line-height: 1.3;
}
.book-detail-author {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.book-detail-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    margin-bottom: 24px;
}
.book-detail-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.7;
}
.book-detail-value {
    color: var(--text-primary);
    font-size: 0.95rem;
}
.book-detail-availability {
    margin-top: 20px;
}
.book-detail-availability h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.book-detail-availability table {
    width: 100%;
    border-collapse: collapse;
}
.book-detail-availability th,
.book-detail-availability td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.9rem;
}
.book-detail-availability th {
    color: var(--text-secondary);
    font-weight: 600;
    opacity: 0.7;
}
.book-detail-permalink {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.book-detail-permalink-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
}
.book-detail-permalink-input:focus {
    outline: none;
    border-color: var(--gold);
}
.book-detail-qr-btn {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.3rem 0.75rem;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    vertical-align: middle;
    transition: background 0.2s;
}
.book-detail-qr-btn:hover {
    background: rgba(255,255,255,0.18);
    color: var(--gold);
}
.book-detail-qr-container {
    margin-top: 0.75rem;
    text-align: center;
}
.book-detail-qr-container svg {
    border-radius: var(--radius-sm);
    padding: 12px;
    background: #fff;
}
.book-detail-qr-print {
    margin-top: 0.5rem;
    padding: 0.3rem 1rem;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}
.book-detail-qr-print:hover {
    background: rgba(255,255,255,0.18);
    color: var(--gold);
}
.book-detail-biblio {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.book-detail-biblio-text {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 6px 0;
    line-height: 1.5;
    user-select: all;
}
.book-export-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.book-export-buttons .book-detail-qr-btn {
    margin-left: 0;
}

/* Suggest dropdown */
.catalog-suggest-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    background: rgba(10, 22, 40, 0.97);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    z-index: 50;
    max-height: 300px;
    overflow-y: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.catalog-suggest-list.active {
    display: block;
}
.catalog-suggest-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}
.catalog-suggest-item:last-child {
    border-bottom: none;
}
.catalog-suggest-item:hover,
.catalog-suggest-item.active {
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold);
}
.catalog-suggest-item mark {
    background: none;
    color: var(--gold);
    font-weight: 600;
}

/* Loading */
.catalog-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.catalog-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--ocean);
    border-radius: 50%;
    animation: catalogSpin 0.8s linear infinite;
}

@keyframes catalogSpin {
    to { transform: rotate(360deg); }
}

/* Results */
.catalog-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.catalog-results-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.catalog-csv-btn {
    font-size: 0.8rem;
    padding: 4px 12px;
    background: rgba(201,168,76,0.15);
    border: 1px solid rgba(201,168,76,0.3);
    color: var(--brass-gold);
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}
.catalog-csv-btn:hover {
    background: rgba(201,168,76,0.25);
}

.catalog-results-table {
    width: 100%;
    border-collapse: collapse;
}

.catalog-results-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--navy-mid);
    color: var(--gold-light);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-gold);
}

.catalog-results-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.catalog-results-table th.sortable:hover {
    color: var(--gold);
}

.sort-arrow {
    font-size: 0.7rem;
}

.catalog-results-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 0.93rem;
    vertical-align: top;
}

.catalog-results-table tr:hover td {
    background: var(--bg-card-hover);
}

.catalog-results-table .col-author {
    width: 22%;
}

.catalog-results-table .col-title {
    width: 38%;
}

.catalog-results-table .col-publisher {
    width: 20%;
}

.catalog-results-table .col-date {
    width: 8%;
    text-align: center;
}

.catalog-results-table .col-inv {
    width: 12%;
    text-align: center;
}

.catalog-inv-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: default;
}

.catalog-inv-badge.has-copies {
    background: rgba(56, 142, 60, 0.2);
    color: #66bb6a;
}

.catalog-inv-badge.no-copies {
    background: rgba(183, 28, 28, 0.15);
    color: #ef5350;
}

/* Tooltip */
.catalog-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--navy-light);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-navy);
    padding: 8px 12px;
    max-width: 350px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.catalog-tooltip.visible {
    opacity: 1;
}

.catalog-tooltip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.catalog-tooltip-table th {
    text-align: left;
    padding: 4px 8px;
    color: var(--gold-light);
    font-weight: 600;
    border-bottom: 1px solid var(--border-gold);
}

.catalog-tooltip-table td {
    padding: 4px 8px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

/* Pagination */
.catalog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.catalog-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.catalog-page-btn:hover:not(:disabled):not(.active) {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
}

.catalog-page-btn.active {
    background: var(--ocean);
    color: var(--white);
    border-color: var(--ocean);
    font-weight: 600;
    cursor: default;
}

.catalog-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.catalog-page-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 0.9rem;
    user-select: none;
}

/* Empty state */
.catalog-empty {
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .catalog-search-form {
        flex-direction: column;
    }

    .catalog-results-table .col-publisher,
    .catalog-results-table th:nth-child(3),
    .catalog-results-table td:nth-child(3) {
        display: none;
    }

    .catalog-results-table .col-author { width: 30%; }
    .catalog-results-table .col-title { width: 45%; }
    .catalog-results-table .col-date { width: 10%; }
    .catalog-results-table .col-inv { width: 15%; }

    .catalog-captcha {
        flex-wrap: wrap;
    }
}

/* Focus-visible styles for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.lightbox-nav:focus-visible,
.lightbox-close:focus-visible,
.scroll-top-btn:focus-visible {
    outline-color: #fff;
}

/* Skip-to-content link (a11y) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--gold);
    color: #fff;
    padding: 8px 16px;
    border-radius: 0 0 6px 6px;
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
    transition: top .2s;
}
.skip-link:focus {
    top: 0;
}

/* ===== News Pagination ===== */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.news-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.news-page-btn:hover:not(:disabled):not(.active) {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
}

.news-page-btn.active {
    background: var(--ocean);
    color: var(--white);
    border-color: var(--ocean);
    font-weight: 600;
    cursor: default;
}

.news-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.news-page-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 0.9rem;
    user-select: none;
}

/* ===== News Category Filter Pills ===== */
.news-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.news-cat-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.news-cat-btn:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
}

.news-cat-btn.active {
    background: var(--gold);
    color: var(--white);
    border-color: var(--gold);
    font-weight: 600;
}

/* News category badge (public) */
.news-cat-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}

/* News category badge (admin small) */
.news-cat-badge-sm {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 600;
}

/* Loading fade for news list */
.loading-fade {
    opacity: 0.4;
    transition: opacity 0.2s;
    pointer-events: none;
}

/* Admin category row */
.admin-cat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.admin-cat-row:last-child {
    border-bottom: none;
}

.admin-cat-name {
    flex: 1;
    font-size: 0.9rem;
}

/* ============================================================
   Resource Pages
   ============================================================ */

/* -- Public: детальная страница ресурса -- */
.rp-back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--gold-light, #dbc06e);
    text-decoration: none;
    transition: color var(--transition);
}
.rp-back-link:hover { color: var(--gold, #c9a84c); text-decoration: underline; }
.rp-detail-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white, #fff);
    margin-bottom: 1.5rem;
}

/* Баннеры */
.rp-banners {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}
.rp-banner-link,
.rp-banner-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light, #dde3ea);
    transition: box-shadow 0.15s;
}
.rp-banner-link:hover {
    box-shadow: 0 4px 16px rgba(10,22,40,0.12);
}
.rp-banner-img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
}
.rp-banner-caption {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7c93);
    margin: 0.3rem 0 0.5rem;
    text-align: center;
}

/* Контент страницы */
.rp-content {
    line-height: 1.7;
    font-size: 1rem;
    margin-bottom: 2rem;
}
.rp-content h2,
.rp-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--sand, #f5e6c8);
}
.rp-content a {
    color: var(--gold-light, #dbc06e);
    text-decoration: none;
    border-bottom: 1px solid var(--gold-dark, #a88a32);
    transition: color var(--transition), border-color var(--transition);
}
.rp-content a:hover {
    color: var(--gold, #c9a84c);
    border-color: var(--gold, #c9a84c);
}
.rp-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Файлы */
.rp-files { margin-top: 1.5rem; }
.rp-files-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--white, #fff);
}
.rp-files-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.rp-files-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}
.rp-files-list li:last-child { border-bottom: none; }
.rp-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gold-light, #dbc06e);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition);
}
.rp-file-link:hover { color: var(--gold, #c9a84c); }
.rp-file-icon { font-size: 1.1rem; }

/* -- Admin: таблица страниц ресурсов -- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}
.admin-table th,
.admin-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-light, #dde3ea);
}
.admin-table th {
    background: var(--glass-bg, rgba(255,255,255,0.85));
    font-weight: 700;
    color: var(--navy, #0a1628);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.admin-table code {
    font-size: 0.82rem;
    background: #f0f2f5;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Admin: баннеры и файлы в редакторе страницы */
.rp-admin-banner,
.rp-admin-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light, #dde3ea);
    flex-wrap: wrap;
}
.rp-admin-banner:last-child,
.rp-admin-file:last-child { border-bottom: none; }

/* -- Responsive -- */
@media (max-width: 600px) {
    .rp-banners {
        flex-direction: column;
    }
    .rp-banner-img {
        max-height: 150px;
    }
    .admin-table { font-size: 0.8rem; }
    .admin-table th, .admin-table td { padding: 6px 5px; }
}
