/*
Theme Name: AccurateStakes News
Theme URI: https://www.accuratestakes.com/blog/
Author: Beta Web Analysis Limited
Author URI: https://www.accuratestakes.com/
Description: Editorial news theme for AccurateStakes, built to match the AccurateStakes.com landing page design system (navy/blue, gold accents, Sora + DM Sans). Includes home, single, archive, search and 404 templates styled as a football news publication.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: as-news
*/

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  --blue: #3a55de;
  --blue-dark: #2a3fb0;
  --blue-deeper: #1b2a80;
  --blue-light: #eef1fd;
  --blue-mid: #c7cffa;
  --gold: #f5a623;
  --gold-light: #fff8ec;
  --green: #1db954;
  --green-light: #e8f8ee;
  --red: #e64040;
  --red-light: #fdf0f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(58,85,222,0.07);
  --shadow-md: 0 4px 24px rgba(58,85,222,0.12);
  --text: #0f1117;
  --text-muted: #5a6075;
  --text-light: #9399b0;
  --border: #e4e7f2;
  --surface: #f8f9fe;
  --white: #ffffff;
  --bg: #f4f6fe;
  --nav-bg: #0f1f5c;
  --nav-text: rgba(255,255,255,.85);
  --card-bg: #ffffff;
  --topbar-bg: #1a237e;
  --topbar-text: rgba(255,255,255,.85);
  --footer-bg: #1b2a80;
  --footer-text: rgba(255,255,255,.7);
}

[data-theme="dark"] {
  --text: #e8ecff;
  --text-muted: #9aa0c0;
  --text-light: #6068a0;
  --border: #2a3060;
  --surface: #181e3a;
  --white: #1e2545;
  --bg: #111628;
  --card-bg: #1e2545;
  --blue-light: #1e2a60;
  --blue-mid: #2a3880;
  --green-light: #0d2818;
  --red-light: #2a1010;
  --gold-light: #2a1e00;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box }
html { scroll-behavior: smooth; overflow-x: hidden }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  transition: background .3s, color .3s;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}
a { color: inherit; text-decoration: none }
img { max-width: 100%; height: auto; display: block }
ul, ol { list-style: none }
h1, h2, h3, h4 { font-family: 'Sora', sans-serif; font-weight: 700; color: var(--text) }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
}
::selection { background: var(--blue-mid) }

/* ==========================================================================
   3. TOPBAR
   ========================================================================== */
.as-topbar {
  background: var(--topbar-bg);
  color: var(--topbar-text);
  text-align: center;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 7px 16px;
}

/* ==========================================================================
   4. MAIN NAV
   ========================================================================== */
.as-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.as-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  gap: 16px;
}
.as-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0 }
.as-logo-mark {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.12);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.as-logo-mark svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.as-logo-text { font-family: 'Sora', sans-serif; font-size: 1.1rem; font-weight: 700; color: #fff; letter-spacing: -.01em }
.as-logo-text span { color: var(--gold) }

.as-nav-links { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center }
.as-nav-links a {
  color: var(--nav-text);
  font-size: .875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: .2s;
}
.as-nav-links a:hover, .as-nav-links a.active { color: #fff; background: rgba(255,255,255,.1) }

.as-nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0 }
.as-theme-toggle {
  width: 42px; height: 24px;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background .3s;
}
.as-theme-toggle::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px;
  background: #fff;
  border-radius: 50%;
  transition: transform .3s;
}
[data-theme="dark"] .as-theme-toggle::after { transform: translateX(18px) }
[data-theme="dark"] .as-theme-toggle { background: var(--gold); border-color: var(--gold) }

.as-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 6px; flex-shrink: 0;
}
.as-hamburger span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: .3s }
.as-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg) }
.as-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0) }
.as-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) }

