:root {
    --bg: #f4f7f5;
    --panel: #ffffff;
    --ink: #14213d;
    --muted: #5c6b73;
    --brand: #1f7a8c;
    --brand-dark: #155e6d;
    --soft: #dff3ef;
    --danger: #a4161a;
    --shadow: 0 18px 50px rgba(20, 33, 61, 0.10);
    --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-text-size-adjust: 100%;
}

body.lightbox-open { overflow: hidden; }
img, video { max-width: 100%; display: block; }
a { color: inherit; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px clamp(12px, 4vw, 56px);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(20, 33, 61, 0.08);
}

.logo {
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    font-weight: 900;
    text-decoration: none;
    letter-spacing: -0.04em;
    white-space: nowrap;
}
.logo span { color: var(--brand); }

nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
nav a {
    text-decoration: none;
    font-weight: 800;
    color: var(--muted);
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 0.95rem;
}
nav a:hover, nav a:focus { color: var(--brand-dark); background: var(--soft); }

main {
    width: min(1380px, calc(100% - 24px));
    margin: 0 auto;
}

.simple-title { text-align: center; padding: clamp(14px, 4vw, 26px) 8px 14px; }
.simple-title.left { text-align: left; padding: 0; }

.eyebrow {
    margin: 0 0 6px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 900;
    color: var(--brand);
}

h1, h2, h3 { margin-top: 0; letter-spacing: -0.04em; line-height: 1.05; }
h1 { font-size: clamp(1.85rem, 7vw, 4.6rem); margin-bottom: 0; }
h2 { font-size: clamp(1.45rem, 4vw, 2.6rem); margin-bottom: 12px; }
h3 { font-size: 1.2rem; }
p { line-height: 1.65; color: var(--muted); }

.top-gallery { margin-bottom: 22px; }

.slideshow {
    position: relative;
    min-height: min(76vh, 820px);
    overflow: hidden;
    border-radius: clamp(14px, 3vw, 28px);
    background: #07121f;
    box-shadow: var(--shadow);
    touch-action: pan-y;
}

.main-slideshow { min-height: min(78vh, 860px); }
.slide { display: none; min-height: min(76vh, 820px); position: relative; }
.slide.active { display: block; }

.media-open {
    position: relative;
    width: 100%;
    min-height: min(78vh, 860px);
    padding: 0;
    margin: 0;
    border: 0;
    background: #07121f;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-open img,
.media-open video {
    width: 100%;
    height: min(78vh, 860px);
    object-fit: contain;
    background: #07121f;
}

.fullscreen-hint {
    position: absolute;
    right: 14px;
    top: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(7, 18, 31, 0.72);
    font-size: 0.82rem;
    font-weight: 900;
    pointer-events: none;
    opacity: 0.86;
}

.slide-caption {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    padding: 13px 16px;
    border-radius: 18px;
    color: white;
    background: linear-gradient(135deg, rgba(7, 18, 31, 0.88), rgba(7, 18, 31, 0.52));
    backdrop-filter: blur(10px);
    pointer-events: none;
}
.slide-caption h2, .slide-caption p { margin: 0; color: white; }
.slide-caption h2 { font-size: clamp(1.05rem, 3vw, 2rem); }

.slide-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(42px, 8vw, 54px);
    height: clamp(42px, 8vw, 54px);
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    font-size: 2rem;
    cursor: pointer;
    z-index: 5;
}
.slide-control:hover, .slide-control:focus { background: white; }
.slide-control.prev { left: 12px; }
.slide-control.next { right: 12px; }

