/* Mathilde & Magnus, Kragerø 26.06.27
   Bygget på invitasjonen: Caslon (rett og kursiv) i Cabernet,
   Helvetica Light i spaserte versaler i Moss, tynne linjer.
   Hver seksjon har sitt eget bilde, og bildene veksler mellom venstre og høyre side. */

:root {
  /* Bryllupspaletten */
  --champagne: #ede3d0;
  --mauve:     #ca9baa;
  --moss:      #827c34;
  --babyblue:  #cfdaff;
  --cabernet:  #5b3c45;

  /* Papirfarge. Teksturen legges oppå som en skygge, så denne fargen kan endres fritt. */
  --paper: #f8f6f1;

  /* Caslon: Libre Caslon Text er en gratis Caslon for nettet.
     Helvetica: Helvetica Neue på Mac og iPhone, ellers Inter Tight Light. */
  --serif: "Libre Caslon Text", "Adobe Caslon Pro", "Big Caslon", Georgia, serif;
  --sans:  "Helvetica Neue", "Inter Tight", Arial, sans-serif;

  --pad: clamp(20px, 5vw, 80px);
  --col-gap: clamp(14px, 2vw, 28px);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; scroll-padding-top: 40px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--cabernet);
  background-color: var(--paper);
  background-image: url("images/papir.jpg");
  background-size: 768px;
  background-blend-mode: multiply;
  font-family: var(--serif);
  font-size: 16.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, p, ol, ul, dl, dd, figure, fieldset { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--mauve); text-underline-offset: 3px; }
a:hover { color: var(--moss); }
:focus-visible { outline: 1px solid var(--moss); outline-offset: 4px; }
::selection { background: var(--babyblue); }

/* Etiketter i spaserte versaler, som på invitasjonen */
.cap {
  font-family: var(--sans); font-weight: 300; font-style: normal;
  font-size: 11px; line-height: 1.5; letter-spacing: .24em; text-transform: uppercase;
  color: var(--moss);
}
.todo { background: var(--babyblue); padding: 0 .25em; }

/* ---------- Meny ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px var(--pad) 30px;
  background-color: var(--paper);
  background-image: url("images/papir.jpg"); background-size: 768px; background-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent);
          mask-image: linear-gradient(to bottom, #000 65%, transparent);
}
.mono { font-style: italic; font-size: 20px; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 26px; }
.nav a {
  position: relative; text-decoration: none; padding: 6px 10px;
  font-family: var(--sans); font-weight: 300; font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--cabernet); transition: color .2s;
}
.nav a:hover { color: var(--moss); }
/* Tynn tegnet ring rundt seksjonen du er i */
.nav a::after, .day-on::after {
  content: ""; position: absolute; inset: -4px -8px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 50' preserveAspectRatio='none'%3E%3Cpath d='M8 30 C 6 12, 40 4, 66 6 S 116 14, 113 28 S 78 47, 52 45 S 4 40, 10 22 C 14 13, 30 9, 44 8' fill='none' stroke='%23ca9baa' stroke-width='1' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.nav a.active::after { opacity: 1; }

.bar-right { display: flex; align-items: center; gap: 18px; }
.lang { display: flex; gap: 12px; }
.lang button {
  font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--cabernet);
  background: none; border: 0; padding: 2px 0; cursor: pointer; opacity: .45;
}
.lang button[aria-pressed="true"] { opacity: 1; text-decoration: underline wavy var(--moss); text-decoration-thickness: 1px; text-underline-offset: 5px; }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 6px 0; color: var(--cabernet); }

/* ---------- Bokside: felles rutenett ---------- */
.page {
  position: relative;
  max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto;
  padding: clamp(90px, 10vw, 160px) var(--pad);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap);
  align-content: start;
}
.title { font-weight: 400; font-style: italic; font-size: clamp(28px, 2.8vw, 38px); line-height: 1.15; margin-bottom: 22px; }
.lead { font-size: 17.5px; line-height: 1.55; max-width: 34em; }
h3 { font-weight: 400; font-size: 17.5px; line-height: 1.35; }
.sub { opacity: .75; font-size: 15px; margin-top: 6px; }

/* ---------- Forside ---------- */
.cover { padding-top: clamp(130px, 14vw, 190px); padding-bottom: clamp(40px, 5vw, 70px); }
.cover-title { grid-column: 4 / span 6; font-weight: 400; font-style: italic; font-size: clamp(34px, 3.8vw, 52px); line-height: 1.1; margin-bottom: 22px; }
.cover-photo { grid-column: 4 / span 6; }
.cover-photo img { width: 100%; aspect-ratio: 4 / 5; max-height: 66vh; object-fit: cover; object-position: 50% 40%; filter: saturate(.85) contrast(.95); }
.cover-place { grid-column: 4 / span 6; text-align: right; font-style: italic; font-size: 16px; margin-top: 14px; }

/* ---------- Invitasjonstekst ---------- */
.intro { padding-top: clamp(60px, 7vw, 110px); }
.intro-text, .intro-facts { grid-column: 4 / span 6; }
.intro-facts { margin-top: 44px; }

/* Rader med etikett og innhold, som på invitasjonen */
.facts { margin-top: 36px; border-bottom: 1px solid var(--moss); }
.facts > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); column-gap: var(--col-gap); align-items: baseline; padding: 20px 0; border-top: 1px solid var(--moss); }
.facts dd { font-size: 16.5px; }

