/* ==========================================================================
   TamilGuru 2.0 — "Editorial" design system
   Loaded last; owns tokens, chrome (header/footer), home, listings,
   and restyles the article, widget and calculator components.
   ========================================================================== */

:root {
  --ink: #1b1714;
  --ink-2: #4a433d;
  --ink-3: #7a7068;
  --paper: #faf7f2;
  --paper-2: #f2ede4;
  --card: #ffffff;
  --line: #e4ddd2;
  --line-strong: #1b1714;
  --accent: #b3261e;        /* kumkum red */
  --accent-ink: #ffffff;
  --accent-soft: #fbe9e6;
  --gold: #a87a12;
  --ok: #2f7d4f;
  --warn: #b3261e;

  --f-head: 'Anek Tamil', 'Noto Sans Tamil', system-ui, sans-serif;
  --f-body: 'Anek Tamil', 'Noto Sans Tamil', system-ui, -apple-system, sans-serif;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgb(27 23 20 / .06), 0 6px 18px -10px rgb(27 23 20 / .18);
  --wrap: 1240px;

  /* Map legacy tokens so main.css / single.css components follow the new palette */
  --tg-primary: var(--accent);
  --tg-primary-hover: #8f1d17;
  --tg-primary-light: var(--accent-soft);
  --tg-secondary: var(--gold);
  --tg-accent: var(--gold);
  --tg-dark: var(--ink);
  --tg-surface: var(--card);
  --tg-surface-subtle: var(--paper);
  --tg-surface-card: var(--card);
  --tg-border: var(--line);
  --tg-border-light: var(--paper-2);
  --tg-text: var(--ink);
  --tg-text-muted: var(--ink-3);
  --tg-text-light: var(--ink-3);
  --tg-radius-sm: var(--r-sm);
  --tg-radius: var(--r);
  --tg-radius-lg: var(--r-lg);
  --tg-shadow: var(--shadow);
  --tg-shadow-lg: var(--shadow);
  --tg-font-sans: var(--f-body);
  --tg-font-tamil: var(--f-body);
  --tg-container-max: var(--wrap);
}

[data-theme="dark"] {
  --ink: #efe9e1;
  --ink-2: #c9c0b5;
  --ink-3: #978d82;
  --paper: #15120f;
  --paper-2: #1e1a16;
  --card: #1c1814;
  --line: #322c26;
  --line-strong: #efe9e1;
  --accent: #e5554b;
  --accent-soft: rgb(229 85 75 / .14);
  --gold: #d9a93c;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);
  --tg-primary-hover: #f06d63;
}

/* ---------- Base ---------- */
html, body { font-family: var(--f-body); }
body {
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
  padding-bottom: 0;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--f-head); color: var(--ink); line-height: 1.35; letter-spacing: 0; }
.container { max-width: var(--wrap); padding-inline: 16px; margin-inline: auto; }
@media (min-width: 768px) { .container { padding-inline: 24px; } }
.tg-muted { color: var(--ink-3); font-size: .95rem; }

