/* =========================================================
   NST Campus Blog — uses the theme variables from
   assets/css/styles.css + themes.css (--blue, --gold, --grad-2,
   --pop, --card, --muted, --line, --paper, --dark, --ink).
   ========================================================= */

.blog-page {
  font-family: 'Inter', 'Noto Sans Tamil', system-ui, sans-serif;
}
.blog-page h1, .blog-page h2, .blog-page h3 {
  font-family: 'Fraunces', 'Noto Sans Tamil', serif;
}
.blog-brand-logo { border-radius: 50%; display: block; }
.main-nav a.is-current { color: var(--blue); font-weight: 700; }
.main-nav a.is-current::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 3px;
  background: linear-gradient(90deg, var(--blue), var(--gold));
}

/* Hero */
.blog-hero {
  background: linear-gradient(120deg, var(--blue), var(--grad-2, #1e6f9f));
  color: #fff;
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}
.blog-hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 55%, transparent), transparent 70%);
  opacity: .6;
}
.blog-hero .wrap { position: relative; z-index: 1; }
.blog-hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 6px 0 12px; line-height: 1.25; }
.blog-hero .eyebrow { color: var(--gold); margin: 18px 0 0; }
.blog-hero-lede { max-width: 640px; font-size: 1.1rem; line-height: 1.8; color: rgba(255,255,255,.88); margin: 0; }

