:root {
    color-scheme: dark;
    --page: #030910;
    --surface: #0a1926;
    --surface-raised: #102638;
    --text: #e1edf5;
    --muted: #a5bbc9;
    --link: #88dff4;
    --line: #294a5d;
    --accent: #62c7e5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.amm-astro {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font: 16px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--link); }
a:hover { color: #fff; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible { outline: 3px solid #f5d17b; outline-offset: 3px; }
.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 9px 14px;
    border-radius: 8px;
    background: #fff;
    color: #001527;
}
.skip-link:focus { top: 12px; }

.page-shell {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(180deg, #081d2b 0, #050e18 430px, #02080e 100%);
}
.site-header {
    display: flex;
    align-items: flex-end;
    min-height: clamp(150px, 18vw, 245px);
    padding: 24px clamp(20px, 3vw, 56px);
    background: linear-gradient(0deg, #071620d9, #07162015 72%), #071620 url('../images/header-hd.png') center 20% / cover no-repeat;
}
.site-title {
    color: #e0f7ff;
    font-size: clamp(1.7rem, 3vw, 3rem);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -.025em;
    text-decoration: none;
    text-shadow: 0 2px 10px #000;
}
.top-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px clamp(16px, 2.4vw, 44px);
    border-bottom: 1px solid #356078;
    background: #102b3cf0;
}
.top-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.top-navigation a {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: #e2edf3;
    font-weight: 600;
    text-decoration: none;
}
.top-navigation li.current > a, .top-navigation li.active > a,
.top-navigation a:hover { background: #276079; color: #fff; }
.site-search { display: flex; flex: 0 1 27rem; gap: 7px; margin: 0; }
.site-search--mobile { display: none; }
.site-search input[type=search] { width: 100%; min-width: 0; min-height: 44px; background: #061926; }
.site-search button { min-height: 44px; white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.page-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(16px, 2vw, 32px);
    width: 100%;
    min-height: 400px;
    padding: clamp(16px, 2.4vw, 40px);
    align-items: start;
}
.page-columns.has-left { grid-template-columns: minmax(0, 1fr) minmax(0, 4fr); }
.page-columns.has-right { grid-template-columns: minmax(0, 4fr) minmax(0, 1.15fr); }
.page-columns.has-left.has-right { grid-template-columns: minmax(0, 1fr) minmax(0, 3.8fr) minmax(0, 1.15fr); }
.site-sections, .sidebar, .main-content { min-width: 0; }
.site-sections > summary { display: none; }
.sidebar { overflow-wrap: anywhere; }
.sidebar > * + * { margin-top: 12px; }
.sidebar h2, .sidebar h3 { margin: 0 0 .7em; color: #c2f0fc; font-size: 1rem; }
.sidebar ul { margin: 0; padding: 0; list-style: none; }
.sidebar li a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
}
.sidebar li.current > a, .sidebar li.active > a, .sidebar li a:hover {
    background: #1b4258;
    color: #fff;
}
.sidebar .menu-group, .sidebar .sidebar-module {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 8px 24px #0003;
}
.sidebar .menu-group { overflow: hidden; }
.sidebar .menu-group > summary {
    display: list-item;
    padding: 11px 14px;
    background: var(--surface-raised);
    color: #c2f0fc;
    cursor: pointer;
    font-weight: 700;
    list-style-position: inside;
}
.sidebar .menu-group > summary:hover { background: #1a4055; color: #fff; }
.sidebar .menu-group > ul { padding: 6px 8px 10px; }
.sidebar .menu-group li.parent { position: relative; }
.sidebar .menu-group li.parent > a,
.sidebar .menu-group li.parent > span { display: block; padding-right: 42px; }
.sidebar .menu-group .submenu-toggle {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #a8d9e9;
    font-size: 22px;
    line-height: 1;
}
.sidebar .menu-group .submenu-toggle:hover { background: #1a4055; }
.sidebar .menu-group ul ul {
    margin-left: 10px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}
.sidebar .menu-group ul[hidden] { display: none; }
.sidebar .sidebar-module { padding: 16px; }
.sidebar-right .sidebar-module h2,
.sidebar-right .sidebar-module h3 {
    margin: -16px -16px 9px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    border-radius: 11px 11px 0 0;
    background: var(--surface-raised);
}
.sidebar-right .sidebar-module li + li { border-top: 1px solid #1c3545; }

.main-content {
    padding: clamp(18px, 2.5vw, 40px);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #081723e8;
    box-shadow: 0 16px 40px #0003;
    overflow-wrap: anywhere;
}
.main-content h1, .main-content h2, .main-content h3 {
    color: #e5f8ff;
    line-height: 1.25;
}
.main-content h1 { margin-top: 0; font-size: clamp(1.75rem, 2.5vw, 2.65rem); }
.main-content p { margin: 0 0 1em; }
.main-content img, .main-content video, .main-content iframe { max-width: 100%; height: auto; }
.main-content table { display: block; max-width: 100%; overflow-x: auto; }
.main-content blockquote {
    margin: 1.2em 0;
    padding: .3em 1em;
    border-left: 3px solid var(--accent);
    color: var(--muted);
}
.gallery-overview { margin: 0 0 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.gallery-overview__heading h2 { margin: 0 0 .25rem; font-size: clamp(1.4rem, 2vw, 2rem); }
.gallery-overview__heading p { margin-bottom: 1rem; color: var(--muted); }
.gallery-overview__grid, .gallery-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.gallery-overview__card, .gallery-card a { display: block; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); color: var(--text); text-decoration: none; transition: border-color .16s ease, transform .16s ease; }
.gallery-overview__card[hidden] { display: none; }
.gallery-overview__card:hover, .gallery-card a:hover { border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.gallery-overview__card img, .gallery-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.gallery-overview__card > span, .gallery-card__body { display: block; padding: 11px 13px 14px; }
.gallery-overview__card strong, .gallery-card__body strong { display: block; line-height: 1.3; }
.gallery-overview__card small, .gallery-card__body small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.4; }
.gallery-card--text-only a { border-left: 3px solid var(--accent); background: linear-gradient(135deg, #102638, #0a1926); }
.gallery-card--text-only .gallery-card__body { padding: 18px; }
.gallery-pagination { margin-top: 1.5rem; }
.gallery-pagination .pagination__wrapper { display: flex; justify-content: center; }
.gallery-pagination .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.gallery-pagination .page-item { margin: 0; padding: 0; list-style: none; }
.gallery-pagination .page-link { display: flex; align-items: center; justify-content: center; min-width: 2.6rem; min-height: 2.6rem; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); color: var(--text); text-decoration: none; }
.gallery-pagination a.page-link:hover, .gallery-pagination a.page-link:focus-visible { border-color: var(--accent); background: #1b4258; color: #fff; }
.gallery-pagination .active .page-link { border-color: var(--accent); background: #1b566d; color: #fff; font-weight: 700; }
.gallery-pagination .disabled .page-link { color: var(--muted); opacity: .45; }
.gallery-pagination .icon-angle-double-left::before { content: '«'; }
.gallery-pagination .icon-angle-left::before { content: '‹'; }
.gallery-pagination .icon-angle-right::before { content: '›'; }
.gallery-pagination .icon-angle-double-right::before { content: '»'; }
.com-content-category__child { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.com-content-category__child h3 { margin: 0; }
input, select, textarea, button { max-width: 100%; font: inherit; }
input, select, textarea {
    padding: 8px;
    border: 1px solid #6b9baf;
    border-radius: 7px;
    background: #10222d;
    color: #fff;
}
button, .btn, input[type=submit] {
    padding: 9px 15px;
    border: 1px solid #71bdd1;
    border-radius: 7px;
    background: #1b566d;
    color: #fff;
    cursor: pointer;
}
.site-footer {
    padding: 20px clamp(20px, 3vw, 56px) 30px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .85rem;
    text-align: right;
}
.component-only { background: var(--page) !important; }
.component-only .main-content { width: 100%; margin: auto; }

@media (max-width: 1100px) {
    .page-columns.has-left.has-right { grid-template-columns: minmax(0, 1fr) minmax(0, 3.6fr); }
    .page-columns.has-left.has-right .sidebar-right { grid-column: 1 / -1; }
    .sidebar-right { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 16px; }
    .sidebar-right > * + * { margin-top: 0; }
}
@media (max-width: 760px) {
    .page-columns, .page-columns.has-left, .page-columns.has-right,
    .page-columns.has-left.has-right { display: flex; flex-direction: column; gap: 16px; }
    .site-sections, .sidebar, .main-content { width: 100%; }
    .site-sections { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
    .site-sections > summary {
        display: list-item;
        padding: 13px 16px;
        color: #e5f8ff;
        cursor: pointer;
        font-weight: 700;
        list-style-position: inside;
    }
    .site-sections > .sidebar { padding: 0 12px 12px; }
    .site-header { min-height: 145px; }
    .top-navigation { flex-direction: column; align-items: stretch; padding-inline: 10px; }
    .site-search--desktop { display: none; }
    .site-search--mobile { display: flex; flex-basis: auto; width: 100%; }
    .top-navigation a { padding: 7px 10px; }
    .site-footer { text-align: center; }
}
