/* =====================================================================
   MELINA.dk — melina.css
   Visuel identitet: typeprøvearket. Navnet er selve motivet, og alt
   omkring det holdes i ro. Farverne er blæk, arkivpapir og honning —
   det sidste en genklang af navnets græske rod, meli.
   ===================================================================== */

/* ---------- 1. Tokens ---------------------------------------------- */

:root {
  --blaek:      #16182b;
  --blaek-70:   #16182bb3;
  --blaek-45:   #16182b73;
  --papir:      #e9ece6;
  --papir-dyb:  #dde2da;
  --kort:       #fbfcfa;
  --honning:    #a9700f;
  --honning-lys:#e3b04b;
  --honning-flade: #f4e6cd;
  --blomme:     #6b3f6e;
  --blomme-flade:#ece2ee;
  --tusch:      #4e5a52;
  --advarsel:   #a63a2e;
  --advarsel-flade:#f6e4e1;
  --grøn:       #3f6b4f;
  --grøn-flade: #e2eee6;

  --streg:      #16182b1f;
  --streg-fast: #16182b40;

  --display: "Bodoni Moda", "Didot", "Bodoni MT", Georgia, serif;
  --brød:    "Archivo", "Helvetica Neue", Arial, sans-serif;
  --data:    "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --rum-1: 0.4rem;
  --rum-2: 0.8rem;
  --rum-3: 1.4rem;
  --rum-4: 2.2rem;
  --rum-5: 3.6rem;
  --rum-6: 5.5rem;

  --bredde: 1140px;
  --radius: 3px;
}

/* ---------- 2. Grundlag -------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--papir);
  color: var(--blaek);
  font-family: var(--brød);
  font-size: 16.5px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blaek); text-decoration-color: var(--honning); text-underline-offset: 3px; }
a:hover { color: var(--honning); }

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

.skjult {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.midte { width: 100%; max-width: var(--bredde); margin: 0 auto; padding: 0 var(--rum-3); }

/* ---------- 3. Typografi ------------------------------------------- */

h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; letter-spacing: -0.01em; }

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.06; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); line-height: 1.16; }
h3 { font-size: 1.16rem; line-height: 1.3; }

p { margin: 0 0 var(--rum-2); }

.mærkat {
  font-family: var(--data);
  font-size: 0.66rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--tusch);
  display: block;
  margin-bottom: var(--rum-2);
}

.manchet {
  font-size: 1.06rem;
  color: var(--blaek-70);
  max-width: 62ch;
}

.lille { font-size: 0.85rem; color: var(--tusch); }
.tal   { font-family: var(--data); font-variant-numeric: tabular-nums; }

/* ---------- 4. Sidehoved ------------------------------------------- */

.top {
  border-bottom: 1px solid var(--streg-fast);
  background: var(--papir);
  position: sticky;
  top: 0;
  z-index: 40;
}

.top__ind {
  display: flex; align-items: center; gap: var(--rum-3);
  min-height: 62px; flex-wrap: wrap;
}

.logo {
  font-family: var(--display);
  font-size: 1.42rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--blaek);
  line-height: 1;
}
.logo span { color: var(--honning); }
.logo:hover { color: var(--blaek); }

.top nav { margin-left: auto; display: flex; gap: var(--rum-3); flex-wrap: wrap; }

.top nav a {
  font-size: 0.83rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--tusch);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.top nav a:hover { color: var(--blaek); border-bottom-color: var(--streg-fast); }
.top nav a[aria-current="page"] { color: var(--blaek); border-bottom-color: var(--honning); }

/* ---------- 5. Sektioner ------------------------------------------- */

.blok { padding: var(--rum-5) 0; }
.blok--tæt { padding: var(--rum-4) 0; }
.blok--top { padding-top: var(--rum-4); }
.blok + .blok { border-top: 1px solid var(--streg); }

.blok__hoved { margin-bottom: var(--rum-4); max-width: 66ch; }
.blok__hoved p { color: var(--blaek-70); margin-bottom: 0; }

/* ---------- 6. Søgefelt -------------------------------------------- */

