/* ==========================================================================
   Ønskeboksen for Åsane Rideklubb
   Mørkt, monokromt stilark. Phillip Rødseth, 2026.

   Ett tema (mørkt), én hjørneradius (4px), én typeskala (13/15/17/22/30),
   ingen aksentfarge utover blekket. Tailwind står for layout; fargene og
   skalaen er låst i tailwind.config i base.html til tokenene under.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --paper: #121212;     /* sidebakgrunn */
  --surface: #1a1a1a;   /* skjema, tabeller */
  --raised: #232323;    /* hover, valgt rad */
  --line: #2c2c2c;      /* skillelinjer */
  --edge: #6a6a6a;      /* feltkanter, minst 3:1 mot bakgrunnen */

  --ink: #ebebe8;       /* brødtekst og primærknapp */
  --muted: #a8a8a4;     /* sekundærtekst, ca. 7:1 */
  --faint: #8e8e8a;     /* hjelpetekst og metadata, ca. 5,5:1 */

  --danger: #f0a8a2;
  --danger-line: #7a3a35;
  --ring: rgba(235, 235, 232, 0.4);

  --radius: 4px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0 0 1rem; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--paper); }

.hairline { border-bottom: 1px solid var(--line); }

/* --- Juridiske tekster ----------------------------------------------------- */

.prose-no { color: var(--muted); font-size: 17px; line-height: 1.6; max-width: 68ch; }
.prose-no h2 {
  color: var(--ink);
  font-size: 22px;
  margin: 2.5rem 0 0.75rem;
}
.prose-no h2:first-of-type { margin-top: 0; }
/* Tailwinds nullstilling lastes etter denne fila; klassen gir høyere presedens. */
.prose-no p { margin: 0 0 1rem; }
.prose-no h3 { color: var(--ink); font-size: 17px; margin: 1.75rem 0 0.5rem; }
.prose-no strong { color: var(--ink); font-weight: 600; }
.prose-no ul { margin: 0 0 1rem; padding-left: 1.15rem; list-style: disc; }
.prose-no ol { margin: 0 0 1rem; padding-left: 1.35rem; list-style: decimal; }
.prose-no li { margin-bottom: 0.4rem; }
.prose-no a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose-no code { font-size: 0.9em; color: var(--ink); white-space: nowrap; }

.tabellramme {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.prose-no table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  margin: 0;
  font-size: 15px;
}
.prose-no th, .prose-no td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose-no tr:last-child th, .prose-no tr:last-child td { border-bottom: 0; }
.prose-no th { color: var(--ink); font-weight: 600; background: var(--surface); }

/* --- Flater ---------------------------------------------------------------- */

.card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* --- Skjema ---------------------------------------------------------------- */

.field-label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 0.4rem; }
.field-hint { font-size: 13px; color: var(--faint); margin: 0.4rem 0 0; }

.field {
  width: 100%;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  appearance: none;
}
.field::placeholder { color: var(--faint); opacity: 1; }
.field:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
textarea.field { min-height: 110px; resize: vertical; }

select.field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a8a4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}
select.field option { background: var(--surface); color: var(--ink); }

/* Honeypot: skjult for mennesker, synlig for enkle roboter. */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.checkbox {
  appearance: none;
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
}
.checkbox:checked {
  background-color: var(--ink);
  border-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121212' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 74%;
  background-position: center;
  background-repeat: no-repeat;
}
.checkbox:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

/* --- Knapper --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #d6d6d2; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--edge); }
.btn-ghost:hover { background: var(--raised); }

.btn-quiet { background: transparent; color: var(--muted); padding: 0.45rem 0.6rem; }
.btn-quiet:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: #241413; }

.btn-sm { font-size: 13px; padding: 0.5rem 0.8rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* --- Merker og statuser ---------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
  white-space: nowrap;
}
.status-ny       { background: var(--ink); color: var(--paper); }
.status-vurderes { background: #3a3a3a; color: var(--ink); }
.status-godkjent { box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
.status-kjopt    { box-shadow: inset 0 0 0 1px var(--edge); color: var(--muted); }
.status-avvist   { box-shadow: inset 0 0 0 1px var(--line); color: var(--faint); text-decoration: line-through; }

.chip {
  display: inline-block;
  font-size: 13px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* --- Meldinger ------------------------------------------------------------- */

.flash {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  font-size: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
}
.flash-error { color: var(--danger); border-color: var(--danger-line); border-left-color: var(--danger); }

/* --- Tabeller -------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--faint);
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--raised); }
.table tbody tr:last-child td { border-bottom: 0; }

/* --- Dashbord -------------------------------------------------------------- */

.fane {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  padding: 0.65rem 0.75rem;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.fane:hover { color: var(--ink); }
.fane-aktiv { color: var(--ink); border-bottom-color: var(--ink); }

.meny { position: relative; }
.meny > summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
}
.meny > summary::-webkit-details-marker { display: none; }
.meny > summary:hover { color: var(--ink); border-color: var(--ink); }
.meny > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.meny-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 50;
  min-width: 12rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.meny-panel a,
.meny-panel button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 15px;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  text-decoration: none;
}
.meny-panel a:hover,
.meny-panel button:hover { background: var(--raised); color: var(--ink); }
.meny-skille { display: block; height: 1px; margin: 0.35rem 0.2rem; background: var(--line); }

.massefelt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* Klubblogoen for mørk bakgrunn har sin egen nesten-svarte flate. «lighten»
   lar den smelte inn i sidebakgrunnen uten at selve logofila endres. */
.logo { mix-blend-mode: lighten; }


/* --- Tilgjengelighet ------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* Skjult for øyet, lesbar for skjermleser. Med vilje uten position:absolute:
   et absolutt plassert element slipper unna overflow-klipping når forelderen
   ikke selv er posisjonert, og skjøv da hele siden sidelengs. */
.sr-only-focusable:not(:focus):not(:focus-within) {
  display: block;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
