/*
Theme Name: Summit Players
Theme URI: https://summitplayers.com
Author: Summit Players
Description: Viral entertainment portal — tabloid card grid, FR homepage + geo subfolders.
Version: 1.9.0
License: GNU General Public License v2 or later
Text Domain: summit-players
Tags: news, blog, entertainment, grid, dark
*/

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --color-bg:         #ffffff;
  --color-text:       #111111;
  --color-text-inv:   #ffffff;
  --color-border:     #e0e0e0;
  --color-badge-bg:   #ffffff;
  --color-badge-text: #111111;
  --font-display: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-body:    'Barlow', Arial, sans-serif;
  --gap: 4px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; height: auto; }

/* Kill default list bullets EVERYWHERE */
ul, ol { list-style: none; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Logo */
.site-branding { padding-bottom: 16px; }
.site-logo img,
.site-logo-fallback img { height: 56px; width: auto; }
.site-logo-fallback {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #111;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.main-navigation {
  width: 100%;
  border-top: 1px solid var(--color-border);
}

/* Hide any stray heading WP might inject */
.main-navigation > h2,
.main-navigation > div > h2,
.main-navigation .menu-item > ul { display: none !important; }

/* The <ul> itself */
.main-navigation ul {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.main-navigation ul li {
  list-style: none !important;
}
.main-navigation ul li a {
  display: block;
  padding: 13px 18px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #111;
  white-space: nowrap;
  transition: color 0.15s;
}
.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item a,
.main-navigation ul li.current_page_item a { color: #666; }

/* ============================================================
   CATEGORIES BAR — полоса рубрик под хедером
   ============================================================ */
.categories-bar {
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  width: 100%;
}
.categories-bar__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}
.categories-bar__inner ul {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0;
}
.categories-bar__inner ul li {
  list-style: none !important;
}
.categories-bar__inner ul li a {
  display: block;
  padding: 9px 16px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #444;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
  border-bottom: 2px solid transparent;
}
.categories-bar__inner ul li a:hover,
.categories-bar__inner ul li.current-menu-item a,
.categories-bar__inner ul li.current_page_item a {
  color: #111;
  border-bottom-color: #111;
}

/* Mobile — горизонтальный скролл */
@media (max-width: 640px) {
  .categories-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .categories-bar::-webkit-scrollbar { display: none; }
  .categories-bar__inner ul {
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    width: max-content;
    min-width: 100%;
  }
  .categories-bar__inner ul li a {
    font-size: 11px;
    padding: 8px 12px;
  }
}

/* ============================================================
   MAIN / HOMEPAGE GRID
   ============================================================ */
.site-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 4px 4px 48px;
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  position: relative;
  overflow: hidden;
  background: #222;
  aspect-ratio: 4/3;
  display: block;
  text-decoration: none;
}
.card:hover .card__img { transform: scale(1.04); opacity: 0.82; }
.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, opacity 0.35s ease;
  opacity: 0.95;
}
.card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.88) 0%,
    rgba(0,0,0,0.28) 52%,
    rgba(0,0,0,0.00) 100%
  );
  pointer-events: none;
}
.card__body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 14px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.card__counter {
  position: absolute;
  top: 10px; left: 11px;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.04em;
}
.card__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
}
.card__badge {
  display: inline-block;
  background: #fff;
  color: #111;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 11px;
}

/* ============================================================
   ARCHIVE HEADER — заголовок страницы рубрики
   ============================================================ */
.archive-header {
  padding: 20px 4px 16px;
  border-bottom: 2px solid #111;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.archive-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
  white-space: nowrap;
}
.archive-heading {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #111;
  line-height: 1;
}

/* ============================================================
   ARCHIVE / CATEGORY PAGE
   ============================================================ */
.content-area {
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}
.content-area.no-sidebar { grid-template-columns: 1fr; }

.archive-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #111;
}
.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.post-hero {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover; margin-bottom: 24px;
}
.post-header { margin-bottom: 20px; }
.post-category-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid #111;
  padding: 3px 10px; margin-bottom: 12px;
}
.post-title {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 900;
  line-height: 1.12; text-transform: uppercase;
  letter-spacing: 0.01em; margin-bottom: 12px;
}
.post-meta { font-size: 12px; color: #888; letter-spacing: 0.05em; }
.post-content { font-size: 16px; line-height: 1.78; color: #222; }
.post-content p { margin-bottom: 1.3em; }
.post-content h2 {
  font-family: var(--font-display);
  font-size: 23px; font-weight: 800;
  text-transform: uppercase; margin: 2em 0 0.7em;
}
.post-content h3 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  text-transform: uppercase; margin: 1.5em 0 0.6em;
}

/* ============================================================
   POST CONTENT — TABLES
   Gutenberg wraps tables in figure.wp-block-table — target both
   ============================================================ */

/* Make the figure wrapper scrollable on mobile */
.post-content figure.wp-block-table,
.post-content .table-wrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  margin: 2em 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}

