/* =====================================================================
   svsudhan.com - styles (mobile-first)
   Colours are set once here as variables.
   ===================================================================== */
:root {
  --red: #D32F2F;
  --red-2: #E53935;
  --red-dark: #B71C1C;
  --ink: #111111;
  --ink-2: #1E1E1E;
  --muted: #555;
  --bg: #FFFFFF;
  --bg-alt: #F8F9FA;
  --line: #E0E0E0;
  --green: #2E7D32;
  --amber: #B26A00;
  --wa: #128C4B;
  --fb: #1877F2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: "Noto Sans Tamil", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
  background: var(--bg);
  padding-bottom: 64px; /* space for sticky bar on mobile */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
h1, h2, h3 { line-height: 1.35; color: var(--ink); margin: 0 0 .5em; }
svg { width: 1.2em; height: 1.2em; flex: none; }
:focus-visible { outline: 3px solid var(--red-2); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--red); color: #fff; font-size: 14px; }
.topbar__in { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 12px; }
.topbar__links { display: flex; gap: 16px; }
.topbar a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; }
.topbar a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: #fff; border-bottom: 3px solid var(--red); }
.header__in { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 12px; }
.brand { color: #fff; text-decoration: none; display: flex; flex-direction: column; padding: 6px 0; min-width: 0; }
.brand__name { font-weight: 700; font-size: 19px; }
.brand__role { font-size: 12.5px; color: #ccc; line-height: 1.4; }
.menu-btn { background: none; border: 1px solid #444; color: #fff; border-radius: 8px; width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer; }
.menu-btn svg { width: 26px; height: 26px; }
.nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink-2); flex-direction: column; border-bottom: 3px solid var(--red); }
.nav.open { display: flex; }
.nav a { color: #fff; text-decoration: none; padding: 14px 20px; border-top: 1px solid #333; font-weight: 600; }
.nav a.active { color: var(--red-2); }

section[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; border: 2px solid transparent; cursor: pointer; text-align: center; line-height: 1.4; }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-dark); }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: #0d6e3a; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--fb { background: var(--fb); color: #fff; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--sm { min-height: 40px; padding: 6px 14px; font-size: 15px; }
.btn--block { width: 100%; }

/* ---------- Hero ---------- */
/* Banner image: assets/img/hero-banner-*.webp (made from hero-flag-with-sudhan.png).
   Mobile: banner cropped around the portrait on top, headline below on white.
   Desktop: banner fills the whole hero; headline sits on the flag side over a dark fade. */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%); border-bottom: 4px solid var(--red); }
