/* =========================================================
   FÄRGER OCH GRUNDINSTÄLLNINGAR
   Ändra variablerna här om webbplatsens färger ska bytas.
   ========================================================= */
:root {
  color-scheme: dark;
  --background: #262626;
  --page-background: #1a1a1a;
  --text: #eeeeee;
  --muted-text: #b7b7b7;
  --accent: #c7e600;
  --border: #3b3b3b;
  --card-background: #222222;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 16px/1.75 Merriweather, Georgia, serif;
}

/* =========================================================
   WEBBPLATSENS YTTRE RAM OCH TILLGÄNGLIGHET
   ========================================================= */
.site {
  max-width: 1200px;
  margin: 22px auto;
  background: var(--page-background);
  box-shadow: 0 18px 60px #00000088;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  top: 1rem;
  left: 1rem;
  z-index: 10;
  padding: 0.7rem;
  background: #ffffff;
  color: #000000;
}

/* =========================================================
   SIDHUVUD OCH NAVIGERING
   ========================================================= */
.top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 4.5%;
}

.top nav,
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.35rem;
}

.top nav a,
footer nav a {
  border-bottom: 2px solid transparent;
  color: #ffffff;
  font: 700 0.78rem Montserrat, Arial, sans-serif;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.top nav a:hover,
.top nav a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
}

/* Knappen visas bara i mobilvyn. */
.menu {
  display: none;
  padding: 0.6rem 0.8rem;
  border: 1px solid #666666;
  background: transparent;
  color: #ffffff;
}

.hero {
  display: block;
  width: 100%;
  height: auto;
}

/* =========================================================
   HUVUDINNEHÅLL OCH TYPOGRAFI
   ========================================================= */
main {
  max-width: 940px;
  margin: auto;
  padding: 4.5rem 4.5% 5.5rem;
}

h1,
h2,
h3 {
  font-family: Montserrat, Arial, sans-serif;
  line-height: 1.2;
}

h1 {
  margin: 0 0 2rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: -0.035em;
}

/* Den stora rubriken på startsidan har en egen, mindre storlek. */
.home-title {
  font-size: clamp(2rem, 3vw, 2.6rem);
}

h2 {
  font-size: 1.35rem;
}

h3 {
  margin-top: 2rem;
  font-size: 1.05rem;
}

a {
  color: var(--accent);
}

p {
  margin: 0 0 1.45rem;
}

.lead {
  color: #ffffff;
  font-size: 1.25rem;
}

hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* =========================================================
   INFORMATIONSRUTOR, KORT OCH KNAPPAR
   ========================================================= */
.notice {
  margin: 2.2rem 0;
  padding: 1.2rem 1.5rem;
  border-left: 5px solid var(--accent);
  background: var(--card-background);
}

.notice p {
  margin: 0;
}

.facts,
.info-grid,
.contacts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin: 2.2rem 0;
}

/*
   Om en grupp innehåller ett ojämnt antal kort placeras det sista
   kortet centrerat på en egen rad. Regeln fungerar exempelvis för
   3, 5 eller 7 kort.
*/
.facts > :last-child:nth-child(odd),
.info-grid > :last-child:nth-child(odd),
.contacts > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 0.55rem);
}

.facts > div,
.info-grid section,
.contacts article,
.feature {
  padding: 1.4rem;
  border: 1px solid var(--border);
  background: var(--card-background);
}

.facts span,
.facts small {
  display: block;
  color: var(--muted-text);
}

.facts strong {
  display: block;
  color: #ffffff;
  font: 700 1.15rem Montserrat, Arial, sans-serif;
}

.button {
  display: inline-block;
  padding: 0.85rem 1.2rem;
  background: var(--accent);
  color: #111111;
  font: 700 0.9rem Montserrat, Arial, sans-serif;
  text-decoration: none;
}

/* =========================================================
   ORDNINGSREGLER
   ========================================================= */
.rules li {
  margin: 0.75rem 0;
  padding-left: 0.3rem;
}

.rules li::marker {
  color: var(--accent);
}

/* =========================================================
   ANMÄLNINGSFORMULÄR
   ========================================================= */
.form {
  width: 100%;
  height: 1200px;
  border: 0;
  background: #ffffff;
}

