/* TablePress base */
.tablepress { border-collapse: collapse; border-spacing: 0; }
.tablepress thead th { border: 1px solid #ddd; }
.tablepress tbody td { border: 1px solid #ddd; }

/**
 * Playdoit Affiliate — Стили по референсу igaming
 * BEM-подобная методология, mobile-first
 * Не изменяет существующие классы, только дополняет/переопределяет
 */

/* ========== CSS Variables ========== */
:root {
  --pd-bp-min: 300px;
  --pd-red: #e71018;
  --pd-red-bright: #e7000b;
  --pd-dark: #333333;
  --pd-dark-nav: #2d2d2d;
  --pd-gray-light: #f5f5f5;
  --pd-gray-bg: #f1f0f1;
  --pd-gray-text: #757575;
  --pd-gray-text-light: #999999;
  --pd-gray-text-muted: #b0b0b0;
  --pd-white: #ffffff;
  --pd-black: #010400;
  --pd-green: #459418;
  --pd-border: #e0e0e0;
  --pd-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --pd-font-sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pd-transition: 0.2s ease;
}

/* ========== Base typography & body ========== */
html {
  min-width: var(--pd-bp-min);
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--pd-font-sans);
  font-size: clamp(0.875rem, 2.5vw, 1.0625rem);
  line-height: 1.6;
  color: var(--pd-dark);
  background-color: var(--pd-gray-bg);
  -webkit-font-smoothing: antialiased;
  min-width: var(--pd-bp-min);
  overflow-x: hidden;
}

#page.site {
  overflow: visible !important;
}

/* ========== Header — красная полоса по референсу ========== */
.site-header {
  background-color: var(--pd-red-bright);
  color: var(--pd-white);
  min-height: 56px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* .site-header-inner flex layout is defined in nav-menu.css as single source of truth */

.site-header .site-branding {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.site-header .hamburger {
  flex-shrink: 0;
}

.site-header .header-html-1,
.site-header .header-html-2 {
  flex-shrink: 0;
}

.site-header .header-html-1 .btn,
.site-header .header-html-2 .btn {
  font-family: var(--pd-font-sans);
  font-weight: 600;
  font-size: clamp(0.625rem, 2.2vw, 0.9375rem);
  padding: clamp(0.2rem, 0.8vw, 0.5rem) clamp(0.35rem, 1.5vw, 1rem);
  border-radius: 4px;
  transition: opacity var(--pd-transition);
}

.site-header .header-html-1 .btn {
  background-color: var(--pd-green) !important;
  color: var(--pd-white) !important;
  border: 1px solid var(--pd-white);
}

.site-header .header-html-2 .btn {
  background-color: var(--pd-black) !important;
  color: var(--pd-white) !important;
  border: 1px solid var(--pd-white);
}

.site-logotype img {
  width: auto;
  height: auto;
  max-width: clamp(90px, 30vw, 275px);
  max-height: clamp(28px, 9vw, 50px);
  object-fit: contain;
}

/* ========== Main Navigation — тёмно-серый подменю ========== */
.main-navigation.fixed,
.footer-navigation.fixed {
  background-color: var(--pd-dark-nav);
}

.main-navigation ul li > a,
.footer-navigation ul li > a {
  font-weight: 500;
}

/* ========== Content area ========== */
#content.fixed,
#content.site-content,
.site-content-inner {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
  padding-left: clamp(0.75rem, 3vw, 2rem);
  padding-right: clamp(0.75rem, 3vw, 2rem);
}

/* #primary (ID) beats theme's .sidebar-none .content-area specificity */
#primary.content-area,
.content-area {
  box-sizing: border-box;
  padding: clamp(0.75rem, 3vw, 2rem);
  background-color: var(--pd-white);
  border-radius: 0;
  box-shadow: var(--pd-shadow);
}

/* ========== Article typography ========== */
.article-post h1 {
  font-size: clamp(1.125rem, 4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--pd-dark);
}

.article-post h2 {
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--pd-red);
  color: var(--pd-dark);
}

.article-post h3 {
  font-size: clamp(0.9375rem, 2.8vw, 1.125rem);
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--pd-dark);
}

