/* ==========================================================================
   SMAB design system
   Shared by the public website, the admin CMS and the portals.

   Direction: every rule uses CSS logical properties (inline-start/end, margin-inline,
   text-align: start) so the same stylesheet lays out correctly in Arabic RTL and
   English LTR with no direction-specific overrides. The few places that cannot be
   expressed logically are marked and handled under [dir="rtl"].
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts — served locally; no external font CDN is used.
   Cairo, SIL Open Font License 1.1 (see /fonts/Cairo-OFL.txt). Covers Arabic and Latin,
   so both languages share one family and one vertical rhythm.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Cairo';
  src: url('/fonts/cairo-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('/fonts/cairo-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette: warm church tones taken from the approved artwork. */
  --c-burgundy-900: #4a1019;
  --c-burgundy-800: #5f1622;
  --c-burgundy-700: #7d2231;
  --c-burgundy-600: #97303f;
  --c-burgundy-500: #b04455;

  --c-gold-700: #9a6f16;
  --c-gold-600: #b8860b;
  --c-gold-500: #c9a227;
  --c-gold-300: #e3c87a;
  --c-gold-100: #f6ead0;

  --c-cream-50: #fffcf7;
  --c-cream-100: #fdf6ea;
  --c-cream-200: #f8eeda;
  --c-cream-300: #f0e0c6;

  --c-brown-700: #4a3a2e;
  --c-brown-500: #6b5744;
  --c-brown-300: #a08f7d;

  --c-ink: #2b1d18;
  --c-ink-soft: #5a4740;

  /* Semantic roles */
  --c-surface: var(--c-cream-50);
  --c-surface-alt: var(--c-cream-100);
  --c-surface-deep: var(--c-cream-200);
  --c-surface-inverse: var(--c-burgundy-900);
  --c-border: rgb(122 60 40 / 14%);
  --c-border-strong: rgb(122 60 40 / 26%);
  --c-text: var(--c-ink);
  --c-text-soft: var(--c-ink-soft);
  --c-text-inverse: var(--c-cream-50);
  --c-accent: var(--c-burgundy-700);
  --c-accent-hover: var(--c-burgundy-600);
  --c-focus: var(--c-gold-600);

  /*
   * Text and icons drawn on top of a photograph or a deep band. This stays light in every
   * theme: it describes content over imagery, not the theme's own surface colour. Keeping it
   * separate from --c-cream-50 is what stops a dark theme making its own hero text invisible.
   */
  --c-on-media: #fffcf7;

  /* Filled by the active theme; these fall back to the light palette. */
  --c-link: var(--c-accent);
  --c-link-hover: var(--c-accent-hover);
  --c-emphasis: var(--c-burgundy-800);
  --c-notice-bg: var(--c-gold-100);
  --c-notice-fg: var(--c-brown-700);

  --c-success: #2f6b46;
  --c-warning: #8a5a12;
  --c-danger: #9b2c2c;

  /* Typography */
  --font-body: 'Cairo', 'Segoe UI', system-ui, -apple-system, 'Noto Sans Arabic', sans-serif;
  --font-display: var(--font-body);

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.3125rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.5rem;
  --fs-4xl: 3rem;

  --lh-tight: 1.25;
  --lh-snug: 1.45;
  --lh-normal: 1.75;

  /* Spacing — a 4px base scale used for every gap, pad and margin. */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-7: 2rem;
  --sp-8: 2.5rem;
  --sp-9: 3rem;
  --sp-10: 3.5rem;
  --sp-11: 4.5rem;

  /* Rhythm of the panelled page, measured from homepage.png at 1440px:
     panels sit ~8px apart on the page background and pad their contents by ~20px. */
  --section-gap: 0.5rem;
  --panel-pad: 1.25rem;
  --card-gap: 1.25rem;

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  /* Depth */
  --shadow-sm: 0 1px 2px rgb(74 16 25 / 6%), 0 2px 6px rgb(74 16 25 / 5%);
  --shadow-md: 0 4px 12px rgb(74 16 25 / 8%), 0 10px 24px rgb(74 16 25 / 7%);
  --shadow-lg: 0 12px 28px rgb(74 16 25 / 12%), 0 24px 56px rgb(74 16 25 / 10%);

  /* Layout — the reference runs almost edge to edge with a narrow gutter, so the container
     is wide and the side margin small. The cap keeps it sane on an ultrawide monitor. */
  --container: 1560px;
  --container-narrow: 960px;
  --gutter: 1.25rem;
  --header-height: 96px;
  /* The admin topbar's own fixed height, so a page's sticky action bar can sit exactly below
     it rather than guessing — see .admin-panel__head--sticky in admin.css. */
  --admin-topbar-height: 73px;

  /* Motion — every duration flows through these so reduced-motion can zero them all. */
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-slow: 520ms;
  --ease-out: cubic-bezier(0.22, 0.8, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* --------------------------------------------------------------------------
   3. Reset and base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  block-size: 100%;
  /* Chromium does not flip the *viewport's own* scrollbar for an RTL document — only an
     ordinary element's own scrollbar follows its direction. So the document itself does not
     scroll: overflow: hidden here hands scrolling to body (below), an ordinary block that
     does respect direction, and the scrollbar lands on the correct side in both languages.
     Verified in Chromium: without this, dir="rtl" alone still drew the bar on the right. */
  overflow: hidden;
  /* Anchor links must clear the sticky header. */
  scroll-padding-block-start: calc(var(--header-height) + var(--sp-4));
}

