/* ============================================================================
   COLOR SYSTEM — Optimized 2026
   Design principles:
   - LIGHT theme: warm ivory bg + deep ink text (≥ 12:1 contrast — eye-friendly)
   - DARK theme: deep midnight bg + warm cream text + DISTINCT primary blue & accent gold
   - Both themes preserve brand identity: deep royal blue (primary) + warm gold (accent)
   ============================================================================ */
:root {
    /* Surfaces — gentle warm white, avoids pure-white glare */
    --color-bg:        #f8f4ec;   /* warm parchment */
    --color-bg-soft:   #fefcf8;   /* near-white, softer than pure #fff */
    --color-surface:   #ffffff;
    /* Text — deep but not pure black (reduces contrast fatigue) */
    --color-text:      #1a1f2b;   /* ink blue-black */
    --color-text-soft: #414856;   /* secondary — clear hierarchy */
    --color-text-muted:#7c8494;   /* tertiary hints */
    --color-border:    #e2dcd0;
    /* Brand */
    --color-primary:        #0f2042;   /* deep royal blue */
    --color-primary-soft:   #1e3a6f;
    --color-accent:         #a67c30;   /* rich antique gold — AA compliant on white */
    --color-accent-light:   #c5a059;
    --color-accent-glow:    rgba(166, 124, 48, 0.22);
    /* On-color (text/icons placed ON brand colors) */
    --color-on-primary: #ffffff;
    --color-on-accent:  #0f2042;
    /* Shadows — subtle, warm */
    --shadow-soft:   0 6px 24px -6px rgba(15, 32, 66, 0.10);
    --shadow-strong: 0 16px 44px -10px rgba(15, 32, 66, 0.16);
}
[data-theme="dark"] {
    /* Surfaces — warmer dark (not cold blue-black) reduces eye strain */
    --color-bg:        #111518;   /* warm dark charcoal */
    --color-bg-soft:   #1a1e24;   /* subtle distinction from bg */
    --color-surface:   #21262e;   /* card/panel surface */
    /* Text — warm cream, not pure white (avoids halation) */
    --color-text:      #e8e0cf;   /* warm parchment white */
    --color-text-soft: #b5ad9a;   /* clear secondary */
    --color-text-muted:#7d7567;   /* muted hints */
    --color-border:    #2f3540;
    /* Brand — distinct primary vs accent */
    --color-primary:        #3b6bc8;   /* brighter royal blue — pops on dark bg */
    --color-primary-soft:   #5088e0;
    --color-accent:         #dbb95e;   /* warm gold — slightly muted vs light mode */
    --color-accent-light:   #ebd080;
    --color-accent-glow:    rgba(219, 185, 94, 0.35);
    /* On-color */
    --color-on-primary: #e8e0cf;
    --color-on-accent:  #111518;
    /* Shadows — subtle depth */
    --shadow-soft:   0 8px 32px -8px rgba(0, 0, 0, 0.50);
    --shadow-strong: 0 20px 52px -12px rgba(0, 0, 0, 0.65);
}
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box; }
body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    margin: 0;
}
.lucide-wrap { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.lucide-icon { display: block; }
html[lang="zh-CN"] .font-display { font-family: 'Playfair Display', 'Noto Serif SC', serif; }
html[lang="en-US"] .font-display { font-family: 'Playfair Display', Georgia, serif; }
html[lang="zh-CN"] body { font-family: 'Noto Sans SC', 'Inter', sans-serif; }
html { scroll-behavior: smooth; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-soft); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-accent), var(--color-primary));
    border-radius: 10px;
}
.hero-bg {
    background:
        radial-gradient(ellipse at top right, rgba(197, 160, 89, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(15, 32, 66, 0.20) 0%, transparent 55%),
        linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-soft) 100%);
    position: relative;
}
[data-theme="dark"] .hero-bg {
    background:
        radial-gradient(ellipse at top right, rgba(230, 198, 110, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(40, 78, 145, 0.28) 0%, transparent 55%),
        linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-soft) 100%);
}
.stars-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden; pointer-events: none; opacity: 0.5;
}
.stars-bg::before, .stars-bg::after {
    content: ''; position: absolute; width: 2px; height: 2px;
    background: var(--color-accent);
    box-shadow:
        100px 200px var(--color-accent), 250px 400px var(--color-accent),
        500px 100px var(--color-accent), 700px 300px var(--color-accent),
        900px 500px var(--color-accent), 1100px 200px var(--color-accent),
        1300px 700px var(--color-accent), 200px 600px var(--color-accent),
        400px 800px var(--color-accent), 800px 900px var(--color-accent),
        1500px 400px var(--color-accent), 1700px 600px var(--color-accent),
        300px 1000px var(--color-accent), 600px 1200px var(--color-accent);
    border-radius: 50%;
    animation: twinkle 4s ease-in-out infinite alternate;
}
.stars-bg::after { animation-delay: -2s; }
@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}
@keyframes shine {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.animate-float { animation: float 6s ease-in-out infinite; }
.text-gradient-gold {
    background: linear-gradient(135deg, #c5a059 0%, #e6c66e 50%, #c5a059 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    background-size: 200% 100%; animation: shine 5s linear infinite;
}
[data-theme="dark"] .text-gradient-gold {
    background: linear-gradient(135deg, #d4b365 0%, #f0d488 50%, #d4b365 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    background-size: 200% 100%; animation: shine 5s linear infinite;
}
.gold-divider {
    display: inline-flex; align-items: center; gap: 1rem;
    color: var(--color-accent); font-weight: 600;
    letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.875rem;
}
.gold-divider::before, .gold-divider::after {
    content: ''; height: 1px; width: 3rem;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}
.glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(197, 160, 89, 0.2);
}
[data-theme="dark"] .glass-card {
    background: rgba(22, 28, 52, 0.65);
    border: 1px solid rgba(230, 198, 110, 0.18);
}
.premium-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    position: relative; overflow: hidden;
}
.premium-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 0%, var(--color-accent-glow) 100%);
    opacity: 0; transition: opacity 0.5s ease; pointer-events: none;
}
.premium-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-strong);
    border-color: var(--color-accent);
}
.premium-card:hover::before { opacity: 0.15; }
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.95rem 2.25rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, #1c3c75 100%);
    color: #fff; font-weight: 600; letter-spacing: 0.04em;
    border-radius: 999px; border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px -10px rgba(15, 32, 66, 0.55);
    transition: all 0.3s ease; position: relative; overflow: hidden;
    text-decoration: none; cursor: pointer;
}
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, #e6c66e 100%);
    color: #0a0e1a;
    box-shadow: 0 10px 30px -8px rgba(230, 198, 110, 0.45);
}
.btn-primary::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
    transform: translateX(-100%); transition: transform 0.7s ease;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 40px -8px rgba(15, 32, 66, 0.65); }
