/* =========================================================
   Golden Play Portugal — Global Styles
   Mobile-first. BEM. Только переменные из tokens.css.
   ========================================================= */

/* ── Base ──────────────────────────────────────────────── */
body {
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
}

main {
  display: block;
  padding-bottom: var(--main-bottom-padding);
}

/* ── Skip link ─────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  background: var(--color-accent-gold);
  color: var(--color-text-on-gold);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-btn);
  font-weight: var(--fw-semibold);
  z-index: 999;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1rem;
}

/* ── Focus visible ─────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--color-accent-gold);
  outline-offset: 2px;
}

/* ── Container ─────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-side-padding);
}

/* ── Section rhythm ────────────────────────────────────── */
.section {
  padding-block: var(--space-section);
}

.section--tight {
  padding-block-start: 0;
}

/* ── Headings ──────────────────────────────────────────── */
h1 {
  font-family: var(--font-primary);
  font-size: var(--fs-h1-hero);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-hero);
  color: var(--color-white);
}

h2 {
  font-family: var(--font-primary);
  font-size: var(--fs-h2);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-h2);
  text-transform: uppercase;
  color: var(--color-heading-gold);
  margin-bottom: var(--space-h2-text);
  letter-spacing: 0.01em;
}

h3 {
  font-family: var(--font-primary);
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  color: var(--color-accent-gold);
  margin-bottom: var(--space-h3-text);
}

p {
  margin-bottom: var(--space-paragraph);
  color: var(--color-text-primary);
}

p:last-child {
  margin-bottom: 0;
}

