/* ═══════════════════════════════════════════════════════════════
   AdSense Sites - Professional Template
   Fast loading, mobile-first, AdSense-optimized
   ═══════════════════════════════════════════════════════════════ */

:root {
  --brand: #2563eb;
  --text: #1a1a2e;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --bg-dark: #f3f4f6;
  --border: #e5e7eb;
  --radius: 8px;
  --max-w: 820px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --font-body: Georgia, 'Times New Roman', 'Noto Serif', serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ───────────────────────────────────────────────────── */

header {
  border-bottom: 3px solid var(--brand);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

header nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo:hover { opacity: 0.85; }

header ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

header ul a {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  text-transform: capitalize;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.15s;
}
header ul a:hover { color: var(--brand); }

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* ── Main ─────────────────────────────────────────────────────── */

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Typography ───────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ui);
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 2.1rem; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
h2 { font-size: 1.5rem; margin: 2rem 0 0.8rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--brand); }
h3 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; color: #374151; }
h4 { font-size: 1.05rem; margin: 1.2rem 0 0.4rem; }

p { margin: 0.9em 0; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { color: #111827; }

/* ── Article ──────────────────────────────────────────────────── */

article { margin-bottom: 2rem; }

.article-meta {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

article h2:first-of-type { margin-top: 0; }

article ul, article ol {
  margin: 1em 0;
  padding-left: 1.8em;
}
article li { margin: 0.4em 0; }

article blockquote {
  border-left: 4px solid var(--brand);
  margin: 1.5em 0;
  padding: 1em 1.5em;
  background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: #374151;
}

article img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

article pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.2em 1.5em;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 1.5em 0;
}
article code {
  background: var(--bg-dark);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}
article pre code { background: none; padding: 0; }

/* ── Tables (for comparisons) ─────────────────────────────────── */

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-family: var(--font-ui);
  font-size: 0.92rem;
}
article th {
  background: var(--brand);
  color: white;
  padding: 0.7em 1em;
  text-align: left;
  font-weight: 600;
}
article td {
  padding: 0.6em 1em;
  border-bottom: 1px solid var(--border);
}
article tr:nth-child(even) { background: var(--bg-alt); }

/* ── Breadcrumbs ──────────────────────────────────────────────── */

.breadcrumbs {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumbs a { color: var(--text-light); }
.breadcrumbs a:hover { color: var(--brand); }

/* ── Newsletter ───────────────────────────────────────────────── */

.newsletter {
  background: linear-gradient(135deg, var(--brand), #6366f1);
  color: white;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin: 3rem 0;
  text-align: center;
}
.newsletter h3 {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  color: white;
  margin: 0 0 0.5rem;
}
.newsletter p {
  font-size: 0.95rem;
  opacity: 0.9;
  margin: 0.3rem 0 1.2rem;
}
.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
  margin: 0 auto;
}
.newsletter-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 1rem;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color 0.2s;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.6); }
.newsletter-form input:focus { border-color: white; background: rgba(255,255,255,0.25); }
.newsletter-form button {
  padding: 0.75rem 1.5rem;
  background: white;
  color: var(--brand);
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.newsletter-form button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.newsletter-note {
  font-size: 0.78rem !important;
  opacity: 0.7 !important;
  margin: 0.8rem 0 0 !important;
}
.newsletter-msg {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.2);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.newsletter-msg.success { background: rgba(16,185,129,0.3); }

@media (max-width: 480px) {
  .newsletter { padding: 2rem 1.2rem; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form button { width: 100%; }
}

/* ── Ad Slots ─────────────────────────────────────────────────── */

.ad-slot {
  margin: 2rem 0;
  min-height: 90px;
  text-align: center;
  overflow: hidden;
}
.ad-in-article {
  margin: 2.5rem -1rem;
  padding: 1rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── Hero (Homepage) ──────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 3rem 0 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 2.6rem;
  background: linear-gradient(135deg, var(--brand), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  color: var(--text-light);
  margin-top: 0.4rem;
}

/* ── Article Grid (Index & Category) ──────────────────────────── */

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.article-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--text);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.article-card .category {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
}

.article-card h2 {
  font-size: 1.15rem;
  border: none;
  padding: 0;
  margin: 0.4rem 0 0.5rem;
  line-height: 1.4;
}

.article-card .excerpt {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .meta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

/* ── Category Header ──────────────────────────────────────────── */

.category-header {
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--brand);
}
.category-header h1 { margin: 0; }
.category-header p {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--text-light);
  margin: 0.3rem 0 0;
}

/* ── Related Articles ─────────────────────────────────────────── */

.related {
  margin: 3rem 0 1rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}
.related h2 { border: none; margin-top: 0; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.related-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  color: var(--text);
  text-decoration: none;
  transition: box-shadow 0.15s;
}
.related-card:hover {
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
.related-card h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
  color: var(--brand);
}
.related-card p {
  font-size: 0.88rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.5;
}

/* ── Footer ───────────────────────────────────────────────────── */

footer {
  text-align: center;
  padding: 2rem 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer-links {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.footer-links a {
  color: var(--text-light);
  text-decoration: none;
}
.footer-links a:hover { color: var(--brand); }

footer p {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 768px) {
  body { font-size: 16px; }
  h1 { font-size: 1.7rem; }
  .hero h1 { font-size: 2rem; }
  main { padding: 1.5rem 1rem; }

  header nav { padding: 0.7rem 1rem; }
  header ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.8rem;
    border-bottom: 2px solid var(--brand);
    box-shadow: var(--shadow);
  }
  header ul.show { display: flex; }
  .menu-btn { display: block; }

  .article-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }

  article table { font-size: 0.82rem; }
  article th, article td { padding: 0.4em 0.6em; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.7rem; }
  header nav { padding: 0.6rem 0.8rem; }
  .logo { font-size: 1.3rem; }
}

/* ── Print ────────────────────────────────────────────────────── */

@media print {
  header, footer, .ad-slot, .related, .breadcrumbs { display: none; }
  main { max-width: 100%; padding: 0; }
  body { font-size: 12pt; }
}
