/* =========================================================
   Bryghus – offentligt tema
   Farver: ristet malt, rav-øl, skum, humle og kraftpapir
   ========================================================= */
:root {
  /* Farver fra beer.bredahl.dk */
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --line: #DDDDDD;
  --ink: #111111;
  --text: #333333;
  --muted: #767676;
  --accent: #CA2017;
  --accent-dark: #A01810;
  --accent-soft: #FBEAE8;
  --dark: #111111;
  --on-dark: #BBBBBB;
  --hop: #6F8F3D;
  --danger: #CA2017;

  --display: 'Shrikhand', 'Cooper Black', Georgia, serif;
  --body: 'Bitter', Georgia, 'Times New Roman', serif;

  --wrap: 1160px;
  --radius-label: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); font-size: 1.0625rem; line-height: 1.7; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .005em; }
h3 { font-weight: 800; }

/* ---------- header ---------- */
.site-header { background: var(--surface); color: var(--ink); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 76px; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--accent); }
.brand-logo { width: auto; height: 52px; max-width: 220px; object-fit: contain; }
.brand-hop { width: 44px; height: 44px; color: var(--hop); }
.brand-name { font-family: var(--display); font-size: 1.6rem; line-height: 1; }
.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.site-nav a { color: var(--ink); text-decoration: none; padding: .45rem .8rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.site-nav .nav-admin { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 2px; margin-left: .5rem; color: var(--ink); }
.site-nav .nav-admin:hover { border-color: var(--accent); color: var(--accent); }
.nav-admin svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-admin-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* dropdown */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > a { padding-right: .25rem; }
.sub-toggle { font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; padding: .45rem .6rem .45rem .2rem; display: inline-flex; align-items: center; gap: .4rem; }
.sub-toggle-label { padding-left: .8rem; }
.sub-toggle::after { content: ""; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid currentColor; transition: transform .15s; }
.sub-toggle:hover, .has-sub.is-active > .sub-toggle, .has-sub.is-active > a { color: var(--accent); }
.has-sub.is-active > .sub-toggle-label { border-bottom-color: var(--accent); }
.has-sub.open > .sub-toggle::after { transform: rotate(180deg); }
.has-sub.open > .sub-toggle, .has-sub:focus-within > .sub-toggle { color: var(--accent); }

/* Dropdown i stil med beer.bredahl.dk: mørk boks, kursiv serif, pil */
.sub-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 240px; background: #222222; padding: 0; z-index: 30; text-align: center;
}
.sub-menu::before { /* pil op mod menupunktet */
  content: ""; position: absolute; top: -8px; left: 50%; margin-left: -8px;
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 8px solid #222222;
}
.sub-menu a {
  display: block; padding: 1.15rem 1.25rem; border: 0; border-top: 1px solid #393939;
  color: #FFFFFF; font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: .98rem; line-height: 1.35;
}
.sub-menu a:first-child { border-top: 0; }
.sub-menu a:hover, .sub-menu a:focus-visible { color: var(--accent); background: transparent; }
.sub-menu a[aria-current="page"] { border-bottom: 0; color: var(--accent); }
.has-sub::after { /* usynlig bro så menuen ikke lukker mellem punkt og boks */
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; display: none;
}
.has-sub.open > .sub-menu { display: block; }
@media (min-width: 821px) {
  .site-nav { align-self: stretch; }
  .nav-item { align-self: stretch; }
  .has-sub.open::after { display: block; }
}
@media (hover: hover) and (min-width: 821px) {
  .has-sub:hover > .sub-menu { display: block; }
  .has-sub:hover::after { display: block; }
  .has-sub:hover > .sub-toggle { color: var(--accent); }
  .has-sub:hover > .sub-toggle::after { transform: rotate(180deg); }
}
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); font: inherit; padding: .35rem .9rem; border-radius: 2px; cursor: pointer; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); flex-direction: column; align-items: stretch; padding: .75rem 1.25rem 1.25rem; border-bottom: 1px solid var(--line); }
  .site-nav.open { display: flex; }
  .site-nav .nav-admin { margin-left: 0; width: auto; height: auto; padding: .6rem .8rem; justify-content: flex-start; }
  .nav-admin-text { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .nav-item { flex-wrap: wrap; }
  .nav-item > a { flex: 1; }
  .sub-toggle-label { flex: 1; justify-content: space-between; }
  .sub-menu { position: static; transform: none; width: 100%; margin: .25rem 0 .5rem; text-align: left; }
  .sub-menu::before { display: none; }
  .sub-menu a { padding: .8rem 1.1rem; }
  .brand-name { font-size: 1.3rem; }
}

