/* The two public front doors, / and /for-providers/, in one layout language.
   Brand tokens come from app.css.

   Surfaces are white and one neutral grey, alternating as full-bleed bands;
   green is for accents only (buttons, icons, small labels, the chosen state),
   plus the open-requests join card. The one dark surface is a bento's lead tile,
   in neutral ink. Shape: surfaces 20px, chips a full pill, and buttons are the
   design system's own .btn, untouched. Type is the site's own (Tajawal, Inter). Reviewed with the owner, 2026-10-17/18. */

.tx {
  --tx-ink: var(--ink-900);
  --tx-muted: var(--ink-600);
  --tx-line: var(--color-border-strong);
  --tx-grey: #f2f4f6;
  --tx-accent: var(--green-500);
  --tx-accent-deep: var(--green-800);
  --tx-r: 20px;
  --tx-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --tx-shadow: var(--shadow-pop);
  --tx-gutter: max(clamp(16px, 4vw, 48px), calc((100% - 1280px) / 2));
  color: var(--tx-ink);
  background: #fff;
}
.tx > section { padding-inline: var(--tx-gutter); }
/* full-bleed bands: the marketing .shell caps pages at 1240px, so on these two pages it
   steps aside (the same :has() move the product makes for the settings and admin shells) */
.shell:has(> .content > .tx) { width: 100%; margin: 0; }
.content:has(> .tx) { margin-top: 0; }

:where(.tx) :where(h1, h2, h3) { margin: 0; }
:where(.tx) p { margin: 0; }

