/* =============================================================
   PortalSatu – Homepage Layout
   File: css/homepage.css  (dimuat HANYA di halaman depan)
   Hero height: aspect-ratio 16/7 agar proporsional di semua layar
   Semua .ps-* class HANYA ada di file ini – tidak ada di style.css
============================================================= */

/* ─── WRAPPER ─────────────────────────────────────────────── */
.ps-page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.ps-hero-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* ─── BREAKING NEWS BAR ────────────────────────────────────── */
.ps-breaking-bar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  border-top: 3px solid #e8232a;
}
[data-theme="dark"] .ps-breaking-bar { background: #161b22; border-color: #30363d; border-top-color: #e8232a; }
.ps-breaking-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 40px;
  overflow: hidden;
  gap: 0;
}
.ps-breaking-bar__label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e8232a;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 5px 14px;
  border-radius: 2px;
  flex-shrink: 0;
  white-space: nowrap;
  margin-right: 14px;
}
.ps-breaking-bar__ticker {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 1px solid #e2e8f0;
  padding-left: 14px;
}
[data-theme="dark"] .ps-breaking-bar__ticker { border-color: #30363d; }
.ps-breaking-bar__track {
  display: flex;
  white-space: nowrap;
  animation: psTicker 38s linear infinite;
}
.ps-breaking-bar:hover .ps-breaking-bar__track { animation-play-state: paused; }
.ps-breaking-bar__track a {
  color: #1a1a2e;
  font-size: 13px;
  font-weight: 500;
  padding: 0 28px;
  text-decoration: none;
  position: relative;
}
[data-theme="dark"] .ps-breaking-bar__track a { color: #e6edf3; }
.ps-breaking-bar__track a::before {
  content: '·';
  position: absolute;
  left: 0;
  color: #cbd5e0;
}
.ps-breaking-bar__track a:hover { color: #e8232a; }
@keyframes psTicker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── HERO ──────────────────────────────────────────────────
   Layout: 2 kolom (slider kiri | peunutoh kanan)
   Tinggi FIXED via aspect-ratio 16/7 pada hero kiri,
   hero kanan menyesuaikan tinggi hero kiri (align-items: stretch).
   Gambar slider: object-fit cover, tidak pernah terdistorsi.
────────────────────────────────────────────────────────────── */
.ps-hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* Hero Kiri – proporsional 16:7, gambar cover */
.ps-hero__left {
  /* Tinggi proporsional: aspect-ratio 16:9 pada kolom kiri */
  aspect-ratio: 16 / 9;
  min-height: 380px;
  max-height: 540px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  min-width: 0;
  width: 100%;
}
.ps-hero__slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Slide items */
.ps-slide {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ps-slide.is-active { display: block; }
.ps-slide > a {
  display: block;
  width: 100%;
  height: 100%;
}
.ps-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;    /* gambar selalu fill, tidak terdistorsi */
  object-position: center top;
  display: block;
}
.ps-slide__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.85) 0%,
    rgba(0,0,0,.25) 50%,
    transparent 100%
  );
  pointer-events: none;
}
.ps-slide__content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 20px;
  color: #fff;
  z-index: 2;
}
.ps-slide__cat {
  display: inline-block;
  background: #e8232a;
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 9px;
}
.ps-slide__title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px;
}
.ps-slide__title a { color: inherit; text-decoration: none; }
.ps-slide__title a:hover { text-decoration: underline; }
.ps-slide__meta { font-size: 11.5px; opacity: .75; }