.post-content figure.wp-block-table table,
.post-content .table-wrap table,
.post-content table {
  width: 100% !important;
  min-width: 480px;
  border-collapse: collapse !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  border: none !important;
}

/* thead */
.post-content figure.wp-block-table thead,
.post-content table thead {
  background: #111 !important;
  color: #fff !important;
}
.post-content figure.wp-block-table thead th,
.post-content table thead th {
  font-family: var(--font-display) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  padding: 12px 14px !important;
  text-align: left !important;
  border: none !important;
  color: #fff !important;
  background: #111 !important;
}

/* tbody rows */
.post-content figure.wp-block-table tbody tr,
.post-content table tbody tr {
  border-bottom: 1px solid #e8e8e8 !important;
  transition: background 0.12s;
}
.post-content figure.wp-block-table tbody tr:nth-child(even),
.post-content table tbody tr:nth-child(even) {
  background: #f7f7f7 !important;
}
.post-content figure.wp-block-table tbody tr:hover,
.post-content table tbody tr:hover {
  background: #f0f0f0 !important;
}

/* tbody cells */
.post-content figure.wp-block-table tbody td,
.post-content figure.wp-block-table tbody th,
.post-content table tbody td,
.post-content table tbody th {
  padding: 11px 14px !important;
  color: #222 !important;
  vertical-align: top !important;
  border: none !important;
  border-bottom: 1px solid #e8e8e8 !important;
  background: none;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

/* First column accent */
.post-content figure.wp-block-table tbody td:first-child,
.post-content table tbody td:first-child {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: #111 !important;
  border-left: 3px solid #111 !important;
}

/* Gutenberg table figcaption */
.post-content figure.wp-block-table figcaption {
  font-size: 12px !important;
  color: #888 !important;
  text-align: center;
  padding: 6px 0 0;
  font-style: italic;
}

/* ============================================================
   POST CONTENT — LISTS
   Gutenberg outputs ul.wp-block-list — target both
   ============================================================ */
.post-content ul,
.post-content ul.wp-block-list,
.post-content ol,
.post-content ol.wp-block-list {
  list-style: none !important;
  margin: 1.4em 0 1.8em !important;
  padding: 0 !important;
}

/* UL — black square marker */
.post-content ul li,
.post-content ul.wp-block-list li {
  position: relative !important;
  padding: 7px 0 7px 22px !important;
  color: #222 !important;
  border-bottom: 1px solid #f0f0f0 !important;
  line-height: 1.65 !important;
  list-style: none !important;
}
.post-content ul li::before,
.post-content ul.wp-block-list li::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 15px !important;
  width: 7px !important;
  height: 7px !important;
  background: #111 !important;
}
.post-content ul li:last-child,
.post-content ul.wp-block-list li:last-child {
  border-bottom: none !important;
}

/* OL — black numbered square */
.post-content ol,
.post-content ol.wp-block-list {
  counter-reset: sp-counter !important;
}
.post-content ol li,
.post-content ol.wp-block-list li {
  position: relative !important;
  padding: 8px 0 8px 38px !important;
  counter-increment: sp-counter !important;
  color: #222 !important;
  border-bottom: 1px solid #f0f0f0 !important;
  line-height: 1.65 !important;
  list-style: none !important;
}
.post-content ol li::before,
.post-content ol.wp-block-list li::before {
  content: counter(sp-counter) !important;
  position: absolute !important;
  left: 0 !important;
  top: 9px !important;
  width: 24px !important;
  height: 24px !important;
  background: #111 !important;
  color: #fff !important;
  font-family: var(--font-display) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  letter-spacing: 0 !important;
}
.post-content ol li:last-child,
.post-content ol.wp-block-list li:last-child {
  border-bottom: none !important;
}

/* Bold lead word (Identifiez, Analysez…) */
.post-content ul li strong,
.post-content ol li strong,
.post-content ul.wp-block-list li strong,
.post-content ol.wp-block-list li strong {
  font-family: var(--font-display) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: #111 !important;
  display: block !important;
  margin-bottom: 2px !important;
}

