:root{
  --blue: rgb(142, 169, 204);
  --wine: #5f0d0f;
  --cream: #f4efe4;
  --ink: #161412;
  --bg: var(--cream);
  --fg: var(--ink);
  --accent: var(--wine);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html{ scroll-padding-top: env(safe-area-inset-top, 0px); }
/* alla mått i rem skalar med denna rad: oförändrat (1rem = 16px) upp till 1920px bredd, därefter växer sidan med skärmen */
/* 0.8334vw = 16px vid 1920px; 1.5vh hindrar att mycket breda, låga skärmar (t.ex. 5120x1440) blir för stora */
html{ font-size: max(1rem, min(0.8334vw, 1.5vh)); }
*{ box-sizing: border-box; }

/* färgtema per ruta: bakgrund, textfärg och rubrikfärg byts ut samtidigt */
.cream, .wine{ background: var(--bg); color: var(--fg); }
.cream{ --bg: var(--cream); --fg: var(--ink); --accent: var(--wine); }
.wine{ --bg: var(--wine); --fg: var(--blue); --accent: var(--blue); }

body{
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.0625rem;
  -webkit-font-smoothing: antialiased;
}
h1, h2{ margin: 0; font-weight: 500; line-height: 1; letter-spacing: 0.125rem; color: var(--accent); }
a{ color: inherit; }
button, input{ font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; border-radius: 0; }

.button{
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.button:hover{ background: var(--bg); color: var(--fg); }
.button.small{ padding: 0.5rem 1rem; font-size: 0.8rem; }

/* layout: panel till vänster (överst på mobil), innehåll till höger */
.layout{ flex: 1; display: grid; }

.panel{ container-type: inline-size; display: flex; flex-direction: column; gap: 2rem; padding: 2rem 1.25rem 8rem; }
.logo{ display: block; font-size: 3rem; font-size: clamp(2.5rem, 15cqw, 5.5rem); font-weight: 700; line-height: 1; color: var(--accent); text-decoration: none; }
.panel nav{ display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.9rem; }
.panel nav a{ text-decoration: none; border-bottom: 1px solid transparent; }
.panel nav a:hover, .panel nav a[aria-current]{ border-color: var(--fg); }
.panel-foot{ display: grid; justify-items: start; gap: 0.75rem; margin-top: auto; font-size: 0.85rem; }

/* innehåll: kortet och bilderna delar samma bredd (--measure) och ligger centrerade */
.content{ --measure: 38.75rem; isolation: isolate; padding: 0 1.25rem 5rem; }
.sheet{ position: relative; max-width: var(--measure); margin: -4.5rem auto 0; padding: 2rem; }
/* blå ruta bakom kortet: lika stor som kortet, förskjuten 1rem åt höger och nedåt */
.sheet::before{ content: ''; position: absolute; z-index: -1; inset: 1rem -1rem -1rem 1rem; background: var(--blue); }
.sheet h1{ font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 1.75rem; }

.gallery{ display: grid; gap: 1rem; max-width: var(--measure); margin: 4.5rem auto 0; }
.gallery figure{ margin: 0; }
.gallery img{ display: block; width: 100%; max-height: 70vh; aspect-ratio: 3 / 2; object-fit: cover; }

/* nästa träff */
.facts{ margin: 0 0 2rem; border-top: 1px solid var(--fg); }
.facts div{ display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.875rem; border-bottom: 1px solid var(--fg); }
.facts dt{ font-size: 0.8rem; letter-spacing: 0.125rem; }
.facts dd{ margin: 0; text-align: right; overflow-wrap: anywhere; font-size: 1.25rem; color: var(--accent); }

/* faq och om klubben: löpande text */
details p, .about p{ font-size: 0.9rem; line-height: 1.7; }
details{ border-top: 1px solid var(--fg); }
details:last-of-type{ border-bottom: 1px solid var(--fg); }
summary{ display: flex; justify-content: space-between; gap: 1rem; padding-block: 1rem; font-weight: 500; cursor: pointer; list-style: none; }
summary::-webkit-details-marker{ display: none; }
summary::after{ content: '+'; color: var(--accent); }
details[open] summary::after{ content: '–'; }
details p{ margin: 0 0 1.25rem; }

/* om klubben: bildrutan visas som tom ram tills src har en bild */
.about{ margin-top: 2.5rem; }
.about h2{ margin-bottom: 1.25rem; font-size: clamp(1.3rem, 3vw, 1.6rem); }
.about figure{ display: grid; aspect-ratio: 3 / 2; margin: 0 0 1.25rem; border: 1px solid var(--fg); }
.about img{ width: 100%; height: 100%; object-fit: cover; }
.about img[src=""]{ display: none; }
.about p{ margin: 0; }

/* formulär */
.form{ display: grid; gap: 1.375rem; }
.field{ display: grid; gap: 0.25rem; font-size: 0.8rem; letter-spacing: 0.125rem; }
.field input{ padding: 0.625rem 0; border: 0; border-bottom: 1px solid var(--fg); background: transparent; font-size: 1rem; letter-spacing: 0.0625rem; }
.field input::placeholder{ color: var(--fg); opacity: 0.5; }
.form input:focus-visible{ outline: 2px solid var(--fg); outline-offset: 0.25rem; }
.form fieldset{ display: flex; flex-wrap: wrap; gap: 0.75rem; border: 0; padding: 0; margin: 0; }
.form legend{ padding: 0; margin-bottom: 0.5rem; font-size: 0.8rem; letter-spacing: 0.125rem; }
.choice{ position: relative; flex: 1 1 8.75rem; }
.choice input{ position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.choice span{ display: block; padding: 0.75rem; border: 1px solid var(--fg); text-align: center; }
.choice input:checked + span{ background: var(--fg); color: var(--bg); }
.choice input:focus-visible + span{ outline: 2px solid var(--fg); outline-offset: 0.25rem; }
.status{ min-height: 1.5em; margin: 0; }
.form .button{ justify-self: start; }

/* kontaktruta */
.overlay{ position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 1.25rem; overflow: auto; z-index: 10; background: color-mix(in srgb, var(--ink) 75%, transparent); }
.overlay.open{ display: flex; }
.modal{ position: relative; width: 100%; max-width: 26.25rem; padding: 2.25rem 1.75rem 1.875rem; border: 1px solid var(--fg); }
.modal h2{ margin-bottom: 1.125rem; font-size: clamp(1.3rem, 4.5vw, 1.7rem); line-height: 1.15; letter-spacing: 0.0625rem; }
.modal p{ margin: 0.5rem 0; }
.modal-close{ position: absolute; top: 0.5rem; right: 0.875rem; padding: 0; background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; }

/* responsivt: minsta mobiler, surfplatta, dator, stora skärmar */
@media (max-width: 380px){
  .sheet{ padding: 1.5rem; }
}
@media (min-width: 600px){
  .content{ padding-inline: 2.5rem; }
}
@media (min-width: 900px){
  .layout{ grid-template-columns: clamp(21.25rem, 38%, 32.5rem) 1fr; }
  .panel{ position: sticky; top: 0; align-self: start; height: 100vh; padding: 2.5rem 2rem; }
  .panel nav{ flex-direction: column; }
  .content{ padding: 14vh 3rem 6rem; }
  /* kortet (och den blå rutan bakom) går 4.5rem in över panelen på alla bredder; bilderna ligger kvar i innehållsytan */
  .sheet{ margin-top: 0; margin-left: -7.5rem; }
  .gallery{ margin-top: 6rem; margin-left: 0; }
}
@media (min-width: 900px) and (max-height: 620px){
  .panel{ position: static; height: auto; }
}
@media (min-width: 1600px){
  .content{ --measure: 45rem; }
}
@media (min-width: 2200px){
  .content{ --measure: 64rem; }
  .gallery{ max-width: none; grid-template-columns: repeat(3, minmax(0, 32rem)); }
  .gallery:has(> :only-child){ grid-template-columns: minmax(0, var(--measure)); }
  details p, .about p{ max-width: 70ch; }
  .about{ display: grid; grid-template-columns: minmax(0, 30rem) 1fr; column-gap: 2rem; align-items: start; }
  .about h2{ grid-column: 1 / -1; }
  .about figure{ margin: 0; }
  .form{ max-width: 40rem; }
}