.soeg { display: flex; gap: var(--rum-2); flex-wrap: wrap; align-items: stretch; }

.felt {
  font-family: var(--brød);
  font-size: 1rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--streg-fast);
  border-radius: var(--radius);
  background: var(--kort);
  color: var(--blaek);
  min-width: 0;
}
.felt:focus { border-color: var(--blomme); }

.felt--stor {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  padding: 0.5rem 0.85rem;
  flex: 1 1 300px;
}

.knap {
  font-family: var(--brød);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--blaek);
  border-radius: var(--radius);
  background: var(--blaek);
  color: var(--papir);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.knap:hover { background: var(--honning); border-color: var(--honning); color: #fff; }

.knap--tom { background: transparent; color: var(--blaek); }
.knap--tom:hover { background: var(--blaek); border-color: var(--blaek); color: var(--papir); }

.knap--lille { font-size: 0.78rem; padding: 0.42rem 0.8rem; }

/* Hurtige navneforslag under søgefeltet */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--rum-2); align-items: center; }

.chip {
  font-family: var(--data);
  font-size: 0.74rem;
  padding: 3px 9px;
  border: 1px solid var(--streg-fast);
  border-radius: 999px;
  background: transparent;
  color: var(--tusch);
  cursor: pointer;
}
.chip:hover { border-color: var(--honning); color: var(--honning); }
.chip[aria-pressed="true"] { background: var(--blaek); border-color: var(--blaek); color: var(--papir); }

/* ---------- 7. Signaturen: typeprøven ------------------------------ */

.proeve {
  background: var(--kort);
  border: 1px solid var(--streg-fast);
  border-radius: var(--radius);
  padding: var(--rum-4) var(--rum-3) var(--rum-3);
  position: relative;
  overflow: hidden;
}

.proeve__hjoerne {
  position: absolute;
  top: 10px; right: 14px;
  font-family: var(--data);
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blaek-45);
}

/* Selve navnet, sat stort med stavelsesstreger */
.specimen {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  font-family: var(--display);
  font-size: clamp(3rem, 12vw, 7.4rem);
  line-height: 1;
  letter-spacing: -0.015em;
  min-height: 1.2em;
}

.stavelse {
  position: relative;
  padding: 0 0.045em;
  display: inline-flex;
}

/* Hårfin lodret streg mellem stavelserne */
.stavelse + .stavelse::before {
  content: "";
  position: absolute;
  left: 0; top: 8%; bottom: 8%;
  width: 1px;
  background: var(--streg-fast);
}

/* Trykmarkøren sidder over den betonede stavelse */
.stavelse--tryk::after {
  content: "";
  position: absolute;
  left: 50%; transform: translateX(-50%);
  top: -0.16em;
  width: 26%;
  height: 3px;
  background: var(--honning);
  border-radius: 2px;
}

.bogstav { display: inline-block; }
.bogstav--vokal { color: var(--honning); }
.bogstav--likvid, .bogstav--nasal, .bogstav--glidelyd { color: var(--blomme); }
.bogstav--lukkelyd, .bogstav--hvislelyd { color: var(--blaek); }

/* Sonoritetskurven under navnet */
.kurve { margin-top: var(--rum-3); width: 100%; height: 78px; display: block; }
.kurve__linje { fill: none; stroke: var(--blomme); stroke-width: 1.6; stroke-linejoin: round; }
.kurve__flade { fill: var(--blomme); opacity: 0.08; }
.kurve__prik  { fill: var(--kort); stroke: var(--blomme); stroke-width: 1.4; }
.kurve__grund { stroke: var(--streg); stroke-width: 1; }
.kurve__tekst { font-family: var(--data); font-size: 9px; fill: var(--blaek-45); text-anchor: middle; }

.proeve__fod {
  display: flex; flex-wrap: wrap; gap: var(--rum-3);
  margin-top: var(--rum-3); padding-top: var(--rum-2);
  border-top: 1px solid var(--streg);
  font-family: var(--data); font-size: 0.76rem; color: var(--tusch);
}
.proeve__fod b { color: var(--blaek); font-weight: 600; }

