:root {
  --accent: #c6a04a;          /* gold */
  --accent-2: #d4b253;        /* lighter gold */
  --accent-light: #f3e7c9;    /* very light gold */
  --menu-bg: #111;
  --menu-fg: #fff;
  --transition: 0.3s ease;
}

html { scroll-behavior: smooth; }

/* ✅ Critical: prevents padding from pushing elements outside screen */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(120deg, #f7fafc, #fffdf7);
  color: #222;
}

/* ✅ Prevent horizontal “layout drift” on mobile */
body, main, section, article, nav, aside, header, footer, div {
  max-width: 100%;
}

/* ✅ Any long text (URLs, long words, etc.) should wrap */
p, li, a, span, strong, em, code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ================= DRAWER ================= */

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 1000;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(88vw, 320px);
  background: var(--menu-bg);
  color: var(--menu-fg);
  transform: translateX(100%);
  transition: transform .3s ease;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 16px rgba(0,0,0,.24);
}

.drawer header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer header h2 {
  margin: 0;
  font-size: 1rem;
}

.close {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

nav.menu { padding: 8px 8px 24px; }

nav.menu a {
  color: #fff;
  text-decoration: none;
  padding: 12px 14px;
  display: block;
  border-radius: 10px;
  font-weight: 500;
}

nav.menu a:hover { background: rgba(255,255,255,.08); }

.is-open .drawer { transform: translateX(0); }
.is-open .backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ================= GENERIC (used elsewhere) ================= */

.subtitle {
  color: #555;
  font-size: 1.1rem;
  margin: 0;
}

/* ✅ COUNTDOWN (index) – fixed wrapping by making boxes wider + no-wrap text */
.countdown {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 30px 0 22px;
}

.time {
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;

  padding: 1.1rem 1.25rem;
  border-radius: 12px;

  /* ✅ Wider so 3 digits + “Minutter/Sekunder” fit */
  width: 122px;
  min-height: 96px;

  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;

  text-align: center;
}

.time:hover { transform: translateY(-3px); }

.time strong {
  display: block;
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1;
  margin: 0;

  /* ✅ Don’t allow numbers like 153 to break into 15 + 3 */
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.time span {
  display: block;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  line-height: 1.15;
  margin: 0;

  /* ✅ Don’t allow “Minutter” to split */
  white-space: nowrap;
}

/* ================= INFO PAGE ================= */

.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 16px 64px;
}

/* Layout: sidebar + content */
.info-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

.info-sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
}

.page-intro {
  padding: 6px 2px 10px;
}

.page-intro h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin: 0 0 6px;
}

/* Content */
.info-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
  min-width: 0;
}

/* Section cards */
.info-section {
  background: rgba(255,255,255,.92);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  scroll-margin-top: 120px;
  min-width: 0;
}

.info-section p,
.info-section li {
  line-height: 1.55;
}

.info-section h2 {
  font-family: 'Playfair Display', serif;
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.info-section p { margin: 0 0 10px; }
.info-section ul { margin: 8px 0 0 18px; padding: 0; }
.info-section li { margin: 6px 0; }

/* ✅ Make all images responsive everywhere */
img {
  max-width: 100%;
  height: auto;
}

/* Image helper */
.responsive-img-1 {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin-top: 12px;
}

.responsive-img-2 {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin-top: 12px;
}

.responsive-img-3 {
  max-width: 30%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin-top: 12px;
}

/* ================= TOC (details/summary) ================= */

.toc-summary::-webkit-details-marker { display: none; }
.toc-summary { list-style: none; }
.toc-summary { display: none; }

/* Gold wiki panel */
.info-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;

  background: linear-gradient(145deg, rgba(198,160,74,0.22), rgba(243,231,201,0.55));
  border: 1px solid rgba(198,160,74,0.35);

  box-shadow: 0 10px 22px rgba(0,0,0,.10);
  backdrop-filter: blur(6px);
}

.info-nav a {
  text-decoration: none;
  color: #2a2416;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;

  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(198,160,74,0.25);

  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}

.info-nav a:hover {
  background: rgba(255,255,255,0.85);
  border-color: rgba(198,160,74,0.55);
  transform: translateY(-1px);
}

.info-nav .back-home {
  color: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 14px rgba(198,160,74,0.30);
}

.info-nav .back-home:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

/* ================= RESPONSIVE (Mobile overlay TOC) ================= */

@media (max-width: 900px) {
  .page-wrap {
    padding: 14px 12px 44px;
  }

  .info-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .info-content {
    gap: 12px;
  }

  .subtitle {
    font-size: 1rem;
  }

  .info-section {
    padding: 14px;
    border-radius: 12px;
  }

  .info-section h2 { font-size: 1.15rem; }

  .info-section ul {
    margin-left: 16px;
  }

  /* ✅ Mobile: still wide enough, but not huge */
  .countdown {
    gap: 12px;
    margin: 22px 0 16px;
  }

  .time {
    width: 104px;
    min-height: 88px;
    padding: 0.95rem 1.05rem;
    gap: 5px;
  }

  .time strong { font-size: 1.95rem; }
  .time span { font-size: 0.85rem; }

  /* Sticky TOC bar area */
  .info-sidebar {
    position: sticky;
    top: calc(10px + env(safe-area-inset-top, 0px));
    z-index: 2000;
  }

  /* Show summary button on mobile */
  .toc-summary {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    cursor: pointer;
    user-select: none;

    padding: 10px 12px;
    border-radius: 999px;

    background: linear-gradient(145deg, rgba(198,160,74,0.28), rgba(243,231,201,0.55));
    border: 1px solid rgba(198,160,74,0.35);
    box-shadow: 0 8px 18px rgba(0,0,0,.10);
  }

  .toc-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    box-shadow: 0 6px 14px rgba(198,160,74,0.30);
    font-size: 18px;
    line-height: 1;
  }

  .toc-title {
    font-weight: 800;
    color: #2a2416;
  }

  /* Closed: hide nav */
  .toc:not([open]) .info-nav { display: none; }

  /* OPEN on mobile: full-screen overlay */
  .toc[open] {
    position: fixed;
    inset: 0;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 12px 14px;
    background: rgba(0,0,0,0.45);
    z-index: 3000;
  }

  .toc[open] .toc-summary {
    max-width: 520px;
    margin: 0 auto;
  }

  .toc[open] .info-nav {
    display: flex;
    max-width: 520px;
    margin: 12px auto 0;
    border-radius: 18px;
  }

  .info-nav a {
    font-size: 1rem;
    padding: 12px 12px;
  }
}
