/*
Theme Name: Manaratul Quran Layout Fix
Theme URI: https://manaratulquran.ponpes.id
Description: Child theme perbaikan layout Portal Pro — compact, ornamen Maghribi, grid sambutan sejajar. Aktifkan setelah tema induk manaratul-quran (Portal Pro) terpasang.
Author: Manaratul Quran
Template: manaratul-quran
Version: 5.5.1
Requires at least: 6.2
Requires PHP: 8.0
Text Domain: manaratul-quran-layout-fix
*/

:root {
  --mq-primary: #064e3b;
  --mq-primary-dark: #022c22;
  --mq-accent: #c59b27;
  --mq-bg: #fbf9f5;
  --mq-text: #1c1917;
}

body {
  margin: 0;
  padding: 0;
  background: var(--mq-bg);
  color: var(--mq-text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-serif-display { font-family: 'Playfair Display', Georgia, serif; }
.font-arabic { font-family: 'Amiri', serif; }

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mq-float-wa {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.mq-float-wa:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.55);
}

.mq-faq details {
  border: 1px solid #e7e5e4;
  border-radius: 0.65rem;
  background: #fff;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.mq-faq summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.mq-faq summary::-webkit-details-marker { display: none; }
.mq-faq summary::after { content: '+'; font-size: 1.15rem; color: #064e3b; }
.mq-faq details[open] summary::after { content: '−'; }
.mq-faq .mq-faq-body {
  padding: 0 1rem 0.9rem;
  font-size: 0.8125rem;
  color: #57534e;
  line-height: 1.6;
}

.mq-form-card {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.04);
}
.mq-form-card label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #44403c;
  margin-bottom: 0.35rem;
}
.mq-form-card input[type="text"],
.mq-form-card input[type="email"],
.mq-form-card input[type="tel"],
.mq-form-card input[type="date"],
.mq-form-card input[type="number"],
.mq-form-card select,
.mq-form-card textarea {
  width: 100%;
  border: 1px solid #d6d3d1;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  background: #fafaf9;
}
.mq-form-card input:focus,
.mq-form-card select:focus,
.mq-form-card textarea:focus {
  outline: 2px solid #064e3b55;
  border-color: #064e3b;
}
.mq-form-card .mq-file {
  font-size: 0.8rem;
  padding: 0.5rem 0;
}
.mq-alert-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.mq-alert-err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.mq-book-card {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 1rem;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.mq-book-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.mq-footer-ornament {
  background: linear-gradient(90deg, transparent, #c59b27, transparent);
  height: 2px;
  opacity: 0.5;
  margin: 0 auto 2rem;
  max-width: 12rem;
}

/* ---- Lebar konten lebih proporsional ---- */
.mq-shell {
  max-width: 68rem; /* ~1088px, lebih sempit dari 7xl */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
@media (min-width: 640px) {
  .mq-shell { padding-left: 1.75rem; padding-right: 1.75rem; }
}
@media (min-width: 1024px) {
  .mq-shell { padding-left: 2.5rem; padding-right: 2.5rem; }
}

/* ---- Ornamen Maghribi tipis (tidak ramai) ---- */
.mq-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0 auto 0.85rem;
  max-width: 14rem;
  color: #c59b27;
  opacity: 0.7;
}
.mq-ornament::before,
.mq-ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}
.mq-ornament-star {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  background: currentColor;
  opacity: 0.85;
  transform: rotate(45deg);
  clip-path: polygon(50% 0%, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0% 50%, 35% 35%);
}

/* Garis pola geometris Maghribi di tepi section */
.mq-maghribi-edge {
  position: relative;
}
.mq-maghribi-edge::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: min(280px, 50%);
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='12' viewBox='0 0 56 12' fill='none'%3E%3Cpath d='M0 6h8l4-4 4 4 4-4 4 4 4-4 4 4 4-4 4 4h8' stroke='%23c59b27' stroke-width='0.75' opacity='0.55'/%3E%3Cpath d='M28 1v10M24 6h8' stroke='%23c59b27' stroke-width='0.6' opacity='0.4'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 56px 12px;
  pointer-events: none;
}

.mq-maghribi-edge-bottom::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(280px, 50%);
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='12' viewBox='0 0 56 12' fill='none'%3E%3Cpath d='M0 6h8l4-4 4 4 4-4 4 4 4-4 4 4 4-4 4 4h8' stroke='%23064e3b' stroke-width='0.75' opacity='0.35'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 56px 12px;
  pointer-events: none;
}

