/* ===== GEOCITIES DARK THEME ===== */

@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap');

html {
    background: #000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #e6e6e6;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive, sans-serif;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
}

body.has-starry-background::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.95) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.7) 1.5px, transparent 1.5px);
    background-size: 400px 400px, 280px 280px;
    background-position: 0 0, 90px 90px;
    pointer-events: none;
    z-index: 0;
}

/* Very sparse subtle glow for a few feature stars */
body.has-starry-background::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 20% 25%, rgba(255,255,255,0.06) 0, transparent 6%),
                radial-gradient(circle at 70% 15%, rgba(255,255,255,0.05) 0, transparent 8%),
                radial-gradient(circle at 50% 80%, rgba(255,255,255,0.05) 0, transparent 7%);
    z-index: 0;
}

a {
    color: #d8d8d8;
    text-decoration: none;
}

a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.page {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER ===== */

.site-header {
    padding: 20px 0;
}

.header-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
}

.header-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.header-copy-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.site-title {
    font-size: 2rem;
    color: #ffffff;
    text-shadow: none;
    margin: 0;
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

.site-title a:hover {
    color: #ffffff;
}

.site-subtitle {
    color: #cfcfcf;
    font-size: 1.1rem;
    line-height: 1.2;
}

.header-photos {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.header-photos-left {
    justify-self: end;
    align-items: flex-end;
}

.header-photos-right {
    justify-self: start;
    align-items: flex-start;
}

.header-thumb {
    width: clamp(72px, 10vw, var(--header-image-size, 120px));
    height: clamp(72px, 10vw, var(--header-image-size, 120px));
    object-fit: cover;
    border: 2px solid #8a8a8a;
    border-radius: 4px;
}

.divider {
    color: #666;
    font-size: 0.8rem;
    letter-spacing: -1px;
    margin: 15px 0;
    overflow: hidden;
}

/* Header divider: match footer's dashed rule */
.header-divider {
    border-top: 1px dashed #333;
    margin: 15px 0;
}

@media (max-width: 720px) {
    /* Keep 3-column grid but let photo columns shrink to their content */
    .header-layout {
        grid-template-columns: auto 1fr auto;
        gap: 10px;
        align-items: center;
    }

    .header-photos-left {
        justify-self: center;
        align-items: center;
    }

    .header-photos-right {
        justify-self: center;
        align-items: center;
    }

    .header-photos {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px;
    }

    .header-thumb {
        width: clamp(48px, 13vw, 72px);
        height: clamp(48px, 13vw, 72px);
    }
}

/* ===== ALBUM GRID (index page) ===== */

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--thumbnail-display-size, 200px), 1fr));
    gap: 25px;
    padding: 20px 0;
}

.album-card {
    display: block;
    text-align: center;
    background: linear-gradient(180deg, #2b2b2b 0%, #242424 100%);
    border-radius: 10px;
    padding: 12px;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
    border: 3px solid #111;
    box-shadow: 0 6px 18px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
}

.album-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 36px rgba(0,0,0,0.7), 0 0 14px rgba(255,255,255,0.08);
    border-color: #b5b5b5;
    text-decoration: none;
}

.album-thumb-container {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(180deg, #000 0%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    padding: 6px;
}

.album-thumb {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    border: 4px solid #000; /* inner black frame for letterboxing */
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

.album-thumb-placeholder {
    font-size: 4rem;
}

.album-name {
    color: #f4f4f4;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 8px;
}

.album-count {
    color: #b0b0b0;
    font-size: 0.9rem;
}

/* ===== ALBUM PAGE (thumbnail grid) ===== */

.album-title {
    color: #f0f0f0;
    text-align: center;
    font-size: 1.8rem;
    margin: 15px 0;
    text-shadow: none;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--thumbnail-display-size, 200px), 1fr));
    gap: 8px;
    padding: 10px 0;
}

.thumb-cell {
    cursor: pointer;
    position: relative;
}

.thumb-container {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(180deg, #000 0%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    padding: 6px;
    border: 1px solid #1a1a1a;
}

.thumb-container:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.7), 0 0 10px rgba(255,255,255,0.06);
    transform: translateY(-3px);
}

