/*
Theme Name: SisLab Insight
Theme URI: https://sislab.co.id
Author: SisLab / Agia Digital Teknologi
Author URI: https://sislab.id
Description: Custom editorial theme for sislab.co.id — konten & wawasan seputar Sistem Informasi Laboratorium (LIS) yang mengarahkan pembaca ke sislab.id.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: sislab-insight
*/

/* ============================================================
   DESIGN TOKENS — ubah warna/logo brand di sini
   ============================================================ */
:root {
  --c-ink: #0B1F3A;        /* navy utama - header, heading */
  --c-bg: #FAFBFC;         /* background clinical white */
  --c-bg-alt: #F0F3F6;     /* section alternate */
  --c-teal: #0F8B8D;       /* aksen - link, garis, icon */
  --c-teal-dark: #0B6E70;
  --c-amber: #E8A33D;      /* CTA - dipakai hemat */
  --c-amber-dark: #C6842A;
  --c-slate: #5B6B7C;      /* teks sekunder */
  --c-slate-light: #64758A; /* meta text — darkened from initial draft to pass WCAG AA contrast */
  --c-border: #DDE3E9;
  --c-card: #FFFFFF;

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 4px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-teal-dark); text-decoration: none; }
a:hover { color: var(--c-amber-dark); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--c-teal);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--c-ink);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.2em; }

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-teal-dark);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 2px;
  background: var(--c-amber);
  display: inline-block;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--c-border);
  background: var(--c-card);
  position: sticky;
  top: 0;
  z-index: 50;
}
/* Keep the sticky header flush under the WP admin bar instead of
   leaving a gap (only relevant when viewing the site logged in) */
body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.site-branding {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--c-ink);
}
.site-branding img { height: 34px; width: auto; }
.site-branding .sep {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: .85rem;
  color: var(--c-slate-light);
}

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.primary-nav a {
  color: var(--c-ink);
  font-size: .95rem;
  font-weight: 500;
}
.primary-nav a:hover { color: var(--c-teal-dark); }

/* ---- dropdown submenu ("Kategori" etc) ---- */
.primary-nav li { position: relative; }

/* invisible bridge filling the gap between the link and the dropdown box,
   so the mouse never "leaves" a hoverable area while moving down to it */
.primary-nav .menu-item-has-children::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
}

.primary-nav .menu-item-has-children > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.primary-nav .menu-item-has-children > a::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  opacity: .6;
  transition: transform .15s ease;
}
.primary-nav .menu-item-has-children.sub-open > a::after,
.primary-nav .menu-item-has-children:hover > a::after {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.primary-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  top: calc(100% + 12px);
  left: -8px;
  min-width: 220px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(11,31,58,.1);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}
.primary-nav .sub-menu li { width: 100%; }
.primary-nav .sub-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 3px;
  font-size: .9rem;
  font-weight: 400;
}
.primary-nav .sub-menu a:hover { background: var(--c-bg-alt); color: var(--c-teal-dark); }

/* desktop: hover or keyboard focus reveals dropdown */
@media (min-width: 821px) {
  .primary-nav .menu-item-has-children:hover > .sub-menu,
  .primary-nav .menu-item-has-children:focus-within > .sub-menu {
    display: flex;
  }
}

/* mobile: JS toggles .sub-open, submenu becomes static (accordion) */
@media (max-width: 820px) {
  .primary-nav .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--c-border);
    margin: 4px 0 4px 12px;
    display: none;
  }
  .primary-nav .menu-item-has-children.sub-open > .sub-menu { display: flex; }
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-ink);
  color: #fff !important;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
  transition: background .15s ease;
}
.btn-cta:hover { background: var(--c-teal-dark); color: #fff !important; }
.btn-cta.amber { background: var(--c-amber); color: var(--c-ink) !important; }
.btn-cta.amber:hover { background: var(--c-amber-dark); color: #fff !important; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--c-border);
}
.hero-inner { max-width: 880px; }
.hero .lead {
  font-size: 1.15rem;
  color: var(--c-slate);
  max-width: 680px;
}
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-actions .btn-ghost {
  padding: 11px 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-ink);
  font-weight: 600;
  font-size: .9rem;
}
.hero-actions .btn-ghost:hover { border-color: var(--c-teal); color: var(--c-teal-dark); }

/* ---- hero with background image (homepage or category header) ---- */
.archive-hero { padding: 48px 0 32px; }
.hero.has-image {
  padding: 72px 0;
  background-size: cover;
  background-position: center;
  background-color: var(--c-ink); /* fallback while image loads */
}
.hero.has-image .eyebrow { color: #CFE0E0; }
.hero.has-image .eyebrow::before { background: var(--c-amber); }
.hero.has-image h1 { color: #fff; }
.hero.has-image .lead { color: #E4EAEF; }
.hero.has-image .hero-actions .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); }
.hero.has-image .hero-actions .btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.1); }

/* ============================================================
   HOMEPAGE LAYOUT BUILDER — rows & columns
   ============================================================ */
.home-row {
  display: grid;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--c-border);
}
.home-row-cols-1 { grid-template-columns: 1fr; }
.home-row-cols-2 { grid-template-columns: repeat(2, 1fr); }
.home-row-cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .home-row-cols-2, .home-row-cols-3 { grid-template-columns: 1fr; }
}