body {
  margin: 0;
  block-size: 100%;
  /* The scrolling element — see the note on html above. overflow-x stays clipped (the
     off-canvas mobile drawer sits outside the viewport and would otherwise add a sideways
     scroll); overflow-y is set by whichever shell wraps this body (.site-shell or
     .admin-shell), since the public site also keeps the footer pinned to a short page. */
  overflow-x: clip;
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--c-burgundy-800);
  text-wrap: balance;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p {
  margin: 0 0 var(--sp-4);
  text-wrap: pretty;
}

p:last-child { margin-block-end: 0; }

a {
  color: var(--c-link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover { color: var(--c-link-hover); }

img, picture, svg, video {
  display: block;
  max-width: 100%;
}

/* Images never stretch: the intrinsic ratio is preserved unless a box sets one explicitly. */
img { height: auto; }

ul, ol { margin: 0; padding-inline-start: var(--sp-5); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* One visible focus treatment everywhere, keyboard-only. */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) { outline: none; }

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  inline-size: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}

.container--narrow {
  inline-size: min(100% - (var(--gutter) * 2), var(--container-narrow));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-gap);
}

.section--tight { padding-block: 0; }

.section--roomy { padding-block: var(--sp-6); }

/*
 * A panelled section: the container itself becomes a rounded surface floating on the page
 * background. Styling the container rather than the <section> means a partial opts in with
 * one class and needs no extra markup.
 */
.section--panel > .container,
.section--panel > .container--narrow {
  padding: var(--panel-pad);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
}

.section--panel-plain > .container { background: var(--c-cream-50); }

.section--alt { background: var(--c-surface-alt); }

.section--deep { background: var(--c-surface-deep); }

.stack > * + * { margin-block-start: var(--sp-4); }

.grid {
  display: grid;
  gap: var(--card-gap);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Fits as many cards per row as the width allows, rather than a fixed count. Used where the
   number of items is whatever the church has — services, sub-services, meetings — so a fixed
   column count would leave a ragged row or squeeze three into space for two. */
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

/* The smaller cards a public section's own card grid uses (news, events, gallery, service
   tiles, confession's father list, Sunday School classes) — four across on a wide desktop,
   narrowing at the same three breakpoints every other grid--N here already collapses at (below).
   A plain repeat(N) rather than auto-fit: auto-fit's column count depends on the exact pixel
   width available, which produced a different count at every screen size and — worse — left a
   nearly-empty trailing row whenever the item count did not happen to divide evenly into however
   many columns happened to fit (six items over five auto-fit columns leaves four empty cells
   beside the sixth card). A fixed ladder means a short last row simply has fewer cards, left
   aligned, which is how a card grid is expected to look — not a wall of empty space. */
.grid--cards-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Card grids are marked up as lists for screen readers but drawn as grids. */
.list-plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

.text-center { text-align: center; }

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link: first tab stop on every page. */
.skip-link {
  position: absolute;
  inset-block-start: var(--sp-2);
  inset-inline-start: var(--sp-2);
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-burgundy-800);
  color: var(--c-on-media);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
}

.skip-link:focus { transform: translateY(0); color: var(--c-on-media); }

/* --------------------------------------------------------------------------
   5. Section headers
   -------------------------------------------------------------------------- */
