:root {
  --bg: #0b0f14;
  --card: #121826;
  --text: #e8eef7;
  --muted: #b8c2d6;
  --accent: #4ea1ff;
  --border: rgba(255, 255, 255, 0.10);
}

* { box-sizing: border-box; }

/* ✅ Globalt: aldri blå/lilla lenker */
a:link,
a:visited {
  color: var(--muted);
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

/* ----------------------------
   Header / Toppmeny
---------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0e141f;
}

.brand .title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand .title strong { font-size: 16px; }
.brand .title span { font-size: 12px; color: var(--muted); }

.nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ✅ HOVEDMENY: alltid "bokser" */
.nav a {
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;

  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}

.nav a:active {
  text-decoration: none;
}

.nav a.active {
  color: var(--text);
  background: rgba(78, 161, 255, 0.12);
  border: 1px solid rgba(78, 161, 255, 0.25);
}

/* ----------------------------
   Main
---------------------------- */
main {
  padding: 32px 0 64px;
}

/* ----------------------------
   Hero
---------------------------- */
.hero {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 22px;
  padding-right: 340px;

  background: linear-gradient(180deg, rgba(78,161,255,0.14), rgba(18,24,38,0.6));
  border: 1px solid var(--border);
  border-radius: 18px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.hero-logo{
  position: absolute;
  top: 22px;
  right: 22px;
}

.hero-logo img{
  display: block;
  width: 280px;
  height: auto;
  max-height: 160px;
  object-fit: contain;
}

/* ----------------------------
   Undermeny (subnav)
---------------------------- */
.subnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.subnav a {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;

  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
}

.subnav a:hover,
.subnav a:focus-visible {
  color: var(--text);
  border-color: rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.05);
  text-decoration: none;
}

.subnav a:active {
  text-decoration: none;
}

.subnav a.active {
  background: rgba(78, 161, 255, 0.15);
  color: var(--text);
  border: 1px solid rgba(78, 161, 255, 0.3);
}

/* ----------------------------
   Brødtekst / Innhold
---------------------------- */
.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem;
}

.content h2 {
  margin-top: 32px;
  font-size: 20px;
}

.content p,
.content ul {
  line-height: 1.7;
  color: var(--text);
}

.content ul {
  padding-left: 18px;
}

/* ----------------------------
   Tabeller: tynne hvite ruter
---------------------------- */
table {
  width: 100%;
  border-collapse: collapse; /* viktig */
  margin: 1rem 0;
}

th,
td {
  border: 1px solid rgba(255,255,255,0.25); /* tynn hvit kant */
  padding: 0.5rem 0.75rem;
  text-align: left;
}

th {
  font-weight: 600;
  color: var(--text);
}

td {
  color: var(--muted);
}

tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.03);
}

tbody tr:hover {
  background: rgba(78,161,255,0.08);
}


/* ✅ Brødtekstlenker: alltid grå, med understrek */
.content p a,
.content li a,
.hero p a,
.hero li a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.content p a:hover,
.content p a:focus-visible,
.content li a:hover,
.content li a:focus-visible,
.hero p a:hover,
.hero p a:focus-visible,
.hero li a:hover,
.hero li a:focus-visible {
  color: var(--text);
  text-decoration-thickness: 2px;
}

.content p a:active,
.content li a:active,
.hero p a:active,
.hero li a:active {
  color: var(--text);
}

/* ----------------------------
   Grid / Cards (forside, osv.)
---------------------------- */
.grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

a.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.card-link:hover {
  transform: translateY(-2px);
}

/* ----------------------------
   Vedtekter / lange tekster
---------------------------- */
.page-header .lead { opacity: 0.85; margin-top: 0.25rem; }
.bylaw { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.12); }
.bylaw h2 { margin-bottom: 0.5rem; }
.bylaw h3 { margin-top: 1rem; }
.bylaw p { line-height: 1.6; margin: 0.5rem 0; }
.lettered { margin: 0.5rem 0 0.75rem 1.25rem; }

/* ----------------------------
   Nyheter
---------------------------- */
.news { margin-top: 2rem; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

a.news-card {
  display: block;
  padding: 1.25rem;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.news-card h3 { margin: 0 0 0.5rem; }
.news-card p { margin: 0 0 0.75rem; opacity: 0.9; line-height: 1.5; }

.news-meta {
  display: inline-block;
  font-size: 0.9rem;
  opacity: 0.8;
  border: 1px solid rgba(255,255,255,0.16);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

a.news-card:hover {
  transform: translateY(-2px);
  border-color: rgba(120,170,255,0.45);
}

a.news-card:focus-visible {
  outline: 3px solid rgba(120,170,255,0.65);
  outline-offset: 3px;
}

/* ----------------------------
   Failsafe: aldri understrek i nav/subnav og kort
---------------------------- */
.nav a,
.nav a:visited,
.nav a:hover,
.nav a:focus-visible,
.nav a:active,
.subnav a,
.subnav a:visited,
.subnav a:hover,
.subnav a:focus-visible,
.subnav a:active,
a.card-link,
a.card-link:visited,
a.card-link:hover,
a.card-link:focus-visible,
a.card-link:active,
a.news-card,
a.news-card:visited,
a.news-card:hover,
a.news-card:focus-visible,
a.news-card:active {
  text-decoration: none;
}

/* ----------------------------
   Footer
---------------------------- */
footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 20px 0;
}

/* ----------------------------
   Responsivt
---------------------------- */

@media (max-width: 900px) {

  /* --- eksisterende regler --- */
  .grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .brand { min-width: unset; }
  .hero { padding-right: 22px; }
  .hero-logo { display: none; }

  /* --- MOBIL: hovedmeny --- */
  .nav {
    justify-content: center;     /* ikke høyrejustert */
    gap: 8px;
  }

  .nav a {
    padding: 6px 8px;            /* mindre bokser */
    font-size: 14px;
    white-space: nowrap;         /* aldri linjeskift i teksten */
  }
}
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.image-gallery img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.image-gallery figure {
  margin: 0;
}

.image-gallery figcaption {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.4rem;
  text-align: center;
}
/* === GLOBAL BILDE-SIKRING (VIKTIG) === */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === RESPONSIVT BILDEGALLERI === */
.image-gallery {
  display: grid;
  grid-template-columns: 1fr;   /* mobil: én kolonne */
  gap: 1rem;
  margin-top: 1rem;
}

.image-gallery figure {
  margin: 0;
}

.image-gallery img {
  width: 100%;
  border-radius: 6px;
}

.image-gallery figcaption {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.4rem;
  text-align: center;
}

/* === STØRRE SKJERMER === */
@media (min-width: 600px) {
  .image-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .image-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* === SIKRING MOT HORISONTAL SCROLL === */
body {
  overflow-x: hidden;
}
