/* ==========================================================================
   CoolBet Norge — Stylesheet
   ========================================================================== */

:root {
  --theme-rounded-section: 30px;
  --theme-rounded-button: 50px;
  --theme-rounded-images: 12px;

  --bg-body: #090f1d;
  --bg-card: #1a2337;
  --bg-card-hover: #1d2332;
  --bg-header: #090f1d;
  --bg-mobile-menu: #1c263c;

  --text-body: #fffffe;
  --text-muted: #c5cad6;
  --text-footer: #5c6277;

  --color-primary: #7475e8;
  --color-primary-hover: #5a5be0;
  --color-success: #56ae66;
  --color-success-hover: #4a9c58;
  --color-link: #1079d6;
  --color-link-hover: #4094de;
  --color-danger: #d32222;
  --color-banner: #4b35a1;
  --color-banner-cta: linear-gradient(90deg, #d7a429 0%, #ac3a30 100%);
  --color-cta: linear-gradient(90deg, #d7a429 0%, #ac3a30 100%);

  --media-block-1: #1d2331;
  --media-block-2: #0a0f1c;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-body);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-link); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-link-hover); }

ul { list-style: none; padding: 0; margin: 0; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

h1,h2,h3,h4 { margin: 0 0 1.5rem; line-height: 1.2; color: var(--text-body); font-weight: 600; }

h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); text-align: center; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); margin-top: 1.5rem; }

p  { margin: 0 0 1rem; }
strong { color: var(--text-body); font-weight: 700; }

table { width: 100%; border-collapse: separate; border-spacing: 10px;
  margin: 1rem -10px 1.5rem; }
th, td { padding: 15px 12px; line-height: normal; vertical-align: middle;
  background-color: var(--bg-card); color: var(--text-body);
  border-radius: var(--theme-rounded-images); }
thead th, table tr:first-child td { font-weight: 600; }

ul.content-list, .article-body ul, .media-block ul {
  padding-left: 1.4rem; margin: 0.5rem 0 1rem; list-style: disc;
}
ul.content-list li::marker, .article-body ul li::marker { color: var(--color-link); }
ol.content-list, .article-body ol { padding-left: 1.4rem; margin: 0.5rem 0 1rem; list-style: decimal; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header
   -------------------------------------------------------------------------- */
.site-header { background-color: var(--bg-header);
  position: sticky; top: 0; z-index: 100; }
.site-header__inner { display: flex; align-items: center; gap: 1.25rem; height: 70px; }

.site-logo { flex: 0 0 auto; display: block; max-width: 175px; }
.site-logo img { width: auto; max-height: 38px; }

.primary-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.primary-nav__list { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.primary-nav__link { display: inline-flex; align-items: center;
  padding: 6px 14px; font-size: 0.9rem; font-weight: 600;
  color: var(--text-body); white-space: nowrap;
  border-radius: var(--theme-rounded-button); transition: color 0.2s ease; }
.primary-nav__link:hover { color: var(--color-primary); }
.primary-nav__link[aria-current="page"] { color: var(--color-primary); }

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.btn { display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; padding: 10px 28px;
  border-radius: var(--theme-rounded-button);
  text-align: center; line-height: 1.2;
  transition: filter 0.2s ease, transform 0.05s ease, background 0.2s ease;
  white-space: nowrap; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-hover); color: #fff; }
.btn--success { background: var(--color-success); color: #fff; }
.btn--success:hover { background: var(--color-success-hover); color: #fff; }
.btn--header { padding: 8px 22px; font-size: 14px; }
.btn--banner { background: var(--color-banner-cta); color: #fff;
  font-size: 18px; padding: 10px 50px; }
.btn--banner:hover { filter: brightness(1.05); color: #fff; }
.btn--cta { background: var(--color-cta); color: #fff;
  padding: 10px 40px; font-size: 16px; }
.btn--cta:hover { filter: brightness(1.05); color: #fff; }

/* Language dropdown */
.lang-dropdown { position: relative; margin-left: 12px; }
.lang-dropdown__toggle { display: inline-flex; align-items: center; gap: 8px;
  padding: 4px; background: transparent; color: var(--text-body);
  font-weight: 600; font-size: 0.95rem; text-transform: uppercase; }
.lang-dropdown__toggle img {
  width: 30px; height: 30px; object-fit: cover; border-radius: 50%;
  flex-shrink: 0;
}
.lang-dropdown__panel { position: absolute; right: -10px; top: calc(100% + 6px);
  background: #1d2332; border-radius: var(--theme-rounded-button);
  min-width: 200px; padding: 10px; opacity: 0; visibility: hidden;
  transform: translateY(-6px); transition: all 0.2s ease; z-index: 110;
  pointer-events: none;
}
.lang-dropdown:hover .lang-dropdown__panel,
.lang-dropdown.is-open .lang-dropdown__panel,
.lang-dropdown:focus-within .lang-dropdown__panel {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
.lang-dropdown__list { display: grid; gap: 8px; }
.lang-dropdown__item { display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: 6px;
  color: var(--text-body); font-size: 0.95rem; font-weight: 600;
  text-transform: uppercase; }
.lang-dropdown__item img {
  width: 30px; height: 30px; object-fit: cover; border-radius: 50%;
  flex-shrink: 0;
}
.lang-dropdown__item:hover { color: var(--color-primary); }
.lang-dropdown__item[aria-current="page"] { color: var(--color-primary); }

/* Mobile burger */
.burger-toggle { display: none; background: transparent; padding: 0;
  width: 30px; height: 24px; position: relative; }
.burger-toggle span { position: absolute; left: 0; right: 0; height: 3px;
  background: var(--text-body); border-radius: 2px; }
.burger-toggle span:nth-child(1) { top: 2px; }
.burger-toggle span:nth-child(2) { top: 10px; }
.burger-toggle span:nth-child(3) { top: 18px; }

@media (max-width: 991px) {
  .burger-toggle { display: block; order: 99; }
  .primary-nav { position: fixed; inset: 0 0 0 auto; width: 80%; max-width: 320px;
    background: var(--bg-mobile-menu); padding: 4.5rem 1.5rem 1.5rem;
    transform: translateX(100%); transition: transform 0.25s ease;
    box-shadow: -10px 0 30px rgba(0,0,0,0.4); z-index: 105; justify-content: flex-start; }
  .primary-nav.is-open { transform: translateX(0); }
  .primary-nav__list { flex-direction: column; gap: 0.5rem; width: 100%; }
  .primary-nav__link { font-size: 1rem; padding: 8px 0; }
  .header-actions .btn { padding: 8px 16px; font-size: 13px; }
}
@media (max-width: 600px) {
  .header-actions .btn--success { display: none; }
  .lang-dropdown { margin-left: 4px; }
}

/* Welcome / hero
   -------------------------------------------------------------------------- */
.welcome { max-width: 800px; margin: 1.5rem auto 1.5rem;
  text-align: center; padding: 0 1rem; }
.welcome__lede { color: var(--text-muted); font-size: 1rem; }
@media (max-width: 991px) {
  .welcome { max-width: none; text-align: left; }
}

/* Banner
   -------------------------------------------------------------------------- */
.banner { position: relative; background-color: var(--color-banner);
  border-radius: var(--theme-rounded-section); overflow: hidden;
  margin: 0 0 1.5rem; padding: 32px;
  display: flex; justify-content: flex-end; }
.banner__art { position: absolute; top: 0; left: 80px; height: 100%; width: auto;
  z-index: 1; pointer-events: none; }
.banner__inner { position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.banner__name { color: #fff; font-size: clamp(1.5rem, 3vw, 3rem); font-weight: 600;
  line-height: normal; margin: 0 0 0.25rem; }
.banner__value { color: #fff; font-size: clamp(1.5rem, 3vw, 3rem);
  font-weight: 600; line-height: normal; margin: 0 0 1rem; }
@media (max-width: 991px) {
  .banner { padding: 16px; justify-content: center; }
  .banner__art { left: 50% !important; transform: translateX(-50%);
    top: 16px !important; height: 200px !important; width: auto !important; }
  .banner__inner { align-items: center; text-align: center; padding-top: 200px; width: 100%; }
  .banner__name, .banner__value { font-size: 6vw; }
  .btn--banner { font-size: 14px; width: 100%; padding: 10px 20px; }
}

/* Quick categories (short menu)
   -------------------------------------------------------------------------- */
.short-menu { margin: 0 0 1.5rem; }
.short-menu__list { display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 30px; }
.short-menu__item { display: flex; align-items: center;
  justify-content: space-between; height: 65px; padding: 0 22px;
  background-color: var(--bg-card); border-radius: var(--theme-rounded-section);
  color: var(--text-body); font-weight: 600; transition: background 0.2s ease; }
.short-menu__item:hover { background-color: var(--bg-card-hover); color: var(--text-body); }
.short-menu__item img { max-width: 47px; width: auto; height: auto; flex-shrink: 0; }
.short-menu__label { flex: 1; text-align: right; }
@media (max-width: 991px) {
  .short-menu__list { grid-template-columns: 1fr; gap: 8px; }
}

/* Section heading row */
.section-head { margin: 2rem 0 1.5rem; }
.section-head h2 { margin: 0; }

/* Casino tile grid (most_popular_games)
   -------------------------------------------------------------------------- */
.tile-grid-wrap { margin: 0 0 1.5rem; }
.tile-grid-wrap .grid-head { display: flex; gap: 24px; align-items: center;
  margin-bottom: 1.5rem; }
.tile-grid-wrap .grid-head h2 { margin: 0; }
.tile-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  list-style: none; margin: 0; padding: 0;
}
.tile { display: block; cursor: pointer; }
.tile img { width: 100%; height: auto; display: block;
  border-radius: var(--theme-rounded-images);
  transition: transform 0.4s ease; }
.tile:hover img { transform: scale(1.05); }
@media (max-width: 991px) {
  .tile-grid {
    overflow-x: auto;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 140px;
    margin: 0 -1rem;
    padding: 0 1rem;
    -ms-overflow-style: none; scrollbar-width: none;
  }
  .tile-grid::-webkit-scrollbar { display: none; }
}

/* Sport grid (games_sports)
   -------------------------------------------------------------------------- */
.sport-grid-wrap { margin: 0 0 1.5rem; }
.sport-grid-wrap .grid-head { display: flex; gap: 24px; align-items: center;
  margin-bottom: 1.5rem; }
.sport-grid-wrap .grid-head h2 { margin: 0; }
.sport-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 15px;
  list-style: none; margin: 0; padding: 0; }
.sport-card { display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; height: 140px; padding: 0 22px;
  background-color: var(--bg-card); border-radius: var(--theme-rounded-section);
  color: var(--text-body); font-size: 17px; transition: background 0.4s ease; }
.sport-card:hover { background-color: var(--color-link); color: var(--text-body); }
.sport-card img { max-height: 60px; width: auto; }
.sport-card__name { text-align: center; line-height: normal; }
@media (max-width: 991px) {
  .sport-grid { grid-template-columns: 1fr; gap: 8px; }
  .sport-card { flex-direction: row; height: auto; padding: 15px;
    justify-content: flex-start; }
  .sport-card img { max-height: 45px; }
}

/* TOC navigation
   -------------------------------------------------------------------------- */
.toc { margin: 0 0 1.5rem; display: flex; flex-wrap: wrap; gap: 8px; }
.toc ol { display: contents; list-style: none; margin: 0; padding: 0; }
.toc li { display: contents; }
.toc a { display: block; padding: 9px 12px; line-height: normal;
  background-color: transparent; border: 1px solid var(--color-link);
  border-radius: var(--theme-rounded-button); font-size: 13px;
  color: var(--text-body); }
.toc a:hover { color: var(--color-link); }

/* Article body
   -------------------------------------------------------------------------- */
.article-body { padding: 0 0 2rem; }
.article-body img { border-radius: var(--theme-rounded-images);
  margin: 0.5rem 0; max-width: 100%; height: auto; }
.article-body img.float-left { float: left; margin: 0.5rem 1.5rem 1rem 0;
  max-width: 449px; width: 38%; }
.article-body img.float-right { float: right; margin: 0.5rem 0 1rem 1.5rem;
  max-width: 449px; width: 38%; }
.article-body section { clear: both; }
.article-body .section-cta { display: flex; justify-content: center;
  margin: 1.5rem 0; }
@media (max-width: 991px) {
  .article-body img.float-left, .article-body img.float-right {
    float: none; max-width: 100%; width: auto; margin: 1rem auto;
  }
}

/* Hero gallery image (centered, not full-width) */
.hero-gallery { display: flex; justify-content: center; margin: 1.5rem 0; }
.hero-gallery img { max-width: 800px; width: 100%; height: auto;
  border-radius: var(--theme-rounded-images); }

/* FAQ
   -------------------------------------------------------------------------- */
.faq { margin: 1.5rem 0 2rem; }
.faq__heading { margin: 0 0 1.5rem; }
.faq__list { display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 15px 32px; align-items: start; }
.faq__item { padding: 15px;
  background-color: var(--bg-card);
  border-radius: var(--theme-rounded-images);
}
.faq__question { width: 100%; display: flex; justify-content: space-between;
  align-items: flex-start; gap: 1rem; padding: 0;
  text-align: left; font-size: 17px; font-weight: 600;
  color: var(--text-body); cursor: pointer;
  list-style: none; user-select: none; }
.faq__question::-webkit-details-marker { display: none; }
.faq__question .toggler { display: inline-flex; flex: 0 0 auto;
  width: 13px; height: 13px;
  color: var(--color-link); transition: transform 0.2s ease; }
.faq__item[open] .toggler { transform: rotate(180deg); }
.faq__answer { margin-top: 15px; color: var(--text-body); }
.faq__answer p:last-child { margin-bottom: 0; }
@media (max-width: 991px) {
  .faq__list { grid-template-columns: 1fr; gap: 10px; }
}

/* Footer
   -------------------------------------------------------------------------- */
.site-footer { padding: 40px 0;
  color: var(--text-footer); background-color: transparent;
  margin-top: 2.5rem; }
.footer-logo { display: block; max-width: 175px; margin-bottom: 32px; }
.footer-logo img { width: auto; max-height: 38px; }
.footer-grid { display: flex; gap: 24px; align-items: flex-start;
  padding-bottom: 32px; }
.footer-grid > .footer-brand { flex: 1 0 0; max-width: 240px; }
.footer-brand__text { font-size: 14px; line-height: normal; font-weight: 300;
  margin: 0 0 16px; }
.footer-social { display: flex; gap: 6px; }
.footer-social a { display: inline-flex; align-items: center;
  justify-content: center; width: 40px; height: 40px;
  color: var(--text-body); transition: transform 0.2s ease, color 0.2s ease; }
.footer-social a:hover { color: var(--color-link); }
.footer-social a:hover svg { transform: scale(1.2); }
.footer-social svg { width: 24px; height: 24px; transition: transform 0.2s ease; }
.footer-col { flex: 1 0 0; }
.footer-heading { font-size: 14px; font-weight: 700; line-height: normal;
  text-transform: uppercase; color: var(--text-body); margin: 0 0 24px; }
.footer-nav__label { font-size: 13px; margin-bottom: 4px; }
.footer-nav a { color: var(--text-body); font-size: 14px; }
.footer-nav a:hover { color: var(--color-link); }
.footer-nav ul { display: flex; flex-direction: column; gap: 10px; }

.footer-logos, .footer-payments, .footer-partners {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; padding: 30px 0; gap: 28px;
}
.footer-logos > img { width: auto; max-height: 50px; max-width: 75px;
  object-fit: contain; }
.footer-logos .item { max-width: 75px; }
.footer-logos .item img { width: 100%; max-height: 70px; }
.footer-payments { gap: 20px; }
.footer-payments > img { width: auto; max-height: 19px; max-width: 65px;
  object-fit: contain; }
.footer-payments .item { max-width: 65px; }
.footer-payments .item img { width: 100%; max-height: 19px; }
.footer-partners > img { width: auto; max-height: 28px; max-width: 90px;
  object-fit: contain; }
.footer-partners .item { max-width: 90px; }
.footer-partners .item img { width: 100%; max-height: 28px; }

.footer-bottom { display: grid; grid-template-columns: 1fr auto;
  gap: 24px; padding-top: 32px; align-items: center; }
.footer-copyright { color: var(--text-footer); font-size: 0.85rem; margin: 0; }

@media (max-width: 991px) {
  .footer-grid { flex-direction: column; gap: 24px; align-items: center;
    text-align: center; }
  .footer-grid > .footer-brand { max-width: none; }
  .footer-social { justify-content: center; }
  .footer-logos, .footer-payments, .footer-partners {
    justify-content: center; padding: 16px 0; gap: 16px;
  }
  .footer-logos .item { max-width: 42px; }
  .footer-bottom { grid-template-columns: 1fr; text-align: center;
    padding-top: 16px; }
}

/* Sub-nav
   -------------------------------------------------------------------------- */
.sub-nav { display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 1.5rem; padding: 0; }
.sub-nav__item { display: block; padding: 9px 12px; line-height: normal;
  background-color: transparent; border: 1px solid var(--color-link);
  border-radius: var(--theme-rounded-button); font-size: 13px;
  color: var(--text-body); }
.sub-nav__item:hover, .sub-nav__item.is-active { color: var(--color-link); }

/* Two-column media block
   -------------------------------------------------------------------------- */
.media-block { display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; align-items: center; margin: 1.5rem 0;
  padding: 21px 16px 16px;
  background: linear-gradient(180deg, var(--media-block-1) 0%, var(--media-block-2) 100%);
  border-radius: var(--theme-rounded-images); position: relative; }
.media-block::before { content: ""; height: 5px; position: absolute;
  left: 16px; right: 16px; top: -1px; border-radius: 2px;
  background-color: var(--color-link); }
.media-block img { border-radius: var(--theme-rounded-images);
  width: 100%; height: auto; }
.media-block li::marker { color: var(--color-link); }
@media (max-width: 991px) {
  .media-block { grid-template-columns: 1fr; }
}

/* Section title accent */
.title-accent { position: relative; padding-bottom: 0.5rem; margin-bottom: 1rem; }
.title-accent::after { content: ""; display: block; width: 60px; height: 3px;
  background: var(--color-link); margin-top: 0.5rem; border-radius: 2px; }

/* 404 page */
.error-page { text-align: center; padding: 3rem 1rem 4rem; }
.error-page__code { font-size: clamp(4rem, 12vw, 8rem); margin: 0;
  color: var(--color-danger); font-weight: 800; line-height: 1; }
.error-page__title { margin: 0.5rem 0 1rem; }
.error-page__lede { color: var(--text-muted); max-width: 520px;
  margin: 0 auto 1.5rem; }

/* =============================================================================
   MOBILE FIXES — burger above slide-in nav, X cue when open,
   lang dropdown visible on mobile, scrollable, equal CTA size
   ========================================================================= */
@media (max-width: 991px) {
  /* Burger above the slide-in nav so it stays tappable to close. */
  .burger-toggle {
    position: relative;
    z-index: 110;
    flex-shrink: 0;
  }
  .burger-toggle span {
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .burger-toggle[aria-expanded="true"] span:nth-child(1) {
    top: 10px;
    transform: rotate(45deg);
  }
  .burger-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .burger-toggle[aria-expanded="true"] span:nth-child(3) {
    top: 10px;
    transform: rotate(-45deg);
  }
  /* Lang dropdown visible on mobile, anchored to viewport right, scrollable. */
  .lang-dropdown {
    flex-shrink: 0;
  }
  .lang-dropdown__panel {
    right: 0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Equal-sized header CTAs when both are visible (don't change display so the
   site's existing visibility rules at narrow widths still apply). */
.header-actions .btn--primary,
.header-actions .btn--success {
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1.2;
  min-height: 38px;
  align-items: center;
  justify-content: center;
}

/* Push header-actions to the right edge on mobile */
@media (max-width: 991px) {
  .header-actions {
    margin-left: auto;
  }
}
