/* ============================================================
   Talib e Ilm — "Noor al-Ilm" v2 homepage layer (tei-home.css)
   Reference-style Islamic homepage: photo hero, scalloped trim,
   stats band, arch cards, quote cards, CTA band.
   ============================================================ */

/* ---------- 0. Home page resets: full-canvas, no manuscript card ---------- */
body.home { overflow-x: hidden; }
body.home .entry-hero,
body.home header.entry-header.page-title { display: none !important; }
body.home article.content-bg {
  background: transparent !important;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0 !important;
}
body.home article.content-bg::before { display: none; }
body.home .content-area { margin: 0 !important; padding: 0 !important; max-width: none; }
body.home .content-container.site-container { max-width: none; padding: 0; }
body.home .entry-content-wrap { padding: 0 !important; }
body.home .site-container, body.home .content-wrap { padding-left: 0; padding-right: 0; }

/* full-bleed helper */
.tei-h-hero, .tei-h-stats, .tei-h-verse, .tei-h-cta2 {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

/* boxed sections */
.tei-h-explore, .tei-h-quran, .tei-h-hadith {
  max-width: 1160px;
  margin: 0 auto;
  padding: 56px 24px 30px;
}

/* ---------- 1. Hero ---------- */
.tei-h-hero {
  position: relative;
  background-color: #06301f;
  background-image:
    linear-gradient(180deg, rgba(6, 48, 31, 0.62) 0%, rgba(6, 48, 31, 0.35) 40%, rgba(6, 48, 31, 0.72) 100%),
    url("img/hero-mosque.jpg");
  background-size: cover;
  background-position: center 62%;
  text-align: center;
  padding: clamp(64px, 10vw, 130px) 24px clamp(96px, 13vw, 165px);
}
.tei-h-hero-inner { max-width: 860px; margin: 0 auto; }
.tei-h-bismillah {
  font-family: 'TEI Arabic', 'Amiri', serif;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  color: var(--tei-gold-soft, #e3cf8f);
  margin: 0 0 4px;
  line-height: 1.9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.tei-h-bismillah-tr {
  font-style: italic;
  color: #efe8d2;
  font-size: 0.98rem;
  margin: 0 0 26px;
  letter-spacing: 0.04em;
}
.tei-h-title {
  font-family: 'Marcellus', serif;
  font-size: clamp(2.2rem, 5.4vw, 3.9rem);
  color: #fdf9ec !important;
  margin: 0 0 14px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  position: relative;
  padding-bottom: 26px;
}
.tei-h-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 190px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='12' viewBox='0 0 190 12'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='1.4'%3E%3Cline x1='0' y1='6' x2='72' y2='6'/%3E%3Cline x1='118' y1='6' x2='190' y2='6'/%3E%3Cpath d='M95 1l5 5-5 5-5-5z' fill='%23c9a227'/%3E%3Cpath d='M82 6l4-3 0 6zM108 6l-4-3 0 6z' fill='%23e3cf8f'/%3E%3C/g%3E%3C/svg%3E") center no-repeat;
}
.tei-h-tag {
  font-family: 'Marcellus', serif;
  color: var(--tei-gold-soft, #e3cf8f);
  font-size: clamp(1rem, 2vw, 1.18rem);
  margin: 4px 0 10px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.tei-h-sub {
  color: #f2ecd9;
  font-size: clamp(0.98rem, 1.7vw, 1.12rem);
  max-width: 640px;
  margin: 0 auto 30px;
  line-height: 1.75;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* scalloped ivory trim along the hero bottom */
.tei-h-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 20px;
  background-image: radial-gradient(circle at 14px -8px, transparent 18px, var(--tei-ivory, #f7f1e3) 19px);
  background-size: 28px 20px;
  background-repeat: repeat-x;
}

/* ---------- 2. Buttons ---------- */
.tei-h-cta { margin: 0; }
a.tei-btn {
  display: inline-block;
  font-family: 'Marcellus', serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  padding: 13px 30px;
  margin: 6px 8px;
  border-radius: 4px;
  text-decoration: none !important;
  transition: all 0.22s ease;
}
a.tei-btn-gold {
  background: var(--tei-gold, #c9a227);
  color: #06301f !important;
  border: 1px solid #b3901f;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
a.tei-btn-gold:hover { background: #e3cf8f; color: #06301f !important; transform: translateY(-2px); }
a.tei-btn-ghost {
  background: rgba(6, 48, 31, 0.25);
  color: #fdf9ec !important;
  border: 1px solid rgba(247, 241, 227, 0.75);
}
a.tei-btn-ghost:hover { background: rgba(247, 241, 227, 0.16); border-color: #fff; transform: translateY(-2px); }

/* ---------- 3. Stats band ---------- */
.tei-h-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 0;
  background: var(--tei-ivory, #f7f1e3);
  padding: 34px 16px 30px;
  border-bottom: 1px solid var(--tei-gold-pale, #f0e6c8);
}
.tei-h-stat {
  flex: 1 1 200px;
  max-width: 270px;
  text-align: center;
  padding: 6px 18px;
  position: relative;
}
.tei-h-stat + .tei-h-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background: var(--tei-gold-soft, #e3cf8f);
}
.tei-h-stat-num {
  display: block;
  font-family: 'Marcellus', serif;
  font-size: 2.2rem;
  color: var(--tei-emerald, #0c5941);
  line-height: 1.2;
}
.tei-h-stat-label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f6550;
  margin-top: 2px;
}

/* ---------- 4. Featured revelation ---------- */
.tei-h-verse {
  background-color: var(--tei-emerald-deep, #06301f);
  background-image:
    linear-gradient(160deg, rgba(12, 89, 65, 0.92) 0%, rgba(8, 61, 45, 0.96) 55%, rgba(6, 48, 31, 1) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23e3cf8f' stroke-opacity='0.14' stroke-width='1'%3E%3Cpath d='M32 4l7 21 21 7-21 7-7 21-7-21-21-7 21-7z'/%3E%3Ccircle cx='32' cy='32' r='3.5'/%3E%3C/g%3E%3C/svg%3E");
  padding: 62px 24px 66px;
  text-align: center;
}
.tei-h-verse-inner { max-width: 780px; margin: 0 auto; }
.tei-h-verse-heading {
  font-family: 'Marcellus', serif;
  color: var(--tei-gold-soft, #e3cf8f) !important;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 4px;
  border: none !important;
  padding: 0 !important;
}
.tei-h-verse-sub {
  color: #cfe4d3;
  font-style: italic;
  margin: 0 0 34px;
  font-size: 0.95rem;
}
.tei-h-ayah {
  padding: 14px 0;
  border-bottom: 1px solid rgba(227, 207, 143, 0.18);
}
.tei-h-ayah:last-child { border-bottom: none; }
.tei-h-ar {
  display: block;
  font-family: 'TEI Arabic', 'Amiri', serif;
  direction: rtl;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 2.1;
  color: #fdf9ec;
}
.tei-h-en {
  display: block;
  color: #d8e6da;
  font-size: 0.97rem;
  margin-top: 2px;
}

/* ---------- 5. Section headings ---------- */
.tei-h-heading {
  text-align: center;
  font-family: 'Marcellus', serif;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  color: var(--tei-emerald-dark, #083d2d);
  border: none !important;
  padding: 0 0 24px !important;
  margin: 0 0 6px;
  position: relative;
}
.tei-h-heading::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 190px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='12' viewBox='0 0 190 12'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='1.4'%3E%3Cline x1='0' y1='6' x2='72' y2='6'/%3E%3Cline x1='118' y1='6' x2='190' y2='6'/%3E%3Cpath d='M95 1l5 5-5 5-5-5z' fill='%23c9a227'/%3E%3Cpath d='M82 6l4-3 0 6zM108 6l-4-3 0 6z' fill='%23e3cf8f'/%3E%3C/g%3E%3C/svg%3E") center no-repeat;
}
.tei-h-saw { font-size: 0.8em; }
.tei-h-lede {
  text-align: center;
  color: #6f6550;
  max-width: 620px;
  margin: 0 auto 34px;
  font-size: 1.02rem;
}

/* ---------- 6. Explore cards (arch tops) ---------- */
.tei-h-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
a.tei-h-card {
  display: block;
  background: var(--tei-paper, #fffdf7);
  border: 1px solid var(--tei-gold-soft, #e3cf8f);
  border-radius: 130px 130px 10px 10px;
  padding: 40px 26px 24px;
  text-align: center;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(42, 36, 24, 0.05);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
  position: relative;
}
a.tei-h-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 124px 124px 6px 6px;
  pointer-events: none;
}
a.tei-h-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(42, 36, 24, 0.14);
  border-color: var(--tei-gold, #c9a227);
}
.tei-h-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--tei-emerald, #0c5941), var(--tei-emerald-deep, #06301f));
  color: var(--tei-gold-soft, #e3cf8f);
  font-size: 1.7rem;
  font-family: 'TEI Arabic', 'Amiri', serif;
  margin-bottom: 14px;
  box-shadow: 0 3px 10px rgba(6, 48, 31, 0.3);
}
.tei-h-card-title {
  display: block;
  font-family: 'Marcellus', serif;
  font-size: 1.25rem;
  color: var(--tei-emerald-dark, #083d2d);
  margin-bottom: 8px;
}
.tei-h-card-text {
  display: block;
  color: #5d5442;
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 14px;
}
.tei-h-card-go {
  display: inline-block;
  font-family: 'Marcellus', serif;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  color: var(--tei-maroon, #7c2d3e);
  border-bottom: 1px solid var(--tei-gold, #c9a227);
  padding-bottom: 2px;
}

/* ---------- 7. Quote cards (built by tei-design.js from .tei-longtext) ---------- */
.tei-quotes {
  columns: 2 380px;
  column-gap: 22px;
}
/* Featured hadith trio: masonry columns leave a hole under the short right
   card — use a real grid instead, with the odd last card spanning full width */
.tei-quotes.tei-h-featured {
  columns: unset;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.tei-quotes.tei-h-featured .tei-quote {
  margin: 0;
}
.tei-quotes.tei-h-featured .tei-quote:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.tei-quote {
  break-inside: avoid;
  background: var(--tei-paper, #fffdf7);
  border: 1px solid var(--tei-gold-pale, #f0e6c8);
  border-top: 3px solid var(--tei-gold, #c9a227);
  border-radius: 8px;
  padding: 40px 24px 18px;
  margin: 0 0 22px;
  position: relative;
  box-shadow: 0 2px 6px rgba(42, 36, 24, 0.05);
  line-height: 1.8;
  font-size: 0.99rem;
  color: #4a4231;
}
.tei-quote::before {
  content: "\201D";
  position: absolute;
  top: 4px;
  left: 18px;
  font-family: Georgia, serif;
  font-size: 3.2rem;
  line-height: 1;
  color: var(--tei-gold-soft, #e3cf8f);
}
.tei-quote strong {
  display: block;
  margin-top: 10px;
  font-family: 'Marcellus', serif;
  font-size: 0.86em;
  letter-spacing: 0.06em;
  color: var(--tei-maroon, #7c2d3e);
}
.tei-quote-hidden { display: none; }
.tei-quotes-open .tei-quote-hidden { display: block; }

button.tei-more-btn {
  display: block;
  margin: 6px auto 0;
  background: transparent !important;
  color: var(--tei-emerald-dark, #083d2d) !important;
  border: 1px solid var(--tei-gold, #c9a227) !important;
  border-radius: 999px !important;
  font-family: 'Marcellus', serif !important;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  padding: 10px 34px;
  cursor: pointer;
  transition: all 0.2s;
}
button.tei-more-btn:hover {
  background: var(--tei-gold, #c9a227) !important;
  color: #06301f !important;
}

/* ---------- 8. CTA band ---------- */
.tei-h-cta2 {
  position: relative;
  margin-top: 46px;
  background-color: #06301f;
  background-image:
    linear-gradient(180deg, rgba(6, 48, 31, 0.82) 0%, rgba(6, 48, 31, 0.72) 100%),
    url("img/cta-arches.jpg");
  background-size: cover;
  background-position: center 40%;
  text-align: center;
  padding: clamp(56px, 8vw, 96px) 24px;
}
.tei-h-cta2::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 20px;
  background-image: radial-gradient(circle at 14px 28px, transparent 18px, var(--tei-ivory, #f7f1e3) 19px);
  background-size: 28px 20px;
  background-repeat: repeat-x;
}
.tei-h-cta2-title {
  font-family: 'Marcellus', serif;
  color: #fdf9ec !important;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  margin: 0 0 10px;
  border: none !important;
  padding: 0 !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
.tei-h-cta2-text {
  color: #e9e0c6;
  max-width: 560px;
  margin: 0 auto 26px;
  font-size: 1.04rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

/* ---------- 9. Responsive ---------- */
@media (max-width: 767px) {
  .tei-h-stats { padding: 22px 8px 18px; }
  .tei-h-stat { flex: 1 1 40%; }
  .tei-h-stat + .tei-h-stat::before { display: none; }
  .tei-h-stat-num { font-size: 1.7rem; }
  .tei-quotes { columns: 1; }
  .tei-quotes.tei-h-featured { grid-template-columns: 1fr; }
  .tei-quotes.tei-h-featured .tei-quote:last-child:nth-child(odd) { grid-column: auto; }
  a.tei-btn { display: block; max-width: 320px; margin: 10px auto; }
  .tei-h-explore, .tei-h-quran, .tei-h-hadith { padding: 40px 18px 20px; }
}
