/* =====================================================================
   Guntakal - website redesign
   Design concept: a civic service-counter / noticeboard, not a SaaS
   marketing site. Loaded AFTER css/style.css (still reuses its form
   input basics, .btn structure, .badge semantics) but overrides the
   visual language almost entirely with its own tokens below.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,500&family=Public+Sans:wght@400;500;600;700&display=swap');

:root {
  --paper: #EEF1EA;
  --surface: #FFFFFF;
  --ink: #1E2420;
  --muted: #5B6158;
  --primary: #0F4C41;
  --primary-deep: #0A332B;
  --accent: #E19A2E;
  --accent-deep: #B87A1D;
  --line: #DCE0D4;
  --radius: 12px;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Public Sans', -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Base overrides ---------- */
body {
  background: #FFF;
  color: var(--ink);
  font-family: var(--sans);
}
main.site-main { max-width: 1180px; padding-top: 96px; }
h1, h2, h3, .section-title, .page-head h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
a { color: var(--primary); }
::selection { background: var(--accent); color: var(--primary-deep); }

/* Focus visibility (accessibility floor) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-deep); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Tricolour identity strip ---------- */
.identity-strip { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 1100; display: flex; }
.identity-strip span { flex: 1; }
.identity-strip span:nth-child(1) { background: #FF671F; }
.identity-strip span:nth-child(2) { background: #FFFFFF; }
.identity-strip span:nth-child(3) { background: #046A38; }

/* ---------- Navbar ---------- */
.site-navbar {
  background: #f6c816;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  padding: 14px 0;
  top: 4px;
}
.site-navbar .navbar-brand { color: var(--primary-deep); gap: 10px; }
.site-navbar .navbar-brand img { width: 34px; }
.site-navbar .navbar-brand span > span#appTitle { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; display: block; line-height: 1.1; }
.site-navbar .navbar-brand small { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.02em; }

.site-navbar .nav-link { color: var(--ink); font-weight: 500; font-size: 0.92rem; padding-left: 14px; padding-right: 14px; }
.site-navbar .nav-link:hover, .site-navbar .nav-link:focus { color: var(--primary); }
.site-navbar .nav-link.active { color: var(--primary); font-weight: 600; text-decoration: none; box-shadow: inset 0 -2px 0 var(--accent); }
.site-navbar .dropdown-menu { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(10,51,43,0.12); }
.site-navbar .dropdown-item { color: var(--ink); font-size: 0.9rem; }
.site-navbar .dropdown-item:hover, .site-navbar .dropdown-item:focus { background: var(--paper); color: var(--primary); }
.site-navbar .navbar-toggler { border-color: var(--line); }
.site-navbar .navbar-toggler-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%230F4C41' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); }

.navbar-utils .lang-select {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line) !important;
  border-radius: 8px; padding: 6px 10px; font-size: 0.82rem;
}
.navbar-utils .auth-widget a i { color: var(--primary) !important; }

@media (max-width: 991px) {
  .site-navbar .navbar-collapse { background: var(--surface); margin-top: 12px; padding: 14px; border-radius: 10px; border: 1px solid var(--line); }
  .navbar-utils { margin: 12px 2px 2px; }
}

/* ---------- Page head (non-home pages) ---------- */
.page-head { margin-bottom: 28px; padding-bottom: 20px; 
/*border-bottom: 1px solid var(--line); */
    
}
.page-head .kicker { display: flex; align-items: center; gap: 10px; color: var(--accent-deep); font-size: 0.85rem; margin-bottom: 6px; }
.page-head .kicker i { font-size: 1rem; }
.page-head h1 { margin: 0 0 6px; font-size: 1.9rem; }
.page-head p { color: var(--muted); margin: 0; max-width: 62ch; }

/* ---------- Hero (home) ---------- */
.hero-section { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding: 10px 0 40px; }
.hero-eyebrow-line { width: 46px; height: 3px; background: #e0342c; margin-bottom: 18px; }
.hero-section h1 {
  font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.15; margin: 0 0 18px; color: var(--primary-deep);
}
.hero-section h1 em { font-style: italic; color: var(--primary); }
.hero-section .lede { font-size: 1.08rem; color: var(--muted); max-width: 52ch; margin-bottom: 26px; line-height: 1.6; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-cta .btn { width: auto; margin-top: 0; padding: 13px 24px; }
.hero-cta .btn.ghost {
  background: transparent; color: var(--primary-deep); border: 1px solid var(--primary-deep); width: auto;
}

.hero-portrait { position: relative; }
.hero-portrait .frame {
  border: 1px solid var(--line); background: var(--surface); padding: 14px; border-radius: 4px;
  box-shadow: 0 18px 40px rgba(10,51,43,0.14);
}
.hero-portrait img { width: 100%; height: auto; display: block; border: 3px solid #f6c816; }
.hero-portrait .plate { text-align: center; padding-top: 14px; }
.hero-portrait .plate strong { display: block; font-family: var(--serif); font-size: 1.05rem; color: var(--primary-deep); }
.hero-portrait .plate span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }

@media (max-width: 860px) {
  .hero-section { grid-template-columns: 1fr; }
  .hero-portrait { max-width: 300px; margin: 0 auto; }
}

/* ---------- Notice ticker ---------- */
.notice-strip {
  display: flex; align-items: flex-start; gap: 14px;
  background: #e0342c; color: #fff; border-radius: 6px;
  padding: 16px 20px; margin: 8px 0 44px;
}
.notice-strip .flag { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: var(--primary-deep); font-size: 1rem; }
.notice-strip .body { flex: 1; min-width: 0; }
.notice-strip .label { font-size: 0.72rem; color: rgba(255,255,255,0.65); margin-bottom: 3px; }
.notice-strip strong { display: block; font-family: var(--serif); font-size: 1.02rem; margin-bottom: 2px; }
.notice-strip p { color: rgba(255,255,255,0.85); margin: 0; font-size: 0.9rem; }
.notice-strip a { color: #fff; text-decoration: underline; }

/* ---------- Process steps (genuinely sequential: report -> track -> resolved) ---------- */
.process { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 10px 0 50px; }
.process .step { position: relative; padding-left: 52px; }
.process .step .num {
  position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); color: var(--primary-deep);
  display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 600;
}
.process .step h3 { margin: 2px 0 6px; font-size: 1.05rem; }
.process .step p { color: var(--muted); font-size: 0.9rem; margin: 0; }
@media (max-width: 800px) { .process { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- Service tiles (quick-grid, from css/style.css) ---------- */
.home-section-head { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 16px; }
.home-section-head .swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); flex-shrink: 0; margin-bottom: 2px; }
.home-section-head h2 { margin: 0; font-size: 1.25rem; }

.quick-grid button {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid #f6c816;
  border-radius: 8px; padding: 18px 10px 16px; gap: 10px; transition: background-color .12s ease;
}
.quick-grid button:hover { background: var(--paper); }
.quick-grid .icon {
  width: 40px; height: 40px; border-radius: 50%; background: var(--paper);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.quick-grid button span:last-child { font-weight: 600; font-size: 0.8rem; color: var(--ink); }

/* ---------- Featured banner strip ---------- */
.featured-frame {
  border: 1px solid var(--line); background: var(--surface); padding: 10px; border-radius: 6px; margin: 45px 0 44px;
}
.featured-frame .carousel-item img { border-radius: 3px; }
.featured-frame .carousel-caption-label { padding: 10px 4px 2px; color: var(--muted); font-size: 0.78rem; }

/* ---------- Cards / list content (news, schemes, etc.) ---------- */
.card { border-radius: 8px; border-color: var(--line); }
.card h3 { font-family: var(--serif); font-weight: 600; }
.section-title { font-family: var(--serif); }

/* ---------- Forms ---------- */
.btn { border-radius: 7px; background: #e0342c; }
.btn:active, .btn:hover { background: #e0342c; }
.btn.secondary { border-color: var(--primary); color: var(--primary); }
input, select, textarea { border-radius: 7px !important; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }

.form-page { max-width: 640px; margin: 0 auto; }
.split-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 800px) { .split-row { grid-template-columns: 1fr; } }

/* ---------- Responsive card grids for list pages ---------- */
@media (min-width: 768px) {
  #newsList, #schemesList, #directoryList, #faqsList, #emergencyList,
  #worksList, #eventsList, #announcementsList, #pollsList {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: start;
  }
}
@media (min-width: 1100px) {
  #newsList, #schemesList, #directoryList, #faqsList, #emergencyList, #worksList, #eventsList {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Footer ---------- */
.site-footer { background: #e0342c; color: rgba(255,255,255,0.82); margin-top: 0; padding: 46px 0 22px; }
.site-footer h6 { color: #fff; font-family: var(--serif); font-weight: 600; font-size: 0.95rem; text-transform: none; letter-spacing: 0; margin-bottom: 14px; }
.site-footer p { color: rgba(255,255,255,1); }
.site-footer .footer-links a { color: rgba(255,255,255,1); }
.site-footer .footer-links a:hover { color: #fff; }
.site-footer hr { border-color: rgba(255,255,255,0.18); }
.site-footer .muted { color: rgba(255,255,255,1) !important; }

/* ---------- Static pages (About / Terms / Privacy) ---------- */
.static-page { max-width: 760px; margin: 0 auto; }
.static-page h2 { margin-top: 34px; font-size: 1.2rem; color: var(--primary-deep); }
.static-page h2:first-of-type { margin-top: 0; }
.static-page p, .static-page li { color: var(--ink); line-height: 1.75; }
.static-page .updated-note { color: var(--muted); font-size: 0.85rem; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.static-page .about-portrait { float: right; width: 220px; margin: 0 0 20px 28px; }
.static-page .about-portrait .frame { border: 1px solid var(--line); background: var(--surface); padding: 10px; border-radius: 4px; }
.static-page .about-portrait img { width: 100%; border: 3px solid var(--accent); }
.static-page .about-portrait .plate { text-align: center; padding-top: 10px; font-size: 0.78rem; color: var(--muted); }
.static-page .about-portrait .plate strong { display: block; color: var(--primary-deep); font-family: var(--serif); font-size: 0.92rem; }
@media (max-width: 640px) { .static-page .about-portrait { float: none; width: 180px; margin: 0 auto 20px; } }


/* ---------- Fixes from visual review ---------- */
.site-navbar .navbar-nav .nav-link { color: var(--ink); }
.site-navbar .navbar-nav .nav-link.active { color: var(--primary); }
.site-navbar .navbar-brand { display: flex; align-items: center; }
.site-navbar .navbar-brand img { width: 34px; height: 34px; object-fit: contain; }

.hero-portrait img { aspect-ratio: 4 / 4.2; object-fit: cover; object-position: top center; max-height: 400px; }
.hero-section { padding-top: 24px; }

.notice-strip .loading, .notice-strip #homeLatestNotice { text-align: left; padding: 0; color: rgba(255,255,255,0.85); }
.notice-strip .flag i { line-height: 1; }

.quick-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 700px) { .quick-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }

.featured-frame .carousel-item img { max-height: 380px; object-fit: cover; object-position: center 25%; }

.site-footer .footer-links { list-style: none; margin: 0; padding: 0; }
.site-footer .footer-links li { margin-bottom: 20px; }
.site-footer .footer-links a { text-decoration: none; font-size: 0.88rem; }
.site-footer .footer-links a:hover { text-decoration: underline; }

.notice-strip #homeLatestNotice.loading, .notice-strip #homeLatestNotice { text-align: left !important; padding: 0 !important; }

/* Align the page head with the narrower reading column on static pages */
main.site-main > .page-head:has(+ .static-page) { max-width: 760px; margin-left: auto; margin-right: auto; }
main.site-main > .page-head:has(+ .form-page) { max-width: 640px; margin-left: auto; margin-right: auto; }
main.site-main { padding-top: 120px; }
@media (max-width: 991px) { main.site-main { padding-top: 104px; } }
