/* ==========================================================================
   Rumah Jurnal | UIN Sultanah Nahrasiyah Lhokseumawe
   Warna mengacu pada logo resmi: biru tua #132a64 dan emas #efbe17.
   ========================================================================== */

:root {
  --navy-900: #0c1a45;
  --navy-800: #132a64;
  --navy-700: #1c3a85;
  --navy-600: #2a4a9a;
  --navy-100: #e4e9f5;
  --gold-500: #efbe17;
  --gold-600: #d9a900;
  --gold-800: #765800;

  --paper: #f4f6fb;
  --white: #ffffff;
  --ink: #17203b;
  --muted: #4a5573;
  --line: #d8deec;

  --focus: var(--navy-700);

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 12px;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 4.5rem;
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
}

h1, h2, h3 { margin: 0; font-family: var(--font-serif); font-weight: 600; line-height: 1.15; color: var(--navy-800); }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; }
a { color: var(--navy-700); text-underline-offset: 0.18em; }
a:hover { color: var(--navy-900); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 100;
  background: var(--gold-500); color: var(--navy-900); font-weight: 600;
  padding: 0.6rem 1rem; border-radius: var(--radius-m); text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

[hidden] { display: none !important; }

/* Anchor tidak tertutup header yang menempel */
section[id] { scroll-margin-top: calc(var(--header-h) + 0.5rem); }

/* ---------- Tombol & tautan ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0.55rem 1.25rem;
  font: inherit; font-weight: 600; font-size: 0.9375rem; line-height: 1.2; text-align: center;
  text-decoration: none; cursor: pointer;
  border: 2px solid transparent; border-radius: var(--radius-m);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-gold { background: var(--gold-500); color: var(--navy-900); }
.btn-gold:hover { background: #f7cd45; color: var(--navy-900); }
.btn-outline-light { border-color: rgba(255, 255, 255, 0.55); color: var(--white); }
.btn-outline-light:hover { border-color: var(--white); background: rgba(255, 255, 255, 0.08); color: var(--white); }
.btn-navy { background: var(--navy-800); color: var(--white); }
.btn-navy:hover { background: var(--navy-900); color: var(--white); }
.btn-outline { border-color: var(--navy-800); color: var(--navy-800); background: var(--white); }
.btn-outline:hover { background: var(--navy-100); color: var(--navy-900); }

.link { font-weight: 600; }

/* ---------- Bilah atas ---------- */
.topbar { background: var(--navy-900); color: var(--white); --focus: var(--gold-500); }
.topbar-inner { display: flex; justify-content: flex-end; }
.topbar-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; padding: 0.4rem 0; }
.topbar-links a { color: rgba(255, 255, 255, 0.88); font-size: 0.8125rem; text-decoration: none; }
.topbar-links a:hover { color: var(--gold-500); text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white); border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--header-h); flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.brand-mark { display: block; width: 40px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.5rem; color: var(--navy-800); }
.brand-inst { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }

.menu-toggle {
  display: none; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.4rem 0.9rem;
  font: inherit; font-weight: 600; color: var(--navy-800);
  background: var(--white); border: 2px solid var(--navy-800); border-radius: var(--radius-m);
  cursor: pointer;
}
.menu-toggle[aria-expanded="true"] { background: var(--navy-800); color: var(--white); }

.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 0.25rem; }
.site-nav a {
  display: block; padding: 0.55rem 0.8rem; border-radius: var(--radius-m);
  font-weight: 500; font-size: 0.9688rem; color: var(--ink); text-decoration: none;
}
.site-nav a:hover { background: var(--navy-100); color: var(--navy-900); }

.no-js .search, .no-js .result-status { display: none; }

/* Layar kecil: menu dilipat (hanya bila JavaScript aktif) */
@media (max-width: 52rem) {
  .js .menu-toggle { display: inline-flex; }
  .js .site-nav { display: none; width: 100%; padding-bottom: 0.75rem; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; }
  .js .site-nav a { padding: 0.8rem 0.5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .no-js .site-nav { width: 100%; padding-bottom: 0.5rem; }
  .brand-name { font-size: 1.3rem; }
  .brand-inst { font-size: 0.75rem; }
}

/* ---------- Hero ---------- */
.hero { background: var(--navy-800); color: var(--white); --focus: var(--gold-500); padding-top: clamp(2.5rem, 6vw, 4rem); }
.hero-inner { padding-bottom: clamp(2rem, 5vw, 3rem); }
.hero h1 {
  max-width: 22ch; color: var(--white); font-weight: 600;
  font-size: clamp(2.1rem, 1.2rem + 3.3vw, 3.6rem); letter-spacing: -0.01em; line-height: 1.08;
}
.hero-lead { max-width: 38rem; margin: 1.25rem 0 1.75rem; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.55; color: rgba(255, 255, 255, 0.9); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-note { margin: 1.75rem 0 0; font-size: 0.9375rem; color: rgba(255, 255, 255, 0.78); }
.hero-note strong { color: var(--gold-500); font-weight: 700; }

/* Rak sampul: garis emas menjadi alas, sampul berdiri di atasnya */
.shelf { border-bottom: 6px solid var(--gold-500); }
.shelf-list { display: flex; align-items: flex-end; gap: clamp(0.5rem, 1.8vw, 1.25rem); }
.shelf-list li { flex: 1 1 0; min-width: 0; max-width: 11.5rem; }
.shelf-list a { display: block; }
.shelf-list .cover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); }
.shelf-list a:hover .cover { box-shadow: 0 0 0 2px var(--gold-500); }
@media (max-width: 40rem) { .shelf-list li:nth-child(n+5) { display: none; } }
@media (min-width: 40.01rem) and (max-width: 60rem) { .shelf-list li:nth-child(n+6) { display: none; } }