.panel {
    margin: 22px 0;
    padding: clamp(18px, 5vw, 44px);
    background: var(--panel);
    border: 1px solid rgba(20, 33, 61, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.upload-panel { display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1.2fr); gap: clamp(18px, 4vw, 32px); align-items: start; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 24px; }

.notice { margin: 16px 0; padding: 14px 18px; border-radius: 16px; background: #e6fffa; color: #234e52; font-weight: 800; }
.notice.error { background: #fff5f5; color: var(--danger); }

.card-form { display: grid; gap: 15px; padding: clamp(16px, 4vw, 22px); border-radius: 20px; background: #fbfffe; border: 1px solid rgba(20, 33, 61, 0.08); }
label { display: grid; gap: 8px; font-weight: 800; }
input[type="text"], input[type="email"], input[type="password"], input[type="file"] {
    width: 100%;
    min-height: 48px;
    padding: 13px 14px;
    border: 1px solid rgba(20, 33, 61, 0.18);
    border-radius: 14px;
    font: inherit;
    background: white;
}
input:focus { outline: 3px solid rgba(31, 122, 140, 0.22); border-color: var(--brand); }

.button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: 13px 20px; min-height: 48px; background: var(--brand); color: white; font-weight: 900; text-decoration: none; cursor: pointer; box-shadow: 0 10px 24px rgba(31, 122, 140, 0.20); }
.button:hover, .button:focus { background: var(--brand-dark); }
.button.secondary { background: #ffffff; color: var(--brand-dark); box-shadow: inset 0 0 0 2px var(--soft); }

.empty-state { padding: 28px; text-align: center; border: 2px dashed rgba(31, 122, 140, 0.32); border-radius: 22px; background: rgba(223, 243, 239, 0.45); }
.hero-empty { min-height: 55vh; display: grid; place-items: center; }
.small { font-size: 0.9rem; margin: 0; }
footer { text-align: center; padding: 28px 16px 42px; }
.footer-admin-link { font-size: 0.8rem; color: var(--muted); margin-left: 8px; text-decoration: none; }
.footer-admin-link:hover { text-decoration: underline; }

.lightbox {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #000 !important;
    display: none !important;
    overflow: hidden !important;
}
.lightbox.is-open {
    display: block !important;
}
.lightbox[hidden] { display: none !important; }

.lightbox-stage {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483644 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #000 !important;
    overflow: hidden !important;
}

/* YouTube-style: media fills the whole fullscreen area. It may crop the edges slightly on very wide/tall screens. */
.lightbox-stage img,
.lightbox-stage video {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #000 !important;
}

.lightbox-close,
.lightbox-nav {
    position: fixed !important;
    z-index: 2147483647 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.94) !important;
    color: #07121f !important;
    cursor: pointer !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    box-shadow: 0 10px 35px rgba(0,0,0,0.55) !important;
    opacity: 0.96 !important;
}
.lightbox-close:hover,
.lightbox-nav:hover,
.lightbox-close:focus,
.lightbox-nav:focus {
    background: #ffffff !important;
    transform: scale(1.06) !important;
    outline: 3px solid rgba(255,255,255,0.45) !important;
}

.lightbox-close {
    top: max(18px, env(safe-area-inset-top)) !important;
    right: max(18px, env(safe-area-inset-right)) !important;
    left: auto !important;
    bottom: auto !important;
    width: 64px !important;
    height: 64px !important;
    font-size: 44px !important;
}
.lightbox-nav {
    top: 50% !important;
    bottom: auto !important;
    width: 76px !important;
    height: 76px !important;
    margin-top: -38px !important;
    font-size: 58px !important;
}
.lightbox-prev {
    left: max(22px, env(safe-area-inset-left)) !important;
    right: auto !important;
}
.lightbox-next {
    right: max(22px, env(safe-area-inset-right)) !important;
    left: auto !important;
}
.lightbox-title {
    position: fixed !important;
    z-index: 2147483646 !important;
    left: 50% !important;
    right: auto !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) !important;
    max-width: min(92vw, 900px) !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    border-radius: 999px !important;
    background: rgba(0,0,0,0.46) !important;
    color: white !important;
    text-align: center !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.8) !important;
    pointer-events: none !important;
}

@media (max-width: 900px) {
    .site-header { align-items: flex-start; flex-direction: column; gap: 8px; }
    nav { justify-content: flex-start; }
    main { width: min(100% - 14px, 1380px); }
    .upload-panel, .account-grid { grid-template-columns: 1fr; }
    .slideshow, .main-slideshow, .slide, .media-open { min-height: 62vh; }
    .media-open img, .media-open video { height: 62vh; }
    .slide-caption { left: 10px; right: 10px; bottom: 10px; padding: 11px 13px; }
    .fullscreen-hint { top: 10px; right: 10px; font-size: 0.76rem; }
}

@media (max-width: 560px) {
    .site-header { position: static; padding: 12px; }
    nav a { padding: 8px 9px; font-size: 0.9rem; }
    .simple-title { padding-top: 14px; }
    .slideshow, .main-slideshow, .slide, .media-open { min-height: 58vh; }
    .media-open img, .media-open video { height: 58vh; }
    .slide-control { top: auto; bottom: 14px; transform: none; }
    .slide-control.prev { left: 14px; }
    .slide-control.next { right: 14px; }
    .slide-caption { position: static; border-radius: 0; }
    .lightbox { padding: 0 !important; }
    .lightbox-nav { width: 56px !important; height: 56px !important; margin-top: -28px !important; font-size: 42px !important; background: rgba(255,255,255,0.88) !important; }
    .lightbox-prev { left: 10px !important; }
    .lightbox-next { right: 10px !important; }
    .lightbox-close { top: 12px !important; right: 12px !important; width: 54px !important; height: 54px !important; font-size: 38px !important; }
    .lightbox-title { font-size: 0.86rem !important; bottom: 12px !important; }
}