/* ---------- Kapitler: ett bilde per seksjon ---------- */
.chapter { align-items: start; }
.ch-img img { width: 100%; object-fit: cover; filter: saturate(.85) contrast(.95); }
.ch-img.portrait img { aspect-ratio: 4 / 5; }
.ch-img.landscape img { aspect-ratio: 3 / 2; }
.ch-img figcaption { margin-top: 10px; }

.img-left .ch-img  { grid-column: 1 / span 4; }
.img-left .ch-body { grid-column: 6 / span 7; }
.img-right .ch-img  { grid-column: 9 / span 4; grid-row: 1; }
.img-right .ch-body { grid-column: 1 / span 7; grid-row: 1; }
.chapter .ch-img.landscape { grid-column-end: span 5; }
.img-right .ch-img.landscape { grid-column: 8 / span 5; }

/* Tomt bildefelt til bildet er lagt inn */
.img-empty { background: var(--champagne); aspect-ratio: 4 / 5; }
.img-empty img { height: 100%; }

/* ---------- Program ---------- */
.days { display: flex; gap: 10px 26px; flex-wrap: wrap; margin-bottom: 26px; }
.days li { position: relative; padding: 4px 6px; }
.day-off { opacity: .55; }
.day-off em { font-style: normal; text-transform: lowercase; letter-spacing: .1em; }
.day-on { color: var(--cabernet); }
.day-on::after { opacity: 1; inset: -6px -12px; }
.schedule { border-bottom: 1px solid var(--moss); }
.schedule li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); column-gap: var(--col-gap); align-items: baseline; padding: 18px 0; border-top: 1px solid var(--moss); }
.schedule time { font-style: italic; font-size: 20px; font-variant-numeric: oldstyle-nums; }
.schedule p { font-size: 15px; opacity: .75; }

/* ---------- RSVP ---------- */
.rsvp { margin-top: 32px; display: grid; }
.line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); column-gap: var(--col-gap); align-items: baseline; border: 0; border-top: 1px solid var(--moss); padding: 18px 0; margin: 0; min-width: 0; }
.line:last-of-type { border-bottom: 1px solid var(--moss); }
.line legend { float: left; padding: 0; }
.line input[type="text"] { min-width: 0; border: 0; background: transparent; color: var(--cabernet); font-family: var(--serif); font-size: 17px; padding: 0; }
.line input[type="text"]:focus { outline: none; }
.line:focus-within { background: linear-gradient(to right, rgba(207, 218, 255, .35), transparent 70%); }
.choice-opts { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.choice label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 16.5px; }
.choice input { appearance: none; width: 13px; height: 13px; border: 1px solid var(--cabernet); border-radius: 50%; margin: 0; }
.choice input:checked { background: var(--cabernet); box-shadow: inset 0 0 0 2px var(--paper); }
.choice input:focus-visible { outline: 1px solid var(--moss); outline-offset: 3px; }
.send { justify-self: start; margin-top: 30px; padding: 15px 34px; background: var(--cabernet); color: var(--paper); border: 0; cursor: pointer; transition: background .2s; }
.send:hover { background: var(--moss); }
.form-status { min-height: 1.6em; margin-top: 12px; font-style: italic; color: var(--moss); }

/* ---------- Praktisk info og avslutningsbilde ---------- */
.info { padding-bottom: clamp(40px, 4vw, 60px); }
.info .ch-body { grid-column: 4 / span 6; }
.closing-img { grid-column: 5 / span 4; margin-top: clamp(80px, 9vw, 140px); }
.closing-img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: saturate(.85) contrast(.95); }
.wish { margin-top: 12px; }
.wish li { font-style: italic; padding: 2px 0; }

/* ---------- Bunn ---------- */
.foot { padding-top: clamp(30px, 3.5vw, 55px); padding-bottom: 36px; }
.foot-sees { grid-column: 1 / -1; text-align: center; font-style: italic; font-size: clamp(30px, 3vw, 42px); line-height: 1; }
.foot-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; margin-top: clamp(60px, 7vw, 100px); }
.foot-meta a { text-decoration: none; color: inherit; }

/* ---------- Nettbrett ---------- */
@media (max-width: 1100px) {
  .menu-btn { display: inline-block; }
  .nav {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 4px;
    background-color: var(--paper); background-image: url("images/papir.jpg"); background-size: 768px; background-blend-mode: multiply;
    padding: 20px var(--pad) 34px; border-bottom: 1px solid var(--moss);
    opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
  }
  .nav.open { opacity: 1; visibility: visible; }
  .nav a { font-family: var(--serif); font-style: italic; font-size: 26px; letter-spacing: 0; text-transform: none; padding: 4px 0; }
  .nav a.active { color: var(--moss); }
  .nav a::after { display: none; }
  .bar { -webkit-mask-image: none; mask-image: none; padding-bottom: 16px; }
}

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .page { grid-template-columns: minmax(0, 1fr); padding-top: 70px; padding-bottom: 70px; }
  .page > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .lang { gap: 8px; }
  .lang button { font-size: 14px; }
  .cover { padding-top: 110px; }
  .cover-photo img { max-height: none; }
  .ch-img { position: static; margin-bottom: 34px; width: 78%; }
  .img-right .ch-img { justify-self: end; }
  .ch-img.landscape { width: 100%; }
  .facts > div, .line, .schedule li { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .schedule li { grid-template-columns: 72px minmax(0, 1fr); }
  .foot-meta { flex-direction: column; align-items: center; gap: 10px; }
}

/* Liggende bilder tar én kolonne mer, så teksten flytter seg tilsvarende */
.img-left:has(.landscape) .ch-body { grid-column: 7 / span 6; }
.img-right:has(.landscape) .ch-body { grid-column: 1 / span 6; }