a.inline-link {
  color: var(--color-accent-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

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

/* ── Lists inside content ─────────────────────────────────*/
.content-list {
  margin-bottom: var(--space-paragraph);
  padding-left: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.content-list li {
  list-style: disc;
  color: var(--color-text-primary);
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: var(--radius-btn);
  font-weight: var(--fw-semibold);
  font-size: 0.9375rem;
  line-height: 1;
  transition: background var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.btn--gold {
  background: var(--color-accent-gold);
  color: var(--color-text-on-gold);
}

.btn--gold:hover,
.btn--gold:focus-visible {
  background: #e0bb52;
}

.btn--green {
  background: var(--color-secondary-green);
  color: var(--color-text-on-green);
}

.btn--green:hover,
.btn--green:focus-visible {
  background: var(--color-secondary-green-hover);
}

.btn--neutral {
  background: var(--color-neutral-btn);
  color: var(--color-white);
}

.btn--neutral:hover,
.btn--neutral:focus-visible {
  background: #3d3f45;
}

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

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

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

.breadcrumb a {
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

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

.breadcrumb__current {
  color: var(--color-accent-gold);
}

/* ── Content section (repeatable H2 block) ────────────────*/
.content-section {
  padding-block: var(--space-section);
  border-top: 1px solid var(--color-border);
}

.content-section__layout {
  display: grid;
  gap: 1.75rem;
}

/* Prevent wide content (e.g. a table cell forced to white-space: nowrap)
   inside .content-section__body from inflating the shared implicit grid
   track — and, with it, the sibling .content-section__image — beyond the
   visible container width. Grid items default to min-width: auto (sized
   to their content's max-content width) unless overridden. */
.content-section__layout > * {
  min-width: 0;
}

/* Картинка всегда идёт сразу после H2, перед текстом — на всех разрешениях. */
.content-section__image {
  border-radius: var(--radius-card);
  overflow: hidden;
  width: 100%;
  max-width: 56.25rem; /* 900px on mobile/tablet — картинка отображается полностью, без обрезания */
  margin: 0 auto 1.5rem;
}

.content-section__image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Desktop: image stretches to the full width of the content container,
   matching headings and tables, instead of being capped at 900px. */
@media (min-width: 769px) {
  .content-section__image {
    max-width: 100%;
    margin: 32px 0;
  }
}

.content-section__body h3 {
  margin-top: var(--space-paragraph);
}

.content-section__cta {
  margin-top: 1.75rem;
}

/* ── Mid-content CTA (standalone, between paragraphs) ─────*/
.mid-content-cta {
  display: flex;
  justify-content: center;
  margin-block: 2rem;
}

/* ── Characteristics table ────────────────────────────────*/
.info-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-btn);
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.info-table {
  width: 100%;
  min-width: 600px;
  background: var(--color-surface);
  border-radius: var(--radius-btn);
  overflow: hidden;
}

/* Desktop: table width matches the surrounding text block exactly
   (same width as the paragraphs in .content-section__body), so it lines
   up with the rest of the content instead of leaving empty side margins.
   Mobile (below 769px) is untouched — .info-table-wrap still scrolls
   horizontally there via overflow-x: auto. */
@media (min-width: 769px) {
  .info-table-wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .info-table {
    max-width: 100%;
    table-layout: auto;
  }
}

.info-table caption {
  text-align: left;
  color: var(--color-heading-gold);
  font-weight: var(--fw-semibold);
  padding: 0.75rem 0;
}

.info-table th,
.info-table td {
  text-align: left;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
  white-space: nowrap;
}

/* Compact 2-column spec tables inside App-page platform cards: fit the
   card's fixed width instead of forcing horizontal scroll — narrow the
   label column and let the value column wrap normally. */
.two-col__card .info-table {
  table-layout: fixed;
  min-width: 0;
}

.two-col__card .info-table th {
  width: 42%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

.two-col__card .info-table td {
  width: 58%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

.info-table thead th {
  background: var(--color-bg-dark);
  color: var(--color-accent-gold);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  font-size: var(--fs-small);
  letter-spacing: 0.03em;
}

.info-table tbody tr:last-child th,
.info-table tbody tr:last-child td {
  border-bottom: none;
}

.info-table tbody th {
  color: var(--color-white);
  font-weight: var(--fw-medium);
  background: rgba(255, 255, 255, 0.02);
}

/* ── Generic cards grid ───────────────────────────────────*/
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-card-gap);
}

.cards-grid--4 {
  grid-template-columns: 1fr;
}

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

  .cards-grid--4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── Bonus card ────────────────────────────────────────────*/
.bonus-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: var(--space-card-padding);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bonus-card__image {
  border-radius: calc(var(--radius-card) - 0.6rem);
  overflow: hidden;
  width: 100%;
}

.bonus-card__image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.bonus-card__title {
  color: var(--color-heading-gold);
  font-size: 1.0625rem;
}

.bonus-card__text {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  flex-grow: 1;
}

/* ── Two-column block (Android/iOS style) ─────────────────*/
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-card-gap);
}

@media (min-width: 768px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.two-col__card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: var(--space-card-padding);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.two-col__icon {
  width: 3rem;
  height: 3rem;
}

.two-col__title {
  font-size: 1.125rem;
  color: var(--color-heading-gold);
  font-weight: var(--fw-semibold);
}

/* ── Rating text (hero) ───────────────────────────────────*/
.rating {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--color-border);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  color: var(--color-white);
  margin-bottom: 1rem;
}

.rating__stars {
  color: var(--color-accent-gold);
  letter-spacing: 0.05em;
}

/* ── Section badge/eyebrow ────────────────────────────────*/
.eyebrow {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

/* ── Fade-in animation (opt-in via JS) ────────────────────*/
.is-observed {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

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

.text-muted {
  color: var(--color-text-muted);
}

@media (max-width: 767px) {
  .content-section__image {
    order: -1;
  }
}

/* ── 404 page ──────────────────────────────────────────── */
.error-404 {
  min-height: 60dvh;
  display: flex;
  align-items: center;
}

.error-404__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-block: var(--space-section);
  max-width: 40rem;
}

.error-404__code {
  font-family: var(--font-logo);
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: var(--fw-bold);
  color: var(--color-accent-gold);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-404__title {
  margin-bottom: 1rem;
}

.error-404__text {
  color: var(--color-text-muted);
  margin-bottom: 1.75rem;
}
