:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0f4c81;
  --brand-soft: #e8f1fa;
}

* {
  box-sizing: border-box;
}

@keyframes fadeInBackdrop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomInImage {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#closeModal:hover {
  transform: scale(1.15);
}

#modalCaption {
  margin: .85rem 0 0;
  max-width: 90%;
  color: rgba(255, 255, 255, 0.9);
  font-size: .875rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  letter-spacing: .01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  display: none;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.menu-open {
  overflow: hidden;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: background 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: #d8dee6;
  box-shadow: 0 8px 28px rgba(15, 76, 129, 0.08);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 74px;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
}

.brand span {
  color: var(--brand);
}

.site-nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.site-nav a {
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 0.35rem 0.45rem;
  border-radius: 0.6rem;
  isolation: isolate;
  transition: color 0.2s ease;
  --nav-glow-x: 50%;
  --nav-glow-y: 50%;
}

.site-nav a::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0.08rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 76, 129, 0.45), rgba(15, 76, 129, 0.95));
  transform: scaleX(0.05);
  transform-origin: center;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at var(--nav-glow-x) var(--nav-glow-y), rgba(15, 76, 129, 0.2), transparent 58%);
  transition: opacity 0.2s ease;
  z-index: -1;
}

.site-nav a:hover {
  color: var(--brand);
}

.site-nav a:hover::before,
.site-nav a:focus-visible::before,
.site-nav a.nav-active::before {
  transform: scaleX(1);
  opacity: 1;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a.nav-active::after {
  opacity: 1;
}

.site-nav a.nav-active {
  color: var(--brand);
  font-weight: 700;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 0.7rem;
  width: 44px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #334155;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.site-header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: #9ebad4;
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.14);
  outline: none;
}

.hero {
  padding: 3.2rem 0 2rem;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.kicker {
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.2;
}

.lead {
  margin: 1rem 0 1.4rem;
  color: #4b5563;
  max-width: 58ch;
}

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  padding: 0.75rem 1.1rem;
  border-radius: 0.75rem;
  font-weight: 600;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.06);
}
.hero-card-content {
  padding: 1rem 1rem 1.2rem;
}

.hero-card h2 {
  margin: 0.4rem 0;
  font-size: 1.2rem;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.section {
  padding: 1.2rem 0 3rem;
  scroll-margin-top: 96px;
}

main[id],
section[id] {
  scroll-margin-top: 96px;
}

.muted {
  background: #f2f5fb;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.6rem;
}

.section-head a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}


.card-grid,
.light-grid,
.video-grid {
  display: grid;
  gap: 1rem;
}

.card-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Make all post-card the same height */
.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.post-card h3 {
  margin: 0.4rem 0 0.4rem;
  font-size: 1.05rem;
}

.post-card p {
  margin: 0;
  color: var(--muted);
}

/* Fix excerpt/preview text height for consistent card height */
.post-card .preview-text {
  min-height: 72px;
  max-height: 72px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-grid {
  grid-template-columns: repeat(3, 1fr);
}

.post-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  max-width: 400px;
}

.post-card,
.light-card,
.video-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
}

.post-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.card-body,
.light-card,
.video-card {
  padding: 1rem;
}

.post-card h3,
.light-card h3,
.video-card h3 {
  margin: 0.4rem 0 0.4rem;
  font-size: 1.05rem;
}

.post-card p,
.light-card p,
.video-card p {
  margin: 0;
  color: var(--muted);
}

.meta {
  font-size: 0.84rem;
  color: #6b7280;
}

.light-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  background: #e5e7eb;
  cursor: pointer;
}

.gallery-card:hover .gallery-img {
  transform: scale(1.05);
}

.gallery-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 0.85rem 0.8rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.58) 0%, transparent 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.gallery-card:hover .gallery-caption {
  opacity: 1;
  transform: translateY(0);
}

.video-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 0.6rem;
  overflow: hidden;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.about-wrap {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.2rem;
  align-items: center;
}

.about-wrap p {
  color: #4b5563;
}

.about-wrap img {
  border-radius: 1rem;
  border: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 1.2rem 0;
}

.site-footer p {
  margin: 0;
  color: #6b7280;
  text-align: center;
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .hero-grid,
  .about-wrap {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .light-grid,
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .card-grid,
  .light-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .post-card-link {
    max-width: 100%;
  }
}

@media (max-width: 820px) {
  .nav-wrap {
    position: relative;
    min-height: 68px;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
    flex-shrink: 0;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;

  .site-nav a::before {
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.2rem;
  }
    display: none;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.45rem;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    z-index: 20;
  }

  .site-header.nav-open .site-nav {
    display: flex;
  }

  .site-nav a {
    font-size: 0.92rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.7rem;
  }

}

@media (max-width: 640px) {
  .brand {
    font-size: 1.05rem;
    max-width: calc(100vw - 96px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Clickable article cards ─────────────────────── */
.post-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.1);
}

.post-card-link:hover .post-card h3 {
  color: var(--brand);
}

/* ── Article Detail Page ─────────────────────────── */
.article-detail {
  padding: 2rem 0 4rem;
}

.article-container {
  max-width: 780px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.7;
}

/* ── Search results ────────────────────────────────────────── */

.search-result-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  transition: box-shadow .18s, border-color .18s;
}

.search-result-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, .07);
  border-color: var(--brand);
}

.search-result-thumb {
  width: 80px;
  min-width: 80px;
  height: 60px;
  border-radius: .5rem;
  object-fit: cover;
  border: 1px solid var(--line);
}

.search-result-body {
  flex: 1;
  min-width: 0;
}

.search-result-body h4 {
  margin: 0 0 .35rem;
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-snippet {
  margin: 0;
  font-size: .83rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-snippet mark {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.search-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .15rem .55rem;
  border-radius: 999px;
  margin-bottom: .15rem;
}

.search-badge--artikel {
  background: #dbeafe;
  color: #1d4ed8;
}

.search-badge--tulisan {
  background: #d1fae5;
  color: #065f46;
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.25;
  margin: 0.5rem 0 0.8rem;
}

.article-excerpt {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

.article-hero {
  margin-bottom: 2rem;
}

.article-hero img {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #374151;
}

.article-body p {
  margin: 0 0 1.2rem;
}
