@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil:wght@400;500;600;700&family=Tiro+Tamil:ital@0;1&display=swap");

:root {
  --bg: #f6f2ea;
  --surface: #ffffff;
  --ink: #132238;
  --muted: #5f6b78;
  --accent: #e07a5f;
  --accent-2: #2a9d8f;
  --border: #d7cfc2;
  --shadow: 0 24px 60px rgba(19, 34, 56, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans Tamil", "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.7;
  background: radial-gradient(circle at top left, #fff7e8 0%, #f6f2ea 45%, #eef2f3 100%);
  color: var(--ink);
}

html[lang="ta"] body {
  font-size: 17px;
}

h1,
h2,
h3,
h4 {
  font-family: "Tiro Tamil", "Georgia", serif;
  letter-spacing: 0.2px;
}

html[lang="ta"] h1 {
  font-size: 1.85rem;
}

html[lang="ta"] h2 {
  font-size: 1.35rem;
}

html[lang="ta"] h3 {
  font-size: 1.05rem;
}

html[lang="ta"] h4 {
  font-size: 0.95rem;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

.content a:hover,
.content a:focus {
  color: var(--accent);
}

.rich-text a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rich-text a:hover {
  color: var(--accent);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 10px 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  cursor: pointer;
}

.sidebar-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand a {
  display: inline-flex;
  align-items: center;
  font-family: "Tiro Tamil", "Georgia", serif;
  font-size: 1.6rem;
}

.brand-logo {
  height: 44px;
  width: auto;
  display: block;
}

.tagline {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.dropdown-panel {
  position: absolute;
  top: 48px;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  min-width: 220px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.dropdown-link {
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.dropdown-link:hover,
.dropdown-link.active {
  background: rgba(224, 122, 95, 0.15);
}

.lang-switch {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}

.lang {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.lang.current {
  background: rgba(42, 157, 143, 0.15);
  border-color: rgba(42, 157, 143, 0.3);
}

.page-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 10px;
  padding: 12px;
  flex: 1;
}

.page-body--full {
  grid-template-columns: 1fr;
}

.sidebar {
  position: sticky;
  top: 110px;
  align-self: start;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--shadow);
}

.sidebar-card h4 {
  font-family: "Fraunces", "Georgia", serif;
  margin: 0 0 16px;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.sidebar-link {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
}

.sidebar-link.active,
.sidebar-link:hover {
  color: var(--ink);
  background: rgba(19, 34, 56, 0.08);
}

.content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.hero h1,
.section-hero h1,
.article h1,
.page h1 {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 2.4rem;
  margin: 0 0 12px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--accent);
  margin: 0 0 12px;
  font-weight: 600;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
}

.rich-text {
  line-height: 1.8;
  font-size: 1rem;
}

.rich-text img {
  max-width: 100%;
  border-radius: 16px;
  margin: 18px 0;
}

.rich-text pre {
  background: #132238;
  color: #f7f7f7;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
}

.section-grid {
  display: grid;
  gap: 20px;
  margin-top: 32px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.section-header {
  grid-column: 1 / -1;
  padding: 12px 0 4px;
}

.section-header h2 {
  margin: 0;
  font-family: "Fraunces", "Georgia", serif;
}

.section-card {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(250, 248, 245, 0.7);
}

.section-card h2 {
  margin-top: 0;
  font-family: "Fraunces", "Georgia", serif;
}

.section-card .cta {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent-2);
  font-weight: 600;
}

.article-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.article-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.article-row h2 {
  margin: 0 0 6px;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary {
  margin-top: 8px;
  color: var(--muted);
}

.read-more {
  align-self: center;
  color: var(--accent);
  font-weight: 600;
}

.article-header {
  margin-bottom: 28px;
}

.article-header .lede {
  margin-top: 14px;
}

.notfound {
  text-align: center;
  padding: 80px 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 40px 32px;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  width: 100%;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .page-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(280px, 85vw);
    transform: translateX(-110%);
    transition: transform 0.25s ease;
    z-index: 20;
    padding-top: 100px;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }
}

@media (max-width: 760px) {
  body {
    font-size: 17px;
  }

  html[lang="ta"] body {
    font-size: 16px;
  }

  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .tagline {
    margin-top: 0;
  }

  .site-nav {
    flex-basis: 100%;
  }

  .dropdown-panel {
    left: 0;
    right: auto;
    max-width: calc(100vw - 32px);
  }

  .page-body {
    padding: 8px;
  }

  .content {
    padding: 9px;
  }

  .article-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .site-nav {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown-panel {
    right: auto;
    left: 0;
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(19, 34, 56, 0.4);
  z-index: 15;
}

.sidebar-open .sidebar-overlay {
  display: block;
}