/*
 * Centred as one group — the ornament, title and subtitle are one visual unit in the middle of
 * the section, never pulled off-centre by a "view all" action. The two outer grid tracks are
 * both 1fr, so the middle (auto-sized) track always sits at the true centre whether or not a
 * CTA is present in the third track — simpler and more robust than centring the title with
 * text-align and separately positioning the CTA with position: absolute.
 */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: var(--sp-4);
  margin-block-end: var(--sp-5);
  text-align: center;
}

.section-head__group {
  grid-column: 2;
  min-inline-size: 0;
}

.section-head__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin: 0;
}

.section-head__ornament {
  color: var(--c-gold-600);
  font-size: 0.75em;
  line-height: 1;
}

.section-head__subtitle {
  margin-block-start: var(--sp-2);
  color: var(--c-text-soft);
  font-size: var(--fs-md);
  text-align: center;
}

.section-head__cta {
  grid-column: 3;
  justify-self: end;
  align-self: center;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--c-burgundy-700);
  --btn-fg: var(--c-cream-50);
  --btn-border: transparent;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  min-block-size: 46px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition:
    background-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.btn:hover {
  --btn-bg: var(--c-burgundy-600);
  color: var(--btn-fg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-burgundy-700);
  --btn-border: var(--c-border-strong);
}

.btn--ghost:hover {
  --btn-bg: var(--c-burgundy-700);
  --btn-fg: var(--c-cream-50);
}

.btn--gold {
  --btn-bg: var(--c-gold-600);
  --btn-fg: var(--c-burgundy-900);
}

.btn--gold:hover { --btn-bg: var(--c-gold-500); }

.btn--on-dark {
  --btn-bg: rgb(255 252 247 / 12%);
  --btn-fg: var(--c-on-media);
  --btn-border: rgb(255 252 247 / 40%);
  backdrop-filter: blur(6px);
}

.btn--on-dark:hover {
  --btn-bg: var(--c-on-media);
  --btn-fg: var(--c-burgundy-800);
}

.btn--sm { padding: var(--sp-2) var(--sp-4); min-block-size: 38px; font-size: var(--fs-xs); }
.btn--lg { padding: var(--sp-4) var(--sp-7); min-block-size: 54px; font-size: var(--fs-base); }
.btn--block { display: flex; inline-size: 100%; }

/* Arrow glyphs point along the reading direction, so they flip with the document. */
.btn__arrow {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-out);
}

[dir='rtl'] .btn__arrow { transform: scaleX(1); }
[dir='ltr'] .btn__arrow { transform: scaleX(-1); }

[dir='rtl'] .btn:hover .btn__arrow { transform: translateX(-4px); }
[dir='ltr'] .btn:hover .btn__arrow { transform: scaleX(-1) translateX(-4px); }

/* --------------------------------------------------------------------------
   7. Cards and media framing
   Every image sits inside a box with a declared aspect ratio and uses object-fit,
   so the source file is never distorted, only framed.
   -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--c-cream-50);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--c-border-strong);
}

.card__media {
  position: relative;
  aspect-ratio: var(--card-ratio, 4 / 3);
  overflow: hidden;
  background: var(--c-cream-200);
}

.card__media img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.card:hover .card__media img { transform: scale(1.05); }

.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4);
  flex: 1;
  /* Event and news cards read from the start edge, as in the approved design.
     A schedule card centres itself; see .card--schedule. */
  text-align: start;
}

.card--schedule .card__body { text-align: center; }

.card--schedule .card__meta { justify-content: center; }

.card__title { font-size: var(--fs-md); }

.card__text {
  color: var(--c-text-soft);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-brown-500);
  font-size: var(--fs-sm);
}

.card__meta svg { flex: none; color: var(--c-gold-600); }

.card__footer { margin-block-start: auto; padding-block-start: var(--sp-3); }

/* --------------------------------------------------------------------------
   8. Badges and pills
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--c-gold-100);
  color: var(--c-gold-700);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.badge--registration {
  background: rgb(125 34 49 / 10%);
  color: var(--c-burgundy-700);
}

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }

.field__label { font-size: var(--fs-sm); font-weight: 700; color: var(--c-brown-700); }

.field__hint { font-size: var(--fs-xs); color: var(--c-text-soft); }

/* `.field__control` is what thirteen back-office views call their inputs, and it was styled
   nowhere — every one of them was falling back to the browser's own control. One alias rather
   than renaming the markup in thirteen files. */