/* Frame tipis sudut geometris untuk kartu */
.mq-card-frame {
  position: relative;
}
.mq-card-frame::before,
.mq-card-frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #c59b27;
  opacity: 0.45;
  pointer-events: none;
}
.mq-card-frame::before {
  top: 6px;
  left: 6px;
  border-top: 1px solid;
  border-left: 1px solid;
}
.mq-card-frame::after {
  bottom: 6px;
  right: 6px;
  border-bottom: 1px solid;
  border-right: 1px solid;
}

/* Section spacing — lebih padat */
.mq-section {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}
@media (min-width: 640px) {
  .mq-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}
@media (min-width: 1024px) {
  .mq-section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
}

/* ========== MOBILE-FIRST: proporsional, autofit, auto-grid ========== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Shell: lebih rapat di HP */
.mq-shell {
  max-width: 68rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 640px) {
  .mq-shell { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .mq-shell { padding-left: 2rem; padding-right: 2rem; }
}

/* Auto grid utility */
.mq-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr;
}
@media (min-width: 480px) {
  .mq-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .mq-grid { gap: 0.95rem; }
  .mq-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mq-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .mq-grid { gap: 1.1rem; }
}

/* Stats: 2 kolom di HP, 4 di desktop — angka lebih kecil di HP */
.mq-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
@media (min-width: 768px) {
  .mq-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
  }
}
.mq-stat-card {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #f5f5f4;
  box-shadow: 0 3px 12px rgba(0,0,0,.05);
  padding: 0.55rem 0.45rem;
  text-align: center;
}
@media (min-width: 640px) {
  .mq-stat-card { padding: 0.85rem 0.65rem; border-radius: 0.85rem; }
}
.mq-stat-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: #064e3b;
  font-size: clamp(1.1rem, 4vw, 1.75rem);
  line-height: 1.2;
}
.mq-stat-label {
  font-size: clamp(0.6rem, 2.2vw, 0.75rem);
  color: #78716c;
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* Section spacing lebih ringkas */
.mq-section-y {
  padding-top: clamp(1.75rem, 4vw, 3.5rem);
  padding-bottom: clamp(1.75rem, 4vw, 3.5rem);
}

/* Tipografi skalabel */
.mq-h1 {
  font-size: clamp(1.45rem, 5.5vw, 3.1rem);
  line-height: 1.18;
}
.mq-h2 {
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.25;
}
.mq-h3 {
  font-size: clamp(0.95rem, 2.8vw, 1.125rem);
  line-height: 1.35;
}
.mq-lead {
  font-size: clamp(0.8125rem, 2.4vw, 1.0625rem);
  line-height: 1.55;
}
.mq-small {
  font-size: clamp(0.65rem, 2vw, 0.75rem);
}

/* Kartu program/fasilitas: auto-fit, lebih padat */
.mq-auto-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 0.65rem;
}
@media (min-width: 640px) {
  .mq-auto-cards {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 0.85rem;
  }
}
@media (min-width: 1024px) {
  .mq-auto-cards {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1rem;
  }
}

/* Stack → side-by-side — FIXED layout */
.mq-split {
  display: grid !important;
  gap: 1.25rem;
  align-items: center;
  grid-template-columns: 1fr;
  width: 100%;
}
.mq-split > * {
  min-width: 0; /* prevent grid blowout */
}
@media (min-width: 768px) {
  .mq-split {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
  }
  .mq-split-5 {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) !important;
    gap: 2rem;
    align-items: start;
  }
  /* Sambutan: foto kiri, teks kanan — jangan andalkan Tailwind col-span */
  .mq-split-5 > :first-child {
    grid-column: 1;
  }
  .mq-split-5 > :last-child {
    grid-column: 2;
  }
}
@media (min-width: 1024px) {
  .mq-split-5 {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) !important;
    gap: 2.5rem;
    align-items: center;
  }
}

