/**
 * Godz Casino — глобальні стилі
 * Mobile-first. Використовує токени з tokens.css.
 */

@font-face {
  font-family: 'Norse';
  src: local('Cabin');
  font-display: swap;
}

html {
  background: var(--color-bg-primary);
}

body {
  background: var(--color-bg-primary);
  color: var(--color-text-body);
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  overflow-x: hidden;
}

main {
  display: block;
}

/* ==== Skip link ==== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 999;
  padding: 0.75rem 1.25rem;
  background: var(--color-accent);
  color: var(--color-white);
  font-weight: var(--fw-semibold);
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 0;
}

/* ==== Focus visible ==== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-heading-accent);
  outline-offset: 2px;
}

/* ==== Контейнер ==== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ==== Секції ==== */
.section {
  padding-block: calc(var(--gap-section) / 2);
}

.section + .section {
  border-top: 1px solid rgba(164, 164, 164, 0.08);
}

/* ==== Типографіка ==== */
h1, h2, h3, h4 {
  font-family: var(--font-primary);
  color: var(--color-heading-accent);
  font-weight: var(--fw-bold);
  line-height: 1.25;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-heavy);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: '';
  display: block;
  width: 64px;
  height: 3px;
  margin-top: 0.5rem;
  background: var(--color-heading-accent);
}

h3 {
  font-family: var(--font-decorative);
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  color: var(--color-white);
}

p {
  color: var(--color-text-body);
  font-weight: var(--fw-regular);
}

p + p,
p + ul,
p + ol,
ul + p,
.content-block > * + * {
  margin-top: var(--gap-paragraph);
}

h2 + p,
h2 + .content-section__intro {
  margin-top: var(--gap-h2-text);
}

h3 + p,
h3 + ul {
  margin-top: var(--gap-h3-text);
}

ul.list,
ol.list {
  color: var(--color-text-body);
  padding-left: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

ul.list {
  list-style: disc;
}

ol.list {
  list-style: decimal;
}

a.inline-link {
  color: var(--color-heading-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-base);
}

a.inline-link:hover {
  color: var(--color-white);
}

/* ==== Кнопки ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--color-btn-text);
  border-radius: var(--radius);
  clip-path: var(--clip-corner);
  transition: transform var(--transition-base), filter var(--transition-base);
  white-space: nowrap;
}

.btn:hover {
  filter: brightness(1.12);
}

.btn:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .btn:active {
    transform: none;
  }
}

.btn--primary {
  background: var(--gradient-btn-primary);
}

.btn--secondary {
  background: var(--gradient-btn-secondary);
}

.btn--block {
  width: 100%;
}

@media (min-width: 768px) {
  .btn--block {
    display: flex;
    width: auto;
    max-width: 280px;
    justify-self: center;
    margin-inline: auto;
  }
}

/* ==== Картки (базовий шаблон) ==== */
.card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  clip-path: var(--clip-corner);
  padding: var(--pad-card);
}

/* ==== Таблиці ==== */
.table-wrap {
  margin-top: var(--gap-paragraph);
  overflow-x: auto;
  background: var(--color-bg-dark);
  clip-path: var(--clip-corner);
}

.data-table {
  min-width: 480px;
}

.data-table caption {
  /* Заголовок таблиці дублює текст над блоком і створює зайвий візуальний шум —
     приховано на всіх сторінках, розмітка <caption> лишається для доступності. */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.data-table {
  table-layout: fixed;
  width: 100%;
}

.data-table th,
.data-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(164, 164, 164, 0.12);
  font-size: var(--fs-small);
}

.data-table th {
  color: var(--color-heading-accent);
  background: var(--color-cool-accent);
  font-weight: var(--fw-semibold);
}

.data-table td {
  color: var(--color-text-body);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Пропорційна ширина колонок для таблиць із рівно 3 стовпцями
   (виключаємо таблиці з 4+ колонками, щоб не стискати їх до 0) */
.data-table:has(th:nth-child(3)):not(:has(th:nth-child(4))) th:nth-child(1),
.data-table:has(th:nth-child(3)):not(:has(th:nth-child(4))) td:nth-child(1) {
  width: 22%;
}

.data-table:has(th:nth-child(3)):not(:has(th:nth-child(4))) th:nth-child(2),
.data-table:has(th:nth-child(3)):not(:has(th:nth-child(4))) td:nth-child(2) {
  width: 50%;
}

.data-table:has(th:nth-child(3)):not(:has(th:nth-child(4))) th:nth-child(3),
.data-table:has(th:nth-child(3)):not(:has(th:nth-child(4))) td:nth-child(3) {
  width: 28%;
}

/* ==== Content-section (H2 → картинка → текст → H3-структура) ==== */
.content-section__media {
  margin-top: var(--gap-h2-text);
  background: var(--color-bg-dark);
  clip-path: var(--clip-corner);
}

.content-section__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  max-height: 460px;
  margin-inline: auto;
}

/* На десктопі прибираємо контейнерну "рамку" — картинка лежить прямо на фоні сторінки */
@media (min-width: 768px) {
  .content-section__media {
    background: transparent;
    clip-path: none;
  }

  .content-section__media img {
    margin-block: 1.25rem;
  }
}

.content-section__intro {
  margin-top: var(--gap-h2-text);
}

.content-section__media + .content-section__intro {
  margin-top: var(--gap-paragraph);
}

.content-section__body > * + * {
  margin-top: var(--gap-paragraph);
}

.content-section__body h3 + * {
  margin-top: var(--gap-h3-text);
}

/* ==== Breadcrumb ==== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: var(--fs-small);
  color: var(--color-text-body);
}

.breadcrumb a {
  color: var(--color-text-body);
  transition: color var(--transition-base);
}

.breadcrumb a:hover {
  color: var(--color-heading-accent);
}

.breadcrumb__sep {
  color: var(--color-cool-accent);
}

.breadcrumb [aria-current="page"] {
  color: var(--color-heading-accent);
}

/* ==== Utility ==== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.mt-section {
  margin-top: var(--gap-section);
}

/* ==== Fade-in анімація для IntersectionObserver ==== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