/* ---------- flash ---------- */
.flashes { padding-top: 1rem; }
.flash { padding: .75rem 1rem; margin-bottom: .75rem; font-weight: 600; border-left: 4px solid; background: var(--surface); }
.flash-ok { border-color: var(--hop); background: #EFF4E6; }
.flash-error { border-color: var(--danger); background: var(--accent-soft); color: #6B120C; }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--surface); color: var(--text); overflow: hidden; padding: clamp(2.5rem, 6vw, 5rem) 0 0; border-bottom: 1px solid var(--line); }
.hero.has-photo {
  background:
    linear-gradient(100deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.85) 42%, rgba(255,255,255,0) 75%),
    var(--hero-photo) center / cover no-repeat,
    var(--surface);
}
.hero.has-photo .hero-art { visibility: hidden; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: end; }
.hero-copy { padding-bottom: clamp(2.5rem, 6vw, 5rem); align-self: center; }
.hero h1 { font-size: clamp(2.8rem, 7.5vw, 6rem); line-height: .95; color: var(--ink); max-width: 11ch; margin-bottom: .4em; }
.hero-copy { min-width: 0; position: relative; z-index: 1; }
.hero-text { font-size: 1.2rem; width: min(var(--hero-text-w, 46ch), 100vw - 2.5rem); color: var(--text); }
.hero-actions { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-top: 1.75rem; }
.hero-count { margin: 0; font-style: italic; color: var(--muted); }
.hero-art { align-self: end; }
.pint { width: 100%; max-width: 440px; margin-left: auto; overflow: visible; }

.beer-fill { transform-box: fill-box; transform-origin: bottom; animation: pour 1.8s cubic-bezier(.3,.7,.3,1) both .2s; }
.foam { opacity: 0; animation: foam-in .7s ease-out both 1.6s; }
.bubbles circle { animation: rise 3.2s linear infinite; opacity: 0; }
.bubbles circle:nth-child(2) { animation-delay: .6s; animation-duration: 2.7s; }
.bubbles circle:nth-child(3) { animation-delay: 1.3s; }
.bubbles circle:nth-child(4) { animation-delay: .3s; animation-duration: 3.8s; }
.bubbles circle:nth-child(5) { animation-delay: 2s; }
.bubbles circle:nth-child(6) { animation-delay: 1.6s; animation-duration: 2.4s; }
.bubbles circle:nth-child(7) { animation-delay: 2.4s; animation-duration: 3.4s; }
.bubbles circle:nth-child(8) { animation-delay: .9s; animation-duration: 3s; }
@keyframes pour { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes foam-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-360px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .beer-fill, .foam, .bubbles circle { animation: none; opacity: 1; }
  .bubbles circle { opacity: .7; }
  html { scroll-behavior: auto; }
}
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 0; }
  .pint { max-width: 300px; margin: 0 auto; }
  .hero.has-photo { background: linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)), var(--hero-photo) center / cover no-repeat; }
  .hero.has-photo .hero-art { display: none; }
  .hero.has-photo .hero-copy { padding-bottom: 3rem; }
}