/* Form PSB: 1 kolom HP, 2 kolom tablet+ */
.mq-form-card .mq-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
@media (min-width: 640px) {
  .mq-form-card .mq-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
  .mq-form-card .mq-form-grid .mq-span-2 {
    grid-column: span 2;
  }
}

/* Tombol full-width di HP */
.mq-btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
@media (min-width: 480px) {
  .mq-btn-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}
.mq-btn-row > a {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}
@media (min-width: 480px) {
  .mq-btn-row > a {
    width: auto;
    min-width: 10rem;
  }
}

/* Float WA: tidak menutupi konten, safe area */
.mq-float-wa {
  bottom: max(1rem, env(safe-area-inset-bottom));
  right: max(1rem, env(safe-area-inset-right));
  width: 3rem;
  height: 3rem;
}
@media (min-width: 640px) {
  .mq-float-wa {
    width: 3.5rem;
    height: 3.5rem;
  }
}

/* Header: cegah overflow */
header .mq-shell {
  min-width: 0;
}
header nav {
  min-width: 0;
}

/* Hero: tinggi proporsional, lebih padat */
.mq-hero {
  min-height: min(58vh, 360px);
}
@media (min-width: 768px) {
  .mq-hero {
    min-height: min(55vh, 460px);
  }
}
@media (min-width: 1024px) {
  .mq-hero {
    min-height: 500px;
  }
}

/* Ornamen lebih kecil di HP */
@media (max-width: 639px) {
  .mq-ornament {
    max-width: 9rem;
    margin-bottom: 0.65rem;
    gap: 0.5rem;
  }
  .mq-ornament-star {
    width: 8px;
    height: 8px;
  }
  .mq-maghribi-edge::before,
  .mq-maghribi-edge-bottom::after {
    width: min(160px, 60%);
    height: 8px;
    background-size: 40px 8px;
  }
}

/* Buku maktabah */
.mq-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .mq-book-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}
@media (min-width: 1024px) {
  .mq-book-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
  }
}

/* Prevent long words breaking layout */
.mq-shell, .mq-form-card, article {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* Override sisa spacing Tailwind agar tetap padat di semua ukuran */
@media (max-width: 639px) {
  .py-10 { padding-top: 1.75rem !important; padding-bottom: 1.75rem !important; }
  .py-12 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
  .py-14 { padding-top: 2.15rem !important; padding-bottom: 2.15rem !important; }
  .py-16 { padding-top: 2.15rem !important; padding-bottom: 2.15rem !important; }
  .py-20 { padding-top: 2.25rem !important; padding-bottom: 2.25rem !important; }
  .lg\:py-14, .lg\:py-16, .lg\:py-20, .lg\:py-22, .lg\:py-24 {
    padding-top: 2.15rem !important;
    padding-bottom: 2.15rem !important;
  }
  .gap-10, .gap-12, .gap-14 { gap: 1rem !important; }
  .mb-6, .mb-8, .mb-10, .mb-12 { margin-bottom: 1.15rem !important; }
  .mt-6, .mt-8, .mt-10 { margin-top: 1rem !important; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .lg\:py-14 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
}


/* ============================================================
   LAYOUT FIXES v5.3.2 — sambutan, header, overflow, cards
   ============================================================ */

/* Sambutan: foto proporsional, teks tidak terpotong */
#sambutan .mq-split-5 > :first-child {
  display: flex;
  justify-content: center;
}
@media (min-width: 768px) {
  #sambutan .mq-split-5 > :first-child {
    justify-content: flex-start;
  }
}
#sambutan .mq-split-5 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
#sambutan .aspect-\[3\/4\],
#sambutan [class*="aspect-"] {
  max-width: 18rem;
  width: 100%;
}
@media (min-width: 768px) {
  #sambutan [class*="aspect-"] {
    max-width: 100%;
  }
}

/* Cegah teks di atas gambar terpotong (nama pengasuh di kartu foto) */
#sambutan [class*="rounded"] {
  overflow: hidden;
}

/* Profil lembaga split */
#profil .mq-split,
section.mq-maghribi-edge .mq-split:not(.mq-split-5) {
  align-items: center;
}

