/* ═══════════════════════════════════════════════════════════════
   BilGalleri – Public Frontend Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Custom properties ────────────────────────────────────────── */
:root {
    --bg:          #0e0e12;
    --bg-card:     #17171f;
    --bg-card2:    #1e1e28;
    --border:      #2a2a38;
    --text:        #e8e8f0;
    --text-muted:  #8888a8;
    --accent:      #e63946;
    --accent-2:    #4a90e2;
    --success:     #2ecc71;
    --warning:     #f39c12;

    --font:        'Inter', system-ui, sans-serif;
    --font-cond:   'Barlow Condensed', sans-serif;
    --radius:      10px;
    --radius-sm:   6px;
    --shadow:      0 4px 24px rgba(0,0,0,.45);
    --transition:  .18s ease;

    --max-w:       1280px;
    --gutter:      clamp(1rem, 4vw, 2rem);
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Utilities ────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.accent      { color: var(--accent); }
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .55rem 1.25rem; border-radius: var(--radius-sm);
    font-size: .9rem; font-weight: 600; border: 2px solid transparent;
    transition: var(--transition); white-space: nowrap;
}
.btn-primary {
    background: var(--accent); color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { background: #c1121f; border-color: #c1121f; }
.btn-outline {
    background: transparent; color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(14,14,18,.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: .8rem 0;
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo {
    display: flex; align-items: center; gap: .55rem;
    font-family: var(--font-cond); font-size: 1.5rem; font-weight: 700;
    letter-spacing: .04em; color: var(--text);
}
.logo-icon { color: var(--accent); font-size: 1.3rem; }
.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a {
    font-size: .9rem; font-weight: 500; color: var(--text-muted);
    transition: color var(--transition);
}
.site-nav a:hover, .site-nav a:focus { color: var(--text); }
.nav-admin {
    background: var(--bg-card2); padding: .35rem .85rem;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.nav-admin:hover { border-color: var(--accent); color: var(--accent) !important; }

/* ── Main & Footer ────────────────────────────────────────────── */
.site-main { flex: 1; }
.site-footer {
    border-top: 1px solid var(--border); padding: 1.5rem 0;
    text-align: center; color: var(--text-muted); font-size: .85rem;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
    padding: clamp(3rem, 8vw, 6rem) 0;
    text-align: center;
    background: linear-gradient(160deg, #1a0a0d 0%, var(--bg) 60%);
}
.hero-title {
    font-family: var(--font-cond); font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700; line-height: 1.05; letter-spacing: -.01em;
}
.hero-sub {
    margin-top: .75rem; color: var(--text-muted);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

/* ── Gallery grid ─────────────────────────────────────────────── */
.gallery-section { padding: 2rem 0 4rem; }
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1.5rem;
}
.car-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.car-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow);
    border-color: rgba(230,57,70,.4);
}
.card-img-wrap {
    position: relative; aspect-ratio: 3/2; overflow: hidden;
    background: var(--bg-card2);
}
.card-img-wrap img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s ease;
}
.car-card:hover .card-img-wrap img { transform: scale(1.04); }
.badge-draft {
    position: absolute; top: .6rem; left: .6rem;
    background: var(--warning); color: #000; font-size: .72rem;
    font-weight: 700; padding: .2rem .55rem; border-radius: 4px; text-transform: uppercase;
}
.card-body { padding: 1.1rem 1.25rem 1.3rem; }
.card-meta {
    display: flex; gap: .5rem; align-items: center;
    font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: .45rem;
}
.meta-year { color: var(--accent); }
.card-title {
    font-family: var(--font-cond); font-size: 1.3rem; font-weight: 700;
    line-height: 1.2; margin-bottom: .6rem;
}
.card-title a:hover { color: var(--accent); }
.card-stats {
    display: flex; gap: 1rem; flex-wrap: wrap;
    font-size: .82rem; color: var(--text-muted); margin-bottom: .9rem;
}
.stat { display: flex; align-items: center; gap: .3rem; }
.stat svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.card-link {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .88rem; font-weight: 600; color: var(--accent);
    transition: gap var(--transition);
}
.card-link:hover { gap: .6rem; }

/* ── Empty state ──────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 5rem 2rem;
    color: var(--text-muted);
}
.empty-icon { font-size: 4rem; opacity: .15; margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.5rem; margin-bottom: .5rem; color: var(--text); }
.empty-state a { color: var(--accent); }

/* ── Car detail – Hero ────────────────────────────────────────── */
.car-hero {
    position: relative; min-height: clamp(320px, 50vh, 560px);
    display: flex; align-items: flex-end; overflow: hidden;
    background: var(--bg-card2);
}
.car-hero::before {
    content: ''; position: absolute; inset: 0;
    background-image: var(--hero-bg);
    background-size: cover; background-position: center;
    filter: brightness(.55) saturate(1.1);
    transition: transform .6s ease;
}
.car-hero:hover::before { transform: scale(1.02); }
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.1) 60%, transparent 100%);
}
.car-hero-inner {
    position: relative; z-index: 2;
    padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
    width: 100%;
}
.car-hero-meta {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem;
}
.back-link {
    font-size: .85rem; color: rgba(255,255,255,.7); font-weight: 500;
    transition: color var(--transition);
}
.back-link:hover { color: #fff; }
.car-badges { display: flex; gap: .4rem; }
.badge {
    background: rgba(255,255,255,.12); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.18); color: #fff;
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; padding: .25rem .6rem; border-radius: 4px;
}
.car-hero-title {
    font-family: var(--font-cond); font-size: clamp(1.8rem, 5vw, 3.5rem);
    font-weight: 700; line-height: 1.1; letter-spacing: -.01em;
    color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.5);
    margin-bottom: 1rem;
}
.car-hero-stats {
    display: flex; gap: 1.5rem; flex-wrap: wrap;
}
.hero-stat {
    display: flex; flex-direction: column; align-items: center; line-height: 1.1;
    background: rgba(0,0,0,.4); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.12);
    padding: .6rem 1rem; border-radius: var(--radius-sm); min-width: 80px;
}
.stat-value {
    font-family: var(--font-cond); font-size: 1.9rem; font-weight: 700;
    color: #fff; letter-spacing: -.02em;
}
.stat-unit { font-size: .72rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .06em; }

