/* Middelalderfestival i Sorring – fælles stylesheet
   Layout: festivalplads – vimpelbånd øverst, smal læsespalte, "boder" som kort i gitter,
   messingnitter som punkttegn (fra Ridder-Poul Pots rustning). */

:root {
  --bg: #F2F3EF;          /* kalket væg */
  --surface: #FFFFFF;
  --ink: #1E1D1B;         /* jydepotte-sort */
  --muted: #5B5F63;
  --line: #D6D8D2;
  --orange: #D86F12;      /* Poul Pots ler */
  --orange-ink: #A8520A;  /* til tekst/links på lys bund */
  --brass: #C4921A;       /* nitter og kanter */
  --steel: #6E7480;       /* rustning */
  --forest: #2C4636;      /* handsker / mørke bånd */
  --on-forest: #F2F3EF;
  --tbd-bg: #FFF1C9;
  --tbd-ink: #6A4B00;

  --f-display: "Grenze Gotisch", "Palatino Linotype", Georgia, serif;
  --f-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --f-label: "Alegreya Sans SC", "Alegreya Sans", "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.7rem;
  --step-3: clamp(2rem, 4vw + 1rem, 2.8rem);
  --step-4: clamp(2.6rem, 7vw + 1rem, 4.6rem);

  --wrap: 72rem;
  --read: 42rem;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181916; --surface: #22241F; --ink: #ECEAE3; --muted: #A9ACA4; --line: #3A3D36;
    --orange: #F08C35; --orange-ink: #F4A35A; --brass: #DDB045; --steel: #9AA0AB;
    --forest: #1F3127; --on-forest: #ECEAE3; --tbd-bg: #3D3214; --tbd-ink: #F3D98A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #181916; --surface: #22241F; --ink: #ECEAE3; --muted: #A9ACA4; --line: #3A3D36;
  --orange: #F08C35; --orange-ink: #F4A35A; --brass: #DDB045; --steel: #9AA0AB;
  --forest: #1F3127; --on-forest: #ECEAE3; --tbd-bg: #3D3214; --tbd-ink: #F3D98A;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: var(--step-0); line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--orange-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.1; text-wrap: balance; margin: 0; letter-spacing: 0.005em; }
h1 { font-size: var(--step-4); font-weight: 800; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-family: var(--f-body); font-weight: 700; letter-spacing: 0; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 700px) { .wrap { padding-inline: 2rem; } }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; }

/* Vimpelbånd */
.pennants {
  height: 20px;
  background: repeating-linear-gradient(90deg, var(--orange) 0 36px, var(--brass) 36px 72px, var(--steel) 72px 108px, var(--forest) 108px 144px);
  -webkit-mask: conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 0 0 / 36px 100%;
          mask: conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 0 0 / 36px 100%;
  border-top: 3px solid var(--ink);
}
.pennants-wrap { background: var(--bg); }

/* Header og navigation */
.site-header { background: var(--bg); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .5rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand span { font-family: var(--f-display); font-size: 1.25rem; line-height: 1; }
.brand small { display: block; font-family: var(--f-label); font-size: .8rem; color: var(--muted); letter-spacing: .06em; margin-top: 2px; }
.nav-toggle { display: none; font: inherit; font-family: var(--f-label); background: none; border: 1.5px solid var(--ink); color: var(--ink); border-radius: var(--radius); padding: .35rem .8rem; cursor: pointer; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem .25rem; }
.site-nav a { display: block; padding: .4rem .6rem; text-decoration: none; color: var(--ink); font-family: var(--f-label); font-weight: 500; letter-spacing: .03em; border-radius: var(--radius); }
.site-nav a:hover { background: color-mix(in srgb, var(--brass) 18%, transparent); }
.site-nav a[aria-current="page"] { color: var(--orange-ink); box-shadow: inset 0 -2px 0 var(--orange); border-radius: 0; }
@media (max-width: 960px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 1rem 1rem; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: .65rem .5rem; font-size: 1.1rem; }
}

/* Statusbånd */
.notice { background: var(--forest); color: var(--on-forest); font-size: var(--step--1); }
.notice .wrap { padding-block: .45rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; justify-content: center; text-align: center; }
.notice a { color: var(--on-forest); font-weight: 700; }

/* Sidehoved for undersider */
.page-head { padding-block: 3rem 2rem; border-bottom: 1px solid var(--line); }
.page-head .eyebrow { margin-bottom: .6rem; }
.page-head p.lead { margin-top: 1rem; max-width: var(--read); font-size: var(--step-1); color: var(--muted); line-height: 1.45; }
.eyebrow { font-family: var(--f-label); font-weight: 700; letter-spacing: .1em; color: var(--orange-ink); font-size: var(--step--1); text-transform: lowercase; }

