/* ==========================================================================
   Components — hero/counter, cards, buttons, tables, content, widgets
   Illuminated-manuscript treatment: gold hairline frames, medallions,
   girih ornament. Sacred text stays static and gets the quietest frame.
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-block-size: 2.5rem;
  border-radius: var(--r-md);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease), background-image var(--dur) var(--ease),
    border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--green-600), var(--green-700) 55%, var(--green-800));
  color: var(--white);
  padding: 1.05rem 2.6rem;
  font-size: 1.2rem;
  box-shadow: var(--shadow-btn), inset 0 1px 0 var(--white-glow);
}

/* soft illumination across the top edge on hover */
.btn-primary::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 60%;
  background: radial-gradient(70% 100% at 50% 0%, var(--white-glow), transparent 75%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}

.btn-primary:hover::after { opacity: 1; }

.btn-primary:hover {
  background: linear-gradient(180deg, var(--green-700), var(--green-800) 60%, var(--green-900));
  color: var(--white);
}

.btn-ghost {
  background: var(--surface);
  color: var(--green-800);
  border: 1px solid var(--line);
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
}

.btn-ghost:hover { background: var(--gold-050); border-color: var(--gold-500); color: var(--gold-800); }

.btn-quiet {
  background: var(--green-100);
  color: var(--green-800);
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
}

.btn-quiet:hover { background: var(--gold-050); color: var(--gold-800); }

/* ---------- Home hero — the illuminated opening panel ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(75% 130% at 50% -35%, var(--gold-wash), transparent 70%),
    linear-gradient(135deg, var(--green-100), var(--surface) 75%);
  border: 1px solid var(--gold-300);
  border-radius: var(--r-xl);
  padding: clamp(1.8rem, 5vw, 3rem) clamp(1.2rem, 4vw, 2.6rem);
  margin-block-start: var(--s-5);
  text-align: center;
  box-shadow:
    inset 0 0 0 4px var(--surface),
    inset 0 0 0 5px var(--gold-300),
    var(--shadow-soft);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inline-size: 220px;
  block-size: 220px;
  background: url("../img/ornament.svg") center / contain no-repeat;
  opacity: 0.4;
  pointer-events: none;
  animation: orn-in 1s var(--ease) both;
}

.hero::before {
  inset-block-start: -70px;
  inset-inline-start: -70px;
}

.hero::after {
  inset-block-end: -70px;
  inset-inline-end: -70px;
  transform: rotate(180deg);
}

.hero > * { position: relative; }

.hero h1 {
  font-family: var(--font-quran);
  font-size: var(--fs-hero);
  line-height: 1.9;
  color: var(--green-900);
  margin-block-end: var(--s-2);
}

.hero .sub {
  color: var(--muted);
  font-size: var(--fs-lead);
  margin-block-end: var(--s-5);
  /* balance the two lines so the ﷺ never wraps alone onto the last line */
  text-wrap: balance;
}

/* the day's total, framed like a cartouche */
.counter-num {
  display: inline-block;
  font-size: clamp(2.4rem, 1.5rem + 4vw, 3.7rem);
  font-weight: 800;
  letter-spacing: var(--ls-num);
  color: var(--green-800);
  font-variant-numeric: tabular-nums;
  margin-block: var(--s-3);
  padding: 0.3rem 1.2rem;
  line-height: 1.2;
  background: linear-gradient(180deg, var(--white), var(--gold-050));
  border: 1px solid var(--gold-300);
  border-radius: var(--r-md);
  box-shadow:
    inset 0 0 0 3px var(--surface),
    inset 0 0 0 4px var(--gold-hairline),
    0 10px 24px var(--green-deep-wash);
  transition: box-shadow var(--dur) var(--ease);
}

.counter-num.is-bump { animation: count-bump 0.5s var(--ease); }

.counter-label {
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
}

/* status strip under the day's total: 1 day / 1 month / since launch */
.counter-status {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  inline-size: min(100%, 34rem);
  margin-inline: auto;
  margin-block-start: var(--s-4);
  margin-block-end: var(--s-6);
}

.counter-status .status-item {
  flex: 1 1 6rem;
  min-inline-size: 0;
  background: linear-gradient(180deg, var(--white), var(--gold-050));
  border: 1px solid var(--gold-300);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-2);
}

.counter-status .status-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: var(--ls-kicker);
}

