/*
Theme Name: Manaratul Qur'an Portal Pro
Theme URI: https://manaratulquran.ponpes.id
Author: Pondok Pesantren Alam Tahfizh Al-Qur'an Manaratul Qur'an
Author URI: https://manaratulquran.ponpes.id
Description: Portal profesional lengkap: Maktabah buku digital, formulir PSB dengan upload dokumen, SEO, keamanan, konten dummy, backup gratis, SEO native, performa, checklist kesehatan.
Version: 5.3.1
Tested up to: 6.7
Requires at least: 6.2
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: manaratul-quran
Tags: education, islam, custom-menu, featured-images, theme-options, translation-ready
*/

: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 */
.mq-split {
  display: grid;
  gap: 1rem;
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .mq-split {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
  }
  .mq-split-5 {
    grid-template-columns: 2fr 3fr;
  }
}

/* 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; }
}
