:root {
  --c5t-blue: #1477d6;
  --c5t-purple: #8a2fa0;
  --c5t-red: #e0264d;
  --c5t-gradient: linear-gradient(100deg, var(--c5t-blue) 0%, var(--c5t-purple) 55%, var(--c5t-red) 100%);
  --c5t-ink: #1a1a1a;
  --c5t-muted: #6b6f76;
  --c5t-border: #e7e7ea;
  --c5t-bg: #ffffff;
  --c5t-bg-alt: #f6f7f9;
  --c5t-footer-bg: #171923;
  --c5t-footer-ink: #c9cbd3;
  --c5t-max: 1160px;
  --c5t-radius: 10px;
  --c5t-shadow: 0 2px 10px rgba(20, 20, 30, 0.06);
  --c5t-shadow-hover: 0 10px 24px rgba(20, 20, 30, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Noto Sans Tamil", "Nirmala UI", -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--c5t-ink);
  background: var(--c5t-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--c5t-purple); }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--c5t-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c5t-border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--c5t-gradient);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  flex-wrap: wrap;
}
.site-brand { display: flex; align-items: center; }
.site-logo { height: 42px; width: auto; }
.site-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--c5t-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  cursor: pointer;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--c5t-ink);
  border-radius: 2px;
}
.site-nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px 22px;
  font-size: 0.94rem;
  font-weight: 600;
}
.site-nav a { padding: 4px 2px; position: relative; }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--c5t-gradient);
  transform: scaleX(0);
  transition: transform .15s ease;
}
.site-nav a:hover::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero {
  margin: 22px 0 6px;
  padding: 26px 28px;
  border-radius: var(--c5t-radius);
  background: var(--c5t-gradient);
  color: #fff;
  box-shadow: var(--c5t-shadow);
}
.hero p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 68ch;
}

/* ---------- Grids ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  margin: 26px 0;
}
.post-card {
  border: 1px solid var(--c5t-border);
  border-radius: var(--c5t-radius);
  overflow: hidden;
  background: var(--c5t-bg);
  box-shadow: var(--c5t-shadow);
  transition: box-shadow .18s ease, transform .18s ease;
}
.post-card:hover { box-shadow: var(--c5t-shadow-hover); transform: translateY(-3px); }
.post-card .thumb {
  aspect-ratio: 16 / 9;
  background: var(--c5t-bg-alt);
  overflow: hidden;
}
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .thumb img { transform: scale(1.05); }

.thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c5t-gradient);
}
.thumb-placeholder img { width: 42%; height: auto; opacity: 0.95; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15)); }
.post-media .thumb-placeholder { aspect-ratio: 16/9; border-radius: var(--c5t-radius); }
.post-media .thumb-placeholder img { width: 22%; }
.post-card .body { padding: 12px 14px 16px; }
.post-card .cat {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--c5t-purple);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.post-card h3 {
  font-size: 1.04rem;
  line-height: 1.4;
  margin: 6px 0 6px;
  font-weight: 700;
}
.post-card .meta {
  font-size: 0.78rem;
  color: var(--c5t-muted);
}
.badge {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 800;
  color: #fff;
  background: var(--c5t-ink);
  border-radius: 4px;
  padding: 2px 7px;
  margin-right: 6px;
  vertical-align: middle;
  letter-spacing: .02em;
}
.badge.video { background: var(--c5t-gradient); }

/* ---------- Section heading / breadcrumb ---------- */
.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  padding-bottom: 12px;
  margin: 30px 0 4px;
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 64px;
  height: 4px;
  border-radius: 4px;
  background: var(--c5t-gradient);
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--c5t-muted);
  margin: 20px 0 0;
}
.breadcrumb a { color: var(--c5t-muted); text-decoration: underline; }

/* ---------- Pagination ---------- */
.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 34px 0 46px;
  font-weight: 700;
  font-size: 0.9rem;
}
.pager a, .pager span {
  padding: 8px 16px;
  border: 1px solid var(--c5t-border);
  border-radius: 999px;
}
.pager a { background: var(--c5t-bg); }
.pager a:hover { border-color: var(--c5t-purple); color: var(--c5t-purple); }
.pager .disabled { color: var(--c5t-muted); opacity: 0.45; }

/* ---------- Single post ---------- */
.post-header { margin: 20px 0 12px; }
.post-header h1 { font-size: 1.8rem; line-height: 1.32; margin: 8px 0; font-weight: 800; }
.post-meta {
  font-size: 0.85rem;
  color: var(--c5t-muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.post-media {
  margin: 18px 0;
  background: var(--c5t-bg-alt);
  border-radius: var(--c5t-radius);
  overflow: hidden;
  box-shadow: var(--c5t-shadow);
}
.post-media img { width: 100%; }
.video-embed { position: relative; width: 100%; padding-top: 56.25%; }
.video-embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}
.post-body { font-size: 1.04rem; max-width: 78ch; }
.post-body p { margin: 0 0 1.1em; }
.post-body img { border-radius: 8px; margin: 12px 0; }
.post-body h2, .post-body h3 { margin-top: 1.6em; }
.post-body figure { margin: 1.4em 0; }
.post-body figcaption { font-size: 0.85rem; color: var(--c5t-muted); margin-top: 6px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  max-width: none;
}
.gallery-grid figure { margin: 0; border-radius: var(--c5t-radius); overflow: hidden; box-shadow: var(--c5t-shadow); }
.gallery-grid img { border-radius: 0; margin: 0; aspect-ratio: 4/3; object-fit: cover; }
.gallery-grid figcaption { padding: 8px 12px; }

.tag-list { margin: 30px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c5t-muted);
  background: var(--c5t-bg-alt);
  border: 1px solid var(--c5t-border);
  border-radius: 999px;
  padding: 5px 13px;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 36px;
  background: var(--c5t-footer-bg);
  color: var(--c5t-footer-ink);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 24px;
  padding: 26px 20px 16px;
}
.footer-col h4 {
  color: #fff;
  font-size: 0.85rem;
  margin: 0 0 8px;
  letter-spacing: .02em;
}
.footer-about .footer-logo { height: 32px; margin-bottom: 8px; border-radius: 6px; }
.footer-about p { font-size: 0.82rem; line-height: 1.45; color: var(--c5t-footer-ink); margin: 0; }
.footer-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 14px;
}
.footer-links + .footer-links { margin-top: 8px; }
.footer-links li { font-size: 0.82rem; }
.footer-links a { color: var(--c5t-footer-ink); }
.footer-links a:hover { color: #fff; }
.footer-contact { flex-direction: column; gap: 4px; }
.footer-contact li { color: var(--c5t-footer-ink); }
.social-links { display: flex; gap: 8px; margin-top: 10px; }
.social-links a {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.social-links a svg { width: 15px; height: 15px; }
.social-links a:hover { background: var(--c5t-gradient); color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 10px 20px;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; padding: 22px 20px 14px; }
}

/* Switch to the hamburger menu well before the nav has room to wrap into
   multiple lines next to the logo (was 640px, but 6+ items already wrap
   awkwardly on tablet-width screens). */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    flex: none;
    width: 100%;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 0 6px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 8px 4px; }
}

@media (max-width: 640px) {
  .post-header h1 { font-size: 1.4rem; }
  .hero { padding: 20px; }
  .hero p { font-size: 0.95rem; }
}