/* card boundary on any surface: one border + the soft shadow, both tokens */
.tx-card { background: #fff; border: 1px solid var(--tx-line); box-shadow: var(--shadow-soft); border-radius: var(--tx-r); }

/* ---------- type ---------- */
.tx-eyebrow { color: var(--tx-accent-deep); font-weight: 600; font-size: 0.95rem; margin-bottom: 18px; }
.tx-h1 { font-size: clamp(1.9rem, 1rem + 2vw, 2.6rem); line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
html[dir="ltr"] .tx-h1 { letter-spacing: -0.025em; line-height: 1.12; font-size: clamp(1.8rem, 1rem + 1.7vw, 2.3rem); }
.tx-lead { font-size: 1.08rem; line-height: 1.8; color: var(--tx-muted); max-width: 72ch; margin-top: 20px; }
.tx-h2 { font-size: clamp(1.6rem, 1.1rem + 1.4vw, 2.3rem); line-height: 1.25; font-weight: 700; text-wrap: balance; }
.tx-h3 { font-size: 1.2rem; line-height: 1.4; font-weight: 700; }
.tx-sub { color: var(--tx-muted); font-size: 1.05rem; line-height: 1.75; max-width: 80ch; margin-top: 12px; }
.tx-body { color: var(--tx-muted); line-height: 1.75; margin-top: 10px; }
.tx-kicker { color: var(--tx-accent-deep); font-weight: 600; margin-bottom: 8px; }

/* ---------- buttons: the design system's own .btn, untouched ---------- */
.tx-btn { white-space: nowrap; }
.tx-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- band rhythm: white, then grey, alternating ---------- */
.tx-sec { padding-block: clamp(64px, 8vw, 104px); }
/* Both public pages alternate from How It Works on, white first (owner), and count sections so a page
   missing its services or open requests still alternates. Hero and cards stay unpainted: the cards ride up over the photo. */
.tx-home > section:nth-of-type(n+3) { background: #fff; }
.tx-home > section:nth-of-type(2n+4) { background: var(--tx-grey); }
.shell:has(> .content > .tx-home) ~ .footer { margin-top: 0; }  /* its gap would be one more pale band */

/* ---------- hero: the owner's photo, never cropped ---------- */
.tx > .tx-hero { padding: 0; position: relative; }
.tx-hero-media img { display: block; width: 100%; height: auto; }
.tx-hero-copy { padding: clamp(24px, 4vw, 40px) var(--tx-gutter) 0; }
.tx-hero-copy .tx-note { margin-top: 18px; font-size: 0.95rem; }

.tx-perks ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tx-perks li { display: flex; align-items: center; gap: 12px; padding: 20px; font-weight: 700; }
.tx-perks i { color: var(--tx-accent); font-size: 1.4rem; }
.tx > .tx-perks { padding-block: 32px; }

/* From 1200px the wide photo is tall enough to carry the copy on its sky. The sky is on the
   reading side in Arabic; in English the photo turns round so that it is there too. */
@media (min-width: 1200px) {
  .tx-hero-copy { position: absolute; inset-block: 0; inset-inline-start: var(--tx-gutter); width: min(600px, 44%); padding: 0 0 52px; display: flex; flex-direction: column; justify-content: center; }
  .tx-hero-copy .tx-lead, .tx-hero-copy .tx-note { color: var(--ink-700); }
  .tx-hero-copy .tx-ctas { margin-top: 24px; }
  .tx-hero-copy .tx-note { margin-top: 12px; }
  html[dir="ltr"] .tx-hero-media img { transform: scaleX(-1); }
  .tx > .tx-perks { position: relative; margin-top: -44px; padding-block-start: 0; }
}

/* ---------- band under the hero (still the hero's white) ---------- */
.tx > .tx-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px;
  padding-block: 28px 40px;
  background: linear-gradient(var(--tx-line), var(--tx-line)) no-repeat top / calc(100% - 2 * var(--tx-gutter)) 1px;
}
.tx-stats { display: flex; flex-wrap: wrap; gap: 16px clamp(24px, 5vw, 64px); margin: 0; }
.tx-stat dt { font-size: 2rem; font-weight: 700; color: var(--tx-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tx-stat dd { margin: 4px 0 0; color: var(--tx-muted); }
.tx-note { color: var(--tx-muted); }
.tx-note i { color: var(--tx-accent); }

.tx-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
html[dir="ltr"] .tx-dir { display: inline-block; transform: scaleX(-1); }

/* how it works: one connected track */
.tx-track { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); position: relative; }
.tx-track::before { content: ""; position: absolute; top: 22px; inset-inline: 22px 22px; height: 2px; background: var(--ink-300); }
.tx-track li { position: relative; padding-inline-end: 32px; }
.tx-track-n { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 999px; background: #fff; border: 2px solid var(--tx-accent); color: var(--tx-accent-deep); font-weight: 700; font-size: 1.1rem; position: relative; }
.tx-track h3 { font-size: 1.15rem; font-weight: 700; margin-top: 22px; }
.tx-track p { color: var(--tx-muted); line-height: 1.75; margin-top: 8px; }

/* paths: two tall tiles with a real product screen each */
.tx-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.tx-path { display: flex; flex-direction: column; padding: 32px; }
.tx-path-copy { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.tx-path .tx-btn { margin-top: auto; }
.tx-ticks { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 10px; }
.tx-ticks li { display: flex; gap: 10px; line-height: 1.6; }
.tx-ticks i { color: var(--tx-accent); flex: none; margin-top: 2px; }

.tx-prov { scroll-snap-align: start; padding: 22px; display: flex; flex-direction: column; gap: 14px; transition: transform 0.3s var(--tx-ease), box-shadow 0.3s var(--tx-ease); }
.tx-prov:hover { transform: translateY(-3px); box-shadow: var(--tx-shadow); }
.tx-prov-name { font-size: 1.05rem; font-weight: 700; }
.tx-empty { margin-top: 32px; padding: 28px; }

/* services: chip cloud */
.tx-chips { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tx-chip { display: inline-block; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--tx-line); background: #fff; color: var(--tx-ink); text-decoration: none; font-weight: 600; transition: border-color 0.2s, color 0.2s, transform 0.2s var(--tx-ease); }
.tx-chip:hover { border-color: var(--tx-accent); color: var(--tx-accent-deep); transform: translateY(-2px); }

/* bento: one lead tile (neutral ink, the page's one dark surface) + three white */
/* two by two: a lead tile spanning two rows was more than half empty (review) */
.tx-bento { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 40px; }
.tx-cell { padding: 28px; }
.tx-cell-lead { background: var(--ink-900); color: #fff; border-color: var(--ink-900); display: flex; flex-direction: column; justify-content: center; }
.tx-cell-lead .tx-body { color: var(--ink-300); }
.tx-cell-lead .tx-cell-ic { color: var(--green-300); font-size: 2.6rem; }
.tx-cell-ic { display: block; font-size: 1.6rem; color: var(--tx-accent); margin-bottom: 18px; }

/* faq: pinned heading + questions */
.tx-faq { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 48px; align-items: start; }
.tx-faq-h { position: sticky; top: 96px; }
.tx-faq-list { border-top: 1px solid var(--tx-line); }
.tx-q { border-bottom: 1px solid var(--tx-line); }
.tx-q summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; }
.tx-q summary::-webkit-details-marker { display: none; }
.tx-q summary i { color: var(--tx-accent); transition: transform 0.3s var(--tx-ease); flex: none; }
.tx-q[open] summary i { transform: rotate(45deg); }
.tx-q p { color: var(--tx-muted); line-height: 1.8; padding: 0 0 22px; max-width: 65ch; }

/* closing band: the two doors side by side */
.tx-final { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); padding-block: clamp(48px, 6vw, 80px); }
.tx-final-i { padding-block: 8px; padding-inline-end: clamp(24px, 4vw, 56px); }
.tx-final-i + .tx-final-i { border-inline-start: 1px solid var(--tx-line); padding-inline-start: clamp(24px, 4vw, 56px); }
.tx-final .tx-btn { margin-top: 24px; }

/* ---------- /for-providers/ ---------- */
.tx-or-stats { margin-top: 28px; }
.tx-or-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--tx-muted); font-size: 0.9rem; }
.tx-or-meta i { color: var(--tx-accent); }
/* the shipped page's look for the join card (owner): the brand tint fading to white, solid brand border */
.tx-or-more { background: linear-gradient(180deg, var(--green-50), #fff); border-color: var(--green-200); }
.tx-cell-big { font-size: 1.1rem; font-weight: 600; line-height: 1.6; }
.tx-cell-lead .tx-cell-big { font-size: 1.35rem; }
.tx-plans-t { font-weight: 700; margin: 32px 0 16px; }
.tx-plans-note { margin-top: 20px; }
/* the plans component caps itself at 2 columns below 1550px; here the four fit in one row */
.tx .tx-plans { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }

/* ---------- motion: load-in for the hero, reveal for the rest ---------- */
@media (prefers-reduced-motion: no-preference) {
  .tx-hero-copy > * { animation: tx-up 0.7s var(--tx-ease) both; }
  .tx-hero-copy > :nth-child(2) { animation-delay: 0.06s; }
  .tx-hero-copy > :nth-child(3) { animation-delay: 0.12s; }
  .tx-hero-copy > :nth-child(4) { animation-delay: 0.18s; }
  .tx-hero-copy > :nth-child(5) { animation-delay: 0.24s; }
  /* the band keeps its colour; only its content rises in */
  html.reveal-on .tx-sec > *, html.reveal-on .tx-final > * { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--tx-ease), transform 0.7s var(--tx-ease); }
  html.reveal-on .tx-sec.is-in > *, html.reveal-on .tx-final.is-in > * { opacity: 1; transform: none; }
}
@keyframes tx-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }


/* ---------- below 768px: everything to one column ---------- */
@media (max-width: 767px) {
  .tx-hero-how { display: none; }
  .tx-perks ul { gap: 8px; }
  .tx-perks li { flex-direction: column; gap: 8px; padding: 14px 6px; font-size: 0.875rem; text-align: center; }
  .tx-ctas { flex-direction: column; }
  .tx-ctas .tx-btn { width: 100%; justify-content: center; }
  .tx > .tx-band { flex-direction: column; align-items: flex-start; }
  .tx-stats { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .tx-track { grid-template-columns: 1fr; gap: 28px; }
  .tx-track::before { top: 22px; bottom: 22px; inset-inline-start: 22px; inset-inline-end: auto; width: 2px; height: auto; }
  .tx-track li { display: grid; grid-template-columns: 46px 1fr; column-gap: 16px; padding: 0; }
  .tx-track h3 { margin-top: 10px; }
  .tx-track p { grid-column: 2; }
  .tx-paths { grid-template-columns: 1fr; }
  .tx-path { padding: 24px 20px; }
  .tx-bento { grid-template-columns: 1fr; }
  .tx-faq { grid-template-columns: 1fr; gap: 20px; }
  .tx-faq-h { position: static; }
  .tx-final { grid-template-columns: 1fr; }  /* auto-fit still fit two columns at 600-767px while the stacked divider below applied */
  .tx-final-i { padding-inline: 0; }
  .tx-final-i + .tx-final-i { border-inline-start: 0; border-top: 1px solid var(--tx-line); padding: 32px 0 0; margin-top: 32px; }
}

/* the directory's grid, inside the band */
.tx-pgrid { margin-top: 32px; }
/* one scrolling row, so the section stays one card tall and the page below is a short scroll away (owner).
   Whole cards per view: three on a desktop, two on a tablet; a phone shows most of one and the edge of the next. */
.tx .tx-pgrid:not(.is-list) {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * 16px) / 3);
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  /* 8px of room on every side for the focus ring, which the scroll box would otherwise clip; the negative margin keeps the cards on the section's edges */
  padding: 8px 8px 16px; margin: 24px -8px 0; scroll-padding-inline: 8px;
}
.tx .tx-pgrid > .pcard { scroll-snap-align: start; }
@media (max-width: 1080px) { .tx .tx-pgrid:not(.is-list) { grid-auto-columns: calc((100% - 16px) / 2); } }
@media (max-width: 767px)  { .tx .tx-pgrid:not(.is-list) { grid-auto-columns: 85%; } }

/* /for-providers/ open requests */
.tx-or-grid { list-style: none; padding: 8px 8px 16px; margin: 24px -8px 0; scroll-padding-inline: 8px; display: grid; gap: 16px;
  grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * 16px) / 3);
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.tx-or-grid > li { scroll-snap-align: start; }
/* same scrolling row as the homepage's provider cards (owner): three whole cards, two on a tablet, one and an edge on a phone */
@media (max-width: 1080px) { .tx-or-grid { grid-auto-columns: calc((100% - 16px) / 2); } }
@media (max-width: 767px)  { .tx-or-grid { grid-auto-columns: 85%; } }
/* /for-providers/ what you get: four one-line points, two by two; the lead tile beside three stacked one-liners was mostly empty */
.tx-bento-stack .tx-cell { display: flex; align-items: center; gap: 16px; }
.tx-bento-stack .tx-cell .tx-cell-ic { margin: 0; font-size: 1.8rem; }
/* the join card's action is a real button, at the foot of the card like the other cards' links */
.tx-or-more .tx-btn { margin-top: auto; align-self: flex-start; }


/* the browse button sits under the cards at every width: beside the heading it wrapped between heading and lead wherever the two did not fit one line (768, EN 1024, EN 1081-1205), and the heading is admin-editable copy, so no breakpoint can be trusted */
.tx-sec:has(> .tx-head-row) { display: flex; flex-direction: column; }
.tx-head-row { display: contents; }
.tx-head-row .tx-btn { order: 9; align-self: flex-start; margin-top: 24px; }
@media (max-width: 767px) { .tx-head-row .tx-btn { align-self: stretch; } }
/* the four plans: two by two on a tablet instead of three and one alone */
@media (min-width: 768px) and (max-width: 1200px) { .tx .tx-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* the scroll rows take focus: the product's ring, not the browser's */
.tx-pgrid:focus-visible, .tx-or-grid:focus-visible { outline: 2px solid var(--green-700); outline-offset: 4px; }
.tx .pcard:focus-visible, .tx-or-grid a:focus-visible { outline: 2px solid var(--green-700); outline-offset: 3px; }
/* compact card: at most three tags, so they may wrap to a second line rather than ellipse (in English every tag was cut at 1440); a single tag longer than the card still ellipses */
.tx .pcard-tag { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
/* the card rows scroll by swipe, trackpad, wheel and keyboard; the bar itself is hidden (owner) */
.tx-pgrid, .tx-or-grid { scrollbar-width: none; }
.tx-pgrid::-webkit-scrollbar, .tx-or-grid::-webkit-scrollbar { display: none; }
