/* =========================================================================
   Whiskybrunnen – design system (infosheet style)
   Palette: cream #FAF6EE · tan #F3E9D8 · red #C02625 · ink #444444
   ========================================================================= */

@font-face {
    font-family: "Rufina";
/*    src: url("../fonts/cracked-johnnie.ttf") format("truetype"); */
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

:root {
    --cream: #faf6ee;
    --cream-deep: #fffdf8;
    --tan: #f3e9d8;
    --red: #c02625;
    --red-dark: #9e1e1d;
    --red-soft: rgba(192, 38, 37, 0.22);
    --ink: #444444;
    --ink-soft: #5f5f5f;
    --line: #d9cdb8;

    --font-display: "Rufina", "Aptos", "Times New Roman", serif;
    --font-body: "Aptos", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

    --radius: 6px;
    --shadow: 0 2px 10px rgba(68, 68, 68, 0.08);
    --max-width: 1180px;
    --gap: 1.5rem;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background-color: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
}

img { max-width: 100%; height: auto; }

a { color: var(--red); }

:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--red);
    color: var(--cream);
    padding: 0.6rem 1rem;
    z-index: 100;
}
.skip-link:focus { left: 0; }

.muted { color: var(--ink-soft); }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------------- headings */

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-variant: small-caps;
    font-weight: 700;
    text-transform: lowercase;
    color: var(--red);
    line-height: 1.1;
    margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: 0.02em; }
h2 { font-size: clamp(1.0125rem, 2.25vw, 1.425rem); }
h3 { font-size: 1rem; }

p { margin: 0 0 1em; }

strong { color: var(--ink); }

.body-link {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}
.body-link:hover { color: var(--red); text-decoration: underline; }

/* -------------------------------------------------------------- masthead */

.masthead {
    background: var(--tan);
    border-bottom: 2.5px solid var(--red);
}

.masthead-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.1rem var(--gap) 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--gap);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
}

.brand-wordmark { width: 100%; max-width: 720px; }
.brand-wells { width: 92px; flex: none; }

/* ------------------------------------------------------------------- nav */

.site-nav {
    background: var(--red);
    border-bottom: 3px solid var(--red-dark);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-list {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gap);
    list-style: none;
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
}

.nav-list li { position: relative; display: flex; }

.nav-spacer { flex: 1 1 auto; }

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 0;
    padding: 0.85rem 1.05rem;
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active { background: var(--red-dark); color: #fff; }

.nav-shop { margin-left: auto; font-weight: 700; }

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: var(--red);
    color: var(--cream);
    border: 0;
    border-radius: var(--radius);
    padding: 0.55rem 0.8rem;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    font-size: 1rem;
    cursor: pointer;
}

.nav-toggle-bars { display: inline-flex; flex-direction: column; gap: 4px; }
.nav-toggle-bars span {
    display: block;
    width: 22px; height: 2.5px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-dropdown { position: relative; }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    margin: 0;
    padding: 0.4rem 0;
    list-style: none;
    background: var(--cream-deep);
    border: 1px solid var(--red-soft);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    z-index: 60;
}

.nav-dropdown-menu .nav-link {
    color: var(--ink);
    width: 100%;
    padding: 0.6rem 1rem;
}
.nav-dropdown-menu .nav-link:hover,
.nav-dropdown-menu .nav-link.is-active { background: var(--tan); color: var(--red); }

.nav-dropdown.is-open .nav-dropdown-menu { display: block; }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }

.caret { font-size: 0.7em; }

/* --------------------------------------------------------------- layout */

.site-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--gap);
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
}

.main-col { min-width: 0; }
.main-col:focus { outline: none; }

.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    position: sticky;
    top: 4.2rem;
}

/* ----------------------------------------------------------------- cards */

