/*
Theme Name: SP's English World
Theme URI: https://spsenglishworld.com
Author: Ganesh Thik
Author URI: https://spsenglishworld.com
Description: A blazing-fast, AdSense-friendly, AMP-ready, Google Discover-optimized WordPress theme designed for Marathi-to-English language learning blogs. Features clean typography, Devanagari font support, vocabulary/quiz sections, and pre-built ad zones.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sps-english-world
Tags: blog, education, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks, accessibility-ready
*/

/* ==========================================================================
   1. CSS Variables (Blue & White Professional Theme)
   ========================================================================== */
:root {
  --primary: #1a5fbf;
  --primary-dark: #0d3d80;
  --primary-light: #4a8fe7;
  --accent: #ff9900;
  --bg: #ffffff;
  --bg-soft: #f7faff;
  --bg-section: #eef4fc;
  --text: #1a2332;
  --text-soft: #4a5568;
  --text-muted: #718096;
  --border: #dbe6f3;
  --success: #16a34a;
  --shadow-sm: 0 1px 3px rgba(13, 61, 128, 0.08);
  --shadow-md: 0 4px 12px rgba(13, 61, 128, 0.10);
  --shadow-lg: 0 8px 24px rgba(13, 61, 128, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --container: 1200px;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mr: 'Noto Sans Devanagari', 'Mangal', sans-serif;
  --font-heading: 'Poppins', 'Inter', sans-serif;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-en);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.marathi-content, .marathi, .mr {
  font-family: var(--font-mr);
  line-height: 1.85;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 1.5em 0 .6em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1.1em; }

/* ==========================================================================
   3. Layout
   ========================================================================== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-content { flex: 1; padding: 30px 0; }
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

/* ==========================================================================
   4. Header
   ========================================================================== */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  max-width: var(--container);
  margin: 0 auto;
  gap: 20px;
}
.site-branding { display: flex; align-items: center; gap: 12px; }
.custom-logo-link img { max-height: 50px; width: auto; }
.site-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  font-family: var(--font-heading);
}
.site-title a { color: #fff; text-decoration: none; }
.site-description { font-size: .85rem; opacity: .9; margin: 0; }

/* Navigation */
.main-navigation { display: flex; align-items: center; }
.menu-toggle {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  display: none;
}
.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
}
.nav-menu li a {
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  display: block;
}
.nav-menu li a:hover, .nav-menu .current-menu-item > a {
  background: rgba(255,255,255,.18);
  text-decoration: none;
}
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--primary-dark);
    padding: 12px;
    display: none;
  }
  .nav-menu.toggled { display: flex; }
}

/* ==========================================================================
   5. Hero / Featured
   ========================================================================== */
.hero-section {
  background: var(--bg-soft);
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}
.hero-title {
  font-size: 2.4rem;
  margin: 0 0 8px;
  color: var(--primary-dark);
}
.hero-subtitle { font-size: 1.1rem; color: var(--text-soft); margin: 0; }

/* ==========================================================================
   6. Posts Grid & Cards
   ========================================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin: 24px 0;
}
.post-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card-thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-section); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.post-card-cat {
  display: inline-block;
  background: var(--primary-light);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
  align-self: flex-start;
}
.post-card-title {
  font-size: 1.15rem;
  margin: 0 0 8px;
  line-height: 1.4;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--primary); text-decoration: none; }
.post-card-excerpt { font-size: .92rem; color: var(--text-soft); margin: 0 0 12px; flex: 1; }
.post-card-meta { font-size: .78rem; color: var(--text-muted); display: flex; gap: 12px; }

/* ==========================================================================
   7. Single Post
   ========================================================================== */
