/*
Theme Name: CricketHistory
Theme URI: https://crickethistory.in
Author: CricketHistory
Author URI: https://crickethistory.in
Description: A premium editorial WordPress theme for cricket blogs and sports news sites. Light, modern, fast, Adsense-friendly and Gutenberg compatible.
Version: 2.0.0
Requires at least: 5.5
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: crickethistory
Tags: blog, news, sports, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
  --bg: #f8fafc;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --text: #111111;
  --text-muted: #555c66;
  --border: #e6e8ec;
  --accent: #f59e0b;
  --accent-dark: #b8770a;
  --accent-soft: #fff7e6;
  --shadow-sm: 0 1px 2px rgba(17,17,17,0.05);
  --shadow-md: 0 6px 24px rgba(17,17,17,0.08);
  --radius: 12px;
  --container: 1200px;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* =========================================================
   RESET / BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--text); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-dark); }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); color: var(--text); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
.site-branding { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 999px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  box-shadow: var(--shadow-sm);
}
.site-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; line-height: 1; margin: 0; }
.site-title .accent { color: var(--accent); }
.site-description { font-size: .72rem; color: var(--text-muted); margin: 2px 0 0; letter-spacing: .08em; text-transform: uppercase; }

/* Primary nav */
.primary-nav { display: none; }
.primary-nav ul { list-style: none; display: flex; gap: 26px; padding: 0; margin: 0; }
.primary-nav a {
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 600; color: var(--text-muted);
}
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--text); }
.header-cta { display: none; }
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 999px;
  background: var(--accent); color: #fff !important; font-weight: 600;
  font-size: .85rem; letter-spacing: .04em; border: none; cursor: pointer;
  transition: transform .15s ease, background .2s ease;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text) !important; border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Mobile menu */
.menu-toggle {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; cursor: pointer; color: var(--text);
}
.mobile-nav { display: none; padding: 16px 0 20px; border-top: 1px solid var(--border); }
.mobile-nav.open { display: block; }
.mobile-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.mobile-nav a { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--text-muted); }

@media (min-width: 1024px) {
  .primary-nav { display: block; }
  .header-cta { display: block; }
  .menu-toggle { display: none; }
}

/* =========================================================
   PAGE HERO (inner pages)
   ========================================================= */
.page-hero {
  padding: 90px 0 60px;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.page-hero .eyebrow {
  display: inline-block; font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent-dark);
  background: var(--accent-soft); padding: 6px 14px; border-radius: 999px;
  margin-bottom: 18px; font-weight: 600;
}
.page-hero h1 { margin: 0 0 14px; }
.page-hero p.lead { color: var(--text-muted); font-size: 1.1rem; max-width: 720px; margin: 0 auto; }

/* =========================================================
   HOMEPAGE
   ========================================================= */
.hero {
  position: relative; min-height: 80vh; display: flex; align-items: center;
  padding: 120px 0 80px; overflow: hidden;
  background: linear-gradient(135deg, #fff 0%, #fef7e6 60%, #fff 100%);
}
.hero .container { position: relative; z-index: 2; }
.hero .eyebrow { font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; color: var(--accent-dark); font-weight: 600; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin: 18px 0 22px; }
.hero p { font-size: 1.15rem; color: var(--text-muted); max-width: 620px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.section { padding: 80px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 50px; }
.section-head .eyebrow { font-size: .75rem; letter-spacing: .25em; text-transform: uppercase; color: var(--accent-dark); font-weight: 600; }
.section-head h2 { margin: 12px 0 14px; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(1, 1fr); }
.grid-4 { grid-template-columns: repeat(1, 1fr); }
@media (min-width: 640px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(245,158,11,.4); }
.card .icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent-dark); display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 18px; font-family: var(--font-display); font-weight: 700;
}
.card h3 { margin: 0 0 10px; font-size: 1.2rem; }
.card p { color: var(--text-muted); margin: 0; font-size: .95rem; }

/* Article / page content */
.page-content {
  padding: 60px 0 90px;
}
.entry-content { max-width: 820px; margin: 0 auto; font-size: 1.05rem; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content blockquote {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  padding: 16px 22px; border-radius: 0 8px 8px 0; margin: 24px 0; font-style: italic;
}
.entry-content img { border-radius: var(--radius); margin: 22px 0; }
.entry-content ul, .entry-content ol { padding-left: 22px; }
.entry-content a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

/* Post grid (archive/blog) */
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card .thumb { aspect-ratio: 16/10; background: var(--accent-soft); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .thumb img { transform: scale(1.05); }
.post-card .body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.post-card .meta { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); font-weight: 600; margin-bottom: 10px; }
.post-card h3 { font-size: 1.2rem; margin: 0 0 10px; }
.post-card p { color: var(--text-muted); font-size: .95rem; margin: 0 0 16px; flex: 1; }
.post-card .read-more { font-weight: 600; color: var(--accent-dark); font-size: .9rem; }

/* Contact form */
.contact-grid { display: grid; gap: 40px; grid-template-columns: 1fr; max-width: 980px; margin: 0 auto; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1.2fr; } }
.contact-info .info-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.contact-info .info-item:last-child { border-bottom: 0; }
.contact-info h4 { margin: 0 0 4px; font-size: 1rem; font-family: var(--font-body); }
.contact-info p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); }
.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 640px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 1rem; background: #fff; color: var(--text); transition: border-color .2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Newsletter */
.newsletter {
  background: linear-gradient(135deg, #111 0%, #1a1a1a 100%); color: #fff;
  border-radius: 20px; padding: 60px 30px; text-align: center;
}
.newsletter h2 { color: #fff; }
.newsletter p { color: rgba(255,255,255,.7); max-width: 540px; margin: 0 auto 26px; }
.newsletter form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; flex-wrap: wrap; }
.newsletter input { flex: 1; min-width: 220px; padding: 12px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; }
.newsletter input::placeholder { color: rgba(255,255,255,.5); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: #0f1115; color: rgba(255,255,255,.7); padding: 70px 0 30px; margin-top: 60px; }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1fr; margin-bottom: 40px; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: .95rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 18px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer a { color: rgba(255,255,255,.7); font-size: .92rem; }
.site-footer a:hover { color: var(--accent); }
.footer-brand p { font-size: .9rem; line-height: 1.7; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: rgba(255,255,255,.5); }

/* WordPress core utilities */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .85rem; color: var(--text-muted); text-align: center; margin-top: 8px; }
.screen-reader-text { position: absolute; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.sticky, .bypostauthor { display: block; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 40px 0 0; flex-wrap: wrap; }
.pagination .page-numbers { padding: 10px 16px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-weight: 600; font-size: .9rem; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination a:hover { border-color: var(--accent); color: var(--accent-dark); }

/* Comments */
.comments-area { max-width: 820px; margin: 60px auto 0; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