.as-drawer {
  display: none;
  flex-direction: column;
  background: var(--nav-bg);
  border-top: 1px solid rgba(255,255,255,.08);
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.as-drawer.open { max-height: 300px }
.as-drawer a {
  display: block;
  color: rgba(255,255,255,.85);
  font-size: .95rem;
  font-weight: 500;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.as-drawer a:hover { background: rgba(255,255,255,.06) }

@media (max-width: 780px) {
  .as-nav-links { display: none }
  .as-hamburger { display: flex }
  .as-drawer { display: flex }
}

/* ==========================================================================
   5. MASTHEAD / HERO
   ========================================================================== */
.as-masthead {
  background: linear-gradient(135deg, var(--blue-deeper) 0%, var(--blue) 60%, #5a66ee 100%);
  padding: 30px 20px 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .as-masthead { background: linear-gradient(135deg, #0d1530 0%, #1b2a80 60%, #2a3ab0 100%) }
.as-masthead::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.as-masthead-inner { max-width: 720px; margin: 0 auto; position: relative }
.as-masthead-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 4px 13px;
  font-size: 11px;
  color: rgba(255,255,255,.9);
  margin-bottom: 14px;
}
.as-masthead h1 {
  font-size: clamp(20px, 3.5vw, 32px);
  color: #fff;
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -.3px;
}
.as-masthead h1 em { font-style: normal; color: var(--gold) }
.as-masthead p {
  color: rgba(255,255,255,.85);
  font-size: 13.5px;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}

/* Category strip */
.as-cat-strip {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.as-cat-strip-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.as-cat-strip-inner::-webkit-scrollbar { display: none }
.as-cat-strip a {
  white-space: nowrap;
  padding: 10px 15px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  border-bottom: 2px solid transparent;
  transition: .15s;
}
.as-cat-strip a:hover, .as-cat-strip a.active { color: var(--gold); border-bottom-color: var(--gold) }

/* ==========================================================================
   6. LAYOUT / CONTAINER
   ========================================================================== */
.as-main { max-width: 1180px; margin: 0 auto; padding: 26px 20px 40px; width: 100% }
.as-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px }
.as-section-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.as-section-title::before { content: ''; width: 3px; height: 16px; background: var(--blue); border-radius: 2px; display: block }
.as-section-link { font-size: 12px; color: var(--blue); font-weight: 600 }

/* ==========================================================================
   7. FEATURED POST
   ========================================================================== */
.as-featured {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  transition: background .3s, border-color .3s;
}
.as-featured-media { position: relative; min-height: 260px; background: var(--surface) }
.as-featured-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0 }
.as-featured-body { padding: 22px 24px 22px 6px; display: flex; flex-direction: column; justify-content: center }
.as-tag {
  display: inline-flex;
  align-self: flex-start;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.as-featured-body h2 { font-size: clamp(19px, 2.6vw, 25px); line-height: 1.3; margin-bottom: 10px }
.as-featured-body h2 a:hover { color: var(--blue) }
.as-featured-excerpt { color: var(--text-muted); font-size: 13.5px; line-height: 1.7; margin-bottom: 14px }
.as-meta { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text-light); flex-wrap: wrap }
.as-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-light) }

@media (max-width: 780px) {
  .as-featured { grid-template-columns: 1fr }
  .as-featured-media { min-height: 200px }
  .as-featured-body { padding: 20px }
}

/* ==========================================================================
   8. NEWS GRID / POST CARDS
   ========================================================================== */
.as-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}
@media (max-width: 900px) { .as-grid { grid-template-columns: repeat(2, 1fr) } }
@media (max-width: 560px) { .as-grid { grid-template-columns: 1fr } }

.as-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: .2s;
  display: flex;
  flex-direction: column;
}
.as-card:hover { box-shadow: var(--shadow-md); border-color: var(--blue-mid); transform: translateY(-2px) }
.as-card-media { position: relative; aspect-ratio: 16/10; background: var(--surface); overflow: hidden }
.as-card-media img { width: 100%; height: 100%; object-fit: cover }
.as-card-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1 }
.as-card h3 { font-size: 14.5px; line-height: 1.4 }
.as-card h3 a:hover { color: var(--blue) }
.as-card-excerpt { font-size: 12px; color: var(--text-muted); line-height: 1.6; flex: 1 }

/* ==========================================================================
   9. PAGINATION
   ========================================================================== */
.as-pagination { display: flex; justify-content: center; gap: 6px; margin: 10px 0 30px; flex-wrap: wrap }
.as-pagination a, .as-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
  background: var(--card-bg);
}
.as-pagination a:hover { border-color: var(--blue); color: var(--blue) }
.as-pagination span.current { background: var(--blue); border-color: var(--blue); color: #fff }

/* ==========================================================================
   10. SINGLE ARTICLE
   ========================================================================== */
.as-article-head { max-width: 780px; margin: 0 auto 20px }
.as-article-head .as-tag { margin-bottom: 12px }
.as-article-head h1 { font-size: clamp(22px, 4vw, 32px); line-height: 1.3; margin-bottom: 14px }
.as-article-media { max-width: 960px; margin: 0 auto 26px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow) }
.as-article-media img { width: 100% }

