/* ========================================
   Photography Page Styles — Anchenry
   双视图：瀑布流网格 + 三维地球
   颜色变量继承 styles.css（蓝色太空主题）
   ======================================== */

/* 补充 styles.css 中缺失的变量 */
:root {
    --accent-soft: rgba(92, 225, 255, 0.10);
    --font-serif: "Noto Serif SC", "SimSun", serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ BASE OVERRIDES ============ */
body.photo-page {
    background:
        radial-gradient(ellipse at 80% 8%, var(--accent-glow), transparent 42rem),
        radial-gradient(ellipse at 12% 65%, rgba(183, 148, 255, 0.04), transparent 32rem),
        var(--bg);
}

/* 摄影页特有的页面切换器微调（导航/切换器主样式由 styles.css 提供） */
@media (max-width: 640px) {
    body.photo-page { padding-top: 72px; }
    .photo-hero { padding-top: 28px; }
    .photo-toolbar { top: 72px; }
}

/* ============ HERO ============ */
.photo-hero {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    padding: clamp(72px, 10vw, 120px) 0 clamp(52px, 7vw, 84px);
}
.photo-hero-label {
    display: inline-flex; align-items: center; gap: 12px;
    color: var(--accent);
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.2em; text-transform: uppercase;
}
.photo-hero-label::before {
    content: ""; width: 32px; height: 1px;
    background: var(--accent); opacity: 0.5;
}
.photo-hero h1 {
    margin-top: 20px;
    font-family: var(--font-serif);
    font-size: clamp(3.6rem, 8vw, 7.2rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.06;
    color: var(--text);
    max-width: 14ch;
}
.photo-hero h1 em {
    font-style: normal;
    color: var(--accent);
}
.photo-hero-lead {
    max-width: 520px; margin-top: 28px;
    color: var(--muted);
    font-size: 1.04rem; line-height: 1.85;
}
.photo-hero-stats {
    display: flex; gap: 40px; margin-top: 36px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}
.photo-hero-stat b {
    display: block;
    color: var(--accent);
    font-size: 2.4rem; font-weight: 700;
    letter-spacing: -0.03em; line-height: 1;
}
.photo-hero-stat span {
    display: block; margin-top: 4px;
    color: var(--muted);
    font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase;
}

/* ============ TOOLBAR (Categories + View Toggle) ============ */
.photo-toolbar {
    position: sticky; top: 76px; z-index: 900;
    padding: 14px 0;
    pointer-events: none;
}
.toolbar-inner {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    padding: 10px 12px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    pointer-events: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.28);
}
.cat-chips {
    display: flex; align-items: center; gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 4px;
    -webkit-mask-image: linear-gradient(to right, black 96%, transparent);
    mask-image: linear-gradient(to right, black 96%, transparent);
}
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255,255,255,0.03);
    color: var(--muted);
    font-size: 0.8rem; font-weight: 500;
    cursor: pointer;
    transition: all 0.28s var(--ease);
    white-space: nowrap;
    font-family: var(--font);
}
.cat-chip:hover {
    border-color: var(--accent-dim);
    color: var(--text);
    background: var(--accent-soft);
    transform: translateY(-1px);
}
.cat-chip.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 600;
    box-shadow: 0 4px 16px var(--accent-glow-strong);
}
.cat-chip .cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    font-size: 0.64rem;
    opacity: 0.7;
    font-weight: 500;
}
.cat-chip.active .cat-count {
    background: rgba(11,13,16,0.18);
    opacity: 0.95;
}