/* Sektioner */
main { display: block; }
.section { padding-block: 3rem; }
.section + .section { border-top: 1px solid var(--line); }
.section > .wrap > h2 { margin-bottom: 1.25rem; }
.section-intro { max-width: var(--read); color: var(--muted); margin-bottom: 1.75rem; }
.band { background: var(--forest); color: var(--on-forest); }
.band a { color: var(--on-forest); }
.band .eyebrow { color: var(--brass); }
.prose { max-width: var(--read); display: flex; flex-direction: column; gap: 1rem; }
.prose h2 { margin-top: 1.5rem; font-size: var(--step-2); }
.prose > h2:first-child, .prose .eyebrow + h2 { margin-top: 0; }
.prose h3 { margin-top: .75rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: .35rem; }

/* Nitte-liste (messingnitter som punkttegn) */
ul.rivets { list-style: none; padding-left: 0; display: flex; flex-direction: column; gap: .55rem; margin: 0; }
ul.rivets li { position: relative; padding-left: 1.6rem; }
ul.rivets li::before {
  content: ""; position: absolute; left: .2rem; top: .5em; width: .62rem; height: .62rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--brass) 40%, #fff) 0 18%, var(--brass) 45%, color-mix(in srgb, var(--brass) 60%, #000) 100%);
  box-shadow: 0 0 0 1.5px var(--ink);
}

/* Kort (boder) */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.card h3 { font-size: 1.2rem; }
.card .tag { align-self: flex-start; font-family: var(--f-label); font-size: .8rem; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .6rem; }
.card p { color: var(--muted); }
.card.link { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.card.link:hover { border-color: var(--brass); transform: translateY(-2px); }
.card.link .more { margin-top: auto; color: var(--orange-ink); font-weight: 700; }

/* Knapper */
.btn { display: inline-flex; align-items: center; gap: .5rem; font: inherit; font-family: var(--f-label); font-weight: 700; letter-spacing: .04em; text-decoration: none; padding: .7rem 1.2rem; border-radius: var(--radius); border: 2px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; }
.btn:hover { background: var(--orange); border-color: var(--orange); color: #1E1D1B; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.band .btn { background: var(--brass); border-color: var(--brass); color: #1E1D1B; }
.band .btn.ghost { background: transparent; color: var(--on-forest); border-color: var(--on-forest); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Pladsholdere for indhold der mangler */
.tbd { background: var(--tbd-bg); color: var(--tbd-ink); border-radius: 3px; padding: 0 .35em; font-size: .92em; font-weight: 500; }
.tbd::before { content: "Afventer: "; font-weight: 700; }
.tbd.plain::before { content: none; }

/* Faktaboks / info */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
.facts dt { font-family: var(--f-label); font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .5rem; } }

/* Tabeller */
.table-wrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--f-label); letter-spacing: .04em; font-weight: 700; background: color-mix(in srgb, var(--brass) 12%, var(--surface)); }
tr:last-child td { border-bottom: 0; }

/* Tidsplan */
.schedule { display: flex; flex-direction: column; }
.schedule .row { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding-block: .7rem; border-bottom: 1px dashed var(--line); }
.schedule time { font-family: var(--f-label); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--orange-ink); }
.schedule .where { color: var(--muted); font-size: var(--step--1); }

/* FAQ */
details.faq { border-bottom: 1px solid var(--line); padding-block: .2rem; }
details.faq summary { cursor: pointer; padding-block: .8rem; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-family: var(--f-display); font-size: 1.5rem; line-height: 1; color: var(--orange-ink); }
details.faq[open] summary::after { content: "–"; }
details.faq .answer { padding-bottom: 1rem; max-width: var(--read); display: flex; flex-direction: column; gap: .6rem; }