/* ---------- Primitives ---------- */
.tg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; transition: background .2s, color .2s, border-color .2s; white-space: nowrap;
}
.tg-btn:hover { border-color: var(--ink); color: var(--ink); }
.tg-btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tg-btn-accent:hover { background: var(--tg-primary-hover); border-color: var(--tg-primary-hover); color: #fff; }
.tg-icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: transparent; border: 1px solid transparent; color: var(--ink); cursor: pointer; font-size: 1.6rem; line-height: 1;
}
.tg-icon-btn:hover { border-color: var(--line); background: var(--paper-2); }
.tg-kicker {
  display: inline-block; font-family: var(--f-body); font-size: .78rem; font-weight: 700;
  color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .35rem;
}
.tg-chip {
  display: inline-block; padding: .35rem .85rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: .9rem; background: var(--card);
}
.tg-chip:hover { border-color: var(--accent); }
.tg-byline { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .85rem; color: var(--ink-3); }
.tg-byline > * + *::before { content: "·"; margin-right: .75rem; }
.tg-ph {
  display: grid; place-items: center; width: 100%; height: 100%; min-height: 120px;
  background: var(--paper-2); color: var(--line); font-family: var(--f-head); font-size: 3rem; font-weight: 700;
}
.tg-rule-head {
  font-size: 1.15rem; font-weight: 700; padding-top: .6rem; margin: 0 0 1rem;
  border-top: 3px solid var(--line-strong); display: block;
}
.tg-more { font-size: .9rem; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* ---------- Header (single sticky bar) ---------- */
:root { --tg-header-height: 64px; }
.tg-header {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.admin-bar .tg-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tg-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .tg-header { top: 0; } }
.tg-header-row { display: flex; align-items: center; gap: .75rem; height: var(--tg-header-height); }
.tg-logo { flex: none; }
.tg-logo-link { display: inline-flex; align-items: center; gap: .5rem; }
.tg-logo-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff; font-family: var(--f-head); font-weight: 800; font-size: 1.2rem;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18);
}
.tg-logo-word { font-family: var(--f-head); font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.tg-logo-word em { font-style: normal; color: var(--accent); }
.tg-logo .custom-logo { max-height: 44px; width: auto; }

.tg-nav { display: none; flex: 1; min-width: 0; margin-inline: .5rem; }
.tg-nav-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; justify-content: safe center; gap: .1rem; }
.tg-nav-menu > li { position: relative; }
.tg-nav-menu > li > a {
  display: inline-flex; align-items: center; gap: .3rem; height: 38px; padding: 0 .65rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s;
}
.tg-nav-menu > li > a:hover { background: var(--paper-2); color: var(--ink); }
.tg-nav-menu > .current-menu-item > a, .tg-nav-menu > .current-menu-ancestor > a { background: var(--ink); color: var(--paper); }
.tg-nav-menu > .menu-item-has-children > a::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); opacity: .6; }
.tg-nav-menu .sub-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; list-style: none; margin: 0; padding: .4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.tg-nav-menu .sub-menu::before { content: ""; position: absolute; inset: -10px 0 auto; height: 10px; }
.tg-nav-menu li:hover > .sub-menu, .tg-nav-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.tg-nav-menu .sub-menu a { display: block; padding: .5rem .75rem; border-radius: var(--r-sm); font-size: .95rem; }
.tg-nav-menu .sub-menu a:hover { background: var(--paper-2); color: var(--ink); }

.tg-header-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.tg-search-pill {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font: inherit; cursor: pointer;
  transition: border-color .15s;
}
.tg-search-pill:hover { border-color: var(--ink); color: var(--ink); }
.tg-search-pill-text { display: none; }
.tg-theme-toggle { width: 40px; height: 40px; font-size: 1.05rem; border: 1px solid var(--line); background: var(--card); }
.tg-header-cta { display: none; height: 40px; }
.tg-menu-toggle { margin-left: -8px; }

@media (min-width: 640px) {
  .tg-header-cta { display: inline-flex; }
}
@media (min-width: 1280px) {
  :root { --tg-header-height: 72px; }
  .tg-menu-toggle { display: none; }
  .tg-nav { display: block; }
  .tg-logo-word { font-size: 1.6rem; }
  .tg-logo-mark { width: 40px; height: 40px; font-size: 1.3rem; }
}