.article-post p {
  margin-bottom: 1rem;
  color: var(--pd-dark);
}

/* Prevent content overflow; ensure text wraps within container */
.article-post {
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

.article-post ul,
.article-post ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-post li {
  margin-bottom: 0.5rem;
}

.article-post img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 1rem 0;
  object-fit: contain;
}

/* ========== TOC ========== */
#toc_container {
  background-color: var(--pd-white) !important;
  border: 1px solid var(--pd-border) !important;
  border-radius: 4px;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--pd-shadow);
  /* toc.css uses display:table; width:auto — can overflow viewport; constrain */
  max-width: 100%;
  overflow-wrap: break-word;
}

#toc_container .toc_title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--pd-dark);
}

#toc_container .toc_list a {
  color: var(--pd-dark);
  text-decoration: none;
  transition: color var(--pd-transition);
}

#toc_container .toc_list a:hover {
  color: var(--pd-red);
}

#toc_container .toc_list ul {
  margin-top: 0.25rem;
  margin-left: 1rem;
}

/* ========== Table ========== */
/* Tables in article (with or without tablepress class) */
.article-post table,
.content-area table {
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border-collapse: collapse;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--pd-shadow);
  table-layout: auto;
  box-sizing: border-box;
  width: max-content;
  min-width: 100%;
}

.article-post table thead th,
.article-post table tbody td,
.content-area table thead th,
.content-area table tbody td {
  border: 1px solid #ddd;
}

.article-post table thead th,
.content-area table thead th {
  background-color: var(--pd-dark-nav) !important;
  color: var(--pd-white) !important;
  font-weight: 600;
  padding: 0.75rem 1rem !important;
}

.article-post table tbody td,
.content-area table tbody td {
  padding: 0.65rem 1rem !important;
}

.article-post table tbody tr:nth-child(odd) > *,
.content-area table tbody tr:nth-child(odd) > * {
  background-color: #ffffff !important;
  color: var(--pd-black) !important;
}

.article-post table tbody tr:nth-child(even) > *,
.content-area table tbody tr:nth-child(even) > * {
  background-color: #f5f5f5 !important;
  color: var(--pd-black) !important;
}

.article-post table tbody tr:hover > *,
.content-area table tbody tr:hover > * {
  background-color: #ebebeb !important;
  color: var(--pd-black) !important;
}

.article-post table a,
.content-area table a {
  color: var(--pd-green);
}

.article-post table a:hover,
.content-area table a:hover {
  color: var(--pd-red);
}

/* TablePress legacy (if still used) */
.content-area .tablepress,
.article-post .tablepress {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.tablepress {
  font-size: 0.9rem;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--pd-shadow);
  table-layout: auto;
  box-sizing: border-box;
  width: max-content;
  min-width: 100%;
}

.tablepress thead th,
.tablepress tbody td {
  /* Text does not wrap; table scrolls horizontally via .table-wrapper */
}

.tablepress thead th {
  background-color: var(--pd-dark-nav) !important;
  color: var(--pd-white) !important;
  font-weight: 600;
  padding: 0.75rem 1rem !important;
}

/* 2-column tables: Atributo ~35%, Detalles ~65% */
.tablepress-id-1 .column-1,
.tablepress-id-4 .column-1,
.tablepress-id-1 thead th:first-child,
.tablepress-id-1 tbody td:first-child,
.tablepress-id-4 thead th:first-child,
.tablepress-id-4 tbody td:first-child {
  width: 35%;
}

.tablepress-id-1 .column-2,
.tablepress-id-4 .column-2,
.tablepress-id-1 thead th:last-child,
.tablepress-id-1 tbody td:last-child,
.tablepress-id-4 thead th:last-child,
.tablepress-id-4 tbody td:last-child {
  width: 65%;
}

/* Scroll wrapper for wide multi-column tables */
.table-wrap,
.tablepress-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: 4px;
  box-shadow: var(--pd-shadow);
}

.table-wrap table,
.tablepress-wrap .tablepress {
  box-shadow: none;
  margin: 0 !important;
}

/* Multi-column tables (bonos): auto layout */
.tablepress-id-3 {
  table-layout: auto;
  min-width: 300px;
}