/* View toggle */
.view-toggle {
    flex-shrink: 0;
    display: flex; align-items: center;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(11, 13, 16, 0.45);
}
.view-toggle button {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 0.8rem; font-weight: 500;
    cursor: pointer;
    transition: all 0.28s var(--ease);
    font-family: var(--font);
    white-space: nowrap;
}
.view-toggle button.active {
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--accent-glow-strong);
}
.view-toggle button:hover:not(.active) {
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

/* ============ GRID VIEW ============ */
.grid-view {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto; padding: 42px 0 96px;
    align-items: start;
}
.grid-view.hidden { display: none; }

/* Masonry container */
.masonry-wrap {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 28px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.masonry-section { margin-bottom: 12px; }
.masonry-section + .masonry-section {
    margin-top: 52px;
    padding-top: 52px;
    border-top: 1px solid var(--border);
}
.section-head {
    display: flex; align-items: baseline; gap: 16px;
    margin-bottom: 28px;
}
.section-head h2 {
    font-family: var(--font-serif);
    font-size: 1.7rem; font-weight: 700;
    letter-spacing: -0.03em; color: var(--text);
}
.section-head .section-sub {
    color: var(--muted); font-size: 0.76rem;
    font-weight: 500; letter-spacing: 0.08em;
    text-transform: uppercase;
}
/* 瀑布流：大小不一的卡片 */
.masonry-grid {
    columns: 4 200px;
    column-gap: 14px;
}
/* 让特定卡片跨更多列，营造大小不一的节奏 */
.photo-card { margin-bottom: 14px; }
.photo-card.size-lg { column-span: all; }
.photo-card.size-wide { grid-column: span 2; }

.photo-card {
    position: relative;
    break-inside: avoid;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: border-color 0.4s ease, transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.photo-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-4px);
    box-shadow: 0 18px 44px rgba(0,0,0,0.35);
}
.photo-card img {
    width: 100%; display: block;
    transition: transform 0.9s var(--ease), filter 0.8s ease;
    filter: saturate(0.7) contrast(1.05) brightness(0.92);
}
.photo-card:hover img {
    transform: scale(1.06);
    filter: saturate(1) contrast(1.08) brightness(1);
}
/* 不同卡片高度，制造瀑布流节奏 */
.photo-card.tall img { aspect-ratio: 3/4; object-fit: cover; }
.photo-card.square img { aspect-ratio: 1/1; object-fit: cover; }
.photo-card.wide img { aspect-ratio: 16/9; object-fit: cover; }
.photo-card.normal img { aspect-ratio: 4/3; object-fit: cover; }
.photo-card-info {
    position: absolute; inset: auto 0 0;
    padding: 56px 16px 16px;
    opacity: 0;
    background: linear-gradient(180deg, transparent, rgba(11,13,16,0.92));
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.photo-card:hover .photo-card-info { opacity: 1; }
.photo-card-loc {
    display: block;
    color: var(--accent);
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.15em; text-transform: uppercase;
}
.photo-card-date {
    display: block; margin-top: 4px;
    color: rgba(255,255,255,0.7);
    font-size: 0.72rem;
}

/* Empty state */
.empty-state {
    padding: 64px 24px; text-align: center;
    color: var(--muted);
}
.empty-state .empty-icon { font-size: 2.4rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 0.9rem; }

/* ============ GLOBE MARKER BADGES ============ */
.globe-marker {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}
.globe-marker-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    background: var(--surface);
}
.globe-marker-count {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    box-shadow: 0 4px 16px var(--accent-dim);
    font-family: var(--font);
}

/* ============ GLOBE VIEW ============ */
.globe-view {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto; padding: 0 0 96px;
    min-height: 70vh;
}
.globe-view.hidden { display: none; }
.globe-container {
    width: 100%;
    height: clamp(560px, 82vh, 860px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0e1116 0%, #06070a 100%);
    position: relative;
}
.globe-container canvas {
    display: block;
    margin: 0 auto;
}
.globe-hint {
    text-align: center;
    padding: 10px 18px;
    color: var(--muted);
    font-size: 0.72rem;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Globe info popup */
.globe-popup {
    position: fixed; z-index: 2000;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    color: var(--text);
    font-size: 0.82rem;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -120%);
    transition: opacity 0.2s ease;
    white-space: nowrap;
}
.globe-popup.visible { opacity: 1; }
.globe-popup strong { color: var(--accent); display: block; }
.globe-popup span { color: var(--muted); font-size: 0.7rem; }

/* ============ LIGHTBOX (near-fullscreen) ============ */
.photo-lightbox {
    position: fixed; inset: 0; z-index: 4000;
    display: none; align-items: center; justify-content: center;
    background: rgba(4, 5, 7, 0.98);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}
.photo-lightbox.active { display: flex; }
.lightbox-img {
    max-width: 98vw;
    max-height: 96vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 32px 90px rgba(0,0,0,0.75);
    -webkit-user-select: none;
    user-select: none;
}
.lightbox-close {
    position: fixed; top: 20px; right: 20px; z-index: 4010;
    width: 48px; height: 48px; display: grid; place-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%; background: var(--surface);
    color: var(--text); cursor: pointer;
    font-size: 1.15rem; transition: all 0.25s ease;
}
.lightbox-close:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.lightbox-nav {
    position: fixed; top: 50%; z-index: 4010;
    width: 52px; height: 52px; display: grid; place-items: center;
    transform: translateY(-50%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%; background: var(--surface);
    color: var(--text); cursor: pointer;
    font-size: 1.4rem; transition: all 0.25s ease;
}
.lightbox-nav:hover { background: var(--accent); color: var(--bg); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-caption {
    position: fixed; bottom: 24px; left: 50%; z-index: 4010;
    transform: translateX(-50%);
    padding: 10px 22px; border-radius: 999px;
    background: var(--surface); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    color: var(--text); font-size: 0.82rem; text-align: center;
    max-width: min(520px, calc(100% - 48px));
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============ FOOTER ============ */
.photo-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    position: relative; z-index: 10;
}
.photo-footer-inner {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto; padding: 44px 0;
    display: flex; justify-content: space-between;
    align-items: center; gap: 24px; flex-wrap: wrap;
}
.photo-footer-name {
    font-size: 1.2rem; font-weight: 700;
    letter-spacing: -0.04em; text-transform: uppercase;
    color: var(--text);
}
.photo-footer-copy {
    color: var(--muted); font-size: 0.78rem;
}
.photo-footer-note {
    color: var(--muted); font-size: 0.74rem; font-style: italic;
}

/* Back to top */
.back-to-top {
    position: fixed; right: 24px; bottom: 24px; z-index: 1100;
    width: 42px; height: 42px; display: grid; place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%; background: var(--surface);
    color: var(--text); cursor: pointer;
    opacity: 0; visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s var(--ease);
    font-size: 1rem;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
    .masonry-grid { columns: 3 200px; }
    .photo-hero h1 { font-size: clamp(2.8rem, 10vw, 5rem); }
}

@media (max-width: 860px) {
    .toolbar-inner {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        border-radius: var(--radius);
        padding: 14px;
    }
    .cat-chips {
        -webkit-mask-image: none;
        mask-image: none;
    }
    .view-toggle { align-self: flex-end; }
    .masonry-grid { columns: 2 200px; }
}

@media (max-width: 640px) {
    .photo-hero { padding: 48px 0 36px; }
    .photo-hero h1 { font-size: 2.4rem; }
    .photo-hero-stats { gap: 24px; }
    .photo-hero-stat b { font-size: 1.8rem; }
    .masonry-grid { columns: 1; }
    .masonry-wrap { padding: 18px; border-radius: var(--radius-sm); }
    .toolbar-inner { border-radius: var(--radius-sm); }
    .globe-container { height: 460px; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 1.2rem; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close { width: 42px; height: 42px; top: 14px; right: 14px; }
    .photo-footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
