:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --card: #f5f5f5;
  --border: #e5e5e5;
  --accent: #00c853;
}

body.dark {
  --bg: #0f1115;
  --text: #f2f2f2;
  --muted: #aaaaaa;
  --card: #181b22;
  --border: #2a2e38;
  --accent: #00e676;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.author-profile {
  padding: 24px 0 8px;
}

.author-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.author-card img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.author-copy h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
}

.author-title {
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 10px;
}

@media (max-width: 640px) {
  .author-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-copy {
    text-align: center !important;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(1180px, 92%);
  margin: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  white-space: nowrap;
  line-height: 1.2;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  overflow: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

/* When a dropdown is open, let it escape the nav's scroll container
   (the absolutely-positioned dropdown would otherwise be clipped by
   overflow:auto and appear "unclickable" / invisible). */
.nav:has(.nav-group.open) {
  overflow: visible;
}

.nav a {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0.95;
  padding: 8px 4px;
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-actions select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
}

/* Hide mobile search form on desktop by default */
.search-form-mobile {
  display: none !important;
}

/* Search form in header */
.search-form {
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px 0 0 8px;
  font-size: 14px;
  width: 180px;
  transition: border-color 0.15s ease, width 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  width: 220px;
}

.search-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.search-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-left: none;
  background: var(--card);
  color: var(--text);
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.search-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

[dir="rtl"] .search-input {
  border-radius: 0 8px 8px 0;
}

[dir="rtl"] .search-btn {
  border-left: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
}

/* Dark mode toggle */
.theme-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 4px;
}

.theme-toggle-wrap .toggle-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #4b5563;
  border-radius: 999px;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

body.dark .toggle-switch {
  background: #10b981;
}

body.dark .toggle-switch::after {
  transform: translateX(20px);
  background: #1f2937;
}

.theme-toggle-wrap:hover .toggle-switch {
  opacity: 0.85;
}

[dir="rtl"] .toggle-switch::after {
  left: auto;
  right: 2px;
}

[dir="rtl"] body.dark .toggle-switch::after {
  transform: translateX(-20px);
}

.hero {
  padding: 34px 0 20px;
  content-visibility: auto;
  contain-intrinsic-size: 1px 280px;
}

.hero h1 {
  font-size: clamp(42px, 7vw, 82px);
  margin: 0;
  letter-spacing: -3px;
  line-height: 0.95;
}

.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 900px;
  line-height: 1.6;
}

.category-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.category-pills a {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 20px;
  font-weight: 700;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.category-pills a:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  min-height: 420px;
}

.main-feed {
  width: 100%;
}

.main-feed h2 {
  margin: 0 0 18px;
  font-size: 22px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 1px 420px;
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #ddd;
}

.article-image-wrap {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 18px 0 24px;
  overflow: hidden;
  border-radius: 12px;
  background: #ddd;
}

.article-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.card-body {
  padding: 16px;
}

.card h3 {
  font-size: 22px;
  margin: 0 0 10px;
  line-height: 1.2;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.ad-slot {
  border: 1px dashed var(--border);
  color: var(--muted);
  min-height: 90px;
  display: grid;
  place-items: center;
  margin: 18px auto;
  width: min(1180px, 92%);
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  contain-intrinsic-size: 1px 120px;
}

.ad-slot.top-ad {
  max-width: 728px;
  width: 100%;
  min-height: 120px;
}

.ad-slot.footer-ad {
  max-width: 728px;
  width: 100%;
}

.article-page {
  max-width: 850px;
  padding-top: 35px;
}

.article-page h1 {
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -2px;
  line-height: 1.05;
}

.article-meta {
  color: var(--muted);
  margin-bottom: 15px;
}

.language-links {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.language-links a {
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
}

.article-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  margin: 20px 0;
  border-radius: 12px;
}

.article-content {
  font-size: 20px;
  line-height: 1.75;
}

.opinion-box {
  margin-top: 30px;
  padding: 20px;
  border-left: 5px solid var(--accent);
  background: var(--card);
  border-radius: 10px;
}

/* "Read Also" — single compact related article card */
.read-also {
  max-width: 850px;
  margin-top: 40px;
}

.read-also h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.read-also-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.read-also-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.read-also-item img {
  width: 110px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--border);
}

.read-also-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .read-also-item {
    max-width: 100%;
    width: 100%;
  }
}


body[dir="rtl"] .opinion-box {
  border-left: none;
  border-right: 5px solid var(--accent);
}

.comments {
  max-width: 850px;
  margin-top: 40px;
}