/* ---------- Ticker ---------- */
.tg-ticker { border-bottom: 1px solid var(--line); background: var(--paper-2); }
.tg-ticker-inner { display: flex; align-items: center; gap: .75rem; min-height: 42px; }
.tg-ticker-label {
  flex: none; display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700; color: var(--accent);
}
.tg-ticker-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: tgPulse 2s infinite; }
@keyframes tgPulse { 50% { box-shadow: 0 0 0 7px transparent; } }
.tg-ticker-track {
  display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.tg-ticker-track::-webkit-scrollbar { display: none; }
.tg-ticker-item {
  flex: none; font-size: .88rem; color: var(--ink-2); padding: .2rem .75rem; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
}
.tg-ticker-item:hover { border-color: var(--accent); color: var(--accent); }
.tg-ticker-nav-wrap { display: none; gap: .25rem; flex: none; }
.tg-ticker-nav {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: inline-grid; place-items: center;
  background: var(--card); color: var(--ink); font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.tg-ticker-date { display: none; flex: none; font-size: .82rem; color: var(--ink-3); padding-left: .75rem; border-left: 1px solid var(--line); }
@media (min-width: 768px) { .tg-ticker-nav-wrap { display: inline-flex; } }
@media (min-width: 1100px) { .tg-ticker-date { display: inline; } }

/* ---------- Drawer ---------- */
.tg-mobile-drawer { position: fixed; inset: 0; z-index: 1000; visibility: hidden; }
.tg-mobile-drawer.active { visibility: visible; }
.tg-drawer-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .45); opacity: 0; transition: opacity .25s; }
.tg-mobile-drawer.active .tg-drawer-backdrop { opacity: 1; }
.tg-drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); overflow-y: auto;
  background: var(--paper); padding: 1rem 1.25rem 2rem; transform: translateX(-100%); transition: transform .3s ease;
}
.tg-mobile-drawer.active .tg-drawer-panel { transform: none; }
.tg-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.tg-drawer-head .tg-logo-word { font-size: 1.5rem; }
.tg-drawer-search input, .tg-search-field {
  width: 100%; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); font: inherit;
}
.tg-drawer-menu { list-style: none; margin: 1rem 0; padding: 0; }
.tg-drawer-menu a { display: block; padding: .7rem 0; border-bottom: 1px solid var(--line); font-weight: 600; font-family: var(--f-head); }
.tg-drawer-menu .sub-menu { list-style: none; padding-left: 1rem; }
.tg-drawer-menu .sub-menu a { font-family: var(--f-body); font-weight: 400; }
.tg-drawer-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 1.25rem 0 .5rem; }
.tg-drawer-tools { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.tg-drawer-tools a { display: flex; flex-direction: column; gap: .2rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font-size: .9rem; font-weight: 600; }
.tg-drawer-social { display: flex; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Search modal ---------- */
.tg-search-modal { position: fixed; inset: 0; z-index: 1001; display: none; }
.tg-search-modal.active { display: block; }
.tg-search-modal-backdrop { position: absolute; inset: 0; background: rgb(20 16 12 / .6); backdrop-filter: blur(4px); }
.tg-search-modal-content {
  position: relative; margin: 10vh auto 0; width: min(640px, calc(100% - 32px)); background: var(--paper);
  border-radius: var(--r-lg); padding: 1.75rem; box-shadow: var(--shadow);
}
.tg-search-close { position: absolute; top: .6rem; right: .6rem; }
.tg-search-form { display: flex; gap: .5rem; }
.tg-search-form .tg-search-field { flex: 1; min-width: 0; }
.tg-search-suggest { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

/* ---------- Home: lead ---------- */
.tg-home { padding-top: 1.5rem; }
.tg-lead { display: grid; gap: 1.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.tg-lead-media, .tg-story-media, .tg-card-media {
  display: block; overflow: hidden; border-radius: var(--r); background: var(--paper-2); aspect-ratio: 16 / 9; margin-bottom: .8rem;
}
.tg-lead-media img, .tg-story-media img, .tg-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
a:hover > img, .tg-card:hover .tg-card-media img { transform: scale(1.03); }
.tg-lead-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; margin: 0 0 .6rem; line-height: 1.3; }
.tg-lead-excerpt { color: var(--ink-2); font-size: 1.05rem; margin: 0 0 .6rem; }
.tg-lead-second { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; }
.tg-story-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.tg-lead-list ol { list-style: none; counter-reset: n; margin: 0; padding: 0; }
.tg-lead-list li { counter-increment: n; display: grid; grid-template-columns: 2rem 1fr; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.tg-lead-list li::before { content: counter(n); grid-row: span 2; font-family: var(--f-head); font-size: 1.4rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.tg-lead-list li a { font-weight: 600; line-height: 1.45; }
.tg-lead-list time { font-size: .8rem; color: var(--ink-3); }
@media (min-width: 768px) {
  .tg-lead { grid-template-columns: 1.6fr 1fr; }
  .tg-lead-main { grid-row: span 2; }
  .tg-lead-second { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .tg-lead { grid-template-columns: 1.7fr 1fr 1fr; }
  .tg-lead-main { grid-row: auto; padding-right: 1.5rem; border-right: 1px solid var(--line); }
  .tg-lead-second { grid-template-columns: 1fr; padding-right: 1.5rem; border-right: 1px solid var(--line); }
}

/* ---------- Home: tools ---------- */
.tg-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; padding-block: 1.75rem; }
.tg-tool {
  display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); transition: border-color .2s, transform .2s;
}
.tg-tool:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.tg-tool-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--accent-soft); font-size: 1.2rem; }
.tg-tool strong { display: block; font-size: .98rem; line-height: 1.3; }
.tg-tool small { display: block; font-size: .8rem; color: var(--ink-3); line-height: 1.35; }
@media (min-width: 900px) { .tg-tools { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Blocks ---------- */
.tg-block { margin-bottom: 2.5rem; }
.tg-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.tg-block-head .tg-rule-head { flex: 1; }
.tg-block-head .tg-more { padding-top: .75rem; border-top: 3px solid var(--line-strong); }
.tg-block-tint { background: var(--paper-2); border-radius: var(--r-lg); padding: 1.25rem; }

.tg-zodiac { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.tg-zodiac-item {
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: .9rem .4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .2s;
}
.tg-zodiac-item:hover { border-color: var(--accent); color: var(--ink); }
.tg-zodiac-sym { font-size: 1.6rem; line-height: 1; color: var(--accent); margin-bottom: .35rem; }
.tg-zodiac-item strong { font-size: .95rem; }
.tg-zodiac-item small { font-size: .75rem; color: var(--ink-3); }
@media (min-width: 640px) { .tg-zodiac { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .tg-zodiac { grid-template-columns: repeat(6, 1fr); } }

.tg-quotes { display: grid; gap: 1rem; }
.tg-quote { display: block; padding: 1.25rem; background: var(--card); border-radius: var(--r); border-left: 3px solid var(--accent); }
.tg-quote blockquote { margin: 0 0 .6rem; font-family: var(--f-head); font-size: 1.05rem; line-height: 1.6; color: var(--ink); }
.tg-quote cite { font-style: normal; font-size: .85rem; color: var(--ink-3); }
@media (min-width: 768px) { .tg-quotes { grid-template-columns: repeat(3, 1fr); } }

.tg-list { list-style: none; margin: 0; padding: 0; }
.tg-list a { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.tg-list-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.tg-list-t { flex: 1; font-weight: 600; line-height: 1.45; }
.tg-list time { font-size: .8rem; color: var(--ink-3); }

/* ---------- Cards ---------- */
.tg-card-grid { display: grid; gap: 1.75rem 1.5rem; }
@media (min-width: 600px) { .tg-card-grid { grid-template-columns: repeat(2, 1fr); } }
.tg-card { display: flex; flex-direction: column; background: none; border: 0; box-shadow: none; }
.tg-card-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 .4rem; line-height: 1.4; }
.tg-card-excerpt { color: var(--ink-2); font-size: .95rem; margin: 0 0 .5rem; }

/* ---------- Layout + sidebar ---------- */
.tg-layout-wrap { display: grid; gap: 2.5rem; padding: 1.5rem 0 3rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .tg-layout-wrap { grid-template-columns: minmax(0, 1fr) 320px; } }
.tg-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 1024px) { .tg-sidebar { position: sticky; top: calc(var(--tg-header-height) + 16px); align-self: start; } }
.tg-box, .tg-widget {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; box-shadow: none;
}
.tg-box .tg-rule-head, .tg-widget-title {
  font-family: var(--f-head); font-size: 1.05rem; font-weight: 700; margin: 0 0 .9rem; padding: 0 0 .6rem;
  border: 0; border-bottom: 2px solid var(--line-strong); background: none; color: var(--ink);
}
.tg-widget-title::before, .tg-widget-title::after { display: none !important; }
.tg-panchang { margin: 0; }
.tg-panchang div, .tg-panchangam-row { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.tg-panchang div:last-child { border-bottom: 0; }
.tg-panchang dt { color: var(--ink-3); }
.tg-panchang dd { margin: 0; font-weight: 600; text-align: right; }
.tg-panchang .is-warn dd { color: var(--warn); }
.tg-join { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.tg-join a { flex: 1; text-align: center; padding: .55rem .75rem; border-radius: 999px; font-weight: 600; font-size: .9rem; color: #fff; }
.tg-join-wa { background: #1f9d55; } .tg-join-tg { background: #2a8bc9; } .tg-join-yt { background: #c4302b; }
.tg-join a:hover { color: #fff; opacity: .9; }
.tg-widget ul { list-style: none; padding: 0; margin: 0; }
.tg-widget li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.tg-widget li:last-child { border-bottom: 0; }
.tg-widget-post-item { display: flex; gap: .75rem; align-items: flex-start; }
.tg-widget-post-thumb { flex: none; width: 76px; border-radius: var(--r-sm); overflow: hidden; }
.tg-widget-post-title { font-family: var(--f-body); font-weight: 600; font-size: .95rem; line-height: 1.4; }
.tg-widget-post-meta { font-size: .78rem; color: var(--ink-3); }

/* ---------- Listing pages ---------- */
.tg-listing { padding-top: 1.25rem; }
.tg-page-head { padding: 1.5rem 0 1.25rem; border-bottom: 3px solid var(--line-strong); }
.tg-page-title { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 700; margin: 0; }
.tg-page-desc { color: var(--ink-2); margin-top: .5rem; max-width: 65ch; }
.tg-empty { padding: 3rem 1rem; text-align: center; }
.tg-empty .tg-search-form { max-width: 480px; margin: 1.25rem auto 0; }
.navigation.pagination { margin: 2.5rem 0 0; }
.nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.nav-links .page-numbers {
  min-width: 40px; height: 40px; padding: 0 .8rem; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 600; font-size: .92rem;
}
.nav-links .page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.nav-links a.page-numbers:hover { border-color: var(--accent); }
.tg-404 { text-align: center; padding-block: 4rem; max-width: 640px; }
.tg-404-num { font-family: var(--f-head); font-size: 6rem; font-weight: 700; color: var(--accent); line-height: 1; margin: 0 0 .5rem; }
.tg-404 .tg-page-desc { margin-inline: auto; margin-bottom: 1.5rem; }
.tg-404-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1.5rem; }

/* ---------- Breadcrumbs ---------- */
.tg-breadcrumbs, .yoast-breadcrumbs, #breadcrumbs { font-size: .85rem; color: var(--ink-3); background: none; padding: 0; border: 0; box-shadow: none; }
.tg-breadcrumbs a, #breadcrumbs a { color: var(--ink-2); }

/* ---------- Article (restyles single.php markup) ---------- */
.single .site-main, .page .site-main { padding-top: 1rem; }
.tg-article-container { background: none; border: 0; box-shadow: none; padding: 0; }
.tg-article-header { text-align: left; margin-bottom: 1.25rem; }
.tg-article-title { font-size: clamp(1.75rem, 4.2vw, 2.7rem); font-weight: 700; line-height: 1.3; margin: .4rem 0 .9rem; color: var(--ink); }
.tg-badge, .tg-badge-primary, .tg-badge-sm {
  background: none; color: var(--accent); padding: 0; border-radius: 0; font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; box-shadow: none;
}
.tg-meta, .tg-article-meta-wrap { color: var(--ink-3); font-size: .88rem; border-color: var(--line); }
.tg-article-featured-image img, .tg-article-featured-video { border-radius: var(--r-lg); }
.tg-hero-caption { font-size: .82rem; color: var(--ink-3); margin-top: .5rem; }
.tg-article-content { font-size: 1.1rem; line-height: 1.9; color: var(--ink); max-width: none; }
.tg-article-content h2 { font-size: 1.6rem; margin: 2.2rem 0 .8rem; padding: 0; border: 0; background: none; }
.tg-article-content h3 { font-size: 1.3rem; margin: 1.8rem 0 .6rem; }
.tg-article-content h2::before, .tg-article-content h2::after { display: none; }
.tg-article-content p { margin: 0 0 1.25rem; }
.tg-article-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.tg-article-content blockquote {
  margin: 1.75rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 3px solid var(--accent);
  background: none; font-family: var(--f-head); font-size: 1.2rem; color: var(--ink);
}
.tg-article-content ul, .tg-article-content ol { padding-left: 1.4rem; margin: 0 0 1.25rem; }
.tg-article-content li { margin-bottom: .4rem; }
.tg-article-content table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1.5rem 0; display: block; overflow-x: auto; }
.tg-article-content th, .tg-article-content td { border: 1px solid var(--line); padding: .6rem .8rem; text-align: left; }
.tg-article-content th { background: var(--paper-2); font-weight: 700; }
.tg-article-content img { border-radius: var(--r); }
.tg-article-toolbar { border-color: var(--line); background: none; }
.tg-share-link, .tg-btn-share-bottom { border-radius: 999px; }
.tg-tag-pill { border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-2); padding: .3rem .8rem; font-size: .85rem; }
.tg-tag-pill:hover { border-color: var(--accent); color: var(--accent); }
.tg-author-box-modern, .tg-related-section, .tg-post-navigation .tg-nav-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: none;
}
.tg-related-title, .tg-share-bottom-title { font-family: var(--f-head); }
.tg-related-card { background: none; border: 0; box-shadow: none; }
.tg-related-card-title { font-family: var(--f-head); font-size: 1rem; line-height: 1.4; }
.tg-toc-rail-link.is-active { color: var(--accent); border-color: var(--accent); }
#tgReadingProgressBar { background: var(--accent); }

/* ---------- Calculators & forms (page templates) ---------- */
.tg-calc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: none; }
.tg-calc-input, .tg-calc-card select, .tg-calc-card input[type="number"], .tg-calc-card input[type="date"], .tg-calc-card input[type="text"] {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); font: inherit;
}
.tg-calc-input:focus, .tg-calc-card input:focus, .tg-calc-card select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.tg-calc-btn { background: var(--accent); color: #fff; border-radius: 999px; border: 0; font-weight: 700; box-shadow: none; }
.tg-calc-btn:hover { background: var(--tg-primary-hover); }

/* ---------- Footer ---------- */
.tg-footer { background: var(--paper-2); color: var(--ink-2); border-top: 3px solid var(--line-strong); padding: 3rem 0 1.5rem; margin-top: 2rem; }
.tg-footer-top { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; }
.tg-footer-brand { grid-column: 1 / -1; }
.tg-footer-brand .tg-logo-word { font-size: 1.9rem; }
.tg-footer-brand p { max-width: 42ch; font-size: .95rem; margin: .5rem 0 1rem; }
.tg-footer-social { display: flex; gap: .6rem; }
.tg-footer-social a { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-2); }
.tg-footer-social a:hover { border-color: var(--accent); color: var(--accent); }
.tg-footer-col h4 { font-size: .8rem; font-family: var(--f-body); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin: 0 0 .8rem; }
.tg-footer-col ul { list-style: none; padding: 0; margin: 0; }
.tg-footer-col li { margin-bottom: .45rem; font-size: .95rem; }
.tg-footer-menu { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: 1.5rem 0 0; margin: 0; font-size: .9rem; }
.tg-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-3); }
@media (min-width: 900px) {
  .tg-footer-top { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .tg-footer-brand { grid-column: auto; }
}

/* ---------- Back to top & mobile bar ---------- */
.tg-back-to-top {
  position: fixed; right: 16px; bottom: 80px; z-index: 80; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--paper); border: 0; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .25s;
}
.tg-back-to-top.active { opacity: 1; visibility: visible; transform: none; }
.tg-mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 85; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tg-mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .45rem 0; font-size: .72rem; font-weight: 600; color: var(--ink-3); }
.tg-mobile-nav-item span:first-child { font-size: 1.15rem; }
.tg-mobile-nav-item.active { color: var(--accent); }
body { padding-bottom: 60px; }
@media (min-width: 1024px) {
  .tg-mobile-bar { display: none; }
  body { padding-bottom: 0; }
  .tg-back-to-top { bottom: 24px; }
}

/* ---------- Ads ---------- */
.tg-ad-container { background: none; border: 0; padding: 0; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Overflow guards for long Tamil words ---------- */
h1, h2, h3, .tg-lead-title, .tg-card-title, .tg-story-title, .tg-article-title { overflow-wrap: break-word; }
.tg-lead, .tg-lead-second, .tg-tools, .tg-card-grid, .tg-zodiac, .tg-quotes, .tg-footer-top { grid-template-columns: minmax(0, 1fr); }
.tg-lead > *, .tg-lead-second > *, .tg-tools > *, .tg-card-grid > * { min-width: 0; }
.tg-lead-second { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.tg-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tg-zodiac { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tg-footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tg-lead-title { font-size: clamp(1.45rem, 2.8vw, 1.9rem); line-height: 1.35; }
html, body { overflow-x: clip; }
@media (min-width: 600px) { .tg-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 640px) { .tg-zodiac { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 768px) {
  .tg-lead { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .tg-quotes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .tg-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tg-footer-top { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) { .tg-zodiac { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .tg-lead { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); }
  .tg-lead-second { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Pin article grid columns (stray injected markup can't shift content) ---------- */
.tg-layout-wrap > :not(.tg-toc-rail):not(.tg-main-content):not(.tg-sidebar) { grid-column: 1 / -1; }
@media (min-width: 1025px) {
  .tg-layout-wrap > .tg-main-content { grid-column: 1; grid-row: 1; }
  .tg-layout-wrap > .tg-sidebar { grid-column: 2; grid-row: 1; }
}
@media (min-width: 1200px) {
  .tg-layout-wrap.tg-layout-has-toc > .tg-toc-rail { grid-column: 1; grid-row: 1; }
  .tg-layout-wrap.tg-layout-has-toc > .tg-main-content { grid-column: 2; grid-row: 1; }
  .tg-layout-wrap.tg-layout-has-toc > .tg-sidebar { grid-column: 3; grid-row: 1; }
}