/* Header nav: cegah menu bertabrakan / overflow */
header {
  position: sticky;
  top: 0;
  z-index: 40;
}
header .mq-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}
header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}
header nav a {
  white-space: nowrap;
  font-size: 0.8125rem;
}
@media (max-width: 1023px) {
  header nav .hidden-mobile-nav {
    display: none !important;
  }
}

/* Stats cards: jaga tinggi seragam */
.mq-stats-grid {
  align-items: stretch;
}
.mq-stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 4.5rem;
}

/* Kartu program / fasilitas: tinggi lebih merata */
.mq-auto-cards > * {
  min-width: 0;
  height: 100%;
}

/* Hero content: jangan terlalu sempit di tablet */
.mq-hero .mq-shell {
  max-width: 68rem;
}

/* Footer grid: jangan pecah di tablet */
footer .grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  footer .grid.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  footer .grid.md\:grid-cols-4,
  footer .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Perbaiki overflow horizontal global */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Image in content */
.entry-content img,
article img {
  height: auto;
  max-width: 100%;
  border-radius: 0.75rem;
}

/* Mobile menu button area */
@media (max-width: 767px) {
  header .mq-shell {
    flex-wrap: nowrap;
  }
}

/* Sambutan teks: spacing rapi */
#sambutan .mq-split-5 > :last-child {
  padding-top: 0.25rem;
}
#sambutan .mq-h2 {
  margin-top: 0.35rem;
}


/* === COMPACT + ORNAMEN v5.4 === */

/* Section lebih compact */
.mq-section,
.mq-section-y {
  padding-top: clamp(1.5rem, 3.5vw, 2.75rem) !important;
  padding-bottom: clamp(1.5rem, 3.5vw, 2.75rem) !important;
}

/* Hero sedikit lebih pendek di mobile */
@media (max-width: 767px) {
  .mq-hero { min-height: auto; }
  .mq-hero .mq-shell { padding-top: 2.5rem; padding-bottom: 2.5rem; }
}

/* Ornamen Maghribi tipis di section soft */
.mq-maghribi-edge {
  position: relative;
}
.mq-maghribi-edge::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: min(260px, 55%);
  height: 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='12' viewBox='0 0 56 12' fill='none'%3E%3Cpath d='M0 6h8l4-4 4 4 4-4 4 4 4-4 4 4 4-4 4 4h8' stroke='%23c59b27' stroke-width='0.75' opacity='0.5'/%3E%3Cpath d='M28 1v10M24 6h8' stroke='%23c59b27' stroke-width='0.55' opacity='0.35'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 56px 11px;
  pointer-events: none;
  z-index: 1;
}

/* Divider tipis emas di bawah heading section */
.mq-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0 auto 0.65rem;
  max-width: 11rem;
  color: #c59b27;
  opacity: 0.65;
}
.mq-ornament::before,
.mq-ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}
.mq-ornament-star {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background: currentColor;
  opacity: 0.85;
  transform: rotate(45deg);
  clip-path: polygon(50% 0%, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0% 50%, 35% 35%);
}

/* Kartu lebih compact */
.mq-auto-cards {
  gap: 0.65rem !important;
}
.mq-stat-card {
  min-height: 3.75rem !important;
  padding: 0.5rem 0.4rem !important;
}
@media (min-width: 640px) {
  .mq-stat-card { padding: 0.7rem 0.55rem !important; }
}

/* FAQ lebih rapat */
.mq-faq details { margin-bottom: 0.4rem; }
.mq-faq summary { padding: 0.65rem 0.85rem; font-size: 0.8125rem; }

/* Footer ornamen */
.mq-footer-ornament {
  background: linear-gradient(90deg, transparent, #c59b27, transparent);
  height: 2px;
  opacity: 0.45;
  margin: 0 auto 1.25rem;
  max-width: 10rem;
}

/* Pastikan split sambutan rapi */
#sambutan .mq-split,
#sambutan .mq-split-5 {
  align-items: start;
}
@media (min-width: 768px) {
  #sambutan .mq-split-5 {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) !important;
    gap: 1.75rem !important;
  }
}