/* ---------- knapper ---------- */
.btn { display: inline-block; font: inherit; font-weight: 800; text-decoration: none; padding: .8rem 1.4rem; border-radius: 2px; border: 1px solid transparent; cursor: pointer; transition: background .15s, color .15s; }
.btn-amber { background: var(--accent); color: #fff; }
.btn-amber:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; padding: .55rem 1.1rem; }
.btn-ghost:hover { background: var(--ink); color: #fff; }

/* ---------- forside-sektioner ---------- */
.intro { width: min(100% - 2.5rem, var(--content-w, 760px)); margin: 3.5rem auto 0; padding: 2.5rem 3rem; font-size: 1.15rem; background: var(--surface); border: 1px solid var(--line); }
.intro h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
@media (max-width: 600px) { .intro { padding: 1.75rem 1.25rem; } }
.latest { padding: 3rem 0 5rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0 0 -1px; padding-bottom: .4rem; border-bottom: 3px solid var(--accent); }
.link-more { font-weight: 800; }
.empty { padding: 2rem; background: var(--surface); border: 1px dashed var(--line); }

/* ---------- øl-kort (etiket) ---------- */
.beer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.75rem; }
.beer-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-label); transition: border-color .15s ease; }
.beer-card:hover { border-color: var(--accent); }
.beer-card:hover h3 { color: var(--accent); }
.beer-card-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.beer-label { position: relative; aspect-ratio: 4 / 3; background: #F1F1F1; border-bottom: 1px solid var(--line); overflow: hidden; }
.beer-label img { width: 100%; height: 100%; object-fit: contain; }
.label-placeholder { height: 100%; display: grid; place-items: center; align-content: center; gap: .4rem; color: var(--ink); text-align: center; padding: 1rem;
  background: repeating-linear-gradient(135deg, #F4F4F4 0 14px, #ECECEC 14px 28px); }
.label-placeholder svg { width: 54px; height: 54px; color: var(--hop); }
.label-placeholder span { font-family: var(--display); font-size: 1.5rem; line-height: 1.05; }
.label-placeholder.big { aspect-ratio: 4 / 5; border: 1px solid var(--line); }
.label-placeholder.big svg { width: 90px; height: 90px; }
.label-placeholder.big span { font-size: 2.4rem; }
.draft-tag { position: absolute; top: .6rem; left: .6rem; background: var(--accent); color: #fff; font-size: .8rem; font-weight: 800; padding: .15rem .55rem; border-radius: 2px; }
.is-draft { border-style: dashed; }
.beer-card-body { padding: 1rem 1.1rem 1.2rem; }
.beer-card-body h3 { font-size: 1.25rem; margin-bottom: .1rem; transition: color .15s; }
.beer-style { margin: 0 0 .75rem; color: var(--muted); font-style: italic; }
.beer-style.big { font-size: 1.3rem; }
.beer-stats { display: flex; gap: 1.25rem; margin: 0; }
.beer-stats div { display: flex; flex-direction: column-reverse; }
.beer-stats dt { font-size: .8rem; color: var(--muted); }
.beer-stats dd { margin: 0; font-weight: 800; font-size: 1.35rem; color: var(--accent); line-height: 1.1; }
.pkg-list { list-style: none; padding: 0; margin: .9rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.pkg-list li { font-size: .82rem; font-weight: 600; background: var(--bg); border: 1px solid var(--line); padding: .1rem .55rem; border-radius: 2px; color: var(--text); }

/* ---------- sidebanner ---------- */
.page-banner { background: var(--surface); padding: 3rem 0 2.5rem; border-bottom: 1px solid var(--line); }
.page-banner h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: .2em; }
.page-banner p { margin: 0; color: var(--muted); }
.draft-note { display: inline-block; background: var(--accent); color: #fff; font-weight: 800; padding: .2rem .7rem; border-radius: 2px; font-size: .9rem; }

/* ---------- år-oversigt ---------- */
.years-layout { display: grid; grid-template-columns: 160px 1fr; gap: 3rem; padding: 3rem 0 5rem; }
.year-nav { position: sticky; top: 100px; align-self: start; }
.year-nav ol { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 1px solid var(--line); }
.year-nav li { position: relative; margin-bottom: 1rem; }
.year-nav li::before { content: ""; position: absolute; left: calc(-1.1rem - 6px); top: .6rem; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.year-nav a { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.1; }
.year-nav a:hover .yn-year { color: var(--accent); }
.yn-year { font-family: var(--display); font-size: 1.6rem; }
.yn-count { font-size: .85rem; color: var(--muted); }
.year-block { margin-bottom: 4rem; scroll-margin-top: 100px; }
.year-title { font-size: clamp(3.5rem, 9vw, 6.5rem); line-height: .9; color: var(--ink); margin-bottom: 1.5rem; padding-bottom: .25em; border-bottom: 3px solid var(--accent); display: inline-block; }
@media (max-width: 820px) {
  .years-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .year-nav { position: static; }
  .year-nav ol { display: flex; gap: .5rem 1rem; flex-wrap: wrap; border: 0; padding: 0; }
  .year-nav li { margin: 0; }
  .year-nav li::before { display: none; }
  .year-nav a { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: .3rem .9rem; flex-direction: row; gap: .5rem; align-items: baseline; }
  .yn-year { font-size: 1.15rem; }
}

/* ---------- øl-detalje ---------- */
.beer-detail { padding: 2rem 0 5rem; }
.back-link { display: inline-block; font-weight: 800; margin-bottom: 1.5rem; }
.back-link::before { content: "‹ "; }
.beer-detail-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 3rem; align-items: start; }
.beer-detail-label img { border: 1px solid var(--line); background: var(--surface); width: 100%; }
.beer-year { font-family: var(--display); color: var(--accent); font-size: 1.4rem; margin: 0; }
.beer-detail-info h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); margin-bottom: .15em; }
.beer-stats.big { margin: 1.5rem 0; padding: 1.2rem 0; border-block: 1px solid var(--line); gap: 2.5rem; flex-wrap: wrap; }
.beer-stats.big dd { font-size: 1.8rem; }
.beer-stats.big div:last-child dd { font-size: 1.15rem; padding-top: .5rem; color: var(--ink); }
.beer-desc { font-size: 1.12rem; max-width: 62ch; }
.gallery { margin-top: 4rem; }
.gallery h2 { font-size: 2rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.gallery-grid img { aspect-ratio: 1; object-fit: cover; width: 100%; border: 1px solid var(--line); }
.zoom { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
.zoom:hover img { border-color: var(--accent); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(17, 17, 17, .92); }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.lightbox-close { position: fixed; top: 1rem; right: 1.25rem; font-size: 2.2rem; line-height: 1; background: var(--accent); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
@media (max-width: 820px) { .beer-detail-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- rich text ---------- */
.rich > :first-child { margin-top: 0; }
.rich h2 { font-size: 1.9rem; margin-top: 1.5em; }
.rich h3 { font-size: 1.3rem; margin-top: 1.3em; }
.rich blockquote { margin: 1.5em 0; padding: .5em 1.25em; border-left: 4px solid var(--accent); background: var(--surface); font-style: italic; }
.rich img { margin: 1em 0; }
.rich pre { background: var(--dark); color: #eee; padding: 1rem; overflow-x: auto; }
.rich .ql-align-center { text-align: center; }
.rich .ql-align-right { text-align: right; }
.rich .ql-align-justify { text-align: justify; }
.rich li[data-list="bullet"] { list-style-type: disc; }
.rich .ql-indent-1 { margin-left: 2em; }
.rich .ql-indent-2 { margin-left: 4em; }
.page-content { width: min(100% - 2.5rem, var(--content-w, 760px)); margin: 3rem auto 5rem; padding: 2.5rem 3rem; font-size: 1.12rem; background: var(--surface); border: 1px solid var(--line); }
@media (max-width: 600px) { .page-content { padding: 1.75rem 1.25rem; } }
.edit-row { margin-top: 3rem; }

/* ---------- login ---------- */
.login-wrap { min-height: 70vh; display: grid; place-items: center; padding: 3rem 1.25rem; }
.login-card { width: min(100%, 400px); background: var(--surface); border: 1px solid var(--line); padding: 2rem; display: grid; gap: 1rem; }
.login-card h1 { font-size: 2rem; margin: 0; }
.login-hop { width: 56px; height: 56px; color: var(--hop); }
.login-card label { display: grid; gap: .3rem; font-weight: 600; color: var(--ink); }
.login-card input { font: inherit; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 2px; background: #fff; }
.login-card input:focus { border-color: var(--accent); outline: none; }

/* ---------- footer ---------- */
.site-footer { background: var(--dark); color: var(--on-dark); padding: 2.5rem 0; }
.footer-inner { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: .6rem; font-family: var(--display); color: #fff; font-size: 1.3rem; }
.footer-brand svg { width: 32px; height: 32px; color: var(--hop); }
.footer-text p { margin: 0; }
.footer-text a { color: #F06A61; }
.footer-copy { margin: 0; font-size: .9rem; }