/* ---------- Sampul (dipakai rak, kartu, dan edisi) ---------- */
.cover {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 3 / 4; width: 100%; overflow: hidden;
  background: var(--navy-700); color: var(--gold-500);
  border-radius: var(--radius-s);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-fallback {
  display: flex; align-items: center; justify-content: center;
  width: calc(100% - 1rem); height: calc(100% - 1rem); padding: 0.4rem;
  border: 1px solid rgba(239, 190, 23, 0.5); border-radius: 2px;
  text-align: center; font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(0.95rem, 0.8rem + 0.6vw, 1.25rem); line-height: 1.15; overflow-wrap: break-word;
}

/* ---------- Bagian umum ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section-tint { background: var(--paper); }
.section-head { max-width: 40rem; margin-bottom: 2rem; }
.section-head h2, .about-main h2, .contact-info h2, .sambutan-layout > h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); }
.section-head p { margin: 0.75rem 0 0; color: var(--muted); }

/* ---------- Pencarian ---------- */
.search { margin-bottom: 1rem; max-width: 44rem; }
.search-label { display: block; margin-bottom: 0.4rem; font-weight: 600; color: var(--navy-800); }
.search-field { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 1rem; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; min-height: 3.5rem; padding: 0.75rem 5.25rem 0.75rem 3.1rem;
  font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--white); border: 2px solid var(--navy-800); border-radius: var(--radius-m);
}
.search input::placeholder { color: #66708c; }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 0; box-shadow: 0 0 0 5px var(--navy-800); border-radius: var(--radius-m); }
.search-clear {
  position: absolute; right: 0.5rem; min-height: 2.5rem; padding: 0 0.85rem;
  font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--navy-800);
  background: var(--navy-100); border: 0; border-radius: var(--radius-s); cursor: pointer;
}
.search-clear:hover { background: #d3dbee; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
.chip {
  min-height: 2.5rem; padding: 0.3rem 0.95rem;
  font: inherit; font-size: 0.9rem; font-weight: 500; color: var(--navy-800);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--navy-700); }
.chip[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); color: var(--white); }
.chip-count { opacity: 0.75; margin-left: 0.25rem; font-variant-numeric: tabular-nums; }

.result-status { margin: 1.25rem 0 1rem; min-height: 1.6em; font-size: 0.9688rem; color: var(--muted); }