/* Formularer */
form.form { display: flex; flex-direction: column; gap: 1.1rem; max-width: var(--read); }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-row { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
label, legend { font-weight: 700; }
.hint { font-size: var(--step--1); color: var(--muted); font-weight: 400; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], input[type="date"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: .6rem .7rem; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 30%, transparent); }
textarea { min-height: 7rem; resize: vertical; }
fieldset { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .35rem; accent-color: var(--orange); }
.req { color: var(--orange-ink); }
.form-status { border-radius: var(--radius); padding: 1rem; background: color-mix(in srgb, var(--forest) 12%, var(--surface)); border: 1.5px solid var(--forest); display: flex; flex-direction: column; gap: .6rem; }
.form-status pre { white-space: pre-wrap; word-break: break-word; background: var(--surface); border: 1px solid var(--line); padding: .75rem; border-radius: var(--radius); font-size: var(--step--1); max-height: 18rem; overflow: auto; margin: 0; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #C0392B; }
.error-msg { color: #C0392B; font-size: var(--step--1); }

/* Ornament: Sankt Hans-kors (som på Poul Pots brystplade) */
.knot { display: flex; align-items: center; gap: 1rem; color: var(--brass); margin-block: 2rem; }
.knot::before, .knot::after { content: ""; flex: 1; height: 1.5px; background: var(--line); }
.knot svg { width: 30px; height: 30px; }

/* Footer */
.site-footer { background: var(--ink); color: var(--bg); margin-top: 0; font-size: var(--step--1); }
.site-footer .wrap { padding-block: 2.5rem; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.site-footer h2 { font-size: 1.35rem; margin-bottom: .6rem; color: var(--brass); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.site-footer a { color: var(--bg); }
.site-footer .bottom { grid-column: 1 / -1; border-top: 1px solid color-mix(in srgb, var(--bg) 20%, transparent); padding-top: 1rem; color: color-mix(in srgb, var(--bg) 70%, transparent); }
.copy-row { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.copy-btn { font: inherit; font-size: .8rem; background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 999px; padding: 0 .55rem; cursor: pointer; opacity: .8; }
.copy-btn:hover { opacity: 1; }

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

/* Forside */
.hero { padding-block: 2.5rem 3rem; overflow: hidden; }
.hero .wrap { display: grid; gap: 2rem; align-items: center; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@media (max-width: 780px) { .hero .wrap { grid-template-columns: 1fr; } .hero-figure { order: -1; max-width: 12rem; margin-inline: auto; } }
.hero-text { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.hero h1 { font-size: clamp(2.8rem, 8vw + .5rem, 5.6rem); line-height: .95; }
.hero h1 em { font-style: normal; color: var(--orange); display: block; }
.hero .lead { font-size: var(--step-1); color: var(--muted); max-width: 34rem; line-height: 1.45; }
.when { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-family: var(--f-label); font-weight: 700; letter-spacing: .04em; }
.when span { display: inline-flex; flex-direction: column; line-height: 1.2; }
.when small { font-weight: 500; color: var(--muted); letter-spacing: .06em; font-size: .8rem; }
.hero-figure { position: relative; margin: 0; }
.hero-figure img { display: block; width: 100%; filter: drop-shadow(0 10px 18px rgba(0,0,0,.18)); }
.bubble { position: absolute; top: 2%; right: -2%; max-width: 11rem; background: var(--surface); color: var(--ink); border: 2px solid var(--ink); border-radius: 18px; padding: .55rem .8rem; font-family: var(--f-display); font-size: 1.15rem; line-height: 1.15; transform: rotate(4deg); }
.bubble::after { content: ""; position: absolute; left: 1.2rem; bottom: -12px; width: 18px; height: 18px; background: var(--surface); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg) skew(10deg, 10deg); }
@media (max-width: 780px) { .bubble { right: -10%; font-size: 1rem; } }
.phases { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.phase { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; background: var(--surface); display: flex; flex-direction: column; gap: .5rem; }
.phase.now { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
.phase .date { font-family: var(--f-label); font-weight: 700; letter-spacing: .05em; color: var(--orange-ink); }
.phase .actions { margin-top: auto; padding-top: .4rem; }
.figures { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); margin-top: 1.5rem; }
.figures div { border-top: 2px solid var(--brass); padding-top: .6rem; }
.figures strong { display: block; font-family: var(--f-display); font-size: 2.6rem; line-height: 1; color: var(--brass); }
.split { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.split > * { min-width: 0; }
.subnav { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.subnav a { font-family: var(--f-label); font-weight: 700; letter-spacing: .03em; text-decoration: none; border: 1.5px solid var(--line); border-radius: 999px; padding: .3rem .85rem; color: var(--ink); background: var(--surface); }
.subnav a:hover { border-color: var(--brass); }
.note { border: 1.5px dashed var(--brass); border-radius: var(--radius); padding: .8rem 1rem; color: var(--muted); font-size: var(--step--1); max-width: var(--read); }
[id] { scroll-margin-top: 5rem; }
.grid + .actions, .section-intro + .actions { margin-top: 1.5rem; }

/* Roligere, mindre skabelonagtigt udtryk: ingen kasser om alt, linjer i stedet for kort */
.card, .phase {
  background: none; border: 0; border-radius: 0; box-shadow: none;
  border-top: 2px solid var(--ink); padding: .9rem 0 0;
}
.grid { gap: 2rem 2.5rem; }
.card p, .phase p { color: var(--ink); }
.card h3 { font-family: var(--f-display); font-size: 1.45rem; font-weight: 700; }
.card.link { transform: none !important; }
.card.link h3 { color: var(--orange-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card.link:hover { border-color: var(--orange); }
.card.link:hover h3 { text-decoration-thickness: 2px; }
.phase .date { color: var(--muted); }
.subnav { gap: .2rem 0; }
.subnav a { border: 0; background: none; border-radius: 0; padding: .1rem 0; color: var(--orange-ink); text-decoration: underline; text-underline-offset: 3px; font-family: var(--f-body); font-weight: 500; letter-spacing: 0; }
.subnav a + a::before { content: "·"; display: inline-block; color: var(--muted); padding-inline: .6rem; text-decoration: none; }
.page-head { padding-block: 2.5rem 2rem; border-bottom: 2px solid var(--ink); }
.section + .section { border-top: 0; }
.site-footer .bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.site-footer .credit { color: color-mix(in srgb, var(--bg) 85%, transparent); }
.band .section-intro { color: inherit; opacity: .85; }
