/* ==========================================================================
   layout.css — container, header, footer, sections (Sanad structure, see brand/layout.md)
   ========================================================================== */

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

/* Header ----------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--c-paper);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: var(--space-6); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); text-decoration: none; margin-right: auto; }
.brand__logo { width: 2.75rem; height: 2.75rem; flex: none; }
.brand__text { display: grid; gap: 0.25rem; line-height: 1.15; }
.brand__name { white-space: nowrap; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; }
.brand__sub { font-size: var(--fs-xs); color: var(--muted); letter-spacing: 0.02em; }

.site-nav { display: flex; align-items: center; }
.site-nav__list { display: flex; gap: var(--space-8); }
.site-nav__link { font-size: 0.9375rem; font-weight: 500; text-decoration: none; padding-block: var(--space-2); }
.site-nav__link:hover { text-decoration: underline; }
.site-nav__link[aria-current="page"] { color: var(--c-primary); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.4em; }
.site-nav .site-nav__cta { display: none; }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: none;
}
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
  display: block; width: 1.125rem; height: 2px; background: currentColor; position: relative; content: "";
}
.nav-toggle__bar::before { position: absolute; top: -6px; }
.nav-toggle__bar::after { position: absolute; top: 6px; }

@media (max-width: 63.99rem) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 40;
    background: var(--c-paper); padding: var(--space-8) var(--gutter);
    display: none; overflow-y: auto;
  }
  .site-nav.is-open { display: block; }
  .site-nav__list { flex-direction: column; gap: 0; }
  .site-nav__link { display: block; font-size: var(--fs-xl); padding-block: var(--space-4); border-bottom: 1px solid var(--line); }
}

/* Sections --------------------------------------------------------------- */
main { display: block; }
.section { padding-block: clamp(4rem, 3rem + 4vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem); }
.section + .section:not([class*="surface-primary"]):not([class*="surface-secondary"]) { border-top: 1px solid var(--line); }
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4) var(--space-8); margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}
.section-head__title { max-width: 18ch; }
.section-head__num { display: block; font-size: var(--fs-sm); color: var(--muted); letter-spacing: 0.04em; margin-bottom: var(--space-4); font-weight: 500; }
.section-head p { max-width: 36rem; color: var(--muted); margin-top: var(--space-4); }

/* Page header (inner pages) ---------------------------------------------- */
.page-header { padding-block: clamp(3rem, 2rem + 4vw, 6rem) clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.page-header__label { font-size: var(--fs-sm); color: var(--muted); letter-spacing: 0.04em; font-weight: 500; margin-bottom: var(--space-6); }
.page-header h1 { max-width: 20ch; }
.page-header .lead { margin-top: var(--space-6); }

/* Footer ----------------------------------------------------------------- */
.site-footer { padding-top: clamp(4rem, 3rem + 3vw, 6rem); }
.site-footer__cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-8);
  padding-bottom: clamp(3rem, 2rem + 3vw, 4.5rem); border-bottom: 1px solid var(--line);
}
.site-footer__cta h2 { max-width: 22ch; }
.site-footer__cols {
  display: grid; gap: var(--space-12) var(--space-8);
  grid-template-columns: 1.4fr repeat(3, 1fr);
  padding-block: clamp(3rem, 2rem + 3vw, 4.5rem);
}
.site-footer__brand img { width: 6.5rem; height: 6.5rem; }
.site-footer__brand p { margin-top: var(--space-4); color: var(--muted); font-size: var(--fs-sm); max-width: 32ch; }
.site-footer__title { font-size: var(--fs-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-4); font-weight: 600; }
.site-footer__list { display: grid; gap: var(--space-2); font-size: var(--fs-sm); }
.site-footer__list a { text-decoration: none; }
.site-footer__list a:hover { text-decoration: underline; }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4);
  padding-block: var(--space-6); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted);
}
.site-footer__credit a { color: var(--fg); }
.site-footer__gem { color: var(--c-secondary); }

@media (max-width: 63.99rem) {
  .site-footer__cols { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 30rem) {
  .site-footer__cols { grid-template-columns: 1fr; }
}

@media (max-width: 30rem) {
  .brand__sub { display: none; }
  .brand__name { font-size: 1rem; }
  .site-header .site-header__cta { display: none; }
  .site-nav .site-nav__cta { display: inline-flex; margin-top: var(--space-8); }
  .brand__logo { width: 2.5rem; height: 2.5rem; }
  .site-header__inner { gap: var(--space-3); }
}


/* Inner-page intro with a cover photo (Tentang): label, title, lead and photo fit one screen;
   the photo takes whatever height the text leaves. The next section starts below the fold. */
.intro { height: calc(100svh - var(--header-h)); min-height: 34rem; padding-block: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.intro__inner { display: flex; flex-direction: column; height: 100%; }
.intro h1 { max-width: 22ch; }
.intro .page-header__label { margin-bottom: var(--space-4); }
.intro .lead { margin-top: var(--space-4); }
.intro__media { flex: 1; min-height: 10rem; margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.intro__media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--intro-pos, center 42%); border-radius: var(--radius); }
.intro + .section:not([class*="surface-"]) { border-top: 1px solid var(--line); }

/* No divider right after a coloured band: the colour change already separates the sections. */
main [class*="surface-"] + .section.section.section { border-top: 0; }

/* No section divider after a section that already ends with a hairline list (avoids a double line). */
main .section:has(.rows:last-child) + .section.section.section,
main .section:has(.list-rows:last-child) + .section.section.section,
main .section:has(.table-wrap:last-child) + .section.section.section { border-top: 0; }
