/* =========================================================================
   Dhemaji District Online — Stylesheet
   Design language: a civic field-almanac for a riverine district.
   Signature motifs: braided-river hairlines + a gamosa (red-on-white
   handwoven border) tick pattern used as section dividers throughout.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Spectral:wght@400;500;600;700&family=Work+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Palette */
  --bg:        #EFE6D8; /* silt / parchment */
  --bg-alt:    #E2DCC8; /* slightly deeper sand for alt sections */
  --sage:      #DCE3DA; /* river-mist sage */
  --card:      #FBF8F1; /* card surface */
  --ink:       #20281F; /* deep moss ink (body text) */
  --ink-soft:  #4B5447; /* muted ink for secondary text */
  --paddy:     #3F5B33; /* primary green */
  --paddy-dk:  #2C4023;
  --gamosa:    #A6332B; /* signature red accent */
  --terracotta:#C1652E; /* secondary accent / links */
  --line:      #C9B98E; /* hairline border on parchment */
  --white:     #FFFFFF;

  --font-display: 'Spectral', Georgia, serif;
  --font-body: 'Work Sans', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 6px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--paddy-dk);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gamosa);
  margin-bottom: 0.6em;
}

/* ---- Gamosa divider (signature element) -------------------------------- */
.gamosa-divider {
  height: 14px;
  background-image: url('../images/gamosa-pattern.svg');
  background-repeat: repeat-x;
  background-position: left center;
  opacity: 0.9;
}

/* ---- Skip link / accessibility ----------------------------------------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gamosa); color: var(--white); padding: 8px 14px; z-index: 999;
}
.skip-link:focus { left: 8px; top: 8px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
}

/* =========================================================================
   HEADER / NAV
   ========================================================================= */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  color: var(--paddy-dk);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--paddy);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  flex-shrink: 0;
}
.brand-text { line-height: 1.1; }
.brand-text strong { display: block; font-size: 1.15rem; }
.brand-text span { display: block; font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-soft); letter-spacing: 0.06em; }

.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: var(--ink);
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: var(--radius);
}
.main-nav a:hover, .main-nav a.active { color: var(--gamosa); background: var(--sage); text-decoration: none; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--gamosa); color: var(--white); }
.btn-primary:hover { background: #8c2823; text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--paddy); color: var(--paddy-dk); }
.btn-outline:hover { background: var(--paddy); color: var(--white); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-danger { background: #7a2e2e; color: var(--white); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  width: 42px; height: 38px; cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px auto; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--sage) 0%, var(--bg) 100%);
  overflow: hidden;
  padding: 64px 0 40px;
}
.hero-motif {
  position: absolute; left: 0; right: 0; bottom: 0; height: 220px;
  background: url('../images/river-motif.svg') no-repeat center bottom / cover;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.hero p.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 620px; }
.hero-actions { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }

.disclaimer-bar {
  background: var(--paddy-dk);
  color: #E8E2D1;
  font-size: 0.82rem;
  text-align: center;
  padding: 8px 16px;
}
.disclaimer-bar strong { color: #fff; }

/* ---- Stat strip ---------------------------------------------------------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 36px;
}
.stat-cell {
  background: var(--card);
  padding: 18px 16px;
}
.stat-cell .num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--gamosa);
  display: block;
}
.stat-cell .label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

/* =========================================================================
   SECTIONS / CARDS
   ========================================================================= */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 700px; margin-bottom: 32px; }
.section-head p { color: var(--ink-soft); }

.grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-img { aspect-ratio: 16/10; background: var(--sage); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }
.card-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gamosa);
  margin-bottom: 6px;
}
.card-body h3 { margin-bottom: 6px; }
.card-body .meta { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 8px; }
.card-body p { color: var(--ink-soft); font-size: 0.94rem; flex: 1; }
.card-body .btn { margin-top: 10px; align-self: flex-start; }

.fact-list { list-style: none; margin: 0; padding: 0; }
.fact-list li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}
.fact-list li span:first-child { color: var(--ink-soft); }
.fact-list li span:last-child { font-family: var(--font-mono); text-align: right; }

blockquote.pull {
  border-left: 3px solid var(--gamosa);
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--paddy-dk);
}

.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 24px; }
.timeline-item { position: relative; margin-bottom: 28px; }
.timeline-item::before {
  content: ''; position: absolute; left: -29px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--gamosa);
}
.timeline-item .year { font-family: var(--font-mono); color: var(--gamosa); font-size: 0.85rem; }