.tablepress tbody td {
  padding: 0.65rem 1rem !important;
}

/* Override cell-level striping from tablepress-combined.min.css */
.tablepress > tbody.row-striping > tr:nth-child(odd) > * {
  background-color: #ffffff !important;
  color: var(--pd-black) !important;
}

.tablepress > tbody.row-striping > tr:nth-child(even) > * {
  background-color: #f5f5f5 !important;
  color: var(--pd-black) !important;
}

.tablepress > .row-hover > tr:hover > *,
.tablepress > tbody.row-hover > tr:hover > * {
  background-color: #ebebeb !important;
  color: var(--pd-black) !important;
}

.tablepress a {
  color: var(--pd-green);
}

.tablepress a:hover {
  color: var(--pd-red);
}

/* ========== Links in content ========== */
.article-post a,
.entry-content a {
  color: var(--pd-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-post a:hover,
.entry-content a:hover {
  color: var(--pd-red);
}

/* ========== Footer — светлый по референсу ========== */
.site-footer-container {
  margin-top: 2rem;
}

.site-footer,
.site-footer.site-footer--style-gray {
  background-color: var(--pd-gray-light) !important;
  color: var(--pd-dark);
  padding: 2rem 1rem 1rem;
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.footer-navigation {
  background-color: var(--pd-gray-light) !important;
  color: var(--pd-dark) !important;
  padding: 1rem;
}

.footer-navigation ul li a {
  color: var(--pd-dark) !important;
}

.footer-navigation ul li a:hover {
  color: var(--pd-red) !important;
}

.footer-bottom {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pd-border);
}

.footer-info {
  font-size: 0.75rem;
  color: var(--pd-gray-text-light);
  line-height: 1.5;
  max-width: 600px;
  text-align: center;
}

/* ========== Buttons ========== */
.btn,
.btn-primary {
  font-family: var(--pd-font-sans);
  font-weight: 600;
  border-radius: 4px;
  transition: opacity var(--pd-transition), transform 0.1s ease;
}

.btn:hover,
.btn:focus {
  opacity: 0.9;
}

/* ========== Scroll to top ========== */
.scrolltop:before {
  color: var(--pd-red) !important;
}

/* ========== Utility: accessibility ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== FAQ accordion ========== */
/* Semantic FAQ: section#faq with h2, h3, p */
#faq {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

#faq > h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--pd-red);
}

#faq > h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--pd-border);
}

#faq > h3::after {
  content: "";
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--pd-dark);
  transition: transform var(--pd-transition);
}

#faq > h3[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

#faq > h3:last-of-type {
  border-bottom: none;
}

#faq > h3 + p {
  display: none;
  padding-bottom: 1rem;
  margin: 0 0 0.5rem;
}

#faq > h3 + p.is-expanded {
  display: block;
}

/* Legacy: faq-container (bonos, etc.) */
.faq-container {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.faq-container > h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--pd-red);
}

.faq-item {
  border-bottom: 1px solid var(--pd-border);
}

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

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.faq-question h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.faq-arrow {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--pd-dark);
  transition: transform var(--pd-transition);
}

.faq-question[aria-expanded="true"] .faq-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding-bottom: 1rem;
}

.faq-answer.is-expanded {
  display: block;
}

.faq-answer p {
  margin: 0 0 0.5rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Legacy: expert-review-faq (if still used elsewhere) */
.expert-review-faq-item__answer {
  display: none;
}

.expert-review-faq-item__answer.is-expanded {
  display: block;
}

/* ========== Pseudo clearfy links ========== */
.pseudo-clearfy-link { color: #008acf; cursor: pointer; }
.pseudo-clearfy-link:hover { text-decoration: none; }

/* ========== TOC list bullets ========== */
ul.toc_list li::before {
  position: initial !important;
  display: inline-block;
  margin-right: 0.5em;
}

/* ========== Print ========== */
@media print {
  .site-header,
  .main-navigation,
  .footer-navigation,
  .scrolltop,
  .hamburger {
    display: none !important;
  }

  body {
    background: white;
  }

  .content-area {
    box-shadow: none;
  }
}