/* ---------- 8. Kort ------------------------------------------------ */

.gitter { display: grid; gap: var(--rum-3); }
.gitter--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.gitter--3 { grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }
.gitter--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.kort {
  background: var(--kort);
  border: 1px solid var(--streg-fast);
  border-radius: var(--radius);
  padding: var(--rum-3);
}

.kort__hoved {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--rum-2); margin-bottom: var(--rum-2);
  padding-bottom: var(--rum-2); border-bottom: 1px solid var(--streg);
}
.kort__hoved h3 { font-family: var(--brød); font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--tusch); }

.kort__tal {
  font-family: var(--display);
  font-size: 2.5rem;
  line-height: 1;
  display: block;
  margin-bottom: 2px;
}
.kort__under { font-size: 0.85rem; color: var(--tusch); }

/* Måler */
.maaler { height: 5px; background: var(--papir-dyb); border-radius: 3px; overflow: hidden; margin: var(--rum-2) 0; }
.maaler__fyld { height: 100%; background: var(--honning); border-radius: 3px; transition: width 400ms ease; }
.maaler__fyld--blomme { background: var(--blomme); }
.maaler__fyld--advarsel { background: var(--advarsel); }
.maaler__fyld--groen { background: var(--grøn); }

/* Liste med noter */
.noter { list-style: none; margin: 0; padding: 0; }
.noter li {
  display: flex; gap: var(--rum-2); align-items: flex-start;
  padding: var(--rum-2) 0; border-bottom: 1px solid var(--streg);
  font-size: 0.91rem;
}
.noter li:last-child { border-bottom: 0; }

.prik {
  flex: 0 0 auto; margin-top: 0.42em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--tusch);
}
.prik--ok { background: var(--grøn); }
.prik--obs { background: var(--advarsel); }
.prik--info { background: var(--blomme); }
.prik--honning { background: var(--honning); }

/* Etiketter */
.tag {
  display: inline-block;
  font-family: var(--data);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--papir-dyb);
  color: var(--tusch);
  margin: 0 4px 4px 0;
}
.tag--honning { background: var(--honning-flade); color: var(--honning); }
.tag--blomme  { background: var(--blomme-flade); color: var(--blomme); }
.tag--groen   { background: var(--grøn-flade); color: var(--grøn); }
.tag--advarsel{ background: var(--advarsel-flade); color: var(--advarsel); }

/* ---------- 9. Tabeller -------------------------------------------- */

.tabel { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tabel th, .tabel td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--streg); vertical-align: top; }
.tabel th {
  font-family: var(--data); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--tusch); font-weight: 500;
  border-bottom-color: var(--streg-fast);
}
.tabel tr:last-child td { border-bottom: 0; }
.tabel td.tal { font-family: var(--data); font-variant-numeric: tabular-nums; }

.rul { overflow-x: auto; }

/* ---------- 10. Resultatlister ------------------------------------- */

.navneliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--streg); border: 1px solid var(--streg-fast); border-radius: var(--radius); overflow: hidden; }

.navneliste li { background: var(--kort); padding: var(--rum-2) var(--rum-3); display: flex; gap: var(--rum-2); align-items: center; flex-wrap: wrap; }

.navneliste__navn { font-family: var(--display); font-size: 1.35rem; line-height: 1.1; text-decoration: none; }
.navneliste__navn:hover { color: var(--honning); }
.navneliste__meta { font-size: 0.82rem; color: var(--tusch); flex: 1 1 200px; }
.navneliste__score { font-family: var(--data); font-size: 0.78rem; color: var(--blaek-45); margin-left: auto; }

/* ---------- 11. Personer (live) ------------------------------------ */

