/* ============================================================
   CrookedEye.net — Main Stylesheet
   Dark theme with warm gold accents
   ============================================================ */

/* ------------------------------------------------------------
   CUSTOM PROPERTIES
   ------------------------------------------------------------ */
:root {
    --bg:             #0f0f14;
    --bg-surface:     #141419;
    --bg-card:        #1c1c26;
    --bg-card-hover:  #23232f;
    --accent:         #c4a35a;
    --accent-dim:     #9a7e40;
    --accent-light:   #dfc27a;
    --accent-glow:    rgba(196, 163, 90, 0.15);
    --text:           #dddde8;
    --text-muted:     #8080a0;
    --text-dim:       #50506a;
    --border:         #28283a;
    --border-accent:  #5a4a28;
    --shadow-sm:      0 2px 8px  rgba(0,0,0,0.45);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.55);
    --shadow-lg:      0 8px 32px rgba(0,0,0,0.70);
    --radius:         8px;
    --radius-sm:      4px;
    --ease:           0.22s ease;
    --font-head:      'Cinzel', 'Georgia', serif;
    --font-body:      'Open Sans', system-ui, -apple-system, sans-serif;
    --max-w:          1320px;
}

/* ------------------------------------------------------------
   RESET & BASE
   ------------------------------------------------------------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* offset for sticky header */
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    min-height: 100vh;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--ease);
}

a:hover { color: var(--accent-light); }

button {
    font-family: var(--font-body);
    cursor: pointer;
}

/* ------------------------------------------------------------
   LAYOUT UTILITIES
   ------------------------------------------------------------ */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.75rem;
}

.section {
    padding: 4.5rem 0;
}

.section-title {
    font-family: var(--font-head);
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text);
    margin-bottom: 2.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

/* Gold underline accent on section headings */
.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 56px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* ------------------------------------------------------------
   SITE HEADER
   ------------------------------------------------------------ */
.site-header {
    background: linear-gradient(180deg, #090910 0%, #0f0f16 100%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.75rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-branding { flex-shrink: 0; }

.site-title {
    font-family: var(--font-head);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.site-title span { color: var(--accent); }

.site-tagline {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 3px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2.25rem;
}

.site-nav a {
    font-family: var(--font-head);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color var(--ease);
}

.site-nav a:hover { color: var(--accent); }

/* ------------------------------------------------------------
   UPDATES SECTION
   ------------------------------------------------------------ */
.updates-section { background: var(--bg-surface); }

.updates-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.update-card {
    display: flex;
    gap: 2rem;
    padding: 1.4rem 1.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-left: 3px solid var(--accent-dim);
}

.update-date {
    flex-shrink: 0;
    width: 4.5rem;
    text-align: center;
    padding-top: 0.1rem;
}

.update-date-day {
    display: block;
    font-family: var(--font-head);
    font-size: 2rem;
    color: var(--accent);
    line-height: 1;
}

.update-date-month {
    display: block;
    font-size: 0.67rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 3px;
}

.update-date-year {
    display: block;
    font-size: 0.67rem;
    color: var(--text-dim);
}

.update-body { flex: 1; min-width: 0; }

.update-title {
    font-family: var(--font-head);
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.update-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ------------------------------------------------------------
   MINI GRID & CARDS
   ------------------------------------------------------------ */
.mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.5rem;
}

.mini-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.mini-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-lg);
}

.mini-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Thumbnail */
.mini-card-thumb-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #090910;
}

.mini-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.45s ease;
}

.mini-card:hover .mini-card-thumb {
    transform: scale(1.07);
}

.mini-card-count {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.72);
    color: var(--text-muted);
    font-size: 0.68rem;
    padding: 0.18rem 0.5rem;
    border-radius: 20px;
    letter-spacing: 0.06em;
    pointer-events: none;
}