/* ---------- Kartu jurnal ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); gap: 1.25rem; }

.card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l);
  overflow: hidden; transition: border-color 0.15s;
}
.card:hover, .card:focus-within { border-color: var(--navy-700); }
.card-cover { display: block; padding: 0.75rem 0.75rem 0; }
.card .cover { border-radius: var(--radius-s); box-shadow: 0 0 0 1px var(--line); }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 0.6rem; padding: 0.9rem 1rem 1rem; }
.card-field { margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--gold-800); line-height: 1.3; }
.card-title { font-size: 1.1875rem; line-height: 1.2; }
.card-meta { margin: 0; font-size: 0.875rem; color: var(--muted); }
.card-desc { margin: 0; font-size: 0.9375rem; color: var(--muted); }
/* .card-actions { display: flex; flex-direction: column; align-items: stretch; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; }
.card-actions .btn { width: 100%; }
.card-actions { gap: 0.5rem; } */
.card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.card-actions .btn {
  width: 100%;
  box-sizing: border-box;
  /* border-radius: 9999px; */
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
  line-height: 1.4;
}
.btn.is-disabled { border-color: var(--line); color: #6b7592; background: var(--paper); cursor: not-allowed; }
.btn.is-disabled:hover { background: var(--paper); color: #6b7592; }

/* ---------- Keadaan kosong ---------- */
.empty { max-width: 36rem; padding: 2rem; background: var(--paper); border: 1px dashed #aab4cf; border-radius: var(--radius-l); }
.empty h3 { font-size: 1.5rem; }
.empty p { margin: 0.5rem 0 1.25rem; color: var(--muted); }
.empty-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.noscript-note { margin-top: 1rem; color: var(--muted); }
.noscript-list { columns: 2 18rem; column-gap: 2rem; }
.noscript-list li { margin-bottom: 0.4rem; break-inside: avoid; }

/* ---------- Edisi terbaru ---------- */
.edisi-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1.25rem; }
.edisi-item {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.1rem; align-items: center;
  padding: 1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l);
}
.edisi-item .cover-fallback { font-size: 0.8rem; padding: 0.2rem; }
.shelf-list .cover-fallback { font-size: clamp(0.7rem, 0.5rem + 0.9vw, 1.15rem); }
.edisi-item h3 { font-size: 1.1875rem; line-height: 1.2; margin-bottom: 0.75rem; }

/* ---------- Sambutan ---------- */
.sambutan-layout { display: grid; gap: 1.5rem 4rem; }
.sambutan-body { max-width: 40rem; font-family: var(--font-serif); font-size: 1.25rem; line-height: 1.65; }
.sambutan-body p { margin-bottom: 1.1em; }
.sign-off { margin-top: 1.75rem; margin-bottom: 0.25rem; color: var(--muted); }
.signature { font-family: var(--font-sans); font-size: 1rem; line-height: 1.45; color: var(--ink); }
.signature strong { font-size: 1.0625rem; color: var(--navy-800); }
@media (min-width: 56rem) {
  .sambutan-layout { grid-template-columns: minmax(13rem, 1fr) 2.6fr; align-items: start; }
  .sambutan-layout > h2 { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}

.sambutan-heading h2 {
  font-size: var(--h2-size, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.sambutan-image {
  max-width: 240px;
}

.sambutan-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  border-radius: 0.5rem;
}

/* ---------- Tentang ---------- */
.about-layout { display: grid; gap: 2.5rem; }
.about-main { max-width: 40rem; }
.about-main h2 { margin-bottom: 1rem; }
.about-main p { color: var(--ink); }
.audience { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.audience li { padding: 1.25rem 1.25rem 1.1rem; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--gold-500); border-radius: var(--radius-m); }
.audience h3 { font-size: 1.3125rem; margin-bottom: 0.5rem; }
.audience p { font-size: 0.9688rem; color: var(--muted); margin-bottom: 0.75rem; }

/* ---------- Kontak ---------- */
.contact-layout { display: grid; gap: 2rem; }
@media (min-width: 52rem) { .contact-layout { grid-template-columns: 1fr 1.2fr; align-items: stretch; gap: 3rem; } }
.contact-info p { color: var(--muted); margin: 0.75rem 0 1.25rem; }
.contact-list div { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.contact-list div:last-child { border-bottom: 1px solid var(--line); }
.contact-list dt { font-size: 0.875rem; font-weight: 600; color: var(--gold-800); }
.contact-list dd { margin: 0; overflow-wrap: anywhere; }
.contact-list a { font-weight: 500; }
.map-link { margin-top: 1.25rem; margin-bottom: 0; }
.map { min-height: 18rem; border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; background: var(--paper); }
.map iframe { display: block; width: 100%; height: 100%; min-height: 18rem; border: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper); border-top: 4px solid var(--gold-500); }
.footer-grid { display: grid; gap: 2.25rem; padding-block: 3rem 2.5rem; }
@media (min-width: 52rem) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: 3rem; } }
.footer-brand { display: flex; align-items: flex-start; gap: 1.25rem; }
.footer-brand img { width: 6.5rem; height: auto; flex: none; }
.footer-name { margin: 0; font-family: var(--font-serif); font-weight: 700; font-size: 1.5rem; color: var(--navy-800); line-height: 1.15; }
.footer-inst { margin: 0.15rem 0 0.75rem; font-weight: 600; color: var(--ink); }
.footer-desc { margin: 0; font-size: 0.9688rem; color: var(--muted); max-width: 26rem; }
.footer-col h2 { margin-bottom: 0.75rem; font-family: var(--font-sans); font-size: 1rem; font-weight: 700; color: var(--navy-800); }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { font-size: 0.9688rem; }
.footer-bar { background: var(--navy-900); color: rgba(255, 255, 255, 0.85); --focus: var(--gold-500); }
.footer-bar p { margin: 0; padding-block: 1rem; font-size: 0.875rem; }
.footer-bar a { color: var(--white); }
.footer-bar a:hover { color: var(--gold-500); }

@media (max-width: 40rem) {
  .brand { flex: 1 1 0; min-width: 0; }
  .menu-toggle { padding: 0; width: 2.75rem; justify-content: center; }
  .menu-toggle span {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
}

@media (max-width: 30rem) {
  .edisi-item { grid-template-columns: 5rem 1fr; }
  .footer-brand { flex-direction: column; }
}

@media print {
  .topbar, .menu-toggle, .search, .chips, .map, .shelf { display: none !important; }
  .site-header { position: static; }
}
