/* Karyakin Chess — style.css */
/* Competitive chess training blog — emerald/amber palette */

:root {
  --emerald: #1B4332;
  --sage: #52796F;
  --amber: #DAA520;
  --amber-light: #E8C547;
  --cream: #F5F5F0;
  --text: #1C1C1C;
  --text-light: #555;
  --border: #E0DDD5;
  --card-bg: #FFFFFF;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Nunito Sans', Arial, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.75;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Lora', Georgia, serif;
  color: var(--emerald);
  line-height: 1.3;
}
h1 { font-size: 2.2rem; margin-bottom: 1rem; }
h2 { font-size: 1.7rem; margin-bottom: 0.75rem; margin-top: 2rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.6rem; margin-top: 1.5rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; margin-top: 1rem; }

p { margin-bottom: 1.1rem; color: var(--text); }
a { color: var(--sage); text-decoration: none; }
a:hover { color: var(--amber); text-decoration: underline; }
strong { color: var(--emerald); }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.4rem; }

/* ===== HEADER ===== */
.site-header {
  background: var(--emerald);
  border-bottom: 3px solid var(--amber);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.site-logo {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.site-logo span { color: var(--amber); font-size: 1.4rem; }
.site-logo:hover { color: var(--amber-light); text-decoration: none; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
  align-items: center;
}

.site-nav ul li a {
  color: #ddd;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  display: block;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.site-nav ul li a:hover {
  color: var(--amber);
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--amber);
  color: var(--amber);
  font-size: 1.3rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  border-radius: 4px;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--emerald) 0%, #0d2b1f 60%, #091a13 100%);
  color: #fff;
  padding: 4rem 1.5rem;
  text-align: center;
}
.hero h1 {
  color: #fff;
  font-size: 2.6rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.hero .hero-sub {
  font-size: 1.15rem;
  color: #cde8d8;
  max-width: 680px;
  margin: 0 auto 1.5rem;
}
.hero .amber-line {
  display: inline-block;
  width: 60px;
  height: 3px;
  background: var(--amber);
  margin: 0.5rem auto 1.5rem;
}
.hero-badge {
  display: inline-block;
  background: var(--amber);
  color: var(--emerald);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero-recommend {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: #a8d5bc;
}
.hero-recommend a { color: var(--amber-light); font-weight: 700; }
.hero-recommend a:hover { color: #fff; }

/* ===== PAGE HERO (inner pages) ===== */
.page-hero {
  background: linear-gradient(135deg, var(--emerald) 0%, #2d6a4f 100%);
  color: #fff;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}
.page-hero h1 { color: #fff; font-size: 2.1rem; margin-bottom: 0.6rem; }
.page-hero .page-intro { color: #c3e6d4; font-size: 1.05rem; max-width: 660px; margin: 0 auto; }
.page-hero .hero-badge { margin-bottom: 0.8rem; }

/* ===== MAIN CONTENT ===== */
.content-wrap {
  max-width: 840px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* ===== ARTICLE BODY ===== */
.article-body p { color: var(--text); }
.article-body h2 { border-left: 4px solid var(--amber); padding-left: 0.8rem; }
.article-body h3 { color: var(--sage); }

/* ===== CARD GRID (homepage) ===== */
.section-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}
.section-title h2 { display: inline-block; border-bottom: 3px solid var(--amber); padding-bottom: 0.4rem; }
.section-title p { color: var(--text-light); margin-top: 0.5rem; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 4px 16px rgba(27,67,50,0.12); transform: translateY(-2px); }
.card-tag {
  display: inline-block;
  background: #e8f5ec;
  color: var(--sage);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.card h3 { font-size: 1.15rem; margin-top: 0; color: var(--emerald); }
.card p { font-size: 0.93rem; color: var(--text-light); margin-bottom: 0.8rem; }
.card a.read-more {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--sage);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.card a.read-more:hover { color: var(--amber); }
.card a.read-more::after { content: "→"; }

/* ===== INFO BOX / CALLOUT ===== */
.info-box {
  background: #e8f5ec;
  border-left: 4px solid var(--sage);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.info-box.amber-box {
  background: #fdf6dc;
  border-left-color: var(--amber);
}
.info-box.dark-box {
  background: var(--emerald);
  border-left-color: var(--amber);
  color: #fff;
}
.info-box.dark-box p, .info-box.dark-box h4 { color: #fff; }
.info-box h4 { margin-top: 0; color: var(--emerald); font-size: 1rem; }
.info-box.amber-box h4 { color: #8a6000; }
.info-box p:last-child { margin-bottom: 0; }

/* ===== TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.93rem; }
.data-table th {
  background: var(--emerald);
  color: #fff;
  padding: 0.7rem 1rem;
  text-align: left;
  font-family: 'Lora', serif;
  font-weight: 600;
}
.data-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }
.data-table tr:nth-child(even) td { background: #f0f7f3; }
.data-table tr:hover td { background: #e4f0e9; }
.data-table .amber { color: var(--amber); font-weight: 700; }

/* ===== CHAMPION LIST (champions page) ===== */
.champion-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
  transition: background 0.15s;
}
.champion-card:hover { background: #f0f7f3; }
.champion-num {
  min-width: 38px;
  height: 38px;
  background: var(--emerald);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.champion-info h4 { margin: 0 0 0.2rem; color: var(--emerald); font-size: 1rem; }
.champion-info p { margin: 0; font-size: 0.88rem; color: var(--text-light); }
.champion-years { margin-left: auto; font-size: 0.82rem; color: var(--amber); font-weight: 700; white-space: nowrap; padding-top: 0.2rem; }

/* ===== PUZZLE BOX ===== */
.puzzle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 1.5rem 0;
}
.puzzle-item {
  background: var(--emerald);
  border-radius: 8px;
  padding: 1.2rem;
  color: #fff;
}
.puzzle-item h4 { color: var(--amber-light); font-size: 1rem; margin-bottom: 0.4rem; }
.puzzle-item p { color: #c3e6d4; font-size: 0.9rem; margin: 0; }

/* ===== TIPS LIST ===== */
.tips-list { list-style: none; padding: 0; }
.tips-list li {
  padding: 0.7rem 0.8rem 0.7rem 2.5rem;
  position: relative;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.tips-list li::before {
  content: "✓";
  position: absolute;
  left: 0.7rem;
  color: var(--sage);
  font-weight: 700;
}

/* ===== PRODUCT CARD (materiel page) ===== */
.product-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1.5rem 0; }
.product-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1.3rem;
  transition: border-color 0.2s;
}
.product-card:hover { border-color: var(--amber); }
.product-card h4 { color: var(--emerald); margin-bottom: 0.4rem; }
.product-card .price { font-size: 1.1rem; font-weight: 700; color: var(--amber); margin-bottom: 0.5rem; }
.product-card p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 0.8rem; }
.product-card .btn-buy {
  display: inline-block;
  background: var(--emerald);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
}
.product-card .btn-buy:hover { background: var(--sage); text-decoration: none; }

/* ===== STAT BADGES ===== */
.stat-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}
.stat-badge {
  background: var(--emerald);
  color: #fff;
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  text-align: center;
  flex: 1;
  min-width: 120px;
}
.stat-badge .stat-num { font-family: 'Lora', serif; font-size: 1.6rem; font-weight: 700; color: var(--amber-light); display: block; }
.stat-badge .stat-label { font-size: 0.78rem; color: #c3e6d4; text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== SECTION DIVIDER ===== */
.section-sep { border: none; border-top: 2px solid var(--border); margin: 2.5rem 0; }

/* ===== TOC ===== */
.toc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
}
.toc h4 { color: var(--emerald); font-size: 1rem; margin-bottom: 0.6rem; }
.toc ol { margin: 0; padding-left: 1.3rem; }
.toc ol li { font-size: 0.9rem; margin-bottom: 0.3rem; }
.toc ol li a { color: var(--sage); }
.toc ol li a:hover { color: var(--amber); }

/* ===== CTA BANNER ===== */
.cta-banner {
  background: linear-gradient(135deg, var(--emerald), #2d6a4f);
  color: #fff;
  border-radius: 10px;
  padding: 2rem 1.5rem;
  text-align: center;
  margin: 2.5rem 0;
}
.cta-banner h3 { color: var(--amber-light); margin-top: 0; }
.cta-banner p { color: #c3e6d4; margin-bottom: 1rem; }
.cta-banner a.btn-cta {
  display: inline-block;
  background: var(--amber);
  color: var(--emerald);
  font-weight: 800;
  padding: 0.65rem 1.6rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.cta-banner a.btn-cta:hover { background: var(--amber-light); text-decoration: none; }

/* ===== TIMELINE (biographies) ===== */
.timeline { border-left: 3px solid var(--sage); padding-left: 1.5rem; margin: 1.5rem 0; }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  background: var(--amber);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--sage);
}
.timeline-item .year { font-family: 'Lora', serif; font-weight: 700; color: var(--amber); font-size: 0.9rem; margin-bottom: 0.2rem; }
.timeline-item p { margin: 0; font-size: 0.93rem; }

/* ===== QUOTE ===== */
blockquote {
  border-left: 4px solid var(--amber);
  padding: 0.8rem 1.2rem;
  margin: 1.5rem 0;
  background: #fdf6dc;
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text);
}
blockquote cite { display: block; margin-top: 0.4rem; font-style: normal; font-size: 0.85rem; color: var(--text-light); }

/* ===== HOMEPAGE FEATURED SECTION ===== */
.featured-section { padding: 3rem 0; }
.featured-section.bg-white { background: #fff; }
.featured-section.bg-dark { background: var(--emerald); }
.featured-section.bg-dark h2 { color: var(--amber-light); }
.featured-section.bg-dark p { color: #c3e6d4; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  background: #fff;
  padding: 0.5rem 1.5rem;
  font-size: 0.82rem;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--sage); }
.breadcrumb a:hover { color: var(--amber); }

/* ===== FOOTER ===== */
.site-footer {
  background: #0d2b1f;
  color: #ccc;
  padding: 3rem 1.5rem 0;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-about h4 {
  font-family: 'Lora', serif;
  color: var(--amber-light);
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}
.footer-about p { font-size: 0.9rem; color: #aaa; line-height: 1.6; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.footer-links h5 { color: var(--amber); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.8rem; font-family: 'Lora', serif; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links ul li { margin-bottom: 0.4rem; }
.footer-links ul li a { color: #aaa; font-size: 0.88rem; text-decoration: none; transition: color 0.2s; }
.footer-links ul li a:hover { color: var(--amber-light); text-decoration: none; }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0;
  font-size: 0.82rem;
  color: #666;
  text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.35rem; }
  .hero h1 { font-size: 1.9rem; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--emerald);
    border-top: 2px solid var(--amber);
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul li a { padding: 0.6rem 1rem; font-size: 1rem; border-radius: 0; }
  .header-inner { position: relative; }
  .cards-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .puzzle-grid { grid-template-columns: 1fr; }
  .product-cards { grid-template-columns: 1fr; }
  .stat-row { gap: 0.7rem; }
  .stat-badge { min-width: 100px; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 0.5rem 0.7rem; }
}

@media (max-width: 480px) {
  .content-wrap { padding: 2rem 1rem; }
  .footer-links { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 1rem; }
  .page-hero { padding: 2rem 1rem; }
}