/* ── Car body ─────────────────────────────────────────────────── */
.car-body { padding: 2.5rem var(--gutter) 4rem; max-width: var(--max-w); }
.car-intro {
    display: grid; grid-template-columns: 1fr 2fr; gap: 2rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}
@media (max-width: 680px) { .car-intro { grid-template-columns: 1fr; } }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td {
    padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.info-table th { color: var(--text-muted); font-weight: 500; width: 40%; white-space: nowrap; }
.info-table .unit { font-size: .8rem; color: var(--text-muted); margin-left: .25rem; }
.car-intro-desc { color: var(--text-muted); line-height: 1.75; }

/* ── Tabs ─────────────────────────────────────────────────────── */
.tabs { margin-bottom: 3rem; }
.tab-list {
    display: flex; gap: .25rem; flex-wrap: wrap;
    border-bottom: 2px solid var(--border); margin-bottom: 1.5rem;
}
.tab-btn {
    background: none; border: none; color: var(--text-muted);
    padding: .7rem 1.1rem; font-size: .9rem; font-weight: 600;
    position: relative; cursor: pointer;
    transition: color var(--transition);
    border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab-btn:hover   { color: var(--text); }
.tab-btn.active  { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel       { display: none; animation: fadeIn .2s ease; }
.tab-panel.active{ display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Specs table ──────────────────────────────────────────────── */
.specs-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
@media (max-width: 680px) { .specs-grid { grid-template-columns: 1fr; } }
.specs-col {}
.specs-group-title {
    font-family: var(--font-cond); font-size: 1rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted);
    margin-bottom: .75rem;
}
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td {
    padding: .55rem .75rem; text-align: left;
    border-bottom: 1px solid var(--border); font-size: .88rem;
}
.spec-table th { color: var(--text-muted); font-weight: 500; width: 55%; }
.spec-table .unit { font-size: .78rem; color: var(--text-muted); margin-left: .2rem; }
.spec-notes { font-size: .85rem; color: var(--text-muted); margin-top: .75rem; }

/* ── Equipment ────────────────────────────────────────────────── */
.equipment-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem;
}
.equipment-group {}
.equipment-category {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--accent); margin-bottom: .5rem;
}
.equipment-list { list-style: none; }
.equipment-item {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--border);
    font-size: .88rem;
}
.eq-name {}
.eq-value { color: var(--text-muted); font-size: .8rem; text-align: right; }

/* ── Evaluation ───────────────────────────────────────────────── */
.eval-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem;
}
.eval-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem;
}
.eval-positive { border-left: 3px solid var(--success); }
.eval-negative { border-left: 3px solid var(--accent); }
.eval-notes    { border-left: 3px solid var(--accent-2); }
.eval-title {
    display: flex; align-items: center; gap: .5rem;
    font-weight: 700; margin-bottom: .75rem; font-size: .95rem;
}
.eval-icon {
    width: 1.5rem; height: 1.5rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 1rem;
}
.eval-positive .eval-icon { background: rgba(46,204,113,.15); color: var(--success); }
.eval-negative .eval-icon { background: rgba(230,57,70,.15);  color: var(--accent); }
.eval-notes    .eval-icon { background: rgba(74,144,226,.15);  color: var(--accent-2); font-size: .7rem; }
.eval-list { list-style: none; }
.eval-list li {
    padding: .3rem 0; border-bottom: 1px solid var(--border);
    font-size: .88rem; color: var(--text-muted);
}
.eval-list li::before { content: '›'; margin-right: .5rem; color: inherit; }

/* ── Image gallery ────────────────────────────────────────────── */
.image-gallery { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.section-title {
    font-family: var(--font-cond); font-size: 1.4rem; font-weight: 700;
    margin-bottom: 1.25rem; letter-spacing: .02em;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .75rem;
}
.gallery-thumb {
    all: unset; cursor: pointer; display: block;
    aspect-ratio: 3/2; border-radius: var(--radius-sm); overflow: hidden;
    background: var(--bg-card2); border: 2px solid transparent;
    transition: border-color var(--transition), transform var(--transition);
}
.gallery-thumb:hover    { border-color: var(--accent); transform: scale(1.02); }
.gallery-thumb.is-cover { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Lightbox ─────────────────────────────────────────────────── */
.lightbox {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,.92); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .25s;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lb-content {
    position: relative; max-width: 90vw; max-height: 88vh;
    display: flex; flex-direction: column; align-items: center;
}
.lb-content img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 6px; }
.lb-counter { color: rgba(255,255,255,.5); font-size: .8rem; margin-top: .5rem; }
.lb-close, .lb-prev, .lb-next {
    position: fixed; background: rgba(255,255,255,.12);
    border: none; color: #fff; font-size: 1.6rem;
    width: 3rem; height: 3rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition); z-index: 1;
}
.lb-close { top: 1rem; right: 1rem; font-size: 1.8rem; }
.lb-prev  { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.25); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .car-hero-stats { gap: .75rem; }
    .hero-stat { min-width: 68px; padding: .5rem .75rem; }
    .stat-value { font-size: 1.5rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
