/* Janabartta E-Paper — shared styles (public site) */
:root {
  --brand: #0a2472;
  --brand-dark: #061539;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7f9;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--brand);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 44px; width: auto; display: block; }

/* Inline nav (desktop / tablet) */
.nav { display: flex; gap: 4px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--ink); padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
}
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { color: var(--brand); background: #eef2fb; }

/* Hamburger / menu toggle — mobile only (hidden on wide screens) */
.menu-toggle {
  display: none; margin-left: 8px; width: 44px; height: 44px; border: 1px solid var(--line);
  background: #fff; border-radius: 10px; cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-toggle:hover { background: var(--bg); }
.menu-toggle span {
  display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Slide-in sidebar */
.side-nav {
  position: fixed; top: 0; right: 0; height: 100%; width: 300px; max-width: 84vw;
  background: #fff; z-index: 200; box-shadow: -8px 0 30px rgba(0,0,0,.18);
  transform: translateX(100%); transition: transform .28s ease;
  display: flex; flex-direction: column;
}
.side-nav.open { transform: translateX(0); }
.side-nav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.side-nav-logo { height: 34px; width: auto; }
.side-nav-close {
  background: none; border: none; font-size: 30px; line-height: 1; color: var(--ink);
  cursor: pointer; padding: 0 4px;
}
.side-nav-close:hover { color: var(--brand); }
.side-nav-links { display: flex; flex-direction: column; padding: 12px; gap: 2px; }
.side-nav-links a {
  color: var(--ink); padding: 14px 16px; border-radius: 10px;
  font-size: 16px; font-weight: 600;
}
.side-nav-links a:hover { background: var(--bg); text-decoration: none; }
.side-nav-links a.active { color: var(--brand); background: #eef2fb; }

/* Backdrop */
.side-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 150;
  opacity: 0; transition: opacity .28s ease;
}
.side-backdrop.show { opacity: 1; }
body.nav-open { overflow: hidden; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-weight: 700;
  border: 1px solid transparent; cursor: pointer; font-size: 15px;
  transition: transform .05s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: #eef2fb; }
.btn-ghost { background: var(--bg); color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Hero / latest edition */
.hero { padding: 24px 0; }
.hero-card {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: 16px; padding: 28px 32px; color: #fff;
  box-shadow: 0 10px 30px rgba(6,21,57,.28);
}
.hero-preview {
  position: relative;
  display: grid; width: 240px; max-width: 34vw; border-radius: 8px;
  overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  line-height: 0; text-decoration: none; color: var(--brand);
  aspect-ratio: 3/4; place-items: center;
}
/* Animated "Latest Edition" badge — top-right of the card */
.latest-badge {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  padding: 6px 14px; border-radius: 20px; line-height: 1.2;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #7c2d12; white-space: nowrap;
  background: #fde68a;
  box-shadow: 0 2px 10px rgba(0,0,0,.28);
  animation: latestHue 4.5s ease-in-out infinite;
}
@keyframes latestHue {
  0%   { background: #ffffff; color: #b45309; }
  33%  { background: #fbbf24; color: #7c2d12; }  /* amber */
  66%  { background: #fdba74; color: #7c2d12; }  /* light orange */
  100% { background: #ffffff; color: #b45309; }
}
@media (prefers-reduced-motion: reduce) {
  .latest-badge { animation: none; }
}
.hero-preview.has-thumb { display: block; aspect-ratio: auto; }
.hero-preview .doc-icon { font-size: 64px; opacity: .7; }
.hero-preview .pdf-thumb-canvas { width: 100%; height: auto; display: block; }
.hero-preview:hover { transform: translateY(-2px); transition: transform .15s ease; }

.hero-info { min-width: 0; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .1em; font-size: 12px;
  font-weight: 700; color: #cdd7f0;
}
.hero h1 { font-size: 30px; margin: 8px 0 8px; line-height: 1.15; color: #fff; }
.hero-date { color: #c3cdea; font-size: 15px; margin-bottom: 22px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* Card thumbnail (archive grid) */
.paper-frame {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; aspect-ratio: 3/4;
  display: grid; place-items: center; color: var(--brand); text-decoration: none;
  position: relative;
}
.paper-frame embed, .paper-frame iframe { width: 100%; height: 100%; border: 0; }
.paper-frame .doc-icon { font-size: 72px; opacity: .8; }
.paper-frame.has-thumb { place-items: start; }
.paper-frame .pdf-thumb-canvas { width: 100%; height: auto; display: block; }

/* Section */
.section { padding: 24px 0 48px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 { font-size: 22px; margin: 0; }

/* Archive grid */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.paper-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
.paper-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.paper-thumb {
  aspect-ratio: 3/4; background: linear-gradient(135deg,#fafafa,#eee);
  display: grid; place-items: center; color: var(--brand);
  border-bottom: 1px solid var(--line); position: relative; overflow: hidden;
  text-decoration: none;
}
.paper-thumb .doc-icon { font-size: 52px; opacity: .85; }
/* When a real page is rendered, align it to the top and let it fill the width. */
.paper-thumb.has-thumb { display: block; }
.paper-thumb .pdf-thumb-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: auto; display: block;
}
.paper-thumb .badge {
  position: absolute; top: 10px; left: 10px; background: var(--brand);
  color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
}
.paper-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.paper-body h3 { font-size: 15px; margin: 0; line-height: 1.35; }
.paper-body .date { color: var(--muted); font-size: 13px; }
.paper-actions { display: flex; gap: 8px; margin-top: auto; }
.paper-actions .btn { flex: 1; justify-content: center; }

/* Footer */
.site-footer {
  background: #101826; color: #cbd5e1; margin-top: 40px;
  padding: 40px 0 24px;
}
.footer-cols {
  display: grid; grid-template-columns: 1fr 1.2fr 1.3fr; gap: 40px;
  padding-bottom: 28px; border-bottom: 1px solid #223049;
}
.footer-col h4 {
  color: #fff; margin: 0 0 14px; font-size: 17px; font-weight: 700;
  text-align: center; position: relative; padding-bottom: 10px;
}
.footer-col h4::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 80px; height: 2px; background: var(--brand);
}
.footer-col a {
  color: #cbd5e1; display: block; padding: 5px 0; font-size: 14px; text-align: center;
}
.footer-col a:hover { color: #fff; }
.footer-about { color: #9fb0c9; font-size: 14px; line-height: 1.7; margin: 0; }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding-top: 22px; flex-wrap: wrap;
}
.footer-contact { color: #cbd5e1; font-weight: 700; font-size: 14px; }
.footer-contact:hover { color: #fff; }
.footer-copy { color: #9fb0c9; font-size: 13px; text-align: center; flex: 1; }
.footer-logo {
  height: 48px; width: auto; background: #fff; padding: 6px 10px;
  border-radius: 8px; object-fit: contain;
}

@media (max-width: 760px) {
  .footer-cols { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .footer-bottom { flex-direction: column; }
}

/* Mobile: footer shows only the logo + copyright/rights line */
@media (max-width: 640px) {
  .footer-cols { display: none; }
  .site-footer { padding-top: 24px; }
  .footer-contact { display: none; }
  .footer-bottom { justify-content: center; }
  .footer-logo { order: -1; }
}

/* Empty state */
.empty {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 48px; text-align: center; color: var(--muted);
}

/* Responsive */
/* Mobile: swap inline nav for the hamburger + sidebar */
@media (max-width: 768px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 680px) {
  .hero-card { grid-template-columns: 1fr; gap: 20px; text-align: center; padding: 24px 20px; }
  .hero-preview { width: 200px; max-width: 60vw; margin: 0 auto; }
  .hero-actions { justify-content: center; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}