/* ============================================================
   POST CONTENT — BLOCKQUOTE
   Gutenberg: .wp-block-quote
   ============================================================ */
.post-content blockquote,
.post-content .wp-block-quote {
  margin: 2em 0 !important;
  padding: 18px 20px 18px 24px !important;
  border-left: 4px solid #111 !important;
  background: #f7f7f7 !important;
  font-family: var(--font-display) !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  color: #111 !important;
  letter-spacing: 0.01em !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
}
.post-content blockquote p,
.post-content .wp-block-quote p {
  margin: 0 !important;
  color: #111 !important;
}
.post-content blockquote cite,
.post-content .wp-block-quote cite {
  display: block !important;
  margin-top: 8px !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  color: #888 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  font-style: normal !important;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; justify-content: center;
  gap: 6px; padding: 32px 0;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  border: 1px solid #ddd; color: #111;
  transition: background 0.15s, color 0.15s;
}
.pagination .current, .pagination a:hover {
  background: #111; color: #fff; border-color: #111;
}

/* ============================================================
   WIDGET / SIDEBAR
   ============================================================ */
.widget { margin-bottom: 32px; }
.widget-title {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  border-bottom: 2px solid #111;
  padding-bottom: 8px; margin-bottom: 16px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #111;
  color: #bbb;
  padding: 40px 20px 32px;
  font-family: var(--font-display);
}
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

/* Logo в футере — инвертируем если нужно */
.footer-logo img { height: 44px; width: auto; filter: brightness(0) invert(1); opacity: 0.7; }
.footer-logo a { color: #bbb; font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* Footer nav — горизонтальный список */
.footer-menu {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.footer-menu li { list-style: none !important; }
.footer-menu li a {
  display: block;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #bbb;
  transition: color 0.15s;
}
.footer-menu li a:hover { color: #fff; }

/* Separator dots between footer links */
.footer-menu li + li a { border-left: 1px solid #333; }

/* Copyright */
.footer-copy {
  font-size: 12px;
  color: #666;
  letter-spacing: 0.08em;
}

/* ============================================================
   RESPONSIVE — TABLET (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .content-area { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {

  /* Header compact */
  .header-inner { padding: 14px 12px 0; }
  .site-branding { padding-bottom: 10px; }
  .site-logo img { height: 42px; }

  /* Nav: горизонтальный скролл, без переноса */
  .main-navigation {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-navigation::-webkit-scrollbar { display: none; }
  .main-navigation ul {
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: visible;
    width: max-content;
    min-width: 100%;
  }
  .main-navigation ul li a {
    font-size: 12px;
    padding: 11px 13px;
    white-space: nowrap;
  }

  /* GRID: 2 колонки */
  .posts-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3px;
  }

  /* Первая карточка — полная ширина */
  .posts-grid .card:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 16/9;
  }
  .posts-grid .card:first-child .card__title { font-size: 18px; }

  /* Остальные карточки */
  .card { aspect-ratio: 3/2; }
  .card__title { font-size: 12px; line-height: 1.15; }
  .card__badge { font-size: 9px; padding: 2px 8px; }
  .card__body { padding: 8px 8px 9px; gap: 5px; }

  /* Archive на мобиле: 2 col */
  .archive-grid { grid-template-columns: 1fr 1fr; gap: 3px; }

  /* Single */
  .post-title { font-size: 26px; }

  /* Tables on mobile — force horizontal scroll */
  .post-content figure.wp-block-table,
  .post-content .table-wrap {
    overflow-x: auto !important;
    display: block !important;
  }
  .post-content figure.wp-block-table table,
  .post-content table {
    min-width: 420px !important;
    font-size: 12px !important;
  }
  .post-content figure.wp-block-table thead th,
  .post-content table thead th {
    font-size: 10px !important;
    padding: 9px 10px !important;
  }
  .post-content figure.wp-block-table tbody td,
  .post-content table tbody td {
    padding: 9px 10px !important;
    font-size: 12px !important;
  }
  .post-content figure.wp-block-table tbody td:first-child,
  .post-content table tbody td:first-child {
    font-size: 11px !important;
  }

  /* Lists on mobile */
  .post-content ul li,
  .post-content ul.wp-block-list li {
    padding: 8px 0 8px 20px !important;
  }
  .post-content ol li,
  .post-content ol.wp-block-list li {
    padding: 8px 0 8px 34px !important;
  }

  /* Footer */
  .footer-inner { gap: 16px; padding: 0; }
  .footer-menu li a { font-size: 12px; padding: 5px 10px; }
  .footer-copy { font-size: 11px; }
}