.single-post-wrap {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
@media (max-width: 600px) { .single-post-wrap { padding: 20px; } }
.entry-header { margin-bottom: 24px; }
.entry-title { font-size: 2rem; margin: 0 0 12px; color: var(--primary-dark); }
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: .85rem;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.entry-meta a { color: var(--text-soft); }
.featured-image { margin: 20px -32px; }
.featured-image img { width: 100%; }
@media (max-width: 600px) { .featured-image { margin: 16px -20px; } }
.entry-content { font-size: 1.05rem; line-height: 1.8; }
.entry-content h2, .entry-content h3 { color: var(--primary-dark); }
.entry-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  background: var(--bg-soft);
  margin: 20px 0;
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.entry-content code {
  background: var(--bg-section);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: .92em;
  color: var(--primary-dark);
}
.entry-content pre {
  background: #1a2332;
  color: #e6edf3;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 10px; text-align: left; }
.entry-content th { background: var(--bg-section); font-weight: 600; }

/* English-Marathi Translation Box */
.translation-box {
  background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 18px 0;
}
.translation-box .english { font-weight: 600; color: var(--primary-dark); }
.translation-box .marathi { font-family: var(--font-mr); color: var(--text); margin-top: 6px; }

/* ==========================================================================
   8. Sidebar
   ========================================================================== */
.sidebar { display: flex; flex-direction: column; gap: 22px; }
.widget {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.widget-title {
  font-size: 1.05rem;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  color: var(--primary-dark);
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.widget ul li:last-child { border-bottom: none; }

/* ==========================================================================
   9. Ad Zones (AdSense)
   ========================================================================== */
.ad-zone {
  margin: 20px 0;
  text-align: center;
  min-height: 90px;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-zone .ad-label {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.ad-header { max-width: 728px; margin: 0 auto; }
.ad-sidebar { min-height: 250px; }
.ad-in-article { margin: 28px auto; }
.ad-footer { max-width: 728px; margin: 20px auto; }

/* ==========================================================================
   10. Vocabulary / Quiz Section
   ========================================================================== */
.vocab-card {
  background: linear-gradient(135deg, #e7f1ff 0%, #f0f7ff 100%);
  border-left: 5px solid var(--primary);
  padding: 18px 22px;
  border-radius: var(--radius);
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
}
.vocab-word {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 6px;
  font-family: var(--font-heading);
}
.vocab-pron {
  font-style: italic;
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 10px;
}
.vocab-meaning-mr {
  font-family: var(--font-mr);
  font-size: 1.1rem;
  color: var(--text);
  margin: 8px 0;
}
.vocab-example {
  background: rgba(255,255,255,.7);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  font-size: .95rem;
}
.vocab-example strong { color: var(--primary); }

/* Quiz */
.quiz-box {
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-md);
}
.quiz-title {
  color: var(--primary-dark);
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quiz-question {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 14px 0;
}
.quiz-options { list-style: none; padding: 0; }
.quiz-options li {
  background: var(--bg-soft);
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s;
  border: 2px solid transparent;
}
.quiz-options li:hover { border-color: var(--primary-light); background: #fff; }
.quiz-options li.correct { background: #d4edda; border-color: var(--success); color: #155724; }
.quiz-options li.wrong { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.quiz-feedback { margin-top: 12px; font-weight: 600; min-height: 24px; }

/* ==========================================================================
   11. Pagination
   ========================================================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
}
.pagination .current, .pagination .page-numbers:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

/* ==========================================================================
   12. Comments
   ========================================================================== */
.comments-area { margin-top: 32px; }
.comment-list { list-style: none; padding: 0; }
.comment-body {
  background: var(--bg-soft);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.comment-author { font-weight: 600; color: var(--primary-dark); }
.comment-meta time { font-size: .82rem; color: var(--text-muted); margin-left: 8px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 12px;
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,95,191,.15);
}

/* ==========================================================================
   13. Buttons
   ========================================================================== */
.btn, button[type="submit"], input[type="submit"] {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .1s;
  font-size: 1rem;
}
.btn:hover, button[type="submit"]:hover {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: #e67e00; }

/* ==========================================================================
   14. Footer
   ========================================================================== */
.site-footer {
  background: var(--primary-dark);
  color: #c8d6ec;
  padding: 36px 0 18px;
  margin-top: 40px;
}
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  margin-bottom: 24px;
}
.footer-widgets h3 { color: #fff; font-size: 1.05rem; margin: 0 0 12px; }
.footer-widgets a { color: #c8d6ec; }
.footer-widgets a:hover { color: #fff; }
.footer-widgets ul { list-style: none; padding: 0; }
.footer-widgets ul li { padding: 4px 0; }
.site-info {
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 18px;
  font-size: .9rem;
}

/* ==========================================================================
   15. Search Form
   ========================================================================== */
.search-form { display: flex; gap: 0; }
.search-form input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: none;
  font-size: .95rem;
}
.search-form button {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 18px;
}

/* ==========================================================================
   16. Utilities & Accessibility
   ========================================================================== */
.screen-reader-text {
  border: 0;
  clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height: 1px; width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  word-wrap: normal!important;
}
.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  z-index: 999;
}
.skip-link:focus { left: 10px; top: 10px; }
.alignleft { float: left; margin: 0 20px 10px 0; }
.alignright { float: right; margin: 0 0 10px 20px; }
.aligncenter { display: block; margin: 0 auto 16px; }
.alignwide { margin-left: -40px; margin-right: -40px; max-width: calc(100% + 80px); }
@media (max-width: 768px) {
  .alignwide { margin-left: -20px; margin-right: -20px; }
}

/* Print */
@media print {
  .site-header, .sidebar, .ad-zone, .site-footer, .comments-area { display: none; }
  body { font-size: 12pt; color: #000; }
}
