/*
 * Barka Modern: lapisan tampilan modern untuk tema Barka.
 * Dimuat setelah style.min.css dan sebelum custom.css, sehingga warna di
 * custom.css (--primary-color, --secondary-color, --accent-color) tetap berlaku.
 */

:root {
  --ink: #0f1b2d;
  --text: #44546a;
  --muted: #66758b;
  --line: #e2e8f0;
  --surface: #f2f5fa;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .05), 0 2px 8px rgba(15, 27, 45, .04);
  --shadow-md: 0 18px 40px -20px rgba(15, 27, 45, .30);
  --tint: #e8f0fb;
  --tint: color-mix(in srgb, var(--secondary-color) 10%, white);
  --font-heading: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Dasar ---------- */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.font-heading, h1, h2, h3, h4, h5 { font-family: var(--font-heading); }
:focus-visible { outline: 2px solid var(--secondary-color); outline-offset: 3px; }
.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: 1rem; top: -4rem; z-index: 100;
  background: var(--primary-color); color: #fff; padding: .6rem 1rem;
  border-radius: var(--radius-sm); font-weight: 700; transition: top .15s;
}
.skip-link:focus { top: 1rem; }

/* Judul bagian */
.text-title {
  border-bottom-width: 0;
  padding-bottom: .65rem;
  color: var(--ink);
  letter-spacing: -.015em;
}
.text-title::after {
  left: 0; right: auto; top: auto; bottom: 0;
  width: 3rem; height: 4px; border-radius: 99px;
  background-color: var(--accent-color);
}
.text-title .fa, .text-title .fa-solid { color: var(--secondary-color); margin-right: .35rem; font-size: .9em; }

.text-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 700; color: var(--secondary-color);
}
.text-link .fa { font-size: .7rem; transition: transform .15s; }
.text-link:hover .fa { transform: translateX(3px); }

/* ---------- Tombol & formulir ---------- */
.btn,
button.bg-secondary.text-white,
button.bg-primary.text-white {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.25rem; border: 0; border-radius: var(--radius-sm);
  background-color: var(--secondary-color); color: #fff; opacity: 1;
  font-weight: 700; font-size: .95rem; line-height: 1.2; cursor: pointer;
  transition: filter .15s, background-color .15s;
}
.btn:hover,
button.bg-secondary.text-white:hover,
button.bg-primary.text-white:hover { filter: brightness(1.1); }
.btn--dark { background-color: var(--primary-color); }
.btn--ghost { background-color: var(--tint); color: var(--secondary-color); }
.btn--ghost:hover { filter: brightness(.97); }

.form-input, .form-select, .form-textarea {
  border: 1px solid #d3dbe8; border-radius: var(--radius-sm);
  background-color: #fff; color: var(--ink);
  padding-left: .9rem; padding-right: .9rem;
}
.form-input, .form-select { height: 2.75rem; }
.form-textarea { padding-top: .6rem; padding-bottom: .6rem; }
.form-input:focus, .form-select:focus, .form-textarea:focus,
.search input:focus, .subscribe input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 1px var(--secondary-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--secondary-color) 18%, transparent);
  outline: none;
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--secondary-color); }

/* ---------- Bilah atas & header ---------- */
.topbar { background: var(--primary-color); color: rgba(255, 255, 255, .85); font-size: .875rem; }
.topbar__inner { display: flex; align-items: center; gap: 1.75rem; min-height: 2.4rem; }
.topbar .fa { color: var(--accent-color); margin-right: .45rem; }
@media (max-width: 1023px) { .topbar { display: none; } }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0; min-height: 4.25rem;
}
@media (min-width: 1024px) { .site-header__inner { gap: 1.5rem; } }
.brand { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.brand img { width: 2.75rem; height: auto; flex: none; }
.brand__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; font-family: var(--font-heading); }
.brand__initial { font-size: .8rem; font-weight: 600; color: var(--muted); }
.brand__name { font-size: 1.3rem; font-weight: 800; color: var(--primary-color); letter-spacing: -.02em; }

.site-header .menu-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; flex: none; border: 0;
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--primary-color); font-size: 1.15rem; cursor: pointer; z-index: 60; margin-left: auto;
}
@media (min-width: 1024px) { .site-header .menu-button { display: none; } }