.thumb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* ===== VIEWER OVERLAY ===== */

.viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 1000;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 24px 58px 18px;
}

.viewer-overlay[hidden] {
    display: none;
}

.viewer-stage {
    position: relative;
    min-height: 0;
}

.viewer-close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 2.5rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1010;
    line-height: 1;
    width: 48px;
    height: 48px;
}

.viewer-close:hover {
    color: #dcdcdc;
}

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.42);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1010;
    padding: 10px 12px;
    transition: color 0.2s ease, transform 0.2s ease;
    line-height: 1;
}

.viewer-nav:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%) scale(1.04);
}

.viewer-nav:disabled {
    pointer-events: none;
}

.viewer-nav--dot {
    font-size: 2rem;
    opacity: 0.4;
    cursor: default;
}

.viewer-nav--dot:hover {
    color: rgba(255, 255, 255, 0.42);
    transform: translateY(-50%);
}

.viewer-prev {
    left: 8px;
}

.viewer-next {
    right: 8px;
}

.viewer-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    touch-action: none;
    user-select: none;
}

.viewer-content img {
    position: absolute;
    top: 0;
    left: 0;
    object-fit: fill;
    border: 5px solid #fff;
    border-radius: 2px;
    box-shadow: 0 26px 70px rgba(0,0,0,0.8);
    cursor: zoom-in;
    max-width: none;
    max-height: none;
    will-change: width, height, left, top;
}

.viewer-content img.viewer-image-natural,
.viewer-content img.viewer-image-zoomed {
    cursor: zoom-out;
}

.viewer-content video {
    position: absolute;
    inset: 0;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    border-radius: 2px;
    border: 5px solid #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.viewer-exif {
    padding: 0 8px 4px;
    color: #ccc;
    font-size: 0.85rem;
    text-align: center;
    min-height: 54px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.viewer-exif span {
    white-space: nowrap;
    color: #f0f0f0;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
}

.viewer-exif strong {
    color: #b6b6b6;
    font-weight: 700;
    margin-right: 0.35rem;
}

.viewer-exif-empty {
    color: #7d7d7d;
}

.viewer-share {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #f0f0f0;
    cursor: pointer;
    padding: 0.2rem 0.55rem;
    font-size: 0.85rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    position: relative;
}

.viewer-share:hover, .viewer-share:focus {
    background: rgba(255, 255, 255, 0.15);
}

.viewer-share:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

.viewer-share-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background-color: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

.viewer-share-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.viewer-share--copied .viewer-share-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

.viewer-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1005;
}

.viewer-spinner[hidden] {
    display: none;
}

.viewer-spinner::after {
    content: '';
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    animation: viewer-spin 0.8s linear infinite;
}

@keyframes viewer-spin {
    to { transform: rotate(360deg); }
}

/* ===== FOOTER ===== */

.site-footer {
    text-align: center;
    padding: 30px 0 15px;
    border-top: 1px dashed #333;
    margin-top: 30px;
}

.visitor-counter {
    margin-bottom: 10px;
}

.counter-label {
    color: #0ff;
}

.counter-digits {
    font-family: 'Courier New', monospace;
    background: #111;
    color: #0f0;
    padding: 2px 8px;
    border: 2px inset #444;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.site-footer marquee {
    color: #ff69b4;
    margin: 10px 0;
}

.footer-text {
    color: #9a9a9a;
    font-size: 0.85rem;
}

#cursor-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 600px) {
    .site-title {
        font-size: 1.3rem;
    }

    .album-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .thumb-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 4px;
    }

    .viewer-content {
        min-height: 0;
    }

    .viewer-nav {
        padding: 8px;
        font-size: 2rem;
    }

    .viewer-exif {
        font-size: 0.75rem;
        gap: 10px;
    }

    .viewer-overlay {
        padding: 58px 12px 12px;
        gap: 12px;
    }

    .viewer-close {
        top: 6px;
        right: 8px;
    }

    .viewer-prev {
        left: 2px;
    }

    .viewer-next {
        right: 2px;
    }

    .header-thumb {
        width: 80px;
        height: 80px;
    }
}
