:root {
    --ink: #17324d;
    --muted: #64788a;
    --sea: #087f8c;
    --sea-dark: #05606a;
    --sand: #f4ead7;
    --sky: #eaf6fb;
    --paper: #ffffff;
    --line: #d9e7ed;
    --danger: #b42318;
    --shadow: 0 14px 40px rgba(25, 64, 87, .10);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(180deg, #f8fcfe 0, #fff 360px);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}
a { color: var(--sea-dark); }
img { max-width: 100%; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
}
.brand-wrap {
    padding: 22px 24px 17px;
    text-align: center;
    background: linear-gradient(105deg, #dff5f5, #f8efdc 52%, #e6f4fb);
}
.brand {
    color: var(--ink);
    font-size: clamp(1.75rem, 4vw, 2.8rem);
    font-weight: 850;
    letter-spacing: -.045em;
    text-decoration: none;
}
.menu-row {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 66px;
}
.main-nav, .account-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.main-nav a, .main-nav button {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    padding: 10px 13px;
    border-radius: 999px;
}
.main-nav a:hover, .main-nav a.active, .main-nav button:hover, .main-nav button.active { background: var(--sky); color: var(--sea-dark); }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}
.nav-dropdown-toggle span { margin-left: 4px; font-size: .8em; }
.nav-submenu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 190px;
    display: none;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(23,50,77,.16);
    z-index: 80;
}
.nav-submenu a {
    display: block;
    border-radius: 10px;
    padding: 10px 12px;
    white-space: nowrap;
}
.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu,
.nav-dropdown.open .nav-submenu { display: block; }
.welcome { color: var(--muted); font-size: .92rem; }

.page-shell { width: min(1240px, calc(100% - 32px)); margin: 34px auto 0; min-height: 62vh; }
.hero {
    border-radius: 26px;
    background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.65), transparent 27%), linear-gradient(115deg, #cceef0, #edf7fb 50%, #f8e9cf);
    box-shadow: var(--shadow);
    padding: clamp(38px, 7vw, 82px);
    margin-bottom: 34px;
    overflow: hidden;
}
.compact-hero { padding-top: clamp(34px, 5vw, 58px); padding-bottom: clamp(34px, 5vw, 58px); }
.hero > div { max-width: 760px; }
.hero h1, .card h1, .admin-heading h1 { font-size: clamp(2rem, 5vw, 4.2rem); line-height: 1.02; letter-spacing: -.05em; margin: 0 0 18px; }
.compact-hero h1, .card h1, .admin-heading h1 { font-size: clamp(2rem, 4vw, 3.35rem); }
.hero p { max-width: 680px; font-size: 1.08rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .76rem !important; font-weight: 850; color: var(--sea-dark); margin: 0 0 10px !important; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.03em; }
.section-heading > span { color: var(--muted); }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 11px;
}
.thumbnail {
    display: block;
    aspect-ratio: 1;
    border-radius: 11px;
    overflow: hidden;
    background: var(--sky);
    box-shadow: 0 4px 16px rgba(23,50,77,.09);
    border: 1px solid rgba(255,255,255,.9);
}
.thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .24s ease, filter .24s ease; }
.thumbnail:hover img { transform: scale(1.045); filter: saturate(1.08); }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; margin: 34px 0 10px; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; text-decoration: none; border: 1px solid var(--line); background: #fff; }
.pagination .current { color: #fff; background: var(--sea); border-color: var(--sea); font-weight: 800; }

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(22px, 4vw, 38px);
    box-shadow: var(--shadow);
    margin-bottom: 28px;
}
.narrow { width: min(620px, 100%); margin-left: auto; margin-right: auto; }
.narrow-wide { width: min(780px, 100%); margin-left: auto; margin-right: auto; }
.auth-card { margin-top: 48px; }
.empty-state { padding: 60px 24px; text-align: center; background: #fff; border: 1px dashed #b9d4df; border-radius: var(--radius); }
.empty-state h3 { font-size: 1.7rem; margin-bottom: 6px; }
.muted, .field-help { color: var(--muted); }
.field-help { margin-top: -6px; font-size: .9rem; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 10px 17px;
    border-radius: 999px;
    border: 1px solid var(--sea);
    background: var(--sea);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    line-height: 1;
}
.button:hover { background: var(--sea-dark); border-color: var(--sea-dark); }
.button-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button-secondary:hover { color: var(--sea-dark); background: var(--sky); border-color: #b8dce4; }
.button-danger { background: #fff4f2; color: var(--danger); border-color: #f0b5ae; }
.button-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
button[disabled] { opacity: .45; cursor: not-allowed; }

.approval-form, .move-gallery-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.approval-form select, .move-gallery-form select {
    max-width: 180px;
    border: 1px solid #bdd2db;
    border-radius: 9px;
    padding: 8px 10px;
    background: #fff;
    color: var(--ink);
}
.text-link {
    border: 0;
    background: transparent;
    color: var(--sea-dark);
    text-decoration: underline;
    padding: 4px;
    font-weight: 750;
}

.stacked-form { display: grid; gap: 12px; }
.stacked-form label { font-weight: 760; }
.stacked-form input, .stacked-form textarea, .stacked-form select {
    width: 100%;
    border: 1px solid #bdd2db;
    border-radius: 11px;
    padding: 12px 14px;
    color: var(--ink);
    background: #fff;
}
.stacked-form input:focus, .stacked-form textarea:focus, .stacked-form select:focus { outline: 3px solid rgba(8,127,140,.16); border-color: var(--sea); }
.stacked-form textarea { resize: vertical; }
.stacked-form .button { justify-self: start; margin-top: 7px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; font-weight: 650 !important; }
.checkbox-label input { width: auto; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.flash { padding: 13px 16px; border-radius: 12px; margin: 0 0 18px; border: 1px solid; }
.flash-success { background: #edfbf4; border-color: #9dd8b8; color: #17613a; }
.flash-error { background: #fff1f0; border-color: #f2b6b0; color: #8d1d16; }
.flash-info { background: #eef8fc; border-color: #a9d8e8; color: #15566c; }
.flash ul { margin: 0; padding-left: 20px; }

.photo-viewer { margin-top: 18px; }
.photo-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.back-link { font-weight: 780; text-decoration: none; }
.photo-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 50vh;
    background: #0c1720;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.photo-stage > img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 185px); object-fit: contain; }
.photo-arrow {
    position: absolute;
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.88);
    color: var(--ink);
    display: grid;
    place-items: center;
    text-decoration: none;
    font-size: 1.8rem;
    box-shadow: 0 5px 20px rgba(0,0,0,.24);
}
.photo-arrow:hover { background: #fff; }
.photo-arrow-left { left: 16px; }
.photo-arrow-right { right: 16px; }
.photo-arrow.disabled { opacity: .25; }
.photo-caption { display: flex; justify-content: space-between; gap: 16px; padding: 12px 4px 0; color: var(--muted); font-size: .9rem; }
.photo-caption strong { color: var(--ink); }
.comments { max-width: 900px; margin: 32px auto 0; }
.comment-list { display: grid; gap: 13px; margin-bottom: 28px; }
.comment { border-top: 1px solid var(--line); padding-top: 14px; }
.comment-meta { display: flex; justify-content: space-between; gap: 14px; }
.comment-meta time { color: var(--muted); font-size: .88rem; }
.comment p { margin-bottom: 0; white-space: normal; }
.comment-form { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 22px; }

.two-column { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; align-items: start; }
.feature-list { padding-left: 20px; }
.ad-demo { aspect-ratio: 4 / 1; display: grid; place-items: center; align-content: center; gap: 2px; border: 2px dashed #9bc6d1; border-radius: 13px; background: var(--sky); color: var(--sea-dark); }
.ad-demo span { color: var(--muted); }

.ad-section { display: flex; justify-content: center; margin: 58px auto 20px; }
.ad-image, .ad-placeholder { width: 800px; max-width: 100%; aspect-ratio: 4 / 1; border-radius: 12px; overflow: hidden; }
.ad-image { object-fit: cover; display: block; box-shadow: 0 9px 28px rgba(23,50,77,.12); }
.ad-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(120deg, #ecf8fb, #faf0dd); border: 2px dashed #9cc8d1; color: var(--ink); text-decoration: none; }
.ad-placeholder strong { font-size: clamp(1.1rem, 3vw, 2rem); }
.ad-placeholder span { color: var(--muted); }
.site-footer { text-align: center; color: var(--muted); padding: 18px 20px 36px; }

.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 30px 0; }
.admin-heading h1 { margin-bottom: 8px; }
.admin-heading p { margin-bottom: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 28px; }
.stat-grid article { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 22px; box-shadow: 0 8px 24px rgba(23,50,77,.07); }
.stat-grid strong { display: block; font-size: 2rem; line-height: 1; margin-bottom: 8px; }
.stat-grid span { color: var(--muted); }
.admin-section { width: 100%; }
.moderation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.moderation-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.moderation-card > img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--sky); }
.moderation-info { display: grid; gap: 3px; padding: 14px; }
.moderation-info span { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.moderation-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.admin-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.admin-photo-grid article { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; padding-bottom: 10px; }
.admin-photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.admin-photo-grid article > div, .admin-photo-grid article > form { padding: 8px 10px 0; }
.admin-photo-grid strong, .admin-photo-grid span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-photo-grid span { color: var(--muted); font-size: .84rem; }
.text-danger { border: 0; background: transparent; padding: 0; color: var(--danger); text-decoration: underline; }
.admin-list article { border-top: 1px solid var(--line); padding: 15px 0; }
.admin-list article:first-child { border-top: 0; }
.admin-list article > div span { display: block; color: var(--muted); font-size: .85rem; }
.admin-list p { margin: 8px 0; }
.admin-ad-preview { margin-bottom: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 10px; vertical-align: top; }
th { font-size: .84rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.config-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; }
.config-list dt { font-weight: 800; }
.config-list dd { margin: 0; }
code { background: #edf5f7; padding: 2px 6px; border-radius: 6px; }

@media (max-width: 900px) {
    .menu-row { align-items: flex-start; padding: 11px 0; }
    .two-column { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
    .site-header { position: static; }
    .menu-row { width: min(100% - 20px, 1240px); flex-direction: column; gap: 9px; }
    .main-nav, .account-nav { width: 100%; }
    .nav-dropdown { position: static; }
    .nav-submenu { top: auto; margin-top: 6px; }
    .account-nav { border-top: 1px solid var(--line); padding-top: 9px; }
    .welcome { margin-right: auto; }
    .page-shell { width: min(100% - 20px, 1240px); margin-top: 20px; }
    .hero { border-radius: 18px; }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
    .photo-arrow { width: 43px; height: 43px; font-size: 1.4rem; }
    .photo-arrow-left { left: 8px; }
    .photo-arrow-right { right: 8px; }
    .photo-toolbar, .photo-caption, .admin-heading { align-items: flex-start; flex-direction: column; }
    .photo-toolbar .muted { display: none; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-grid article { padding: 17px; }
}