.field__control,
.input,
.select,
.textarea {
  inline-size: 100%;
  padding: var(--sp-3) var(--sp-4);
  min-block-size: 46px;
  background: var(--c-cream-50);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-md);
  color: var(--c-text);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.field__control:hover, .input:hover, .select:hover, .textarea:hover { border-color: var(--c-brown-300); }

.field__control:focus, .input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgb(125 34 49 / 14%);
  outline: none;
}

.textarea, textarea.field__control { min-block-size: 120px; resize: vertical; }

.field--invalid .field__control,
.field--invalid .input,
.field--invalid .select,
.field--invalid .textarea { border-color: var(--c-danger); }

.field__error { color: var(--c-danger); font-size: var(--fs-xs); font-weight: 700; }

/* Telephone numbers and email addresses stay left-to-right inside Arabic text. */
.ltr-inline { direction: ltr; unicode-bidi: isolate; }

/* --------------------------------------------------------------------------
   10. Notices
   -------------------------------------------------------------------------- */
.notice {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  border-inline-start: 4px solid var(--c-gold-600);
  background: var(--c-notice-bg);
  color: var(--c-notice-fg);
  font-size: var(--fs-sm);
}

.notice--info { border-inline-start-color: var(--c-burgundy-700); }

/* --------------------------------------------------------------------------
   11. Motion
   Reveal-on-scroll is opt-in per element and is fully disabled, not merely shortened,
   when the visitor prefers reduced motion.
   -------------------------------------------------------------------------- */
/*
 * Scoped to .js, which site.js sets on <html> before first paint. Without JavaScript the
 * starting state never applies, so content is visible rather than stranded at opacity 0.
 */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal { opacity: 1; transform: none; }
  .card:hover, .btn:hover { transform: none; }
  .card:hover .card__media img { transform: none; }
}

/* --------------------------------------------------------------------------
   12. Responsive breakpoints
   Desktop-first wide layout, collapsing at these three widths.
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  :root { --fs-3xl: 2.5rem; --fs-4xl: 3rem; --sp-10: 4rem; --sp-11: 5rem; }

  .grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--cards-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  :root {
    --fs-2xl: 1.75rem;
    --fs-3xl: 2.125rem;
    --fs-4xl: 2.375rem;
    --sp-10: 3rem;
    --sp-9: 2.5rem;
    --header-height: 72px;
  }

  .container,
  .container--narrow { inline-size: min(100% - (var(--sp-4) * 2), var(--container)); }

  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }

  .grid--6,
  .grid--cards-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .section-head { margin-block-end: var(--sp-5); }
}

@media (max-width: 460px) {
  .grid--6,
  .grid--cards-compact { grid-template-columns: minmax(0, 1fr); }
}

/* Print: strip the furniture, keep the content. */
@media print {
  .site-header, .site-footer, .btn, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---- the language switch -------------------------------------------------------------------
   Shared by the public header, the back office and the sign-in pages. Here rather than in
   public-site.css because the admin only loads this sheet. */

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  background: var(--c-surface);
}

.lang-switch__option {
  padding-inline: var(--sp-3);
  padding-block: 5px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--c-text-soft);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

button.lang-switch__option:hover { background: var(--c-surface-deep); color: var(--c-emphasis); }

.lang-switch__option.is-active {
  background: var(--c-burgundy-700);
  color: var(--c-on-media);
  cursor: default;
}

/* --------------------------------------------------------------------------
   Back to top
   One control, shared by the public site and the back office (see _BackToTop.cshtml).
   inset-inline-end rather than -right: the corner it sits in follows the reading
   direction, the left in Arabic and the right in English, same as everything else here.
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  inset-block-end: var(--sp-6);
  inset-inline-end: var(--sp-6);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 44px;
  block-size: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-border);
  background: var(--c-burgundy-700);
  color: var(--c-cream-50);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out),
    visibility 0s linear var(--dur-base), background-color var(--dur-fast) var(--ease-out);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out),
    visibility 0s, background-color var(--dur-fast) var(--ease-out);
}

.back-to-top:hover { background: var(--c-burgundy-900); }

@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: opacity var(--dur-fast) linear, visibility 0s; }
}

@media (max-width: 640px) {
  .back-to-top { inset-block-end: var(--sp-4); inset-inline-end: var(--sp-4); inline-size: 40px; block-size: 40px; }
}