.blog-breadcrumb { font-size: .88rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.blog-breadcrumb a { color: inherit; opacity: .85; text-decoration: none; }
.blog-breadcrumb a:hover { opacity: 1; text-decoration: underline; }
.blog-breadcrumb span { opacity: .7; }

/* List */
.blog-list-section { padding-top: 40px; }
.blog-filter { margin-bottom: 28px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px; }
.post-card {
  background: var(--card, #fff);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover { transform: translateY(-5px); box-shadow: 0 14px 30px -10px rgba(0,0,0,.2); }
.post-card[hidden] { display: none; }
.post-card-cover {
  --c1: var(--blue);
  --c2: var(--grad-2, #1e6f9f);
  aspect-ratio: 16 / 8;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: rgba(255,255,255,.92);
  font-size: 3.2rem;
  text-decoration: none;
  background:
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--gold) 60%, transparent), transparent 45%),
    linear-gradient(135deg, var(--c1), var(--c2));
}
.post-card:nth-child(3n+2) .post-card-cover { --c1: var(--grad-2, #1e6f9f); --c2: var(--pop, #10b981); }
.post-card:nth-child(3n+3) .post-card-cover { --c1: var(--pop, #10b981); --c2: var(--blue); }
.post-card-freebie {
  position: absolute;
  left: 14px; bottom: 14px;
  background: var(--gold);
  color: var(--ink, #1a202c);
  font: 700 12px/1 'Inter', 'Noto Sans Tamil', sans-serif;
  padding: 7px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.post-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.post-card-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .82rem; color: var(--muted, #555); margin-bottom: 10px; }
.post-tag {
  background: color-mix(in srgb, var(--blue) 12%, var(--card, #fff));
  color: var(--blue);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: .72rem;
}
.post-card h2, .post-card h3 { font-size: 1.15rem; line-height: 1.5; margin: 0 0 10px; }
.post-card h2 a, .post-card h3 a { color: var(--dark); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--blue); }
.post-card p { color: var(--muted, #555); font-size: .92rem; line-height: 1.75; margin: 0 0 16px; flex: 1; }
.post-card-foot { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted, #555); margin-top: auto; }

/* Article */
.post-header {
  background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 9%, var(--paper)), var(--paper));
  padding: 34px 0 10px;
}
.post-wrap { max-width: 800px; }
.post-header .blog-breadcrumb { color: var(--muted, #555); margin-bottom: 18px; }
.post-header h1 { font-size: clamp(1.7rem, 4.2vw, 2.4rem); line-height: 1.4; color: var(--dark); margin: 6px 0 14px; }
.post-byline { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted, #555); font-size: .9rem; margin: 0 0 10px; }
.post-byline i { color: var(--blue); margin-right: 4px; }

.post-content { font-size: 1.06rem; line-height: 1.95; color: var(--dark); padding: 10px 0; }
.post-content .lead { font-size: 1.15rem; color: var(--dark); }
.post-content h2 {
  font-size: 1.45rem;
  line-height: 1.45;
  margin: 42px 0 12px;
  color: var(--blue);
  padding-left: 14px;
  border-left: 4px solid var(--gold);
}
.post-content a { color: var(--blue); font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.post-content ul { padding-left: 22px; }
.post-content li { margin-bottom: 8px; }
.post-content code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .9em;
  background: color-mix(in srgb, var(--blue) 9%, var(--card, #fff));
  padding: 2px 6px;
  border-radius: 4px;
}
.post-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px 20px;
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.7;
  border-left: 4px solid var(--gold);
}
.post-content pre code { background: none; padding: 0; color: inherit; font-size: .92rem; }
.table-scroll { overflow-x: auto; margin: 16px 0; }
.post-content table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--card, #fff); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.post-content th, .post-content td { padding: 11px 14px; border-bottom: 1px solid var(--line, #e5e7eb); text-align: left; }
.post-content thead th, .post-content thead td { background: color-mix(in srgb, var(--blue) 10%, var(--card, #fff)); color: var(--blue); font-weight: 700; }
.calc-table td, .calc-table th { text-align: center !important; font-family: 'IBM Plex Mono', 'Noto Sans Tamil', monospace; }
.answer-line {
  background: color-mix(in srgb, var(--pop, #10b981) 12%, var(--card, #fff));
  border-left: 4px solid var(--pop, #10b981);
  padding: 10px 16px;
  border-radius: 8px;
}
.tip-box {
  background: color-mix(in srgb, var(--gold) 14%, var(--card, #fff));
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 30px 0;
}
.tip-box strong { color: var(--dark); }
.tip-box i { color: var(--gold); }
.tip-box ul { margin: 10px 0 0; }

/* Free download card */
.freebie {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 30px 0;
  padding: 22px;
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--gold) 50%, transparent), transparent 45%),
    linear-gradient(120deg, var(--blue), var(--grad-2, #1e6f9f));
  box-shadow: 0 14px 30px -12px var(--blue);
}
.freebie-icon {
  flex-shrink: 0;
  width: 60px; height: 60px;
  border-radius: 14px;
  background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
}
.freebie-body { flex: 1; min-width: 0; }
.freebie-label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; color: var(--gold); font-weight: 700; }
.freebie-title { display: block; font-size: 1.12rem; line-height: 1.5; margin-top: 4px; }
.freebie-text { margin: 6px 0 0; font-size: .9rem; line-height: 1.7; color: rgba(255,255,255,.85); }
.freebie-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold);
  color: var(--ink, #1a202c);
  font-weight: 700;
  text-decoration: none;
  padding: 13px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 18px -6px rgba(0,0,0,.35);
  transition: transform .2s ease;
}
.freebie-btn:hover { transform: translateY(-2px); }
.freebie--compact { padding: 14px 18px; margin: 22px 0 6px; }
.freebie--compact .freebie-icon { width: 46px; height: 46px; font-size: 1.3rem; }
.freebie--compact .freebie-title { font-size: 1rem; }

/* Share + author */
.post-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 26px 0; font-weight: 600; }
.post-share a, .post-share button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  font: 600 .88rem 'Inter', sans-serif;
  color: #fff;
  cursor: pointer;
}
.share-wa { background: #25d366; }
.share-fb { background: #1877f2; }
.share-copy { background: var(--dark); color: var(--paper) !important; }
.author-box {
  display: flex; gap: 16px; align-items: center;
  background: var(--card, #fff);
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  margin-bottom: 50px;
}
.author-box img { border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); flex-shrink: 0; }
.author-box strong { color: var(--dark); }
.author-box p { margin: 4px 0 0; color: var(--muted, #555); font-size: .9rem; line-height: 1.7; }

.related-posts { background: color-mix(in srgb, var(--blue) 5%, var(--paper)); padding: 60px 0; }
.related-posts h2 { color: var(--blue); margin: 0 0 24px; font-size: 1.7rem; }

/* CTA + footer */
.blog-cta { background: linear-gradient(120deg, var(--grad-2, #1e6f9f), var(--blue)); color: #fff; padding: 40px 0; }
.blog-cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.blog-cta h2 { margin: 0 0 6px; font-size: 1.45rem; }
.blog-cta p { margin: 0; color: rgba(255,255,255,.85); }
.blog-cta-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #25d366; color: #fff;
  font-weight: 700; text-decoration: none;
  padding: 14px 22px; border-radius: 999px;
  box-shadow: 0 10px 22px -8px rgba(0,0,0,.4);
}
.blog-footer { background: #0b1120; color: #cbd5e1; padding: 34px 0 20px; }
.blog-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.blog-footer strong { color: #fff; font-family: 'Fraunces', serif; font-size: 1.2rem; }
.blog-footer p { margin: 6px 0 0; }
.blog-footer nav { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.blog-footer nav a { color: #cbd5e1; text-decoration: none; }
.blog-footer nav a:hover { color: var(--gold); }
.blog-footer-copy { text-align: center; color: #94a3b8; font-size: .85rem; margin: 26px 0 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.blog-404 { text-align: center; padding: 40px 0; }
.blog-empty { grid-column: 1 / -1; text-align: center; color: var(--muted, #555); font-size: 1.1rem; padding: 40px 0; }
.preview-bar { background: #fff4e5; color: #92400e; text-align: center; padding: 10px 16px; font-weight: 600; border-bottom: 1px solid #fcd9a8; }
.post-content img { max-width: 100%; height: auto; border-radius: 10px; }
.blog-404 h1 { color: var(--blue); }

/* Midnight theme tweaks */
html[data-theme="midnight"] .post-content h2,
html[data-theme="midnight"] .related-posts h2,
html[data-theme="midnight"] .post-tag { color: #93c5fd; }
html[data-theme="midnight"] .main-nav a.is-current { color: #93c5fd; }

@media (max-width: 640px) {
  .blog-hero { padding: 40px 0 46px; }
  .blog-grid { grid-template-columns: 1fr; }
  .freebie { flex-direction: column; align-items: flex-start; text-align: left; }
  .freebie-btn { width: 100%; justify-content: center; box-sizing: border-box; }
  .freebie--compact { flex-direction: row; flex-wrap: wrap; }
  .post-content { font-size: 1rem; }
}

/* =========================================================
   Printable worksheets (blog/worksheet.php)
   ========================================================= */
.ws-body {
  margin: 0;
  background: #e8ecf2;
  font-family: 'Noto Sans Tamil', 'Inter', system-ui, sans-serif;
  color: #111827;
}
.ws-toolbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(90deg, #2c3e50, #1e6f9f);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.ws-back { color: #fff; text-decoration: none; font-weight: 600; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-btn {
  border: none; cursor: pointer;
  background: #d4af37; color: #1a202c;
  font: 700 14px 'Noto Sans Tamil', 'Inter', sans-serif;
  padding: 11px 18px; border-radius: 999px;
}
.ws-btn--alt { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.5); }
.ws-hint { flex-basis: 100%; margin: 0; font-size: 12.5px; color: rgba(255,255,255,.8); }

.ws-paper {
  width: 210mm;
  max-width: calc(100% - 24px);
  min-height: 297mm;
  margin: 24px auto;
  padding: 16mm 15mm;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.ws-head { display: flex; align-items: center; gap: 14px; border-bottom: 3px solid #2c3e50; padding-bottom: 10px; }
.ws-head img { border-radius: 50%; }
.ws-head strong { display: block; font-size: 16px; color: #2c3e50; }
.ws-head span { font-size: 12px; color: #555; }
.ws-title { font-size: 21px; line-height: 1.4; margin: 16px 0 12px; color: #111827; }
.ws-fields { display: flex; gap: 18px; font-size: 14px; margin-bottom: 14px; }
.ws-fields span { flex: 1; display: flex; gap: 6px; align-items: flex-end; }
.ws-fields i { flex: 1; border-bottom: 1px solid #333; height: 18px; }
.ws-instructions { background: #f3f4f6; border-left: 4px solid #d4af37; padding: 8px 12px; font-size: 13px; line-height: 1.6; margin: 0 0 14px; }

.ws-section { margin-bottom: 18px; break-inside: avoid; }
.ws-section h2 { font-size: 15.5px; color: #2c3e50; background: #eef2f7; padding: 6px 10px; border-radius: 4px; margin: 0 0 10px; }
.ws-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 30px; margin: 0; padding-left: 24px; font-family: 'IBM Plex Mono', monospace; font-size: 14.5px; }
.ws-grid li { padding-left: 4px; }
.blank { display: inline-block; min-width: 110px; border-bottom: 1px solid #333; height: 16px; vertical-align: bottom; }
.blank--long { min-width: 260px; }

.ws-code-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ws-code { border: 1px solid #d1d5db; border-radius: 6px; padding: 8px 12px; break-inside: avoid; }
.ws-code h3 { margin: 0 0 4px; font-size: 14px; color: #2c3e50; }
.ws-code pre { margin: 0 0 6px; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; line-height: 1.55; background: #f8fafc; padding: 6px 8px; border-radius: 4px; }
.ws-code p { margin: 4px 0 0; font-size: 13px; }

.ws-lines { height: 150px; background: repeating-linear-gradient(#fff 0 27px, #cbd5e1 27px 28px); }
.ws-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ws-table th, .ws-table td { border: 1px solid #94a3b8; padding: 5px 6px; height: 22px; vertical-align: top; }
.ws-table thead th { background: #eef2f7; color: #2c3e50; }
.ws-status { text-align: center; letter-spacing: 3px; white-space: nowrap; }
.ws-planner td { height: 50px; position: relative; }
.ws-planner th small { display: block; font-weight: 400; font-size: 10.5px; color: #555; }
.ws-check { position: absolute; right: 4px; bottom: 2px; font-size: 13px; color: #64748b; }
.ws-checklist { list-style: none; padding: 0; font-size: 14px; line-height: 2; margin: 0; }
.ws-motto { text-align: center; font-weight: 700; color: #2c3e50; margin-top: 16px; }

/* Worksheets written in the admin editor (plain headings, lists, tables) */
.ws-content > h2, .answers > h2 { font-size: 15.5px; color: #2c3e50; background: #eef2f7; padding: 6px 10px; border-radius: 4px; margin: 16px 0 10px; }
.ws-content > h3 { font-size: 14.5px; color: #2c3e50; margin: 14px 0 8px; }
.ws-content p, .ws-content li { font-size: 14px; line-height: 1.75; }
.ws-content > ol, .ws-content > ul { padding-left: 24px; }
.ws-content > ol > li { margin-bottom: 14px; }
.ws-content table:not(.ws-table) { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 14px; }
.ws-content table:not(.ws-table) td, .ws-content table:not(.ws-table) th { border: 1px solid #94a3b8; padding: 6px 8px; height: 24px; vertical-align: top; }
.ws-content pre { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; line-height: 1.55; background: #f8fafc; border: 1px solid #d1d5db; padding: 8px 10px; border-radius: 4px; white-space: pre-wrap; }
.ws-content img, .answers img { max-width: 100%; height: auto; }

.answers { display: none; border-top: 2px dashed #94a3b8; padding-top: 14px; margin-top: 10px; }
.answers > ol { padding-left: 24px; font-size: 14px; line-height: 1.8; }
.ws-answer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 20px; font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; padding-left: 26px; }
.ws-foot { margin-top: 20px; padding-top: 8px; border-top: 1px solid #d1d5db; font-size: 11.5px; color: #555; text-align: center; }

@media (max-width: 640px) {
  .ws-paper { padding: 18px 14px; min-height: 0; }
  .ws-grid, .ws-code-grid { grid-template-columns: 1fr; }
  .ws-fields { flex-direction: column; gap: 10px; }
  .ws-planner { font-size: 11px; }
}

@page { size: A4; margin: 12mm; }
@media print {
  .ws-body { background: #fff; }
  .ws-toolbar { display: none; }
  .ws-paper { width: auto; max-width: none; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .ws-grid, .ws-code-grid { grid-template-columns: repeat(2, 1fr); }
  .ws-page-break { break-before: page; }
  body.show-answers .answers { display: block; break-before: page; }
  .ws-head, .ws-section h2, .ws-table thead th, .ws-instructions { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