/* =========================================================
   AKTIVITETER OCH FILMSCHEMA
   ========================================================= */
.schedule {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.schedule strong,
.schedule span {
  display: block;
}

.feature {
  margin-bottom: 1rem;
}

/* =========================================================
   VANLIGA FRÅGOR OCH KONTAKTER
   ========================================================= */
.faq details {
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.faq summary {
  color: #ffffff;
  font: 700 1.05rem Montserrat, Arial, sans-serif;
  cursor: pointer;
}

.faq details[open] summary {
  color: var(--accent);
}

.faq p {
  margin: 0;
  padding: 1rem 0 0;
}

.contacts article a {
  word-break: break-word;
}

/* =========================================================
   SIDFOT
   ========================================================= */
footer {
  padding: 2rem 4.5%;
  border-top: 1px solid var(--border);
  color: var(--muted-text);
}

footer p {
  margin: 1.5rem 0 0;
  font-size: 0.8rem;
  text-align: center;

}

footer nav a {
  font-size: 0.7rem;
}

/* =========================================================
   MOBILANPASSNING
   Används på skärmar som är högst 820 pixlar breda.
   ========================================================= */
@media (max-width: 820px) {
  .site {
    margin: 0;
  }

  .top {
    align-items: flex-start;
  }

  .menu {
    display: block;
  }

  .top nav {
    display: none;
    position: absolute;
    top: 82px;
    right: 0;
    left: 0;
    z-index: 2;
    flex-direction: column;
    padding: 1rem 5%;
    background: #111111;
  }

  .top nav.open {
    display: flex;
  }

  .facts,
  .info-grid,
  .contacts {
    grid-template-columns: 1fr;
  }

  /* På mobil fyller även det sista kortet hela bredden. */
  .facts > :last-child:nth-child(odd),
  .info-grid > :last-child:nth-child(odd),
  .contacts > :last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
  }

  .schedule {
    grid-template-columns: 1fr;
  }

  .hero {
    height: auto;
    min-height: 0;
    object-fit: contain;
  }

  main {
    padding-top: 3rem;
  }

  footer nav {
    gap: 0.75rem 1rem;
  }
}

/* Anmälan och administratörsvy */
.signup { display: grid; gap: .8rem; max-width: 720px; }
.signup > label, .signup legend { font: 700 1rem Montserrat, Arial, sans-serif; }
.signup input:not([type=radio]), .signup textarea { width: 100%; padding: .8rem; border: 1px solid #777; border-radius: 4px; background: #292929; color: #fff; font: inherit; }
.signup input:focus-visible, .signup textarea:focus-visible, .button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.signup fieldset { border: 1px solid #777; padding: 1rem; }
.signup .choice { display: inline-flex; align-items: center; gap: .5rem; margin-right: 2rem; }
.signup .button, button.button { border: 0; cursor: pointer; font: 700 1rem Montserrat, Arial, sans-serif; justify-self: start; }
.form-errors { padding: 1rem; border-left: 5px solid #ff9b89; background: #442724; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.registration { overflow-wrap: anywhere; padding: 1.2rem; margin: 1rem 0; border: 1px solid var(--border); background: var(--card-background); }
.registration h2 { margin-top: 0; }
.registration dt { font-weight: bold; margin-top: .8rem; }
.registration dd { margin-left: 0; white-space: normal; }

.admin-link { margin: -1rem 0 2rem; }
.button-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent) !important; }
.button-secondary:hover { background: #333a12; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.admin-actions form { margin: 0; }
.edit-registration { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.edit-registration summary { cursor: pointer; color: var(--accent); font-weight: bold; }
.edit-registration .signup { margin-top: 1.2rem; }
.delete-registration { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.delete-registration .choice { display: inline-flex; gap: .5rem; align-items: center; }
.button-danger { background: #9b3e34; color: white; }
.button-danger:hover { background: #ba4a3e; }

/* Antal anmälningar – tydlig sammanfattning på anmälningssidan */
.registration-counter {
  display: inline-block;
  max-width: 100%;
  margin: .35rem 0 1.5rem;
  padding: .9rem 1.15rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 5px;
  background: var(--card-background);
  color: inherit;
  font-size: 1rem;
  line-height: 1.5;
}
.registration-counter strong { color: var(--accent); font-size: 1.15em; }