.btn-primary:hover::before { transform: translateX(100%); }
.btn-ghost {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.95rem 2.25rem;
    background: transparent; color: var(--color-text);
    font-weight: 600; letter-spacing: 0.04em;
    border-radius: 999px; border: 1.5px solid var(--color-accent);
    transition: all 0.3s ease; text-decoration: none; cursor: pointer;
}
.btn-ghost:hover {
    background: var(--color-accent); color: #0a0e1a;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px -8px var(--color-accent-glow);
}
.counter-number {
    font-family: 'Playfair Display', 'Noto Serif SC', serif;
    font-weight: 800; font-size: clamp(3rem, 6vw, 5rem); line-height: 1;
    background: linear-gradient(135deg, #c5a059, #e6c66e, #c5a059);
    background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: shine 4s linear infinite;
}
.reveal {
    opacity: 0; transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }
.reveal.delay-4 { transition-delay: 0.4s; }
.img-reveal {
    opacity: 0; transform: scale(0.96);
    transition: opacity 1.2s ease, transform 1.2s ease;
}
.img-reveal.visible { opacity: 1; transform: scale(1); }
.nav-link {
    position: relative; padding: 0.5rem 0;
    color: var(--color-text-soft);
    font-weight: 500; transition: color 0.3s ease;
    text-decoration: none;
}
.nav-link::after {
    content: ''; position: absolute; left: 0; bottom: -2px;
    width: 0; height: 2px;
    background: var(--color-accent); transition: width 0.3s ease;
}
.nav-link:hover { color: var(--color-accent); }
.nav-link:hover::after { width: 100%; }
.news-cover {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    overflow: hidden; position: relative;
}
.news-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    filter: saturate(1.08) contrast(1.02);
}
/* Elegant gradient overlay — dampens watermarks (e.g. CCTV station logo + ticker)
   on top/bottom while preserving the photo subject in the center. */