/* Slider dots */
.ps-slider__dots {
  position: absolute;
  bottom: 14px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 3;
}
.slider-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: none; padding: 0; cursor: pointer; flex-shrink: 0;
  transition: background .3s, width .3s;
}
.slider-dot.is-active { background: #fff; width: 20px; border-radius: 4px; }

/* Slider arrows */
.ps-slider__arrows {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: 0 12px;
  pointer-events: none;
  z-index: 3;
}
.ps-slider__arrow {
  pointer-events: all;
  background: rgba(0,0,0,.45);
  border: none; color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer;
  transition: background .2s;
}
.ps-slider__arrow:hover { background: #053d6a; }

/* Hero Kanan – Peunutoh */
.ps-hero__right {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
[data-theme="dark"] .ps-hero__right { background: #1c2330; border-color: #30363d; }

.ps-hero__right-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: #053d6a;
  flex-shrink: 0;
}
.ps-hero__right-label {
  font-size: 13px; font-weight: 700; color: #fff;
  border-left: 3px solid #f59e0b;
  padding-left: 8px;
}
.ps-hero__right-more {
  font-size: 11px; color: #f59e0b;
  font-weight: 600; text-decoration: none;
}
.ps-hero__right-more:hover { text-decoration: underline; }

.ps-hero__right-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;   /* tidak scroll, semua post bagi rata tinggi */
}
.ps-hero__post {
  display: grid;
  grid-template-columns: 90px 1fr;
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
  text-decoration: none;
  background: #fff;
  transition: background .2s;
  min-height: 0;
}
[data-theme="dark"] .ps-hero__post { background: #1c2330; border-color: #30363d; }
.ps-hero__post:last-child { border-bottom: none; }
.ps-hero__post:hover { background: #f4f6f8; }
[data-theme="dark"] .ps-hero__post:hover { background: #161b22; }

.ps-hero__post-img { overflow: hidden; flex-shrink: 0; }
.ps-hero__post-thumb {
  width: 90px;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ps-hero__post-body {
  padding: 8px 10px;
  display: flex; flex-direction: column;
  gap: 3px; justify-content: center;
  min-width: 0;
}
.ps-hero__post-cat {
  font-size: 9px; font-weight: 800; color: #e8232a;
  text-transform: uppercase; letter-spacing: .8px;
}
.ps-hero__post-title {
  font-size: 12.5px; font-weight: 600; line-height: 1.35;
  color: #1a1a2e;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
[data-theme="dark"] .ps-hero__post-title { color: #e6edf3; }
.ps-hero__post-date { font-size: 10px; color: #718096; }

/* Peunutoh Mobile – sembunyikan di desktop */
.ps-peunutoh-mobile { display: none; }

/* ─── GAP antara hero dan basa-aceh ────────────────────────── */
.ps-basa-gap {
  height: 28px;
  background: #f4f6f8;
}
[data-theme="dark"] .ps-basa-gap { background: #0d1117; }

/* ─── BASA ACEH – Standalone dark band ─────────────────────── */
.ps-basa {
  background: #0f172a;
  border-top: 5px solid #f59e0b;
  border-bottom: 3px solid #1e293b;
  padding: 22px 0 26px;
}
[data-theme="dark"] .ps-basa { background: #07090f; }

.ps-basa__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.ps-basa__heading {
  font-size: 15px; font-weight: 800; color: #fff;
  border-left: 4px solid #f59e0b;
  padding-left: 10px;
  text-transform: uppercase; letter-spacing: .5px;
}
.ps-basa__see-all {
  font-size: 11px; font-weight: 700; color: #f59e0b;
  text-decoration: none; border-bottom: 1px solid #f59e0b;
  text-transform: uppercase; letter-spacing: .5px;
}
.ps-basa__see-all:hover { opacity: .75; }
.ps-basa__overflow { overflow: hidden; }
.ps-basa__track {
  display: flex; gap: 14px;
  transition: transform .4s ease;
  will-change: transform;
}
.ps-basa__card {
  flex: 0 0 calc(25% - 11px);
  background: rgba(255,255,255,.07);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  transition: background .2s;
  min-width: 0;
}
.ps-basa__card:hover { background: rgba(255,255,255,.14); }
.ps-basa__card-img-wrap { overflow: hidden; }
.ps-basa__card-img {
  width: 100%;
  height: 130px;    /* FIXED – konsisten di semua breakpoint desktop */
  object-fit: cover; display: block;
  transition: transform .3s;
}
.ps-basa__card:hover .ps-basa__card-img { transform: scale(1.04); }
.ps-basa__card-body { padding: 10px 12px 12px; }
.ps-basa__card-cat {
  font-size: 9px; font-weight: 800; color: #f59e0b;
  text-transform: uppercase; letter-spacing: .7px; margin-bottom: 4px;
}
.ps-basa__card-title {
  font-size: 13px; font-weight: 600; color: #fff; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ps-basa__card-date { font-size: 10px; color: rgba(255,255,255,.45); margin-top: 5px; }
.ps-basa__nav {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px;
}
.ps-basa__btn {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #fff; width: 34px; height: 34px; border-radius: 50%;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.ps-basa__btn:hover { background: #e8232a; border-color: #e8232a; }

/* ─── MAIN LAYOUT: konten kiri + sidebar sticky kanan ──────── */
.ps-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  padding: 28px 0 48px;
  align-items: start;  /* WAJIB agar position:sticky bekerja di grid */
}
.ps-layout__content { min-width: 0; }
.ps-layout__sidebar {
  width: 300px;
  position: sticky;
  top: 70px;          /* di bawah navbar (48px) + 22px jarak */
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────
   ≤1100px  : kolom kanan hero & sidebar lebih sempit
   ≤900px   : hero single kolom, peunutoh mobile muncul
   ≤600px   : mobile, padding kecil
────────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .ps-hero { grid-template-columns: 1fr 260px; }
  .ps-layout { grid-template-columns: 1fr 250px; }
  .ps-layout__sidebar { width: 250px; }
  .ps-basa__card { flex: 0 0 calc(33.33% - 10px); }
}

@media (max-width: 900px) {
  /* Hero single kolom */
  .ps-hero { grid-template-columns: 1fr; align-items: start; }

  /* Hero kiri lebih pendek di tablet */
  .ps-hero__left { max-height: 380px; min-height: 260px; }

  /* Sembunyikan peunutoh desktop */
  .ps-hero__right { display: none; }

  /* Peunutoh mobile: separator jelas dari hero */
  .ps-peunutoh-mobile {
    display: block;
    margin-top: 16px;                  /* gap putih dari hero */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
  }

  /* Header peunutoh: label + link */
  .ps-peunutoh-mobile__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: #053d6a;
    border-top: 3px solid #f59e0b;     /* accent kuning = pemisah visual dari hero */
    margin-bottom: 0;
  }
  .ps-peunutoh-mobile__head .ps-hero__right-label {
    font-size: 13px; font-weight: 700; color: #fff;
    border-left: 3px solid #f59e0b; padding-left: 8px;
  }
  .ps-peunutoh-mobile__head .ps-hero__right-more {
    font-size: 11px; color: #f59e0b; font-weight: 600;
  }

  /* List: SAMA SEPERTI DESKTOP – gambar kiri, teks kanan */
  .ps-peunutoh-mobile__list {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
  }
  [data-theme="dark"] .ps-peunutoh-mobile__list { background: #1c2330; border-color: #30363d; }

  .ps-peunutoh-mobile__item {
    display: grid;
    grid-template-columns: 88px 1fr;   /* image kiri, text kanan */
    text-decoration: none;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    transition: background .2s;
    min-height: 72px;
  }
  [data-theme="dark"] .ps-peunutoh-mobile__item { background: #1c2330; border-color: #30363d; }
  .ps-peunutoh-mobile__item:last-child { border-bottom: none; }
  .ps-peunutoh-mobile__item:hover { background: #f4f6f8; }

  .ps-peunutoh-mobile__item img {
    width: 88px;
    height: 88px;       /* gambar fixed square */
    min-height: 88px;
    max-height: 88px;
    object-fit: cover;
    display: block;
    align-self: stretch;
  }
  .ps-peunutoh-mobile__item {
    /* TIDAK pakai max-height – biarkan teks menentukan tinggi row */
    min-height: 72px;
    align-items: stretch;
  }
  .ps-peunutoh-mobile__body {
    padding: 8px 10px;
    display: flex; flex-direction: column;
    gap: 3px; justify-content: center; min-width: 0;
  }
  .ps-peunutoh-mobile__title {
    font-size: 13px; font-weight: 600; color: #1a1a2e; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  [data-theme="dark"] .ps-peunutoh-mobile__title { color: #e6edf3; }

  /* Basa 2 kolom */
  .ps-basa__card { flex: 0 0 calc(50% - 7px); }
  .ps-basa__card-img { height: 120px; }  /* sedikit lebih pendek di tablet */

  /* Layout single kolom – sidebar hidden */
  .ps-layout { grid-template-columns: 1fr; gap: 0; padding: 20px 0 32px; }
  .ps-layout__sidebar { display: none; position: static; }
}

@media (max-width: 600px) {
  .ps-hero-wrap { padding: 10px 12px 0; }
  .ps-page-wrap { padding: 0 12px; }
  .ps-breaking-bar__inner { padding: 0 12px; }
  /* Hero lebih pendek di mobile */
  .ps-hero__left {
    max-height: 260px;
    aspect-ratio: 16 / 9;
    min-height: 200px;
  }
  .ps-basa__card { flex: 0 0 78%; }
  .ps-basa__card-img { height: 140px; }  /* card lebih lebar → gambar lebih tinggi */
  .ps-slide__title { font-size: 16px; line-height: 1.3; }
  .ps-slide__content { padding: 14px 12px; }
  .ps-slide__meta { display: none; }  /* hemat ruang di mobile kecil */
}