/* Menu: laci di ponsel, deret horizontal di desktop */
.site-nav { min-width: 0; }
.site-nav .menu {
  width: min(78%, 20rem); padding: 1rem .75rem 2rem; margin: 0;
  font-family: var(--font-body);
}
.menu-title {
  padding: .5rem .9rem 1rem; font-family: var(--font-heading);
  font-size: 1.1rem; font-weight: 800; color: var(--ink);
}
.menu-link {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .7rem .9rem; border-radius: var(--radius-sm);
  font-weight: 600; color: var(--ink);
  transition: background-color .15s, color .15s;
}
.menu-link:hover, .menu-item.is-active > .menu-link { background: var(--tint); color: var(--secondary-color); }
.menu-icon { font-size: .65rem; margin-left: .15rem; }
.site-nav .menu-dropdown { margin: 0 0 0 1rem; border-left: 3px solid var(--tint); padding-left: .35rem; }
.site-nav .menu-dropdown.is-open { margin-bottom: .4rem; }
.submenu-link {
  display: block; padding: .55rem .8rem; border-radius: 10px;
  font-weight: 500; color: var(--text);
  transition: background-color .15s, color .15s;
}
.submenu-link:hover { background: var(--tint); color: var(--secondary-color); }

@media (min-width: 1024px) {
  .site-nav { flex: 1; }
  .site-nav .menu { width: 100%; padding: 0; justify-content: flex-end; gap: .15rem; }
  .menu-title { display: none; }
  .menu-link { padding: .55rem .8rem; font-size: .95rem; }

  .site-nav .menu-dropdown {
    width: 15rem; left: 0; top: 100%; margin: 0; padding: .4rem;
    border: 1px solid var(--line); border-radius: 14px; background: #fff;
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .18s, transform .18s, visibility .18s;
  }
  .site-nav .menu-dropdown::before { content: ''; position: absolute; left: 0; right: 0; top: -.6rem; height: .6rem; }
  .menu-item:hover .menu-dropdown,
  .menu-item:focus-within .menu-dropdown { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .menu-item:last-child .menu-dropdown { left: auto; right: 0; }
}

/* ---------- Hero ---------- */
.hero { padding-top: 1rem; }
.hero .o-slider { height: auto; background: var(--primary-color); border-radius: 24px; overflow: hidden; }
.hero .o-slider figure { position: relative; height: clamp(13rem, 44vw, 28rem); }
.hero .o-slider img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero .o-slider figure::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 40%; pointer-events: none;
  background: linear-gradient(to top, rgba(8, 20, 36, .5), transparent);
}
.o-slider .owl-dots { position: absolute; left: 0; right: 0; bottom: .9rem; text-align: center; z-index: 2; }
.o-slider .owl-dot { display: inline-block; padding: 4px; background: none; border: 0; cursor: pointer; }
.o-slider .owl-dot span {
  display: block; width: 8px; height: 8px; border-radius: 99px;
  background: rgba(255, 255, 255, .6); transition: width .25s, background-color .25s;
}
.o-slider .owl-dot.active span { width: 26px; background: #fff; }
@media (min-width: 1024px) { .o-slider .owl-dots { bottom: 3.6rem; } }

/* ---------- Identitas sekolah ---------- */
.identity {
  position: relative; z-index: 5; display: grid; gap: 1.25rem;
  padding: 1.25rem 1.4rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.identity__place { display: flex; align-items: flex-start; gap: 1rem; }
.identity__icon {
  flex: none; display: grid; place-items: center; width: 3rem; height: 3rem;
  border-radius: 14px; background: var(--primary-color); color: var(--accent-color); font-size: 1.5rem;
}
.identity__name { font-size: 1.3rem; font-weight: 800; line-height: 1.2; color: var(--ink); letter-spacing: -.015em; }
.identity__tagline { margin-top: .15rem; font-weight: 600; font-size: .95rem; color: var(--secondary-color); }
.identity__address { margin-top: .3rem; font-size: .925rem; color: var(--muted); }
@media (min-width: 1024px) {
  .identity { grid-template-columns: 1fr auto; align-items: center; padding: 1.5rem 2rem; }
  .has-hero > .identity:first-child { margin-top: -4.5rem; }
}

.social { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.social-link {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--surface); color: var(--primary-color); border: 1px solid var(--line);
  transition: background-color .15s, color .15s;
}
.social-link:hover { background: var(--primary-color); color: #fff; border-color: transparent; }
.social-link .fa { font-size: 1.1rem; }

/* ---------- Pengumuman berjalan ---------- */
.ticker {
  display: flex; align-items: stretch; overflow: hidden; font-size: .9rem;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm);
}
.ticker__label {
  flex: none; display: inline-flex; align-items: center; gap: .55rem;
  padding: .55rem 1.1rem; background: var(--secondary-color); color: #fff; font-weight: 700;
}
.ticker__date { display: none; }
@media (min-width: 1024px) { .ticker__date { display: inline; } }
.ticker__viewport {
  flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
}
.ticker__track {
  display: inline-flex; flex: none; white-space: nowrap;
  animation: ticker-scroll var(--ticker-duration, 40s) linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { display: inline-flex; align-items: center; padding: 0 1.5rem 0 0; }
.ticker__item::before {
  content: ''; flex: none; width: 6px; height: 6px; margin-right: .9rem; border-radius: 50%;
  background: var(--accent-color);
}
@keyframes ticker-scroll { to { transform: translateX(-25%); } }

/* ---------- Kartu artikel ---------- */
.post-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s;
}
.post-card:hover { box-shadow: var(--shadow-md); border-color: #d3dbe8; }
.post-media {
  display: flex; align-items: center; justify-content: center; flex: none;
  aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface);
}
.post-thumb { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.post-thumb.is-fallback { width: 4rem; height: auto; object-fit: contain; }
.post-date {
  position: absolute; top: .8rem; left: .8rem; display: flex; flex-direction: column; align-items: center;
  padding: .3rem .65rem; line-height: 1.1; text-align: center;
  background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.post-date__day { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.post-date__month { font-size: .75rem; font-weight: 700; color: var(--secondary-color); }
.post-body { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; flex: 1; padding: 1.1rem 1.25rem 1.3rem; }
.post-text { display: flex; flex-direction: column; gap: .5rem; }
.post-title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; color: var(--ink); transition: color .15s; }
.post-text a:hover .post-title { color: var(--secondary-color); }
.post-excerpt {
  font-size: .95rem; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
@media (min-width: 1024px) {
  .post-card { flex-direction: row; }
  .post-media { width: 38%; aspect-ratio: auto; min-height: 13rem; }
  .post-body { padding: 1.5rem; }
}
/* Artikel pertama tampil besar */
.post-card--featured { flex-direction: column; }
.post-card--featured .post-media { width: 100%; min-height: 0; aspect-ratio: 16 / 9; }
.post-card--featured .post-title { font-size: 1.55rem; }
.post-card--featured .post-excerpt { -webkit-line-clamp: 4; }
@media (min-width: 1024px) { .post-card--featured .post-body { padding: 1.5rem 1.75rem 1.75rem; } }

.load-more { display: flex; margin: 1.5rem auto 0; }

/* ---------- Galeri & video ---------- */
.media-card { display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.media-card img { width: 100%; height: 12rem; object-fit: cover; background: var(--surface); }
.media-card figcaption { padding: .9rem 1.1rem .5rem; font-weight: 700; color: var(--ink); }
.media-card .btn { margin: .4rem 1.1rem 1.1rem; }
.video-frame { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: #000; box-shadow: var(--shadow-sm); }
.video-frame iframe { width: 100%; height: 100%; display: block; }

/* ---------- Sidebar ---------- */
.search { position: relative; }
.search input {
  width: 100%; height: 3rem; padding: 0 1.1rem 0 2.8rem; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm); color: var(--ink);
}
.search .fa { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }

.widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.widget__title { font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink); margin-bottom: .6rem; }
.widget__hint { font-size: .925rem; color: var(--muted); margin-bottom: .85rem; }
.widget-list a {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .6rem 0; border-top: 1px solid var(--line); color: var(--text); transition: color .15s;
}
.widget-list a:first-child { border-top: 0; }
.widget-list a:hover { color: var(--secondary-color); }
.widget-list .fa { font-size: .8rem; color: var(--muted); }

.headmaster { text-align: center; }
.headmaster img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 14px; background: var(--surface); }
.headmaster__name { margin-top: 1rem; font-size: 1.1rem; font-weight: 800; color: var(--ink); }
.headmaster__role { font-size: .9rem; color: var(--secondary-color); font-weight: 600; }
.headmaster__speech { margin: .8rem 0 1rem; font-size: .925rem; text-align: left; }

.subscribe { display: flex; gap: .5rem; }
.subscribe input { flex: 1; min-width: 0; height: 2.75rem; padding: 0 .9rem; border: 1px solid #d3dbe8; border-radius: var(--radius-sm); background: #fff; }
.subscribe .btn { flex: none; width: 2.75rem; padding: 0; }

.poll { display: grid; gap: .5rem; margin-bottom: 1rem; }
.poll__option {
  display: flex; align-items: center; gap: .65rem; padding: .6rem .8rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.poll__option:hover, .poll__option:has(input:checked) { border-color: var(--secondary-color); background: var(--tint); }
.poll__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.banners { display: grid; gap: .75rem; }
.banners img { width: 100%; border-radius: var(--radius-sm); }

/* ---------- Isi artikel ---------- */
.post-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; padding: 0; list-style: none; font-size: .875rem; color: var(--muted); }
.post-meta .fa { color: var(--secondary-color); }
.post-meta a:hover { color: var(--secondary-color); }
.post-cover { display: block; width: 100%; height: auto; border-radius: var(--radius); }

.content { font-size: 1.0625rem; line-height: 1.8; color: #2b3a4f; }
.content h2 { font-size: 1.6rem; margin-top: 1.75rem; color: var(--ink); letter-spacing: -.015em; }
.content h3 { font-size: 1.3rem; margin-top: 1.5rem; color: var(--ink); }
.content h4 { font-size: 1.1rem; color: var(--ink); }
.content a { color: var(--secondary-color); text-decoration: underline; text-underline-offset: 3px; }
.content blockquote {
  margin: 1.25rem 0; padding: .35rem 0 .35rem 1.1rem;
  border-left: 4px solid var(--accent-color); color: var(--ink); font-style: italic;
}
.content img { height: auto; border-radius: 14px; box-shadow: none; }
.content table { border-radius: 12px; overflow: hidden; border-color: var(--line) !important; }
.content table thead { background-color: var(--primary-color) !important; }
.content table tr, .content table td, .content table th { border-color: var(--line) !important; padding: .6rem .75rem !important; }
.content table thead th { border-color: rgba(255, 255, 255, .25) !important; }
.content table tbody tr:nth-child(even) { background-color: var(--surface); }

.comment { border-radius: 14px; box-shadow: none; }

/* Kartu putih bawaan di halaman lain (pegawai, siswa, berkas, dll.) */
main .bg-white { border-radius: var(--radius); }
main .shadow, main .shadow-md { box-shadow: var(--shadow-sm); }
main .border { border-color: var(--line); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 2.5rem; background: var(--primary-color); color: rgba(255, 255, 255, .78); }
.site-footer a:hover { color: var(--accent-color); }
.site-footer__grid { display: grid; gap: 2rem; padding-top: 3rem; padding-bottom: 2.5rem; }
@media (min-width: 1024px) { .site-footer__grid { grid-template-columns: 1.4fr 1.2fr 1fr; gap: 3rem; } }
.site-footer__brand { display: flex; align-items: flex-start; gap: 1rem; }
.site-footer__brand img { width: 3.25rem; height: auto; flex: none; }
.site-footer__brand strong { display: block; font-family: var(--font-heading); font-size: 1.2rem; font-weight: 800; color: #fff; line-height: 1.25; }
.site-footer__brand p { margin-top: .35rem; font-size: .925rem; }
.site-footer h4 { margin-bottom: .9rem; font-size: 1.05rem; font-weight: 800; color: #fff; }
.site-footer__list { display: grid; gap: .7rem; list-style: none; padding: 0; margin: 0; font-size: .925rem; }
.site-footer__list li { display: flex; gap: .75rem; }
.site-footer__list .fa { flex: none; width: 1rem; margin-top: .25rem; color: var(--accent-color); text-align: center; }
.site-footer .social-link { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; }
.site-footer .social-link:hover { background: var(--accent-color); color: var(--primary-color); }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .14); font-size: .875rem; }
.site-footer__credit { display: flex; flex-direction: column; gap: .25rem; padding-top: 1.1rem; padding-bottom: 1.1rem; text-align: center; }
@media (min-width: 1024px) { .site-footer__credit { flex-direction: row; justify-content: space-between; text-align: left; } }

/* ---------- Gerak: hormati preferensi pengguna ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .ticker__track { animation: none; }
  .ticker__viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}