.counter-status .status-value {
  display: block;
  margin-block-start: var(--s-1);
  font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.3rem);
  font-weight: 800;
  color: var(--green-800);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* first-visit nudge: it is the button above that adds to the counter.
   Stays until the visitor has tapped once (app.js hides it for good). */
.tap-hint {
  display: flex;
  inline-size: fit-content;
  max-inline-size: 100%;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-inline: auto;
  margin-block-start: var(--s-4);
  padding: 0.4rem 1rem;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--green-800);
  background: var(--green-100);
  border: 1px dashed var(--gold-500);
  border-radius: var(--r-full);
}

.tap-hint .tap-arrow {
  color: var(--gold-800);
  font-weight: 800;
}

.counter-meta {
  display: flex;
  justify-content: center;
  gap: var(--s-5);
  flex-wrap: wrap;
  inline-size: min(100%, 30rem);
  margin-inline: auto;
  margin-block-start: var(--s-5);
  padding-block-start: var(--s-3);
  border-block-start: 1px solid var(--line);
  font-size: var(--fs-small);
  color: var(--muted);
}

.counter-meta b { color: var(--green-800); font-variant-numeric: tabular-nums; }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  box-shadow: var(--shadow-card);
}

.card h2 { margin-block-start: 0; }

.card-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-block-end: var(--s-3);
}

.card-head h2 { margin: 0; }

/* icon set in a gilded medallion */
.card-icon {
  inline-size: 42px;
  block-size: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--white), var(--green-100));
  border: 1px solid var(--gold-300);
  box-shadow: inset 0 0 0 3px var(--white), 0 2px 6px var(--green-deep-wash);
  font-size: 1.15rem;
  flex: none;
}

/* teaser / navigation cards lift, with a gold rule drawn along the top edge.
   Cards carrying sacred text never lift. */
.grid-cards > .card:not(.formula-card) {
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.grid-cards > .card:not(.formula-card)::before {
  content: "";
  position: absolute;
  inset-inline: 1.6rem;
  inset-block-start: 0;
  block-size: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.grid-cards > .card:not(.formula-card):hover {
  transform: translateY(-3px);
  border-color: var(--gold-300);
  box-shadow: var(--shadow-lift);
}

.grid-cards > .card:not(.formula-card):hover::before { opacity: 1; }

/* Cards that are content slots (awaiting maintainer text) */
.content-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.content-card .hadith-text,
.content-card .formula-text {
  font-family: var(--font-quran);
  line-height: var(--lh-quran);
  font-size: 1.15rem;
  color: var(--green-900);
}

/* status pill — used by content slots and the seerah timeline */
.tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: var(--ls-kicker);
  color: var(--gold-800);
  background: var(--gold-050);
  border: 1px solid var(--gold-300);
  border-radius: var(--r-full);
  padding: 0.15rem 0.6rem;
}

/* Placeholder state — replaced as soon as verified content is pasted in */
[data-content="todo"] {
  border-style: dashed;
  border-color: var(--gold-300);
  background: linear-gradient(180deg, var(--gold-050), var(--surface));
}

/* Placeholder / pending-review note (works standalone too) */
.slot-note {
  font-size: var(--fs-small);
  color: var(--muted);
  border-inline-start: 3px solid var(--gold-500);
  padding-inline-start: var(--s-3);
}

/* ---------- Goal progress ---------- */
.goal {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-1);
  background: linear-gradient(180deg, var(--gold-050), var(--surface) 85%);
  border-color: var(--gold-300);
}

.goal-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--green-800);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--ls-num);
}

.bar {
  block-size: 14px;
  background: var(--line-soft);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-block: var(--s-3);
  box-shadow: inset 0 1px 2px var(--green-deep-wash);
}

.fill {
  block-size: 100%;
  inline-size: 0%;
  background: linear-gradient(90deg, var(--green-700), var(--green-600) 55%, var(--gold-500));
  border-radius: var(--r-full);
  transition: inline-size 0.7s var(--ease);
}

/* the fill grows from the inline start — mirror the gradient in RTL */
html[dir="rtl"] .fill {
  background: linear-gradient(270deg, var(--green-700), var(--green-600) 55%, var(--gold-500));
}