.personer { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: var(--rum-3); list-style: none; padding: 0; margin: 0; }
.person { text-align: left; }
.person__foto {
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
  background: var(--papir-dyb); border-radius: var(--radius);
  filter: grayscale(1) contrast(1.03);
  margin-bottom: var(--rum-1);
}
.person__tom {
  width: 100%; aspect-ratio: 3/4; border-radius: var(--radius);
  background: var(--papir-dyb); margin-bottom: var(--rum-1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 2rem; color: var(--blaek-45);
}
.person__navn { font-weight: 600; font-size: 0.9rem; line-height: 1.25; display: block; text-decoration: none; }
.person__meta { font-size: 0.78rem; color: var(--tusch); line-height: 1.35; }

/* ---------- 12. Tilstande ------------------------------------------ */

.henter { font-family: var(--data); font-size: 0.8rem; color: var(--blaek-45); letter-spacing: 0.06em; }
.henter::after { content: "…"; animation: prikker 1.4s steps(4, end) infinite; }
@keyframes prikker { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "…"; } }

.tom-besked {
  border: 1px dashed var(--streg-fast); border-radius: var(--radius);
  padding: var(--rum-3); color: var(--tusch); font-size: 0.92rem; background: transparent;
}

.advarsel-boks {
  border-left: 3px solid var(--advarsel);
  background: var(--advarsel-flade);
  padding: var(--rum-2) var(--rum-3);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.92rem;
}

.note-boks {
  border-left: 3px solid var(--blomme);
  background: var(--blomme-flade);
  padding: var(--rum-2) var(--rum-3);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
}

/* ---------- 13. Sidefod -------------------------------------------- */

.fod {
  border-top: 1px solid var(--streg-fast);
  padding: var(--rum-4) 0 var(--rum-5);
  font-size: 0.87rem;
  color: var(--tusch);
  background: var(--papir);
}
.fod__gitter { display: grid; gap: var(--rum-3); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.fod h4 { font-family: var(--data); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; margin: 0 0 var(--rum-2); font-weight: 500; color: var(--blaek); }
.fod ul { list-style: none; margin: 0; padding: 0; }
.fod li { margin-bottom: 5px; }
.fod a { text-decoration: none; }
.fod a:hover { text-decoration: underline; }
.fod__bund { margin-top: var(--rum-4); padding-top: var(--rum-3); border-top: 1px solid var(--streg); font-size: 0.8rem; }

/* ---------- 14. Formularer ----------------------------------------- */

.form-rk { display: grid; gap: var(--rum-3); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }

.form-felt { display: flex; flex-direction: column; gap: 5px; }
.form-felt > label {
  font-family: var(--data); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--tusch);
}
.form-felt select, .form-felt input { width: 100%; }

.skyder { width: 100%; accent-color: var(--honning); }

.afkryds { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.afkryds input { accent-color: var(--honning); width: 16px; height: 16px; }

/* ---------- 15. Bånd og små ting ----------------------------------- */

.baand { display: flex; gap: 2px; margin: var(--rum-2) 0; align-items: center; }
.baand__stykke { height: 22px; border-radius: 2px; background: var(--honning-flade); position: relative; }
.baand__stykke--aktiv { background: var(--honning); }
.baand__akse { display: flex; justify-content: space-between; font-family: var(--data); font-size: 0.68rem; color: var(--blaek-45); }

.parvis { display: grid; grid-template-columns: 1fr auto; gap: var(--rum-2); padding: 5px 0; border-bottom: 1px solid var(--streg); font-size: 0.9rem; }
.parvis:last-child { border-bottom: 0; }
.parvis > span:last-child { font-family: var(--data); color: var(--tusch); text-align: right; }

/* ---------- 16. Bevægelse ------------------------------------------ */

.toner-ind { animation: tonInd 320ms ease both; }
@keyframes tonInd { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 17. Små skærme ----------------------------------------- */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .top__ind { min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
  .top nav { margin-left: 0; width: 100%; gap: var(--rum-2); overflow-x: auto; padding-bottom: 2px; }
  .top nav a { white-space: nowrap; font-size: 0.8rem; }
  .blok { padding: var(--rum-4) 0; }
  .proeve { padding: var(--rum-4) var(--rum-2) var(--rum-2); }
  .specimen { font-size: clamp(2.4rem, 15vw, 4rem); }
  .kort__tal { font-size: 2rem; }
}

@media print {
  .top, .fod, .knap, .chips { display: none; }
  body { background: #fff; }
  .kort, .proeve { border-color: #999; break-inside: avoid; }
}