.card {
    background: var(--cream-deep);
    border: 1px solid var(--red-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-title {
    margin: 0;
    padding: 0.5rem 1rem 0.4rem;
    background: var(--red);
    color: var(--cream);
    font-size: 1.35rem;
    letter-spacing: 0.05em;
    text-align: center;
}

.card-body { padding: 1rem 1.1rem 1.2rem; }

.page-intro { max-width: 68ch; }

/* --------------------------------------------------------------- events */

.event-list { border-top: 1px dashed var(--line); }

.event-row {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    gap: 0.6rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.98rem;
}

.event-head {
    font-weight: 700;
    color: var(--red);
    border-bottom: 2px solid var(--red-soft);
}
.event-head span { font-variant: small-caps; letter-spacing: 0.05em; }

.event-date { color: var(--ink-soft); white-space: nowrap; }

.sidebar-more { margin: 0.9rem 0 0; }

/* ---------------------------------------------------------------- quote */

.quote {
    margin: 0;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--ink);
}
.quote cite { display: block; margin-top: 0.5rem; font-style: normal; color: var(--ink-soft); font-size: 0.9rem; }

/* ------------------------------------------------------------- content */

.content-card .card-body { padding: 1.25rem 1.4rem 1.5rem; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: var(--gap);
    align-items: start;
}
.hero img { border-radius: var(--radius); border: 1px solid var(--line); }

.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--gap);
}

.prose h2:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- table */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.data-table th, .data-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px dashed var(--line);
    text-align: left;
    vertical-align: top;
}
.data-table th {
    color: var(--red);
    font-variant: small-caps;
    letter-spacing: 0.05em;
    font-size: 1.05rem;
    border-bottom: 2px solid var(--red-soft);
}
.data-table tbody tr:hover { background: var(--tan); }

/* --------------------------------------------------------------- buttons */

.button,
button.button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--red);
    color: var(--cream);
    border: 0;
    border-radius: var(--radius);
    padding: 0.6rem 1.2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: var(--red-dark); color: #fff; }

.button-ghost {
    background: transparent;
    color: var(--red);
    border: 1.5px solid var(--red);
}
.button-ghost:hover { background: var(--red); color: var(--cream); }

/* ----------------------------------------------------------------- forms */

.form { display: grid; gap: 1rem; max-width: 620px; }

.field { display: grid; gap: 0.3rem; }

.field label {
    font-variant: small-caps;
    letter-spacing: 0.05em;
    color: var(--red);
    font-size: 1.02rem;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--red);
    outline: 2px solid var(--red-soft);
    outline-offset: 1px;
}

.field-error { color: var(--red-dark); font-size: 0.92rem; }

/* honeypot: visually hidden, but not display:none (bots read CSS) */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ----------------------------------------------------------------- flash */

.flash-stack { display: grid; gap: 0.6rem; margin-bottom: 1rem; }

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--red-soft);
    background: var(--cream-deep);
}
.flash-success { border-color: #2f7d4f; background: #eef7f1; color: #1f5c3a; }
.flash-error { border-color: var(--red); background: #fdeeed; color: var(--red-dark); }
.flash-info { border-color: var(--line); background: var(--tan); }

/* -------------------------------------------------------------- distilleries */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
}
.filter-bar .field { flex: 1 1 200px; }

.letter-index {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.75rem 0 1rem;
    padding: 0;
    list-style: none;
}
.letter-index a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.25rem 0.4rem;
    border: 1.5px solid var(--red-soft);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--red);
    font-weight: 700;
}
.letter-index a:hover,
.letter-index a.is-active { background: var(--red); color: var(--cream); }
.letter-index a.is-disabled { opacity: 0.35; pointer-events: none; }

.distillery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.5rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.distillery-item a {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
}
.distillery-item a:hover { background: var(--tan); color: var(--red); border-color: var(--red-soft); }

.status-badge {
    font-size: 0.72rem;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1.5px solid currentColor;
    align-self: center;
    white-space: nowrap;
}
.status-active { color: #2f7d4f; }
.status-closed, .status-demolished { color: var(--ink-soft); }
.status-mothballed { color: #8a6110; }

.detail-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1.25rem;
    margin: 1rem 0;
}
.detail-facts dt {
    color: var(--red);
    font-variant: small-caps;
    letter-spacing: 0.04em;
}
.detail-facts dd { margin: 0; }

#map {
    width: 100%;
    height: 420px;
    border: 2px solid var(--red-soft);
    border-radius: var(--radius);
    background: var(--tan);
}
.map-note { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- gallery */

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--gap);
    margin: 0;
    padding: 0;
    list-style: none;
}
.album-card { display: block; text-decoration: none; color: var(--ink); }
.album-card img {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
    transition: transform 0.2s ease;
}
.album-card:hover img { transform: scale(1.015); }
.album-title { display: block; margin-top: 0.5rem; color: var(--red); font-variant: small-caps; font-size: 1.15rem; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.gallery-thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--tan);
    cursor: zoom-in;
    overflow: hidden;
}
.gallery-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.25s ease;
}
.gallery-thumb:hover img { transform: scale(1.04); }

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 12, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1.5rem;
}
.lightbox.is-open { display: flex; }
.lightbox img {
    max-width: min(1100px, 92vw);
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--radius);
}
.lightbox-caption {
    position: absolute;
    bottom: 1.2rem;
    left: 0; right: 0;
    text-align: center;
    color: var(--cream);
    font-size: 0.95rem;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(250, 246, 238, 0.14);
    color: var(--cream);
    border: 1.5px solid rgba(250, 246, 238, 0.5);
    border-radius: 999px;
    width: 46px; height: 46px;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}