.news-cover::after {
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg,
            rgba(15, 32, 66, 0.55) 0%,
            rgba(15, 32, 66, 0.18) 22%,
            transparent 45%,
            transparent 60%,
            rgba(15, 32, 66, 0.30) 82%,
            rgba(15, 32, 66, 0.65) 100%);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.4s ease;
}
[data-theme="dark"] .news-cover::after {
    background:
        linear-gradient(180deg,
            rgba(10, 14, 26, 0.70) 0%,
            rgba(10, 14, 26, 0.25) 22%,
            transparent 45%,
            transparent 60%,
            rgba(10, 14, 26, 0.40) 82%,
            rgba(10, 14, 26, 0.75) 100%);
}
.premium-card:hover .news-cover img { transform: scale(1.08); }
.premium-card:hover .news-cover::after { opacity: 0.7; }
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(10, 14, 26, 0.7);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 100; opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-container {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -55%) scale(0.95);
    width: min(900px, 92vw); max-height: 88vh;
    background: var(--color-bg-soft); border-radius: 24px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-strong); overflow: hidden;
    opacity: 0; transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-container {
    opacity: 1; transform: translate(-50%, -50%) scale(1);
}
.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--color-primary), #1c3c75);
    color: #fff; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 5;
}
[data-theme="dark"] .modal-header {
    background: linear-gradient(135deg, var(--color-accent), #e6c66e);
    color: #0a0e1a;
}
.modal-body {
    padding: 0; overflow-y: auto;
    max-height: 88vh;
    background: var(--color-bg-soft);
}

/* === Article Hero Banner === */
.article-hero {
    position: relative;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary), #1c3c75);
}
.article-hero > img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    filter: saturate(1.08) contrast(1.02);
}
.article-hero:hover > img { transform: scale(1.05); }
.article-hero::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg,
        rgba(15, 32, 66, 0.55) 0%,
        rgba(15, 32, 66, 0.18) 22%,
        transparent 45%,
        rgba(15, 32, 66, 0.45) 75%,
        rgba(15, 32, 66, 0.92) 100%);
    pointer-events: none;
}
.article-hero-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 2rem;
    color: #fff;
    z-index: 1;
}
.article-hero-tag {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--color-accent); color: var(--color-primary);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.4);
}
.article-hero-title {
    font-family: 'Playfair Display', 'Noto Serif SC', serif;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    margin: 0 0 1rem 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.article-hero-meta {
    display: flex; flex-wrap: wrap;
    gap: 1.25rem; align-items: center;
    font-size: 0.8rem; color: rgba(255,255,255,0.92);
}
.article-hero-meta span {
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.article-hero-meta i { color: var(--color-accent); }
.article-hero .modal-close {
    position: absolute;
    top: 1.25rem; right: 1.25rem;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    z-index: 5;
    backdrop-filter: blur(8px);
}
[data-theme="dark"] .article-hero .modal-close { background: rgba(0,0,0,0.3); color: #fff; }

/* === Article Content (forced unified UI for WeChat HTML) === */
.article-content {
    padding: 2.5rem 2rem;
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    line-height: 1.9;
    font-size: 1rem;
    color: var(--color-text);
}
.article-content, .article-content * {
    font-family: 'Inter', 'Noto Sans SC', sans-serif !important;
    color: var(--color-text) !important;
    background: transparent !important;
    background-color: transparent !important;
    border-color: var(--color-border) !important;
    max-width: 100% !important;
}
.article-content p,
.article-content span,
.article-content section {
    line-height: 1.9 !important;
    font-size: 1rem !important;
    letter-spacing: 0.015em !important;
}
.article-content p {
    margin: 0 0 1.5rem 0 !important;
}
.article-content p:first-of-type {
    /* Lead paragraph */
    font-size: 1.125rem !important;
    color: var(--color-text-soft) !important;
    border-left: 3px solid var(--color-accent) !important;
    padding: 1rem 0 1rem 1.5rem !important;
    background: linear-gradient(90deg, rgba(197, 160, 89, 0.08), transparent) !important;
    margin-bottom: 2rem !important;
    border-radius: 0 6px 6px 0;
}
[data-theme="dark"] .article-content p:first-of-type {
    background: linear-gradient(90deg, rgba(230, 198, 110, 0.10), transparent) !important;
}
.article-content section {
    margin: 0 !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    transform: none !important;
    box-shadow: none !important;
    float: none !important;
}
.article-content svg {
    display: none !important;
}
.article-content img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px !important;
    margin: 2rem auto !important;
    box-shadow: 0 12px 32px -12px rgba(15, 32, 66, 0.28) !important;
    cursor: zoom-in !important;
    transition: transform 0.4s ease, box-shadow 0.4s ease !important;
}
.article-content img:hover {
    transform: scale(1.015) !important;
    box-shadow: 0 18px 44px -12px rgba(15, 32, 66, 0.40) !important;
}
.article-content strong, .article-content b {
    color: var(--color-primary) !important;
    font-weight: 700 !important;
}
[data-theme="dark"] .article-content strong,
[data-theme="dark"] .article-content b {
    color: var(--color-accent) !important;
}
.article-content a {
    color: var(--color-accent) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(197, 160, 89, 0.4);
}
.article-content a:hover {
    text-decoration-color: var(--color-accent);
}
.article-content blockquote {
    border-left: 4px solid var(--color-accent) !important;
    padding: 0.5rem 1.5rem !important;
    margin: 2rem 0 !important;
    font-style: italic;
}

/* === Image Lightbox === */
.lightbox-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    cursor: zoom-out;
    padding: 2rem;
}
.lightbox-overlay.active { opacity: 1; visibility: visible; }
.lightbox-img {
    max-width: 92vw; max-height: 92vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    opacity: 0; transform: scale(0.92);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}
.lightbox-overlay.active .lightbox-img {
    opacity: 1; transform: scale(1);
}
.lightbox-close {
    position: absolute; top: 1.5rem; right: 1.5rem;
    width: 48px; height: 48px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: background 0.2s ease, transform 0.3s ease;
    backdrop-filter: blur(8px);
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}
.lightbox-caption {
    position: absolute; bottom: 1.5rem; left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem; letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* === Zoomable image (appointment cards) === */
.zoomable-image {
    cursor: zoom-in !important;
}
.zoomable-image-wrapper {
    cursor: zoom-in;
    position: relative;
    overflow: hidden;
}
.zoomable-image-wrapper::after {
    content: '\f00e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: 1rem; right: 1rem;
    width: 40px; height: 40px;
    background: rgba(15, 32, 66, 0.85);
    color: var(--color-accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.85);
    backdrop-filter: blur(6px);
    z-index: 2;
    pointer-events: none;
}
.zoomable-image-wrapper:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* Responsive */
@media (max-width: 640px) {
    .modal-container { width: 96vw; max-height: 92vh; border-radius: 16px; }
    .article-hero { aspect-ratio: 4 / 3; }
    .article-hero-info { padding: 1.25rem; }
    .article-hero-title { font-size: 1.05rem; line-height: 1.35; }
    .article-content { padding: 1.5rem 1.25rem; }
    .article-content p { font-size: 0.95rem !important; }
}
.modal-close {
    background: rgba(255,255,255,0.15);
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.3s ease;
    border: none; color: #fff;
}
.modal-close:hover { background: rgba(255,255,255,0.3); transform: rotate(90deg); }
[data-theme="dark"] .modal-close { background: rgba(0,0,0,0.15); color: #0a0e1a; }
[data-theme="dark"] .modal-close:hover { background: rgba(0,0,0,0.3); }
.modal-body::-webkit-scrollbar { width: 6px; }
.logo-mark {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--color-primary), #1c3c75);
    color: #c5a059;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    font-family: 'Playfair Display', serif;
    font-weight: 800; font-size: 1.25rem;
    box-shadow: 0 8px 20px -6px rgba(15, 32, 66, 0.4);
    position: relative; overflow: hidden;
}
[data-theme="dark"] .logo-mark {
    background: linear-gradient(135deg, var(--color-accent), #e6c66e);
    color: #0a0e1a;
}
.logo-mark::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: shine 4s ease-in-out infinite;
}
.mobile-menu { display: none; }
.mobile-menu.active { display: block; }

/* ===== PHOTO TIMELINE GALLERY (v3 — Curated Preview + Navigable Lightbox) ===== */

/* Photo count display with animated counter */
.gallery-count {
    display: inline-flex; align-items: baseline; gap: 0.4rem;
    padding: 0.3rem 0.9rem; border-radius: 999px;
    background: linear-gradient(135deg, rgba(197,160,89,0.12), rgba(197,160,89,0.06));
    border: 1px solid rgba(197,160,89,0.25);
    color: var(--color-accent); font-weight: 700;
    font-size: 0.78rem; letter-spacing: 0.06em;
    margin-top: 0.75rem;
}
.gallery-count-num {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem; font-weight: 800;
    background: linear-gradient(135deg, var(--color-accent), #e6c66e);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-filters {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    justify-content: center; margin-bottom: 3rem;
}
.gallery-filter-btn {
    padding: 0.6rem 1.4rem; border-radius: 999px;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
    background: var(--color-surface); color: var(--color-text-soft);
    border: 1px solid var(--color-border); cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    position: relative; overflow: hidden;
}
.gallery-filter-btn::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--color-accent), #e6c66e);
    opacity: 0; transition: opacity 0.35s;
}
.gallery-filter-btn:hover { border-color: var(--color-accent); transform: translateY(-2px); }
.gallery-filter-btn:hover::before { opacity: 0.08; }
.gallery-filter-btn.active {
    background: linear-gradient(135deg, var(--color-accent), #d4a84b); color: #fff;
    border-color: transparent; box-shadow: 0 6px 20px rgba(197,160,89,0.4);
    transform: translateY(-2px) scale(1.05);
}
.gallery-filter-btn.active::before { opacity: 0; }
.gallery-filter-btn span { position: relative; z-index: 1; }

.gallery-timeline {
    position: relative; display: flex; align-items: center;
    justify-content: space-between; margin: 1rem 0 3.5rem;
    padding: 2.5rem 2rem 1rem;
}
.gallery-timeline::before {
    content: ''; position: absolute; top: calc(2.5rem + 8px); left: 2rem; right: 2rem;
    height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0.5;
}
.timeline-dot {
    position: relative; z-index: 2; width: 16px; height: 16px;
    border-radius: 50%; background: var(--color-surface);
    border: 3px solid var(--color-border);
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1); cursor: pointer;
}
.timeline-dot.active {
    background: var(--color-accent); border-color: var(--color-accent);
    box-shadow: 0 0 0 6px rgba(197,160,89,0.15), 0 0 20px rgba(197,160,89,0.3);
    transform: scale(1.5);
}
.timeline-dot .dot-label {
    position: absolute; top: -32px; left: 50%; transform: translateX(-50%);
    font-size: 0.72rem; font-weight: 800; color: var(--color-text-muted);
    white-space: nowrap; transition: all 0.3s;
}
.timeline-dot.active .dot-label {
    color: var(--color-accent); transform: translateX(-50%) scale(1.15);
}

.gallery-grid {
    columns: 3;
    column-gap: 1.5rem;
    perspective: 1200px;
}
.gallery-item {
    position: relative; border-radius: 1.25rem; overflow: hidden;
    cursor: pointer; background: var(--color-surface);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.5s ease, opacity 0.6s ease;
    opacity: 0; transform: translateY(60px) rotateX(8deg) scale(0.92);
    will-change: transform, opacity;
    break-inside: avoid; margin-bottom: 1.5rem;
}
.gallery-item.visible {
    opacity: 1; transform: translateY(0) rotateX(0) scale(1);
}
.gallery-item.hiding {
    opacity: 0; transform: translateY(-20px) rotateX(-5deg) scale(0.88);
    pointer-events: none;
    transition: all 0.35s ease-in;
}
.gallery-item:hover {
    box-shadow: 0 25px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(197,160,89,0.15);
    z-index: 5;
}
.gallery-item img {
    width: 100%; object-fit: cover;
    display: block; transition: transform 0.7s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.5s;
    filter: brightness(0.95);
}
.gallery-item:hover img {
    transform: scale(1.12);
    filter: brightness(1.05);
}

/* Shine sweep on hover */
.gallery-item::before {
    content: ''; position: absolute; inset: 0; z-index: 2;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
    transform: translateX(-100%); transition: transform 0.8s ease;
    pointer-events: none;
}
.gallery-item:hover::before { transform: translateX(100%); }

/* Gold border glow on hover */
.gallery-item::after {
    content: ''; position: absolute; inset: 0; z-index: 1;
    border-radius: 1.25rem;
    border: 2px solid transparent;
    transition: border-color 0.4s;
    pointer-events: none;
}
.gallery-item:hover::after { border-color: rgba(197,160,89,0.4); }

.gallery-caption {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 3;
    padding: 4rem 1.25rem 1.25rem;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
    color: #fff; transform: translateY(30%); opacity: 0;
    transition: all 0.45s cubic-bezier(0.25,0.46,0.45,0.94);
}
.gallery-item:hover .gallery-caption { transform: translateY(0); opacity: 1; }
.gallery-caption p {
    font-size: 0.85rem; line-height: 1.6; margin: 0; font-weight: 500;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.gallery-caption .caption-date {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.68rem; color: var(--color-accent);
    margin-top: 0.6rem; font-weight: 700; letter-spacing: 0.12em;
    padding: 0.2rem 0.6rem; border-radius: 999px;
    background: rgba(197,160,89,0.15); backdrop-filter: blur(4px);
}


/* Gallery responsive — Tablet */
@media (max-width: 1024px) {
    .gallery-grid { columns: 2; column-gap: 1rem; }
}
/* Gallery responsive — Mobile */
@media (max-width: 768px) {
    .gallery-grid {
        columns: 2; column-gap: 0.75rem;
        perspective: none;
    }
    .gallery-item { border-radius: 1rem; }
    .gallery-item.visible { transform: translateY(0) scale(1); }
    .gallery-item:hover { transform: none; }
    .gallery-caption { transform: translateY(0); opacity: 1; padding: 2rem 0.75rem 0.75rem; }
    .gallery-timeline { display: none; }
    .gallery-filters { gap: 0.35rem; }
    .gallery-filter-btn { padding: 0.4rem 0.9rem; font-size: 0.72rem; }
}
@media (max-width: 480px) {
    .gallery-grid { gap: 0.5rem; }
    .gallery-item { border-radius: 0.75rem; }
    .gallery-caption p { font-size: 0.72rem; }
}

/* ===== Gallery CTA — "View All" button ===== */
.gallery-cta-wrap {
    display: flex; justify-content: center; margin-top: 2.5rem;
}
.gallery-cta {
    display: inline-flex; align-items: center; gap: 0.75rem;
    padding: 1rem 2.25rem; border-radius: 999px;
    font-size: 0.9rem; font-weight: 700; letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--color-primary), #1c3c75);
    color: #fff; cursor: pointer; border: none;
    box-shadow: 0 10px 30px rgba(15,32,66,0.25);
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    position: relative; overflow: hidden;
}
.gallery-cta::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--color-accent), #d4a84b);
    opacity: 0; transition: opacity 0.4s;
}
.gallery-cta > * { position: relative; z-index: 1; }
.gallery-cta:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 16px 40px rgba(197,160,89,0.4);
}
.gallery-cta:hover::before { opacity: 1; }
.gallery-cta i { transition: transform 0.4s; }
.gallery-cta:hover i { transform: translateX(6px); }
.gallery-cta-count {
    background: rgba(255,255,255,0.2);
    padding: 0.15rem 0.6rem; border-radius: 999px;
    font-size: 0.78rem;
}

