/* Shared layer for every page of the site (home + inner pages).
   Loaded after raisan.css. Page-specific styles live in assets/css/pages/<group>.css. */

/* ---------- Mega menu (desktop) ---------- */
.r .p-nav__inner { position: relative; }
.r .p-nav__links { align-items: center; }
.r-navitem { position: static; }
.r-navitem__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--r-pill, 9999px);
  font-size: 16px; font-weight: 500; opacity: 0.82;
  transition: opacity var(--t-hover) ease, background-color var(--t-hover) ease;
}
.r-navitem__btn svg { width: 14px; height: 14px; transition: transform 200ms var(--ease-out); }
.r-navitem.is-open .r-navitem__btn, .p-nav__links a[aria-current="page"] { opacity: 1; background: rgba(7, 30, 54, 0.05); }
.r-navitem.is-open .r-navitem__btn svg { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .r-navitem__btn:hover { opacity: 1; background: rgba(7, 30, 54, 0.05); } }

.r-mega {
  position: absolute; inset-inline: var(--pad-x); top: calc(100% + 8px); z-index: 120;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 8px;
  padding: 8px; border-radius: var(--r-card);
  background: var(--white); color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(11, 26, 92, 0.08), 0 40px 80px -40px rgba(11, 26, 92, 0.45);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.985); transform-origin: top center;
  transition: opacity 180ms var(--ease-out), transform 220ms var(--ease-out), visibility 0s linear 220ms;
}
.r-mega--narrow { inset-inline: auto; width: min(560px, calc(100% - var(--pad-x) * 2)); grid-template-columns: 1fr; }
.r-navitem.is-open .r-mega { opacity: 1; visibility: visible; transform: none; transition: opacity 180ms var(--ease-out), transform 220ms var(--ease-out), visibility 0s; }
.r-mega__body { padding: 20px; }
.r-mega__group + .r-mega__group { margin-top: 20px; }
.r-mega__label { display: block; margin: 0 12px 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.r-mega__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
.r-mega--narrow .r-mega__list { grid-template-columns: 1fr; }
.r-mega__list a { display: grid; gap: 2px; padding: 12px; border-radius: var(--r-inner); transition: background-color var(--t-hover) ease; }
.r-mega__list a strong { font-family: var(--f-display); font-size: 16px; font-weight: 700; line-height: 1.5; }
.r-mega__list a span { font-family: var(--f-text); font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.r-mega__list a.is-overview { grid-column: 1 / -1; background: var(--cream-2); }
@media (hover: hover) and (pointer: fine) { .r-mega__list a:hover { background: var(--cream-2); } .r-mega__list a:hover strong { color: var(--r-blue); } }
.r-mega__promo {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  padding: 24px; border-radius: calc(var(--r-card) - 8px);
  background: var(--r-blue); color: var(--white); overflow: clip; position: relative; isolation: isolate;
}
.r-mega__promo strong { font-family: var(--f-display); font-weight: 900; font-size: 22px; line-height: 1.4; }
.r-mega__promo p { font-size: 15px; line-height: 1.65; color: var(--on-dark-strong); }
.r-mega__promo .r-pill { align-self: flex-start; margin-top: 6px; }
.r-mega__promo .r-loop { position: absolute; z-index: -1; }
.p-nav__try { padding: 10px 16px; border-radius: var(--r-pill, 9999px); font-size: 16px; font-weight: 700; color: var(--r-blue); }
@media (hover: hover) and (pointer: fine) { .p-nav__try:hover { background: rgba(37, 99, 234, 0.08); } }

/* perk.css styles every link inside .p-nav__links as a top-level pill; undo that inside panels */
.r .p-nav__links .r-mega a { opacity: 1; font-size: inherit; font-weight: inherit; }
.r .p-nav__links .r-mega__list a { padding: 12px; border-radius: var(--r-inner); }
.r .p-nav__links .r-mega__promo .r-pill { padding: 8px 16px; }
@media (hover: hover) and (pointer: fine) { .r .p-nav__links .r-mega__promo .r-pill:hover { background: var(--white); color: var(--r-blue); } }

@media (max-width: 1180px) {
  .r .p-nav__links { display: none; }
  .r .p-nav__toggle { display: grid; }
  .p-nav__try { display: none; }
}

/* ---------- Mobile menu with groups ---------- */
.r .menu-overlay--site { justify-content: flex-start; overflow-y: auto; gap: 0; padding-top: 104px; overscroll-behavior: contain; }
.menu-overlay--site details { border-bottom: 1px solid var(--on-dark-line); }
.menu-overlay--site summary, .menu-overlay--site > a:not(.island) {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 10px; list-style: none; cursor: pointer;
  font-family: var(--f-display); font-weight: 900; font-size: clamp(28px, 7vw, 38px); line-height: 1.4;
}
.menu-overlay--site summary::-webkit-details-marker { display: none; }
.menu-overlay--site summary::after { content: "+"; font-weight: 400; transition: transform 200ms var(--ease-out); }
.menu-overlay--site details[open] summary::after { transform: rotate(45deg); }
.menu-overlay--site details a { display: block; padding: 8px 0; font-size: 18px; font-weight: 700; color: var(--on-dark-strong); opacity: 1 !important; transform: none !important; font-family: var(--f-sans) !important; line-height: 1.6 !important; }
.menu-overlay--site details div { padding-bottom: 16px; }
.is-open .menu-overlay--site > * { opacity: 1; transform: none; }
.menu-overlay--site > details, .menu-overlay--site > a { opacity: 0; transform: translateY(32px); transition: opacity 600ms var(--ease-lux), transform 600ms var(--ease-lux); }
.is-open .menu-overlay--site > :nth-child(2) { transition-delay: 60ms; }
.is-open .menu-overlay--site > :nth-child(3) { transition-delay: 120ms; }
.is-open .menu-overlay--site > :nth-child(4) { transition-delay: 180ms; }
.is-open .menu-overlay--site > :nth-child(5) { transition-delay: 240ms; }
.is-open .menu-overlay--site > :nth-child(n+6) { transition-delay: 300ms; }

/* ---------- Inner page hero ---------- */
.r-page-hero { position: relative; isolation: isolate; overflow: clip; padding-block: clamp(48px, 6vw, 88px) clamp(96px, 10vw, 136px); }
.r-page-hero > .r-loop { top: 0; }
.r-page-hero__head { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; max-width: 860px; }
.r-page-hero--center .r-page-hero__head { align-items: center; text-align: center; margin-inline: auto; }
.r-page-hero__head .p-sub { max-width: 36em; }
.r-page-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.r-page-hero--split .container { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.r-page-hero--split .r-cut .r-photo { aspect-ratio: 4 / 3.4; }
.r-h-page { font-family: var(--f-display); font-weight: 900; font-size: clamp(42px, 5.6vw, 78px); line-height: 1.32; }

.r-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.r-crumbs li + li::before { content: "/"; margin-inline-end: 8px; opacity: 0.5; }
.r-crumbs a { transition: color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .r-crumbs a:hover { color: var(--r-blue); } }
.r-crumbs [aria-current] { color: var(--ink); }

/* ---------- Section head ---------- */
.r-head { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.r-head--center { align-items: center; text-align: center; margin-inline: auto; }

/* ---------- Card grid ---------- */
.r-grid { display: grid; gap: 16px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.r-grid > .r-card { display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.r-grid .r-card h3 { font-family: var(--f-display); font-weight: 900; font-size: clamp(21px, 1.8vw, 25px); line-height: 1.4; }
.r-grid a.r-card { transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .r-grid a.r-card:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -36px rgba(11, 26, 92, 0.5); } }
.r-grid a.r-card:active { transform: scale(0.985); }
.r-grid .r-card .r-pill { align-self: flex-start; margin-top: auto; }

/* ---------- FAQ ---------- */
.r-faq { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.r-faq__list details { border-bottom: 1px solid var(--ash); }
.p-band--dark .r-faq__list details { border-color: var(--on-dark-line); }
.r-faq__list summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-block: 24px; cursor: pointer; list-style: none;
  font-family: var(--f-display); font-weight: 700; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5;
}
.r-faq__list summary::-webkit-details-marker { display: none; }
.r-faq__list summary::after {
  content: ""; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--r-blue) center / 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  transition: transform 220ms var(--ease-out);
}
.r-faq__list details[open] summary::after { transform: rotate(45deg); }
.r-faq__list details p { padding-bottom: 24px; max-width: 40em; color: var(--graphite); }
.p-band--dark .r-faq__list details p { color: var(--on-dark-strong); }
@supports (interpolate-size: allow-keywords) {
  .r-faq__list { interpolate-size: allow-keywords; }
  .r-faq__list details::details-content { block-size: 0; overflow: clip; transition: block-size 280ms var(--ease-out), content-visibility 280ms allow-discrete; }
  .r-faq__list details[open]::details-content { block-size: auto; }
}

/* ---------- Comparison table ---------- */
.r-table-wrap { overflow-x: auto; border-radius: var(--r-card); background: var(--white); box-shadow: inset 0 0 0 1px var(--ash); }
.r-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 16px; }
.r-table th, .r-table td { padding: 18px 24px; text-align: start; border-bottom: 1px solid var(--ash); vertical-align: top; }
.r-table thead th { font-family: var(--f-display); font-weight: 900; font-size: 18px; background: var(--cream-2); }
.r-table tbody th { font-weight: 700; }
.r-table td { font-family: var(--f-text); color: var(--graphite); }
.r-table tr:last-child > * { border-bottom: 0; }
.r-table .is-yes { color: var(--r-blue); font-family: var(--f-sans); font-weight: 700; }

/* ---------- Form fields ---------- */
.r-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.r-field { display: grid; gap: 8px; }
.r-field--full { grid-column: 1 / -1; }
.r-field label { font-size: 15px; font-weight: 700; }
.r-field input, .r-field select, .r-field textarea {
  width: 100%; min-height: 56px; padding: 14px 18px; border: 0; border-radius: 16px;
  background: var(--white); color: var(--ink); font: inherit; font-size: 17px;
  box-shadow: inset 0 0 0 1px var(--ash);
  transition: box-shadow 200ms var(--ease-out);
}
.r-field textarea { min-height: 140px; resize: vertical; }
.r-field input:focus, .r-field select:focus, .r-field textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--r-blue), 0 0 0 4px rgba(37, 99, 234, 0.14); }
.r-field small { font-size: 13px; color: var(--ink-soft); }

/* ---------- Long-form text (legal, articles) ---------- */
.r-prose { max-width: 72ch; font-family: var(--f-text); font-size: 18px; line-height: 1.9; color: var(--ink-strong); }
.r-prose > * + * { margin-top: 1em; }
.r-prose h2 { margin-top: 2em; font-family: var(--f-display); font-weight: 900; font-size: clamp(26px, 2.4vw, 32px); line-height: 1.4; color: var(--ink); }
.r-prose h3 { margin-top: 1.6em; font-family: var(--f-display); font-weight: 700; font-size: 21px; color: var(--ink); }
.r-prose ul, .r-prose ol { padding-inline-start: 1.2em; }
.r-prose ul { list-style: disc; }
.r-prose ol { list-style: decimal; }
.r-prose li + li { margin-top: 0.4em; }
.r-prose a { color: var(--r-blue); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .r-mega { grid-template-columns: 1fr; }
  .r-mega__promo { display: none; }
}
@media (max-width: 960px) {
  .r-grid { grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr)); }
  .r-page-hero--split .container, .r-faq { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .r-grid, .r-fields { grid-template-columns: 1fr; }
  .r-table th, .r-table td { padding: 14px 16px; }
}
.r-mega__promo .r-pill { background: transparent; color: var(--white); }

