/* =========================================================
   Byggaktuelt – casino review theme
   Layout + automatic styles for everything inside .review
   ========================================================= */

:root {
  --ink: #16181d;
  --ink-soft: #3b3d44;
  --muted: #6b665c;
  --paper: #faf7f1;
  --surface: #ffffff;
  --tint: #f3eee4;
  --line: #e4dccd;
  --navy: #0f1a2b;
  --navy-2: #17253b;
  --gold: #c4a062;
  --gold-dark: #8a6420;
  --cream: #f4ecdc;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--navy); padding: 10px 16px; z-index: 10;
}
.skip:focus { left: 16px; top: 16px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
  color: var(--cream);
  border-bottom: 1px solid rgba(196, 160, 98, .25);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 72px;
}
.logo {
  font: 600 1.45rem/1 var(--serif);
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--cream);
  white-space: nowrap;
}
.logo span { color: var(--gold); }
.nav { display: flex; align-items: center; gap: 28px; font-size: .9rem; }
.nav a { text-decoration: none; color: rgba(244, 236, 220, .78); }
.nav a:hover { color: var(--gold); }
.nav .nav-main { color: var(--cream); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--cream);
  padding: 64px 0 72px;
}
.eyebrow {
  margin: 0 0 18px;
  font-size: .78rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold);
}
.hero h1 {
  margin: 0;
  max-width: 820px;
  font: 500 clamp(2.1rem, 4.6vw, 3.4rem)/1.12 var(--serif);
  letter-spacing: -.01em;
}
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  margin: 28px 0 0; padding: 0; list-style: none;
  font-size: .9rem; color: rgba(244, 236, 220, .72);
}
.meta li { display: flex; align-items: center; gap: 8px; }
.meta strong { color: var(--cream); font-weight: 600; }
.meta .age {
  border: 1px solid rgba(196, 160, 98, .6); color: var(--gold);
  border-radius: 999px; padding: 2px 10px; font-weight: 600; font-size: .8rem;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 64px;
  align-items: start;
  padding-top: 56px;
  padding-bottom: 88px;
}
.layout > .review { max-width: 760px; }
.sidebar { position: sticky; top: 24px; display: grid; gap: 20px; }

/* ---------- Table of contents ---------- */
.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
}
.toc summary {
  list-style: none; cursor: pointer;
  font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.toc summary::-webkit-details-marker { display: none; }
.toc ol {
  counter-reset: toc;
  list-style: none; margin: 14px 0 0; padding: 0;
  max-height: calc(100vh - 220px); overflow-y: auto;
}
.toc li {
  counter-increment: toc;
  display: grid; grid-template-columns: 26px 1fr;
  padding: 7px 0;
  border-top: 1px solid var(--tint);
  font-size: .9rem; line-height: 1.4;
}
.toc li:first-child { border-top: 0; }
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-size: .72rem; font-weight: 600; color: var(--gold-dark); padding-top: 2px;
}
.toc a { text-decoration: none; color: var(--ink-soft); }
.toc a:hover { color: var(--gold-dark); }

.note {
  background: var(--navy);
  color: rgba(244, 236, 220, .82);
  border-radius: var(--radius);
  padding: 22px;
  font-size: .88rem; line-height: 1.55;
}
.note p { margin: 0; }
.note p + p { margin-top: 10px; }
.note strong { color: var(--gold); font-weight: 600; }
.note a { color: var(--cream); }

/* =========================================================
   REVIEW CONTENT – plain tags only, no classes needed
   ========================================================= */
.review {
  counter-reset: section;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink);
}
.review > :first-child { margin-top: 0; }

.review p { margin: 0 0 1.15em; }

/* lead paragraph */
.review > p:first-of-type {
  font-size: 1.2rem; line-height: 1.7; color: var(--ink-soft);
}

.review h2,
.review h3,
.review h4 {
  font-family: var(--serif);
  color: var(--ink);
  letter-spacing: -.005em;
  scroll-margin-top: 24px;
}