.comment {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.comment-form {
  display: grid;
  gap: 12px;
  margin-top: 25px;
}

input,
textarea,
select,
button {
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

button {
  background: var(--accent);
  color: #000;
  font-weight: 900;
  cursor: pointer;
  border: none;
}

.site-footer {
  margin-top: 60px;
  padding: 30px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.footer-legal-links a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.footer-legal-links a:hover {
  text-decoration: underline;
}

.footer-copyright {
  text-align: center;
  margin: 0;
  font-size: 14px;
  width: 100%;
  display: block;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.admin-login form {
  width: 360px;
  display: grid;
  gap: 12px;
}

.error {
  color: red;
}

.admin-wrap {
  width: min(1200px, 94%);
  margin: 30px auto;
}

.admin-nav {
  display: flex;
  gap: 15px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stats-grid div {
  background: var(--card);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border: 1px solid var(--border);
  padding: 10px;
  vertical-align: top;
}

.comment-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 24px;
}

.comment-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.comment-item h4 {
  margin: 0 0 6px;
}

.comment-item small {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 850px) {
  .nav {
    display: none;
  }

  .grid-layout {
    grid-template-columns: 1fr;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px;
  }

  /* Logo: row 1, col 1 (takes full available space) */
  .header-inner .logo {
    align-self: center;
  }

  /* Header-actions (language + dark mode): row 1, col 2 (right side) */
  .header-actions {
    justify-self: end;
    align-self: center;
  }

  /* Hide desktop search form on mobile */
  .search-form-desktop {
    display: none !important;
  }

  /* Mobile search form: row 2, spans all columns */
  .search-form-mobile {
    display: flex !important;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .search-form-mobile .search-input {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  .theme-toggle-wrap .toggle-label {
    display: none;
  }

  .hero {
    padding-top: 28px;
  }

  .hero p {
    font-size: 16px;
  }

  .site-footer .container {
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .footer-legal-links {
    justify-content: center;
  }

  .footer-copyright {
    text-align: center;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .ad-slot {
    min-height: 60px;
    margin: 12px auto;
  }

  .card h3 {
    font-size: 20px;
  }

  .article-content {
    font-size: 18px;
  }
}

/* Pagination */
.pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 24px 0;
  margin-top: 8px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.page-link:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.page-link.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.page-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  color: var(--muted);
  font-size: 14px;
}

/* ============================================================
   Playsgoal football components
   ============================================================ */

/* --- Nav dropdowns (Club Football / International) --- */
.nav-group {
  position: relative;
}

.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 4px;
  line-height: 1.2;
}

.nav-group .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 8px;
  display: none;
  z-index: 30;
}

.nav-group.open .dropdown {
  display: flex;
  flex-direction: column;
}

.nav-group .dropdown a {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.nav-group .dropdown a:hover {
  background: var(--accent);
  color: #000;
}

/* --- Live scores strip (header widget) --- */
.live-scores-strip {
  border-top: 1px solid var(--border);
  background: var(--card);
  font-size: 13px;
  overflow: hidden;
}

.live-scores-strip-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 36px;
}

.live-scores-title {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.live-scores-list {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}

.live-scores-list::-webkit-scrollbar {
  display: none;
}

.ls-match {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ls-live {
  color: #ff3b30;
  font-weight: 700;
  animation: ls-blink 1.2s infinite;
}

@keyframes ls-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.ls-team {
  color: var(--muted);
}

.live-scores-all {
  white-space: nowrap;
  font-weight: 600;
  color: var(--accent);
}

.live-scores-loading,
.live-scores-empty {
  color: var(--muted);
}

/* --- Live scores page --- */
.live-scores-page {
  padding: 24px 0;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.score-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.score-competition {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.score-team {
  font-weight: 600;
  font-size: 14px;
}

.score-num {
  font-weight: 800;
  font-size: 18px;
  min-width: 28px;
  text-align: center;
}

.score-status {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.score-status.is-live {
  color: #ff3b30;
  animation: ls-blink 1.2s infinite;
}

.score-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.score-hint {
  font-size: 14px;
}



/* --- Match page --- */
.match-title {
  font-size: 2rem;
  line-height: 1.2;
  margin: 12px 0;
}

.article-back-link a {
  color: var(--accent);
  font-weight: 600;
}

.match-summary {
  background: var(--card);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 16px 0;
}

.match-summary h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.match-summary p {
  margin: 0;
  line-height: 1.7;
  color: var(--text);
}

/* --- Responsive 16:9 video embed container --- */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  margin: 18px 0;
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

/* --- Engagement bar (Like / Dislike / Share) --- */
.engagement-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.eng-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.1s ease, background 0.15s ease;
}

.eng-btn:hover {
  transform: translateY(-1px);
}

.eng-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.eng-count {
  font-weight: 800;
}

/* --- Comments --- */
.comments-section {
  margin-top: 28px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin-top: 18px;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-form button {
  align-self: flex-start;
  padding: 12px 26px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  cursor: pointer;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
}

.comment-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.comment-item h4 {
  margin: 0 0 4px;
}

.comment-item small {
  color: var(--muted);
}

.comment-item p {
  margin: 8px 0 0;
  line-height: 1.6;
}

/* --- Card category chip --- */
.card-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 6px;
}

/* --- Responsive tweaks --- */
@media (max-width: 860px) {
  .nav .nav-group .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0 0 4px;
  }
  .live-scores-strip-inner {
    gap: 10px;
  }
  .live-scores-title,
  .live-scores-all {
    display: none;
  }
}