.lightbox-close { top: 1.2rem; right: 1.2rem; }
.lightbox-prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.2rem; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: var(--red); border-color: var(--red); }

/* ---------------------------------------------------------------- footer */

.site-footer {
    margin-top: var(--gap);
    background: var(--tan);
    border-top: 2.5px solid var(--red);
    padding: 1.25rem var(--gap) 1.75rem;
    text-align: center;
}

.footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1.4rem;
    margin: 0 0 0.75rem;
    padding: 0;
    list-style: none;
}

.footer-link {
    color: var(--ink);
    text-decoration: none;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    font-size: 1.02rem;
}
.footer-link:hover { color: var(--red); text-decoration: underline; }

.footer-note { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- admin */

.admin-body { background: #f4f2ee; }

.admin-shell { max-width: 1100px; margin: 0 auto; padding: var(--gap); }

.admin-topbar {
    background: var(--red);
    color: var(--cream);
    padding: 0.8rem var(--gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.admin-topbar a { color: var(--cream); text-decoration: none; font-variant: small-caps; letter-spacing: 0.06em; }
.admin-topbar a:hover { text-decoration: underline; }

.admin-nav { display: flex; gap: 1rem; flex-wrap: wrap; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}
.stat-card {
    background: var(--cream-deep);
    border: 1px solid var(--red-soft);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}
.stat-value { font-size: 2rem; font-family: var(--font-display); color: var(--red); }
.stat-label { font-variant: small-caps; letter-spacing: 0.05em; color: var(--ink-soft); }

.login-card {
    max-width: 420px;
    margin: 10vh auto;
    background: var(--cream-deep);
    border: 1px solid var(--red-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 960px) {
    .site-container { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .hero { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }

    .site-nav { border-bottom-width: 2px; }
    .nav-list {
        display: none;
        flex-direction: column;
        padding: 0.4rem var(--gap) 0.8rem;
    }
    .site-nav.is-open .nav-list { display: flex; }
    .nav-list li { display: block; }
    .nav-link { width: 100%; padding: 0.7rem 0.4rem; }
    .nav-shop { margin-left: 0; }
    .nav-spacer { display: none; }

    .nav-dropdown-menu {
        position: static;
        display: none;
        border: 0;
        box-shadow: none;
        background: var(--red-dark);
        border-radius: var(--radius);
        margin: 0.2rem 0 0.5rem;
        min-width: 0;
    }
    .nav-dropdown.is-open .nav-dropdown-menu { display: block; }
    .nav-dropdown:hover .nav-dropdown-menu { display: none; }
    .nav-dropdown.is-open:hover .nav-dropdown-menu { display: block; }
    .nav-dropdown-menu .nav-link { color: var(--cream); padding-left: 1.2rem; }
    .nav-dropdown-menu .nav-link:hover { background: rgba(0,0,0,0.15); color: #fff; }

    .masthead-inner { flex-direction: row; gap: 0.75rem; }
    .brand { gap: 0.75rem; }
    .brand-wells { width: 62px; }

    .event-row { grid-template-columns: 8rem 1fr; }
}

@media (max-width: 560px) {
    :root { --gap: 1rem; }
    body { font-size: 15.5px; }
    .event-row { grid-template-columns: 1fr; gap: 0.15rem; }
    .event-head { display: none; }
    .brand-wells { display: none; }
    .detail-facts { grid-template-columns: 1fr; gap: 0.1rem 0; }
    .detail-facts dd { margin-bottom: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
