/*
  SWG static site styles
  - Responsive layout
  - Sticky header taskbar
  - Fluid typography and spacing
*/

:root {
  --brand: #0066cc;
  --brand-dark: #004a99;
  --accent: #ff5a3d;
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #666666;
  --border: #e5e7eb;
  --surface: #f8fafc;
  --maxw: 1200px;
  --radius: 10px;
  --shadow-1: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-2: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-3: 0 12px 32px rgba(0,0,0,0.12);
}

/* CSS reset (trimmed) */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }
html:focus-within { scroll-behavior: smooth; }
body { min-height: 100vh; text-rendering: optimizeLegibility; line-height: 1.6; color: var(--text); background: var(--bg); }
.no-scroll { overflow: hidden; }
img, picture { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; }

/* Subtle background wash */
body { background:
  radial-gradient(1200px 600px at 100% -10%, #f0f7ff 0%, transparent 60%),
  radial-gradient(900px 500px at -10% 0%, #fff7ed 0%, transparent 55%),
  var(--bg);
}

/* Layout helpers */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.stack-2 > * + * { margin-top: 0.5rem; }
.stack-3 > * + * { margin-top: 0.75rem; }
.stack-4 > * + * { margin-top: 1rem; }
.stack-6 > * + * { margin-top: 1.5rem; }
.cluster { display: flex; align-items: center; gap: 16px; }

/* Header / Taskbar */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.85); backdrop-filter: saturate(150%) blur(8px); border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: auto; padding: 8px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand img { height: 96px; width: auto; }
.brand span { font-size: 1.05rem; letter-spacing: 0.2px; }

.nav { display: flex; align-items: center; gap: 14px; }
.nav a { text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.9rem; padding: 6px 8px; border-radius: 8px; }
.nav a:hover { background: var(--surface); color: var(--brand-dark); }
.nav .menu-item { position: relative; }
.nav .has-dropdown > a { display: inline-flex; align-items: center; gap: 6px; }
.nav .dropdown { position: absolute; top: 100%; left: 0; transform: translateY(6px); background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px; min-width: 220px; display: none; z-index: 60; }
.nav .dropdown a { display: block; padding: 10px 12px; font-weight: 600; }
.nav .dropdown a:hover { background: var(--surface); color: var(--brand-dark); }
.nav .has-dropdown:hover .dropdown, .nav .has-dropdown:focus-within .dropdown { display: block; }

.actions { display: flex; align-items: center; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: linear-gradient(180deg, #0ea5e9, #0369a1); color: #fff; border: 1px solid transparent; box-shadow: var(--shadow-1); text-decoration: none; font-weight: 700; letter-spacing: .2px; transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; }
.btn:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: var(--shadow-3); }
.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.ghost:hover { background: var(--surface); }

.hamburger { display: none; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: #fff; align-items: center; justify-content: center; }
.hamburger span { width: 20px; height: 2px; background: var(--text); position: relative; display: block; }
.hamburger span::before, .hamburger span::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--text); }
.hamburger span::before { top: -6px; }
.hamburger span::after { top: 6px; }

/* Mobile nav panel */
.mobile-panel { display: none; border-top: 1px solid var(--border); background: #fff; }
.mobile-panel.open { display: block; }
.mobile-panel a { display: block; padding: 14px 20px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); font-weight: 600; }
.mobile-panel a:hover { background: var(--surface); }
.mobile-panel a.sub { padding-left: 36px; font-weight: 500; color: var(--muted); }

/* Hero */
.hero { background: linear-gradient(180deg, #fff, #f6fbff); border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding: 32px 0; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; transition: transform .25s cubic-bezier(.2,.6,.2,1), box-shadow .25s ease; will-change: transform; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.card > img { width: 100%; height: auto; display: block; }
.hero .hero-slide > img { aspect-ratio: 16 / 9; object-fit: cover; }
.card .media { aspect-ratio: 16 / 9; background: #dbeafe; background-size: cover; background-position: center; position: relative; }
.media-label { position: absolute; top: 10px; left: 10px; z-index: 1; }
.media-label .pill { box-shadow: var(--shadow-1); font-size: .72rem; padding: 5px 9px; }
.card .body { padding: 16px; }
.hero .hero-slide .body { padding: 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; color: var(--brand-dark); font-weight: 800; font-size: 0.75rem; }
.headline { font-size: clamp(1.25rem, 2.2vw, 1.9rem); line-height: 1.25; font-weight: 800; margin-top: 8px; }
.meta { color: var(--muted); font-size: 0.9rem; }

/* Sections */
.section { padding: 28px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.list { display: grid; gap: 12px; }
.list a { color: var(--text); text-decoration: none; }
.list a:hover { color: var(--brand-dark); }

/* Two-column layout for pages with sidebar */
.two-col-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.content-col { min-width: 0; }
.sidebar-col { min-width: 0; display: grid; gap: 20px; align-content: start; }
.sidebar-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.sidebar-card .body { padding: 16px; }
.sidebar-card img { width: 100%; height: auto; display: block; }

/* Footer */
.site-footer { background: #0b1220; color: #c9d1e3; margin-top: 40px; }
.site-footer a { color: #e0e7ff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding: 28px 0; }
.copyright { border-top: 1px solid rgba(255,255,255,0.09); padding: 16px 0; font-size: 0.9rem; color: #9fb0c9; }

/* Utilities */
.pill { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-weight: 700; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.08em; }
.pill--kesehatan { background: #e0f2fe; color: #075985; }
.pill--lingkungan { background: #dcfce7; color: #166534; }
.pill--keselamatan { background: #fff7ed; color: #9a3412; }
.badge { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; padding: 4px 8px; border-radius: 100px; font-weight: 700; font-size: 0.7rem; }
.muted { color: var(--muted); }

/* Forms */
input[type="text"], input[type="email"], textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fff; }
label { font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Scroll reveal animation */
.animate-on-scroll { opacity: 0; transform: translateY(16px); will-change: opacity, transform; }
.animate-on-scroll.is-visible { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.2,.6,.2,1); }

/* Intro splash */
.intro-overlay { position: fixed; inset: 0; background: #ffffff; z-index: 200; display: grid; place-items: center; }
.intro-box { width: min(56vw, 640px); max-width: 90vw; }
.intro-box img { width: 100%; height: auto; display: block; }
.intro-box { clip-path: inset(0 0 100% 0); }
.intro-overlay.is-revealed .intro-box { animation: smgReveal 1.2s ease forwards; }
.intro-overlay.is-fading { animation: smgFade .7s ease forwards; }
@keyframes smgReveal { to { clip-path: inset(0 0 0 0); } }
@keyframes smgFade { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .animate-on-scroll { opacity: 1 !important; transform: none !important; }
}

/* Breakpoints */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .two-col-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .nav { display: none; }
  .hamburger { display: inline-flex; }
  .brand img { height: 56px; }
}

@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .copyright { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
  .copyright nav { display: flex; flex-wrap: wrap; gap: 10px 14px; }
}

@media (max-width: 480px) {
  .site-header .bar { padding: 6px 0; }
  .brand img { height: 48px; }
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #a0aec0;
  --border: #1f2937;
  --surface: #0f172a;
}
[data-theme="dark"] .site-header { background: rgba(11,18,32,0.85); border-bottom-color: #1f2937; }
[data-theme="dark"] .nav a:hover { background: #0f172a; color: #c7d2fe; }
[data-theme="dark"] .ghost { color: var(--text); border-color: var(--border); }
[data-theme="dark"] .ghost:hover { background: #0f172a; }

/* Digital magazines: symmetric cards */
.mag-grid > .card {
  display: flex;                /* equal-height cards */
  flex-direction: column;
}

.mag-grid > .card .body {
  display: flex;                /* stack content inside */
  flex-direction: column;
  flex: 1;
}

/* Normalize title height (1 line, still aligned if shorter) */
.mag-grid h3 {
  margin: 0 0 8px;
  font-weight: 800;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.2em;            /* keeps rows even */
}

/* Same-sized covers */
.mag-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;          /* identical poster shape */
  object-fit: cover;
  border-radius: 10px;
  margin: 8px 0;                /* matches your inline style */
}

/* Anchor button to bottom so all align horizontally */
.mag-grid .btn {
  margin-top: auto;
  align-self: flex-start;
}