.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.help-cell {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: center;
}
.help-cell .num { font-family: var(--font-mono); font-size: 1.3rem; color: var(--gamosa); display: block; }
.help-cell .label { font-size: 0.78rem; color: var(--ink-soft); }

/* =========================================================================
   GALLERY
   ========================================================================= */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.gallery-item { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.gallery-item img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery-cap { padding: 10px 14px; font-size: 0.85rem; }
.gallery-cap .cat { color: var(--gamosa); font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; }

.gallery-item a { cursor: zoom-in; }

#lightbox {
  position: fixed; inset: 0; background: rgba(32,40,31,0.92);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; z-index: 200; padding: 24px; cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 90vw; max-height: 80vh; border-radius: 4px; }
#lightbox .lb-cap { color: #fff; margin-top: 14px; font-size: 0.9rem; }

/* =========================================================================
   FORMS (contact + admin)
   ========================================================================= */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; }
.form-field .hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], input[type=number],
textarea, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
}
textarea { resize: vertical; min-height: 120px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

.alert {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.92rem;
}
.alert-success { background: #E4EEDF; color: var(--paddy-dk); border: 1px solid #BFD8B4; }
.alert-error { background: #F6E2DF; color: #7a2e2e; border: 1px solid #E3B6AF; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer { background: var(--paddy-dk); color: #DCE6D5; padding: 48px 0 20px; margin-top: 40px; }
.site-footer h4 { color: #fff; font-size: 0.95rem; }
.site-footer a { color: #C7D6BE; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 0.9rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 32px; padding-top: 18px;
  font-size: 0.8rem; color: #A9BC9D;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* =========================================================================
   LOGIN PAGE
   ========================================================================= */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--sage);
  padding: 24px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 400px; width: 100%;
  padding: 36px 32px;
}
.login-card .brand { justify-content: center; margin-bottom: 24px; }
.login-card h1 { font-size: 1.5rem; text-align: center; }
.login-foot { text-align: center; margin-top: 18px; font-size: 0.85rem; }

/* =========================================================================
   ADMIN DASHBOARD
   ========================================================================= */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--paddy-dk); color: #DCE6D5;
  padding: 22px 16px;
}
.admin-sidebar .brand { color: #fff; margin-bottom: 28px; }
.admin-sidebar .brand-text span { color: #A9BC9D; }
.admin-sidebar nav a {
  display: block; color: #DCE6D5; padding: 10px 12px; border-radius: var(--radius);
  font-size: 0.92rem; margin-bottom: 2px;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.admin-sidebar .role-tag {
  font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase;
  color: var(--terracotta); background: rgba(255,255,255,0.08);
  display: inline-block; padding: 3px 8px; border-radius: 4px; margin-bottom: 18px;
}
.admin-main { flex: 1; background: var(--bg); padding: 28px 32px; min-width: 0; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-topbar h1 { font-size: 1.6rem; margin: 0; }

.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 18px; margin-bottom: 28px; }
.dash-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.dash-card .num { font-family: var(--font-mono); font-size: 2rem; color: var(--gamosa); display: block; }
.dash-card .label { color: var(--ink-soft); font-size: 0.85rem; }

.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data-table th, table.data-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.data-table th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); background: var(--bg-alt); }
table.data-table tr:last-child td { border-bottom: none; }
.badge { font-family: var(--font-mono); font-size: 0.68rem; padding: 3px 8px; border-radius: 10px; text-transform: uppercase; }
.badge-green { background: #E4EEDF; color: var(--paddy-dk); }
.badge-amber { background: #F3E6CF; color: #8a5a14; }
.badge-red { background: #F6E2DF; color: #7a2e2e; }
.row-actions a { margin-right: 10px; font-size: 0.85rem; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.panel h2 { font-size: 1.15rem; margin-bottom: 16px; }

.sidebar-toggle { display: none; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 920px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-sidebar { display: none; }
  .admin-sidebar.open { display: block; position: fixed; z-index: 60; height: 100vh; }
  .sidebar-toggle { display: inline-block; }
}
@media (max-width: 720px) {
  .main-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  .main-nav.open { display: flex; }
  .header-bar { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-main { padding: 20px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .header-bar { padding: 14px 16px; }
}