.home-col-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--c-ink);
}
.home-col-header h2 { margin: 0; font-size: 1.3rem; }
.home-col-header a {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--c-teal-dark);
  white-space: nowrap;
}
.home-col-header a:hover { color: var(--c-amber-dark); }

/* card style: auto-fits multiple per line in wide (1-col row) contexts,
   naturally collapses to a single column in narrow (3-col row) contexts */
.home-col-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* list style: compact title + date rows */
.home-col-list { display: flex; flex-direction: column; }
.list-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--c-border);
}
.list-item:last-child { border-bottom: none; }
.list-item-title {
  color: var(--c-ink);
  font-weight: 500;
  font-size: .98rem;
}
.list-item-title:hover { color: var(--c-teal-dark); }
.list-item-meta {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--c-slate-light);
  white-space: nowrap;
}

/* ============================================================
   ARTICLE GRID / "SPECIMEN LABEL" CARDS — signature element
   ============================================================ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 56px 0;
}
@media (max-width: 900px) { .article-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .article-grid { grid-template-columns: 1fr; } }

.spec-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .15s ease;
}
.spec-card:hover { border-color: var(--c-teal); transform: translateY(-2px); }

.spec-thumb {
  aspect-ratio: 16/10;
  background: var(--c-bg-alt);
  position: relative;
  overflow: hidden;
}
.spec-thumb img { width: 100%; height: 100%; object-fit: cover; }
.spec-code {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--c-ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .72rem;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: .04em;
}

.spec-body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.spec-cat {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-teal-dark);
  margin-bottom: 8px;
}
.spec-body h2 { margin-bottom: 8px; font-size: 1.2rem; }
.spec-body h2 a { color: var(--c-ink); }
.spec-body h2 a:hover { color: var(--c-teal-dark); }
.spec-body h3 { margin-bottom: 8px; font-size: 1.1rem; }
.spec-body h3 a { color: var(--c-ink); }
.spec-body h3 a:hover { color: var(--c-teal-dark); }
.spec-excerpt { color: var(--c-slate); font-size: .93rem; flex: 1; margin-bottom: 14px; }
.spec-meta {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--c-slate-light);
  border-top: 1px dashed var(--c-border);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
}

/* ============================================================
   SECTION: CTA STRIP
   ============================================================ */
.cta-strip {
  background: var(--c-ink);
  color: #fff;
  padding: 52px 0;
  margin-top: 32px;
}
.cta-strip .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-strip h2 { color: #fff; margin: 0; font-size: 1.5rem; }
.cta-strip p { color: #C7D3DD; margin: 6px 0 0; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-article { padding: 48px 0 72px; }
.post-header { max-width: 760px; margin: 0 auto 32px; }
.post-header .spec-cat { margin-bottom: 12px; }
.post-meta {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--c-slate-light);
  margin-bottom: 18px;
}
.post-thumb {
  max-width: 760px;
  margin: 0 auto 40px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--c-border);
}
.post-content {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.08rem;
}
.post-content h2 { margin-top: 1.6em; }
.post-content h3 { margin-top: 1.3em; }
.post-content blockquote {
  border-left: 3px solid var(--c-amber);
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  color: var(--c-slate);
  font-style: italic;
}
.post-content code {
  font-family: var(--font-mono);
  background: var(--c-bg-alt);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: .9em;
}
.post-content ul, .post-content ol { padding-left: 1.3em; }
.post-content img { border-radius: var(--radius); margin: 1.5em 0; }

.inline-cta {
  max-width: 760px;
  margin: 2.5em auto;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-teal);
  border-radius: var(--radius);
  padding: 22px 26px;
}
.inline-cta p { margin: 0 0 12px; color: var(--c-slate); }
.inline-cta strong { color: var(--c-ink); }

.post-footer-nav {
  max-width: 760px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding-bottom: 40px;
  font-family: var(--font-mono);
  font-size: .85rem;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-ink);
}
.pagination .current { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }

/* ============================================================
   SIDEBAR (optional)
   ============================================================ */
.content-layout { display: grid; grid-template-columns: 1fr 300px; gap: 48px; padding: 48px 0; }
@media (max-width: 900px) { .content-layout { grid-template-columns: 1fr; } }
.widget { margin-bottom: 32px; }
.widget h4 {
  font-family: var(--font-mono);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-slate);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 10px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--c-bg-alt);
  border-top: 1px solid var(--c-border);
  padding: 48px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h3 {
  font-family: var(--font-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-slate);
  margin-bottom: 14px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--c-ink); font-size: .92rem; }
.footer-grid a:hover { color: var(--c-teal-dark); }
.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding-top: 20px;
  font-size: .82rem;
  color: var(--c-slate);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   RESPONSIVE NAV
   ============================================================ */
@media (max-width: 820px) {
  .primary-nav { display: none; }
  .nav-toggle { display: block; }
  .site-header.nav-open .primary-nav {
    display: block;
    position: absolute;
    top: 76px; left: 0; right: 0;
    background: var(--c-card);
    border-bottom: 1px solid var(--c-border);
    padding: 16px 24px;
  }
  .site-header.nav-open .primary-nav ul { flex-direction: column; gap: 16px; }
  .header-cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