.as-article-body {
  max-width: 780px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px clamp(18px, 4vw, 40px);
  transition: background .3s, border-color .3s;
}
.as-article-content { font-size: 15px; line-height: 1.8; color: var(--text) }
.as-article-content p { margin-bottom: 16px; color: var(--text) }
.as-article-content h2 { font-size: 20px; margin: 26px 0 12px }
.as-article-content h3 { font-size: 16.5px; margin: 20px 0 10px }
.as-article-content ul, .as-article-content ol { margin: 0 0 16px 20px; list-style: disc; color: var(--text) }
.as-article-content ol { list-style: decimal }
.as-article-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px }
.as-article-content img { border-radius: var(--radius-sm); margin: 10px 0 }
.as-article-content blockquote {
  border-left: 3px solid var(--blue);
  background: var(--surface);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
  margin: 16px 0;
}
.as-article-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13.5px }
.as-article-content table th, .as-article-content table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left }
.as-article-content table th { background: var(--surface) }

.as-article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border) }
.as-article-tags a {
  font-size: 11.5px; font-weight: 600;
  background: var(--surface); color: var(--text-muted);
  padding: 5px 12px; border-radius: 20px;
}
.as-article-tags a:hover { background: var(--blue-light); color: var(--blue) }

.as-author-box {
  max-width: 780px; margin: 26px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; gap: 14px; align-items: center;
}
.as-author-box img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0 }
.as-author-box .name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 13.5px; color: var(--text) }
.as-author-box .role { font-size: 11.5px; color: var(--text-light) }

.as-related { max-width: 960px; margin: 34px auto 0 }

.as-disclaimer-box {
  max-width: 780px; margin: 24px auto 0;
  background: var(--gold-light);
  border: 1px solid rgba(245,166,35,.35);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   11. ARCHIVE / SEARCH HEADER
   ========================================================================== */
.as-archive-head { text-align: center; padding: 30px 20px 8px; max-width: 720px; margin: 0 auto }
.as-archive-head .as-eyebrow { font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px }
.as-archive-head h1 { font-size: clamp(20px, 3.5vw, 28px); margin-bottom: 8px }
.as-archive-head p { color: var(--text-muted); font-size: 13.5px }

/* ==========================================================================
   12. 404
   ========================================================================== */
.as-404 { text-align: center; padding: 70px 20px; max-width: 560px; margin: 0 auto }
.as-404-code { font-family: 'Sora', sans-serif; font-size: 72px; font-weight: 700; color: var(--blue); line-height: 1 }
.as-404 h1 { font-size: 20px; margin: 14px 0 10px }
.as-404 p { color: var(--text-muted); font-size: 13.5px; margin-bottom: 22px }
.as-404-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap }
.as-btn-primary {
  background: var(--blue); color: #fff;
  padding: 10px 20px; border-radius: 8px;
  font-weight: 700; font-size: 13px; transition: .2s;
}
.as-btn-primary:hover { background: var(--blue-dark) }
.as-btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px; border-radius: 8px;
  font-weight: 600; font-size: 13px; transition: .2s;
}
.as-btn-secondary:hover { border-color: var(--blue); color: var(--blue) }

.as-empty { text-align: center; padding: 50px 20px; color: var(--text-muted) }

/* ==========================================================================
   13. FOOTER
   ========================================================================== */
.as-footer { background: var(--footer-bg); color: var(--footer-text); padding: 34px 20px 18px }
.as-footer-inner { max-width: 1180px; margin: 0 auto }
.as-footer-top { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 22px }
.as-footer-logo { display: flex; align-items: center; gap: 9px }
.as-footer-logo .as-logo-mark { background: rgba(255,255,255,.15) }
.as-footer-logo-text { color: #fff; font-family: 'Sora', sans-serif; font-size: 15.5px; font-weight: 700 }
.as-footer-logo-text span { color: var(--gold) }
.as-footer-tagline { font-size: 12px; max-width: 380px; line-height: 1.6 }
.as-footer-links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center }
.as-footer-links a { font-size: 12.5px; color: rgba(255,255,255,.75); font-weight: 500 }
.as-footer-links a:hover { color: #fff }
.as-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 14px;
  display: flex; justify-content: center; text-align: center;
  font-size: 11px;
}
.as-disclaimer { max-width: 900px; margin: 12px auto 0; font-size: 10px; opacity: .5; line-height: 1.6; text-align: center }

/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */
@media (max-width: 600px) {
  .as-main { padding: 18px 14px 30px }
  .as-masthead { padding: 24px 16px 20px }
}
