/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #f8f9fb;
  --color-surface: #ffffff;
  --color-primary: #1a5f4a;
  --color-primary-light: #e8f5f0;
  --color-accent: #c9a227;
  --color-text: #2c3e50;
  --color-text-muted: #5a6a7a;
  --color-border: #e2e8f0;
  --color-header: #ffffff;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 80px;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --transition: 0.2s ease;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  min-width: 0;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

ul, ol {
  padding-left: 1.25rem;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0 3rem;
}

@media (min-width: 1024px) {
  .page-layout {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }

  .page-layout--no-toc {
    grid-template-columns: 1fr;
  }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-header);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  height: var(--header-height);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.site-logo img {
  display: block;
  height: 56px;
  width: auto;
  max-width: min(320px, 70vw);
  object-fit: contain;
}

@media (min-width: 768px) {
  .site-logo img {
    height: 64px;
    max-width: 360px;
  }
}

.site-logo:hover img {
  opacity: 0.85;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.site-nav a:hover,
.site-nav a.is-active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text);
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.75rem 1rem;
  }
}

/* ===== TOC ===== */
.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

@media (min-width: 1024px) {
  .toc {
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    max-height: calc(100vh - var(--header-height) - 3rem);
    overflow-y: auto;
  }
}

.toc__title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.toc__list {
  list-style: none;
  padding: 0;
}

.toc__list li {
  margin-bottom: 0.25rem;
}

.toc__list a {
  display: block;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.toc__list a:hover,
.toc__list a.is-active {
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-left-color: var(--color-primary);
}

.toc__list--sub {
  padding-left: 0.75rem;
  margin-top: 0.125rem;
}

.toc__list--sub a {
  font-size: 0.8125rem;
}

/* ===== Main Content ===== */
.main-content {
  min-width: 0;
}

.intro {
  margin-bottom: 1.5rem;
}

.intro h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.25;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.intro p {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
}

.intro__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.intro__meta time {
  color: var(--color-primary);
  font-weight: 600;
}

/* ===== Widget ===== */
.widget-wrap {
  position: relative;
  margin-bottom: 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.widget-wrap.is-scrolling iframe {
  pointer-events: none;
}

#casino-widget-iframe {
  width: 100%;
  border: none;
  display: block;
  overflow: hidden;
}

/* ===== Article Sections ===== */
.article-section {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.article-section h2 {
  font-size: clamp(1.25rem, 3vw, 1.625rem);
  color: var(--color-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary-light);
}

.article-section h3 {
  font-size: 1.125rem;
  color: var(--color-text);
  margin: 1.5rem 0 0.75rem;
}

.article-section h4 {
  font-size: 1rem;
  color: var(--color-text);
  margin: 1.25rem 0 0.5rem;
}

.article-section p {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

.article-section p:last-child {
  margin-bottom: 0;
}

.article-section ul,
.article-section ol {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

.article-section li {
  margin-bottom: 0.375rem;
}

.article-image {
  border-radius: var(--radius);
  margin: 1.5rem 0;
  width: 100%;
  object-fit: cover;
  max-height: 400px;
}

/* ===== Tables ===== */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 280px;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--color-border);
}

th {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
  white-space: nowrap;
}

td {
  background: var(--color-surface);
  color: var(--color-text-muted);
}

tr:nth-child(even) td {
  background: var(--color-bg);
}

/* ===== Author Card ===== */
.author-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.author-card__photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--color-primary-light);
}

.author-card__info h3 {
  font-size: 1.0625rem;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.author-card__role {
  font-size: 0.8125rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.author-card__info p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.author-card__link {
  font-size: 0.875rem;
  font-weight: 600;
}

@media (max-width: 480px) {
  .author-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ===== FAQ ===== */
.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.faq-item p {
  margin: 0;
}

/* ===== Footer ===== */
.site-footer {
  background: #1e2d3d;
  color: #c8d4e0;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.site-footer a {
  color: #8ecdb0;
}

.site-footer a:hover {
  color: var(--color-accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.footer-col h3 {
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

.footer-col p,
.footer-col li {
  font-size: 0.875rem;
  line-height: 1.8;
  color: #a0b0c0;
}

.footer-nav {
  list-style: none;
  padding: 0;
}

.footer-nav li {
  margin-bottom: 0.375rem;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* ===== Contact Form ===== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-form label {
  font-size: 0.8125rem;
  color: #a0b0c0;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #3a4f63;
  border-radius: var(--radius);
  background: #2a3d50;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.contact-form textarea {
  resize: vertical;
  min-height: 80px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  font-family: inherit;
}

.btn:hover {
  background: #144a3a;
  color: #ffffff;
}

.form-message {
  font-size: 0.8125rem;
  padding: 0.5rem;
  border-radius: 4px;
  display: none;
}

.form-message.is-success {
  display: block;
  background: rgba(26, 95, 74, 0.2);
  color: #8ecdb0;
}

.form-message.is-error {
  display: block;
  background: rgba(200, 50, 50, 0.2);
  color: #f0a0a0;
}

.footer-bottom {
  border-top: 1px solid #3a4f63;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #7a8fa0;
}

.footer-disclaimer {
  border-top: 1px solid #3a4f63;
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.footer-disclaimer__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--color-accent);
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.footer-disclaimer p {
  font-size: 0.8125rem;
  color: #7a8fa0;
  max-width: 720px;
  line-height: 1.65;
  margin: 0;
}

.footer-disclaimer a {
  color: #8ecdb0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-bottom p {
  margin-bottom: 0.25rem;
}

/* ===== Cookie Banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding: 1.25rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-banner.is-visible {
  transform: translateY(0);
}

.cookie-banner__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .cookie-banner__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cookie-banner p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  flex: 1;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* ===== 404 Page ===== */
.error-page {
  text-align: center;
  padding: 4rem 1rem;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.error-page h1 {
  font-size: clamp(4rem, 15vw, 8rem);
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-page h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.error-page p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  max-width: 480px;
}

/* ===== Article Page (standalone) ===== */
.page-hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 2rem 0;
  margin-bottom: 0;
}

.page-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.page-hero .meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.article-body .article-section {
  box-shadow: none;
  border: none;
  padding: 0;
  margin-bottom: 2rem;
}

.article-body .article-section h2 {
  border-bottom: none;
  padding-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