.hero__in { display: grid; padding: 0 16px; position: relative; z-index: 1; }
.hero__photo { position: relative; margin: 0 -16px; background: #111; }
.hero__photo img { width: 100%; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 78% center; }
.hero__photo::after { content: ""; display: block; height: 12px; background: linear-gradient(#111 50%, var(--red) 50%); } /* party flag stripe */
.hero__badge { position: absolute; left: 16px; bottom: 28px; background: var(--red); color: #fff; font-weight: 700; font-size: 14px; padding: 4px 12px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
/* Party emblem: top-right of the portrait; width scales with the photo (22%), kept between 64px and 130px */
.hero__emblem { position: absolute; top: 12px; right: 12px; z-index: 2; width: clamp(64px, 22%, 130px); padding: clamp(6px, 1.2vw, 12px); background: #fff; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.3); line-height: 0; }
.hero__emblem img { width: 100%; height: auto; }
.hero__text { padding: 24px 0 36px; }
.eyebrow { color: var(--red); font-weight: 700; margin: 0 0 8px; }
.hero__title { font-family: "Catamaran", "Noto Sans Tamil", sans-serif; font-weight: 800; font-size: clamp(26px, 7.5vw, 34px); line-height: 1.2; color: var(--ink); display: flex; flex-direction: column; margin: 0; text-wrap: balance; }
.hero__name { color: var(--red); font-size: 1.25em; line-height: 1.1; white-space: nowrap; } /* keep the name on one line */
.hero__accent { color: var(--red); }
.hero__rule { width: 72px; border: 0; border-top: 3px solid var(--red); margin: 18px 0; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 20px; max-width: 34em; }
.hero__cta { display: flex; flex-direction: column; gap: 12px; }

/* Image placeholder */
.ph { background: repeating-linear-gradient(45deg, #f1f1f1 0 10px, #f7f7f7 10px 20px); border: 2px dashed #cfcfcf; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #888; font-size: 14px; text-align: center; padding: 12px; aspect-ratio: 16 / 10; }
.ph svg { width: 40px; height: 40px; }
.ph--portrait { aspect-ratio: 4 / 5; border-color: var(--red); }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.h2 { font-size: 23px; padding-left: 12px; border-left: 5px solid var(--red); }
.h3 { font-size: 19px; margin-top: 32px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.note { font-size: 14px; color: var(--muted); margin-top: 20px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }

/* ---------- Form ---------- */
.form { display: grid; gap: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.req { color: var(--red); }
.opt, .hint { color: var(--muted); font-weight: 400; font-size: 14px; }
.hint { margin: 6px 0 0; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 12px; min-height: 48px; border: 1px solid #bdbdbd; border-radius: 8px; background: #fff; color: var(--ink-2); }
input[type="file"] { padding: 10px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--red); outline: 2px solid rgba(211,47,47,.2); }
.invalid { border-color: var(--red); background: #fff7f7; }
.err { color: var(--red-dark); font-size: 14px; margin: 4px 0 0; min-height: 0; }
.err:empty { display: none; }
.preview { display: flex; align-items: flex-end; gap: 12px; margin-top: 10px; }
.preview img { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.done { background: #E8F5E9; border: 1px solid #A5D6A7; color: #1B5E20; padding: 12px 14px; border-radius: 8px; margin: 0; font-weight: 600; }

/* ---------- Works ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { font: inherit; font-weight: 600; font-size: 15px; min-height: 44px; padding: 6px 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.work { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.work .ph, .work img { border-radius: 0; border-width: 0 0 1px; aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.work__body { padding: 14px 16px 18px; }
.work h3 { font-size: 17px; margin-bottom: 4px; }
.work__place { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 4px; margin: 0 0 12px; }
.bar { height: 8px; border-radius: 99px; background: #eee; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--red); }
.bar--done > span { background: var(--green); }
.work__meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 14px; }
.tag { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 99px; }
.tag--done { background: #E8F5E9; color: var(--green); }
.tag--ongoing { background: #FFF3E0; color: var(--amber); }

/* ---------- Schemes ---------- */
.scheme h3 { font-size: 18px; color: var(--red-dark); }
.scheme p { margin: 0 0 10px; }
.scheme details { border-top: 1px solid var(--line); padding: 8px 0; }
.scheme summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.scheme ul { margin: 4px 0 4px; padding-left: 22px; }
.scheme .btn { margin-top: 8px; }
.portal { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.portal strong { display: block; color: var(--ink); }
.portal span { font-size: 14px; color: var(--muted); }
.portal svg { color: var(--red); }

/* ---------- Emergency ---------- */
.grid--sos { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sos { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-decoration: none; color: inherit; padding: 14px; border-left: 4px solid var(--red); min-height: 112px; }
.sos svg { width: 28px; height: 28px; color: var(--red); }
.sos__name { font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.sos__num { font-size: clamp(17px, 5vw, 22px); font-weight: 700; color: var(--ink); letter-spacing: .5px; white-space: nowrap; }
.sos--na { opacity: .7; border-left-color: #bbb; }
.sos--na .sos__num { font-size: 15px; color: var(--muted); }
.local h3 { font-size: 17px; margin-bottom: 4px; }
.local p { margin: 2px 0; font-size: 15px; display: flex; gap: 6px; align-items: flex-start; }
.local p svg { margin-top: 4px; color: var(--muted); }

/* ---------- About ---------- */
.about { display: grid; gap: 16px; }
.info { list-style: none; padding: 0; margin: 16px 0; }
.info li { display: flex; gap: 10px; margin-bottom: 10px; }
.info svg { color: var(--red); margin-top: 5px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.fbcard__head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--fb); margin-bottom: 8px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #ccc; border-top: 4px solid var(--red); padding: 32px 0 16px; font-size: 15px; }
.footer__in { display: grid; gap: 20px; }
.footer__name { color: #fff; font-weight: 700; font-size: 18px; margin: 0; }
.footer p { margin: 0; }
.footer__links { display: flex; flex-direction: column; gap: 4px; }
.footer a { color: #fff; text-decoration: none; padding: 4px 0; }
.footer a:hover { color: var(--red-2); }
.footer__copy { text-align: center; font-size: 13px; color: #888; margin-top: 24px !important; padding: 0 16px; }

/* ---------- Sticky mobile bar ---------- */
.stickybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: 1fr 1fr; box-shadow: 0 -2px 10px rgba(0,0,0,.15); padding-bottom: env(safe-area-inset-bottom); background: var(--ink); }
.stickybar a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; color: #fff; text-decoration: none; font-weight: 700; background: var(--red); }
.stickybar a.stickybar__wa { background: var(--wa); }

/* ---------- ≥ 640px ---------- */
@media (min-width: 640px) {
  body { padding-bottom: 0; }
  .stickybar { display: none; }
  .hero__cta { flex-direction: row; flex-wrap: wrap; }
  .form { grid-template-columns: 1fr 1fr; padding: 24px; }
  .field--full { grid-column: 1 / -1; }
  .grid--2, .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--sos { grid-template-columns: repeat(3, 1fr); }
  .about { grid-template-columns: 3fr 2fr; }
  .footer__in { grid-template-columns: 2fr 1fr 1fr; }
}

/* ---------- ≥ 1024px ---------- */
@media (min-width: 1024px) {
  .menu-btn { display: none; }
  .nav { display: flex; position: static; flex-direction: row; background: none; border: 0; gap: 2px; }
  .nav a { border: 0; padding: 8px 9px; font-size: 14.5px; border-radius: 6px; white-space: nowrap; }
  .brand__role { max-width: 360px; }
  .nav a:hover { background: #222; }
  .hero { background: #111; }
  .hero__in { position: static; grid-template-columns: 1fr; min-height: clamp(520px, 42vw, 680px); align-items: center; }
  .hero__photo { position: absolute; inset: 0; margin: 0; }
  .hero__photo img { height: 100%; aspect-ratio: auto; object-position: 70% center; }
  .hero__photo::after { position: absolute; inset: 0; height: auto; background: linear-gradient(90deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.6) 38%, rgba(0,0,0,0) 62%); }
  .hero__text { position: relative; z-index: 2; max-width: 560px; padding: 48px 0; }
  .hero__text .eyebrow { color: #fff; }
  .hero__title, .hero__name { color: #fff; }
  .hero__accent { color: #FF8A80; }
  .hero__rule { border-top-color: var(--red-2); }
  .hero .lead { color: rgba(255,255,255,.9); }
  .hero__badge { left: auto; right: 24px; bottom: 24px; font-size: 15px; }
  .hero__emblem { top: 20px; right: 24px; width: clamp(90px, 9vw, 130px); }
  .hero__title { font-size: 44px; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--sos { grid-template-columns: repeat(4, 1fr); }
  .h2 { font-size: 27px; }
}