.review h2 {
  counter-increment: section;
  margin: 3.4rem 0 1.1rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.22;
}
.review h2::before {
  content: counter(section, decimal-leading-zero);
  display: block;
  margin-bottom: .7rem;
  font: 600 .76rem/1 var(--sans);
  letter-spacing: .18em;
  color: var(--gold-dark);
}

.review h3 {
  margin: 2.2rem 0 .7rem;
  font-size: 1.32rem;
  font-weight: 600;
  line-height: 1.3;
}
.review h4 {
  margin: 1.8rem 0 .6rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.review a {
  color: var(--gold-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.review a:hover { color: var(--ink); }

.review strong, .review b { font-weight: 650; color: var(--ink); }

/* lists */
.review ul,
.review ol {
  margin: 0 0 1.5em;
  padding: 0;
  list-style: none;
}
.review li { position: relative; padding-left: 1.75em; margin: .55em 0; }
.review ul > li::before {
  content: "";
  position: absolute; left: .3em; top: .72em;
  width: 7px; height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}
.review ol { counter-reset: item; }
.review ol > li { counter-increment: item; }
.review ol > li::before {
  content: counter(item) ".";
  position: absolute; left: 0; top: 0;
  font-weight: 600; color: var(--gold-dark);
}
.review li > ul, .review li > ol { margin: .4em 0 0; }

/* tables */
.review table {
  width: 100%;
  margin: 1.8em 0 2em;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  font-size: .95rem;
  line-height: 1.5;
}
.review th,
.review td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.review thead th {
  background: var(--tint);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.review tbody tr:last-child td { border-bottom: 0; }
.review tbody td:first-child { font-weight: 600; color: var(--ink); }
.review caption {
  caption-side: bottom; padding: 10px 4px 0;
  font-size: .85rem; color: var(--muted); text-align: left;
}

/* other elements */
.review blockquote {
  margin: 2em 0;
  padding: .3em 0 .3em 1.4em;
  border-left: 3px solid var(--gold);
  font: italic 1.2rem/1.6 var(--serif);
  color: var(--ink-soft);
}
.review blockquote p:last-child { margin-bottom: 0; }

.review img, .review video, .review iframe {
  display: block; max-width: 100%; height: auto;
  margin: 1.8em 0; border-radius: var(--radius);
}
.review figure { margin: 2em 0; }
.review figure img { margin: 0; }
.review figcaption { margin-top: .6em; font-size: .88rem; color: var(--muted); }

.review hr { border: 0; border-top: 1px solid var(--line); margin: 2.8em 0; }

.review code {
  font-size: .9em; background: var(--tint);
  padding: .12em .4em; border-radius: 5px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: rgba(244, 236, 220, .7);
  font-size: .9rem;
  padding: 48px 0 40px;
}
.footer-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(244, 236, 220, .12);
}
.footer-top p { margin: 10px 0 0; max-width: 460px; line-height: 1.6; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: var(--cream); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-top: 22px; font-size: .82rem;
}
.footer-bottom a { color: var(--cream); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; }
  .layout > .review { max-width: none; }
  .sidebar { position: static; order: -1; }
  .sidebar .note { display: none; }
  .toc ol { max-height: none; }
  .nav .nav-sec { display: none; }
}

@media (min-width: 1024px) {
  .toc summary { pointer-events: none; }
  .toc ol { max-height: calc(100vh - 330px); }
}
@media (min-width: 1024px) and (max-height: 860px) {
  .sidebar .note { display: none; }
  .toc ol { max-height: calc(100vh - 120px); }
}

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding-top: 14px; padding-bottom: 14px; }
  .nav { font-size: .85rem; }
  .hero { padding: 40px 0 48px; }
  .review { font-size: 1rem; }
  .review > p:first-of-type { font-size: 1.1rem; }
  .review table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .review th, .review td { padding: 12px 14px; min-width: 140px; }
}

@media print {
  .site-header, .sidebar, .site-footer { display: none; }
  .hero { background: none; color: #000; padding: 0 0 20px; }
  .layout { display: block; padding: 0; }
}