/* Cegah overflow teks di kartu foto sambutan */
#sambutan [class*="rounded"] {
  overflow: hidden;
}

/* Floating WA sedikit lebih kecil di HP */
@media (max-width: 639px) {
  .mq-float-wa {
    width: 3rem;
    height: 3rem;
    bottom: 1.1rem;
    right: 1.1rem;
  }
}

/* Tipografi sedikit lebih compact */
.mq-h1 { font-size: clamp(1.35rem, 5vw, 2.75rem) !important; }
.mq-h2 { font-size: clamp(1.15rem, 3.5vw, 1.75rem) !important; }
.mq-lead { font-size: clamp(0.8rem, 2.2vw, 1rem) !important; }
/* ========== User tweaks: menu gap, hero buttons left, rekening center ========== */

/* 1. Jarak menu navigasi lebih lega */
header nav,
header nav.hidden.lg\:flex,
header nav ul,
header nav ul#menu-menu,
header .mq-shell nav {
  gap: 0.35rem 0.85rem !important;
}
header nav a,
header nav ul li a {
  padding: 0.35rem 0.55rem !important;
  letter-spacing: 0.01em;
}
@media (min-width: 1024px) {
  header nav ul,
  header nav ul#menu-menu {
    gap: 0.15rem 0.65rem !important;
  }
  header nav a,
  header nav ul li a {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.8125rem;
  }
}

/* 2. Tombol Hero "Pendaftaran Santri Baru" & "Mengenal Pesantren" rata kiri */
.mq-hero .mq-btn-row,
section.mq-hero .mq-btn-row,
.mq-btn-row {
  justify-content: flex-start !important;
  align-items: flex-start !important;
}
.mq-hero .mq-btn-row > a,
section.mq-hero .mq-btn-row > a {
  text-align: left !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
/* Khusus di hero: baris tombol tidak full center */
@media (min-width: 480px) {
  .mq-hero .mq-btn-row {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: flex-start !important;
  }
  .mq-hero .mq-btn-row > a {
    width: auto !important;
  }
}
@media (max-width: 479px) {
  .mq-hero .mq-btn-row > a {
    width: 100%;
    text-align: center !important; /* HP tetap nyaman full width */
  }
}

/* 3. Kotak Rekening Donasi rata tengah */
#donasi .max-w-3xl > .bg-white,
#donasi .bg-white.rounded-2xl,
#donasi [class*="rounded-2xl"].bg-white {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
#donasi .bg-white p,
#donasi .bg-white .text-lg,
#donasi .bg-white .text-xl {
  text-align: center !important;
}

/* PSB section tombol — biarkan center (bukan hero) */
#psb .mq-btn-row,
section#psb .mq-btn-row {
  justify-content: center !important;
}


/* ========== v5.5 Complete polish ========== */

/* CTA strip setelah section */
.mq-cta-strip {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.mq-cta-strip a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.mq-cta-primary {
  background: #c59b27;
  color: #1c1917 !important;
  box-shadow: 0 6px 16px rgba(197, 155, 39, 0.3);
}
.mq-cta-primary:hover {
  background: #d4ad3a;
  transform: translateY(-1px);
}
.mq-cta-secondary {
  background: transparent;
  color: #064e3b !important;
  border: 1.5px solid rgba(6, 78, 59, 0.35);
}
.mq-cta-secondary:hover {
  background: rgba(6, 78, 59, 0.06);
}

/* Legal box */
.mq-legal-box {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 0.85rem;
  border: 1px solid #e7e5e4;
  background: #fff;
  font-size: 0.8125rem;
  color: #57534e;
  line-height: 1.55;
  text-align: center;
}
.mq-legal-box strong {
  display: block;
  color: #064e3b;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

/* Header WA chip (if injected via widget/HTML) */
.mq-header-wa {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46 !important;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none !important;
  border: 1px solid #a7f3d0;
}
.mq-header-wa:hover {
  background: #d1fae5;
}
@media (max-width: 1023px) {
  .mq-header-wa { display: none; }
}

/* Map fix container */
#donasi iframe,
.mq-map iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 260px;
  border: 0 !important;
}

/* Berita card excerpt clamp */
#berita article p,
#berita .line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