/* Pills that are links: the whole pill is the hit area */
.p-pills li:has(> a) { padding: 0; }
.p-pills li > a { display: block; padding: 8px 16px; border-radius: inherit; }
.p-pills li:has(> a):active { transform: scale(0.97); }
.p-pills li:has(> a) { transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.r-card__title { text-wrap: balance; }

/* Straight-edged tint band for inner pages (raisan.css makes light bands transparent over the marble) */
.r .p-band.p-band--parchment { background: var(--cream-2); }

/* ---------- Closing CTA: one calm row. Text on the start side, actions on the end side. ---------- */
.r .b-cta { padding-block: clamp(80px, 9vw, 120px); }
.r .b-cta.r-slab { padding-top: calc(clamp(80px, 9vw, 120px) + 16px); }
.b-cta > .r-loop { display: none; }
.r-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title actions" "line actions"; align-items: center; column-gap: clamp(32px, 6vw, 96px); row-gap: 14px; text-align: start; }
.r-cta .p-display { grid-area: title; font-size: clamp(34px, 4vw, 56px); line-height: 1.35; }
.r-cta .p-sub { grid-area: line; max-width: 34em; color: var(--on-dark-strong); font-weight: 500; }
.r-cta__actions { grid-area: actions; display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.r-cta__actions .island { justify-content: space-between; }
.r-cta .p-underline { align-self: center; color: var(--white); }
@media (max-width: 760px) {
  .r-cta { grid-template-columns: 1fr; grid-template-areas: "title" "line" "actions"; }
  .r-cta__actions { margin-top: 14px; align-items: flex-start; }
  .r-cta .p-underline { align-self: flex-start; }
}
.r .island--light { background: var(--white); color: var(--r-blue); box-shadow: 0 18px 40px -22px rgba(11, 26, 92, 0.6); }
.r .island--light .island__icon { background: var(--r-blue); color: var(--white); }

/* Safety net: no CTA anywhere shows the arrow bar or a brush highlight, even before its markup is migrated */
.b-cta .r-arrowbar { display: none; }
.r .b-cta .b-brush, .r .b-cta [data-brush].b-brush, .r .b-cta [data-brush].b-brush.is-in { background: none; color: inherit; }

/* Tables keep dark text even inside a navy section */
.r-table-wrap { color: var(--ink); }

/* Inner pages have straight-edged sections, so the footer meets them flat too; the home page keeps its sliding rounded footer */
body.r:not([data-current="index.html"]) .r-footer { margin-top: 0; border-radius: 0; padding-top: clamp(56px, 6vw, 72px); }

.r-mega--full { grid-template-columns: 1fr; }

/* Thmanyah Sans everywhere with its swash finals (salt, "الأحرف المرسلة" in the Thmanyah guide): the elongated ن ي ك ف endings the owner wants on all text */
body.r { font-feature-settings: "salt" 1; --f-text: "Thmanyah Sans", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }
.r p, .r blockquote { font-weight: 400; }
.r .fatha-1 { font-feature-settings: "salt" 1, "ss03" 1; }
.r .fatha-2 { font-feature-settings: "salt" 1, "ss04" 1; }
.r .fatha-3 { font-feature-settings: "salt" 1, "ss05" 1; }
.r .num { font-feature-settings: normal; }

/* Light closing CTA: used where the section before it is dark, so the order stays dark / light / navy footer */
.r .p-band.b-cta--light { background: var(--white); color: var(--ink); }
.r .b-cta--light .r-cta .p-sub { color: var(--graphite); }
.r .b-cta--light .r-cta .p-underline { color: var(--ink); }
.r .b-cta--light .island--light { background: var(--r-blue); color: var(--white); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.r .b-cta--light .island--light .island__icon { background: var(--white); color: var(--r-blue); }

/* Footer legal rows: line 1 rights + contacts with "back to top" at the end, line 2 the company's legal line */
.r .r-footer__bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 32px; font-size: 13px; }
.r .r-footer__bottom .r-footer__legal-1 { grid-column: 1; grid-row: 1; }
.r .r-footer__bottom .r-footer__top { grid-column: 2; grid-row: 1; }
.r .r-footer__bottom .r-footer__legal-2 { grid-column: 1 / -1; grid-row: 2; flex: none; }
.r .r-footer__bottom bdi { unicode-bidi: isolate; }
@media (max-width: 640px) {
  .r .r-footer__bottom { grid-template-columns: 1fr; }
  .r .r-footer__bottom .r-footer__top { grid-column: 1; grid-row: 3; }
}
.r .r-footer__bottom p { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0; row-gap: 4px; }
.r .r-footer__bottom strong { font-weight: 700; color: var(--on-dark-strong); }
.r .r-footer__bottom b { font-weight: 700; color: var(--white); letter-spacing: 0.02em; }
.r .r-footer__bottom i { font-style: normal; margin-inline: 10px; color: var(--on-dark-line); color: rgba(255, 255, 255, 0.32); }
.r .r-footer__bottom .r-footer__legal-1 a { color: var(--on-dark-strong); }