/* Card body */
.mini-card-body {
    padding: 0.9rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.mini-card-name {
    font-family: var(--font-head);
    font-size: 0.92rem;
    letter-spacing: 0.03em;
    color: var(--text);
    line-height: 1.3;
}

.mini-card-manufacturer {
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.04em;
}

.mini-card-range {
    font-size: 0.73rem;
    color: var(--text-dim);
}

.mini-card-awards {
    margin-top: auto;
    padding-top: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.award-tag {
    font-size: 0.68rem;
    padding: 0.14rem 0.5rem;
    border-radius: 20px;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(196, 163, 90, 0.28);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   SECTIONS — ALTERNATING BACKGROUNDS
   ------------------------------------------------------------ */
.recent-section  { background: var(--bg); }
.gallery-section { background: var(--bg-surface); }

/* ------------------------------------------------------------
   GALLERY CONTROLS
   ------------------------------------------------------------ */
.gallery-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    align-items: flex-start;
    padding: 1.3rem 1.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.control-label {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.55rem;
}

.filter-group { flex: 1; min-width: 200px; }

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.32rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.filter-btn:hover {
    border-color: var(--accent-dim);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

.search-group { min-width: 220px; }

.search-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.48rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--ease);
    -webkit-appearance: none;
}

.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { border-color: var(--accent-dim); }

/* Clear button that browsers add to search inputs */
.search-input::-webkit-search-cancel-button { filter: invert(50%); }

.gallery-count {
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    margin-bottom: 1.75rem;
}

.gallery-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.95rem;
}

/* ------------------------------------------------------------
   LIGHTBOX
   ------------------------------------------------------------ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.open {
    display: flex;
}

.lb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 10, 0.94);
    cursor: pointer;
}

.lb-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-height: 96vh;
    padding: 1rem;
    pointer-events: none; /* children re-enable as needed */
}

.lb-inner > * { pointer-events: auto; }

/* Close button */
.lb-close {
    position: fixed;
    top: 1rem;
    right: 1.1rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.14);
    color: var(--text-muted);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background var(--ease), color var(--ease);
}

.lb-close:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

/* Image row */
.lb-image-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
}

.lb-nav {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-muted);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ease), color var(--ease);
}

.lb-nav:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

.lb-nav:disabled {
    opacity: 0.18;
    cursor: not-allowed;
}

.lb-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

#lb-img {
    display: block;
    max-width: min(88vw, 1200px);
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

/* Info panel */
.lb-info {
    text-align: center;
    max-width: min(88vw, 1200px);
    width: 100%;
}

.lb-name {
    font-family: var(--font-head);
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    color: var(--text);
}

.lb-meta {
    font-size: 0.83rem;
    color: var(--accent);
    margin-top: 0.2rem;
}

/* Insert em-dash separator between manufacturer and range */
#lb-range:not(:empty)::before {
    content: ' \2014 ';
    color: var(--text-dim);
}

.lb-awards {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.3rem;
}

.lb-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.6;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* Dot navigation */
.lb-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.lb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--text-dim);
    cursor: pointer;
    padding: 0;
    transition: background var(--ease), transform var(--ease);
}

.lb-dot.active {
    background: var(--accent);
    transform: scale(1.35);
}

.lb-dot:hover { background: var(--accent-dim); }

/* ------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------ */
.site-footer {
    background: #07070d;
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
}

.site-footer p {
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

/* ------------------------------------------------------------
   RESPONSIVE — TABLET
   ------------------------------------------------------------ */
@media (max-width: 768px) {
    .header-inner {
        height: auto;
        flex-direction: column;
        padding: 0.9rem 1.25rem;
        gap: 0.6rem;
        text-align: center;
    }

    .site-nav { gap: 1.5rem; }

    .site-title { font-size: 1.3rem; }

    .section { padding: 3rem 0; }

    .section-title { font-size: 1.35rem; }

    .mini-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 1rem;
    }

    .update-card {
        flex-direction: row;
        gap: 1.25rem;
    }

    .update-date {
        width: 3.5rem;
    }

    .update-date-day { font-size: 1.5rem; }

    #lb-img {
        max-width: min(90vw, 900px);
        max-height: 72vh;
    }
}

/* ------------------------------------------------------------
   RESPONSIVE — MOBILE
   ------------------------------------------------------------ */
@media (max-width: 480px) {
    .container { padding: 0 1rem; }

    .mini-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .gallery-controls { padding: 1rem; }

    .search-group { min-width: 100%; }

    .update-card {
        flex-direction: column;
        gap: 0.75rem;
    }

    .update-date {
        display: flex;
        align-items: baseline;
        gap: 0.5rem;
        width: auto;
        text-align: left;
    }

    .update-date-day { font-size: 1.1rem; }

    .lb-nav {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    #lb-img {
        max-width: 94vw;
        max-height: 65vh;
    }

    .lb-image-row { gap: 0.4rem; }
}