/* ===== Photo Lightbox with Navigation ===== */
.photo-lightbox {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.96);
    display: none; opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(20px);
}
.photo-lightbox.active {
    display: flex; align-items: center; justify-content: center;
    opacity: 1;
}

.lightbox-stage {
    position: relative; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 4rem 5rem 6rem;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-image-wrap {
    position: relative; max-width: 100%; max-height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-image {
    max-width: 100%; max-height: 75vh;
    object-fit: contain; border-radius: 0.75rem;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    animation: lightboxZoom 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
}
@keyframes lightboxZoom {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Caption bar at bottom */
.lightbox-caption-bar {
    position: absolute; bottom: 1.5rem; left: 50%;
    transform: translateX(-50%);
    max-width: 90%; padding: 1rem 1.75rem;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(20px);
    border-radius: 1rem; text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
    animation: captionSlide 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
}
@keyframes captionSlide {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.lightbox-caption-bar p {
    color: #fff; font-size: 0.95rem; line-height: 1.5; margin: 0;
    font-weight: 500;
}
.lightbox-caption-bar .lb-meta {
    display: inline-flex; align-items: center; gap: 1rem;
    color: var(--color-accent); font-size: 0.72rem;
    margin-top: 0.5rem; font-weight: 700; letter-spacing: 0.15em;
}
.lightbox-caption-bar .lb-counter {
    color: rgba(255,255,255,0.5);
}

/* Navigation arrows */
.lightbox-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    z-index: 10;
}
.lightbox-arrow:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 8px 25px rgba(197,160,89,0.5);
}
.lightbox-arrow.prev { left: 2rem; }
.lightbox-arrow.next { right: 2rem; }
.lightbox-arrow:disabled {
    opacity: 0.3; cursor: not-allowed;
    transform: translateY(-50%);
}

/* Close button */
.lightbox-close {
    position: absolute; top: 1.5rem; right: 1.5rem;
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; z-index: 10;
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.18);
    transform: rotate(90deg) scale(1.1);
}

/* Top counter */
.lightbox-top-counter {
    position: absolute; top: 1.75rem; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.7); font-size: 0.85rem;
    font-weight: 700; letter-spacing: 0.15em;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    padding: 0.5rem 1.25rem; border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 10;
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .lightbox-stage { padding: 3.5rem 1rem 5rem; }
    .lightbox-arrow { width: 44px; height: 44px; font-size: 1rem; }
    .lightbox-arrow.prev { left: 0.5rem; }
    .lightbox-arrow.next { right: 0.5rem; }
    .lightbox-close { top: 1rem; right: 1rem; width: 40px; height: 40px; }
    .lightbox-top-counter { top: 1.2rem; font-size: 0.75rem; padding: 0.35rem 1rem; }
    .lightbox-caption-bar { bottom: 1rem; padding: 0.75rem 1.25rem; max-width: 92%; }
    .lightbox-caption-bar p { font-size: 0.82rem; }
    .lightbox-image { max-height: 65vh; }
    .gallery-cta { padding: 0.85rem 1.75rem; font-size: 0.82rem; }
}