.goal-text {
  font-size: var(--fs-small);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Countries table ---------- */
.countries {
  width: 100%;
  border-collapse: collapse;
}

.countries th {
  text-align: start;
  font-size: 0.8rem;
  letter-spacing: var(--ls-kicker);
  color: var(--muted);
  font-weight: 700;
  padding-block-end: var(--s-2);
  border-block-end: 1px solid var(--line);
}

.countries td {
  padding-block: 0.7rem;
  border-block-end: 1px solid var(--line-soft);
}

.countries tbody tr { transition: background-color var(--dur) var(--ease); }
.countries tbody tr:hover { background: var(--gold-wash-soft); }
.countries tr:last-child td { border-block-end: 0; }

.countries .num {
  text-align: end;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--ls-num);
  color: var(--green-800);
}

/* rank sits on a struck gold coin */
.countries .rank {
  position: relative;
  z-index: 0;
  inline-size: 40px;
  text-align: center;
  color: var(--gold-800);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.countries .rank::before {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  margin-block-start: -14px;
  inset-inline: 0;
  margin-inline: auto;
  inline-size: 28px;
  block-size: 28px;
  border-radius: 50%;
  background: var(--gold-050);
  border: 1px solid var(--gold-300);
  z-index: -1;
}

.countries .flag { margin-inline-end: 0.45rem; }

/* ---------- Hadith / quote block — the quietest, most framed panel ------- */
.hadith-block {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--gold-050), var(--surface) 75%);
  border: 1px solid var(--gold-300);
  box-shadow:
    inset 0 0 0 4px var(--surface),
    inset 0 0 0 5px var(--gold-300),
    var(--shadow-soft);
}

.hadith-block::before,
.hadith-block::after {
  content: "";
  position: absolute;
  inline-size: 130px;
  block-size: 130px;
  background: url("../img/ornament.svg") center / contain no-repeat;
  opacity: 0.35;
  pointer-events: none;
}

.hadith-block::before { inset-block-start: -30px; inset-inline-start: -30px; }
.hadith-block::after { inset-block-end: -30px; inset-inline-end: -30px; transform: rotate(180deg); }

.hadith-block > * { position: relative; }

.hadith-block .hadith-text {
  text-align: center;
  font-size: clamp(1.15rem, 1rem + 1vw, 1.5rem);
  color: var(--green-900);
}

.hadith-block .source { text-align: center; }

/* keep the whole quote centred, including translations */
.hadith-block p { text-align: center; }

/* ---------- Riyad as-Saliheen: long-form chapter entries ---------- */
.riyad {
  display: grid;
  gap: var(--s-5);
  margin-block-start: var(--s-5);
}

/* Chapter plate (باب …) — green ground, gold illumination */
.kitab-head {
  display: block;
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: var(--s-5) var(--s-4);
  text-align: center;
  font-family: var(--font-quran);
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  font-weight: 700;
  line-height: 1.95;
  color: var(--on-green);
  background: linear-gradient(180deg, var(--green-800), var(--green-700));
  border: 1px solid var(--green-900);
  border-radius: var(--r-lg);
  box-shadow:
    inset 0 0 0 4px var(--green-900),
    inset 0 0 0 5px var(--gold-500),
    var(--shadow-soft);
}

.kitab-head::after {
  content: "";
  display: block;
  inline-size: min(100%, 340px);
  block-size: 26px;
  margin: var(--s-3) auto 0;
  background: url("../img/ornament.svg") center / contain no-repeat;
  opacity: 0.8;
}

.kitab-kicker {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--gold-300);
  margin-block-end: var(--s-2);
}

.kitab-ar { display: block; }

/* One entry = attribution → sacred text → source → commentary */
.riyad-entry {
  display: grid;
  gap: var(--s-3);
  border-inline-start: 3px solid var(--gold-300);
}

.riyad-entry .isnad,
.riyad-entry .ayah-lead {
  margin: 0;
  line-height: 1.95;
  color: var(--ink);
  font-size: 1rem;
}

.riyad-entry .ayah-lead {
  text-align: center;
  font-weight: 700;
  color: var(--gold-800);
}

.riyad-entry .hadith-text {
  margin: var(--s-1) 0;
  font-size: clamp(1.12rem, 1rem + 0.4vw, 1.28rem);
  color: var(--green-900);
}

/* Qur'an entry — gold-tinted opener, centred verse */
.entry-ayah {
  background: linear-gradient(180deg, var(--gold-050), var(--surface));
  border-color: var(--gold-300);
  box-shadow:
    inset 0 0 0 4px var(--surface),
    inset 0 0 0 5px var(--gold-300),
    var(--shadow-card);
}

.entry-ayah .quran-text {
  text-align: center;
  color: var(--green-900);
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
}

.entry-ayah .source { text-align: center; }

/* Commentary (شرح) box */
.riyad-entry .sharh {
  background: var(--gold-050);
  border-inline-start: 3px solid var(--gold-500);
  border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4);
  font-size: 0.97rem;
  line-height: 2;
  color: var(--ink);
}

.riyad-entry .sharh p { margin: 0; }
.riyad-entry .sharh p + p { margin-block-start: var(--s-3); }

/* Section intro line under a chapter plate */
.riyad-intro {
  margin: 0;
  text-align: center;
  color: var(--muted);
  line-height: 1.9;
  font-size: 1rem;
}

/* Entry title (e.g. "صيغة كعب بن عجرة …") */
.riyad-entry h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-800);
}

/* One-line short formulas (الصيغ المختصرة) */
.short-form {
  margin: 0;
  font-family: var(--font-quran);
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--green-900);
}

@media (max-width: 480px) {
  .kitab-head { padding: var(--s-4) var(--s-3); }
  .riyad-entry .sharh { padding: var(--s-3); }
}


.teaser-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: var(--fs-small);
}

.teaser-link .arrow { transition: transform var(--dur) var(--ease); }
html[dir="rtl"] .teaser-link:hover .arrow { transform: translateX(-4px); }
html[dir="ltr"] .teaser-link:hover .arrow { transform: translateX(4px); }

/* ---------- Formula (صيغ الصلاة) ---------- */
.formula-card { display: flex; flex-direction: column; gap: var(--s-3); }

.formula-text {
  font-family: var(--font-quran);
  font-size: clamp(1.2rem, 1.05rem + 0.8vw, 1.5rem);
  line-height: var(--lh-quran);
  color: var(--green-900);
  background: var(--paper);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--gold-500);
  border-radius: var(--r-sm);
  padding: var(--s-4) var(--s-5);
  margin: 0;
}

.formula-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.formula-note { font-size: var(--fs-small); color: var(--muted); }

/* ---------- Tasbih counter widget ---------- */
.tasbih {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--gold-300);
  border-radius: var(--r-md);
  padding: var(--s-2) var(--s-3);
  box-shadow: 0 2px 8px var(--green-deep-soft);
}

.tasbih-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green-800);
  font-variant-numeric: tabular-nums;
  min-inline-size: 2.5ch;
  text-align: center;
}

.tasbih-label {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: var(--ls-kicker);
}

/* ---------- Timeline (السيرة) ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
  gap: var(--s-5);
}

.timeline::before {
  content: "";
  position: absolute;
  inset-block: 6px;
  inset-inline-start: 11px;
  inline-size: 2px;
  background: linear-gradient(180deg, var(--gold-500), var(--green-700));
  opacity: 0.5;
}

.timeline li {
  position: relative;
  padding-inline-start: var(--s-6);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-1);
}

/* girih star node on a white disc */
.timeline li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  inset-block-start: 8px;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  background: url("../img/star.svg") center / 11px 11px no-repeat, var(--white);
  border: 2px solid var(--gold-300);
  box-shadow: 0 1px 3px var(--green-deep-wash);
}

.timeline .era {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--gold-800);
  letter-spacing: var(--ls-kicker);
}

.timeline h3 { margin-block: 0.15rem 0.35rem; }

.timeline .tl-body {
  width: 100%;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
}

.timeline .tl-body:not([data-content="todo"]) {
  background: var(--surface);
  border: 1px solid var(--line);
}

.timeline p { color: var(--muted); margin: 0; }

/* jump index sitting above the stations */
.tl-index {
  display: grid;
  gap: var(--s-2);
  padding-block-end: var(--s-4);
  margin-block-end: var(--s-5);
  border-block-end: 1px solid var(--line);
}

.tl-index ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.tl-index-title {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--gold-800);
  letter-spacing: var(--ls-kicker);
}

.tl-index a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.32rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.tl-index a::after {
  content: "↓";
  color: var(--gold-600);
  font-weight: 700;
}

.tl-index a:hover {
  color: var(--green-700);
  border-color: var(--gold-500);
  background: var(--surface);
}

/* published station: real copy, sources, sacred-text styling */
.timeline li { scroll-margin-block-start: 6rem; }

.timeline .tl-body p { color: var(--ink); margin-block-end: var(--s-3); }
.timeline .tl-body p:last-child { margin-block-end: 0; }

.timeline .tl-sub {
  color: var(--gold-800);
  font-weight: 700;
  margin-block-end: var(--s-2);
}

.timeline .tl-body p.quran-text,
.timeline .tl-body .hadith-text {
  font-family: var(--font-quran);
  line-height: var(--lh-quran);
  color: var(--green-900);
}

.timeline .tl-body p.quran-text {
  font-size: 1.15rem;
  text-align: center;
  margin-block: var(--s-2) var(--s-3);
}

.timeline .source { margin-block-start: var(--s-3); }
.timeline .source + .source { margin-block-start: var(--s-1); }

.timeline .source a {
  color: var(--green-700);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.timeline .source a:hover { color: var(--gold-700); }

.timeline li:target .tl-body {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px var(--gold-wash);
}

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--green-900), var(--green-800) 55%, var(--green-700));
  color: var(--on-green);
  border: 1px solid var(--green-900);
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, 3vw, 1.7rem) clamp(1.2rem, 3vw, 2rem);
  margin-block-start: var(--s-6);
  box-shadow: inset 0 0 0 1px var(--gold-hairline), var(--shadow-lift);
}

.cta-band::before {
  content: "";
  position: absolute;
  inset-block-start: -50px;
  inset-inline-end: -50px;
  inline-size: 190px;
  block-size: 190px;
  background: url("../img/ornament.svg") center / contain no-repeat;
  opacity: 0.3;
  pointer-events: none;
}

.cta-band > * { position: relative; }

.cta-band h2 { color: var(--white); margin: 0 0 0.25rem; font-size: 1.2rem; }
.cta-band p { margin: 0; color: var(--on-green-dim); font-size: var(--fs-small); }

.cta-band .btn {
  background: var(--gold-500);
  color: var(--green-900);
  padding: 0.85rem 1.7rem;
  box-shadow: 0 8px 18px var(--green-deep-wash);
}

.cta-band .btn:hover { background: var(--gold-300); color: var(--green-900); }

/* ---------- Contact form (تواصل معنا) ---------- */
.contact-form {
  position: relative;
  display: grid;
  gap: var(--s-4);
}

.contact-form .fields {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}

.contact-form .field { display: grid; gap: var(--s-2); }

.contact-form label {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--green-900);
}

.contact-form .hint { font-weight: 400; color: var(--muted); }

.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.7rem 0.9rem;
  inline-size: 100%;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.contact-form textarea { min-block-size: 9rem; resize: vertical; }

.contact-form input:hover,
.contact-form textarea:hover { border-color: var(--gold-300); }

/* the global :focus-visible gold ring stays; this only warms the field up */
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px var(--gold-wash);
}

.contact-form input[dir="ltr"] { text-align: start; }

/* honeypot — off-screen, never announced, only a bot fills it in */
.contact-form .hp {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}

.form-note { margin: 0; font-size: var(--fs-small); max-inline-size: 34rem; }

.contact-form [data-contact-submit]:disabled { opacity: 0.75; cursor: default; }

/* name + email sit side by side once there is room for them */
@media (min-width: 700px) {
  .contact-form .fields { grid-template-columns: 1fr 1fr; }
  .contact-form .field-wide { grid-column: 1 / -1; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  inset-block-end: 22px;
  inset-inline: 0;
  inline-size: fit-content;
  margin-inline: auto;
  transform: translateY(8px);
  background: var(--green-900);
  color: var(--white);
  padding: 0.7rem 1.15rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--gold-hairline);
  box-shadow: var(--shadow-lift), inset 0 1px 0 var(--on-green-line);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 90;
  font-size: 0.95rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 760px) {
  .btn-primary { inline-size: 100%; }
  .section-head { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
  /* column direction: the closing rule runs on the cross axis instead */
  .section-head::after { flex-basis: auto; inline-size: 100%; }
  .cta-band { flex-direction: column; text-align: center; }
  .cta-band .btn { inline-size: 100%; }
}
