/* Shared design for the Arabic (RTL) and French pages.
   Layout uses logical properties, so one file serves both directions.
   Portrait size: the source photo is about 300px. Keep --portrait small. */

:root {
  --paper: #f3eee4;
  --ink: #1b2e2b;
  --muted: #3e534d;
  --line: #d9d0c2;
  --teal: #0e4a44;
  --teal-deep: #1e3f3a;
  --copper: #6e3a28;
  --cream: #f4efe6;
  --ring: #fbf8f2;
  --portrait: 104px;
  --measure: 40rem;
  --pad: 1.25rem;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 280px at 50% -40px, #efe6d4 0%, transparent 70%),
    var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", Inter, "Liberation Sans", "Noto Sans", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
}

html[lang="ar"] body {
  font-family: "Noto Kufi Arabic", "Noto Sans Arabic", "Noto Naskh Arabic", sans-serif;
  line-height: 1.9;
}

body::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--teal-deep);
}

[lang="ar"] {
  font-family: "Noto Kufi Arabic", "Noto Sans Arabic", sans-serif;
  letter-spacing: 0;
}

::selection {
  background: var(--teal-deep);
  color: var(--cream);
}

:focus {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

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

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

a {
  color: var(--teal);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:visited {
  color: var(--teal);
}

a:hover {
  color: var(--copper);
}

img,
object,
svg {
  max-width: 100%;
}

.skip {
  position: absolute;
  inset-inline-start: var(--pad);
  top: -5rem;
  z-index: 5;
  background: var(--teal-deep);
  color: var(--cream);
  padding: 0.65rem 0.9rem;
  text-decoration: none;
}

.skip:focus {
  top: 0.6rem;
}

.wrap {
  width: min(100% - (2 * var(--pad)), var(--measure));
  margin-inline: auto;
  padding-bottom: 2.5rem;
}

.site-header {
  padding-top: max(0.15rem, env(safe-area-inset-top));
}

.lang {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0.15rem 0 0;
}

.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.35rem 0.9rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.lang a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--copper);
}

.hero {
  padding-top: 0.85rem;
  text-align: center;
}

.portrait-figure {
  margin: 0;
}

.portrait-slot {
  width: var(--portrait);
  height: var(--portrait);
  margin-inline: auto;
  border-radius: 50%;
  overflow: hidden;
  background: var(--teal-deep);
  box-shadow:
    0 0 0 3px var(--ring),
    0 0 0 4px var(--line),
    0 10px 22px rgba(27, 46, 43, 0.12);
}

.portrait-slot object {
  display: block;
  width: var(--portrait);
  height: var(--portrait);
  border: 0;
  object-fit: cover;
  object-position: center 35%;
}

.portrait-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--portrait);
  height: var(--portrait);
  background: var(--teal-deep);
  color: var(--cream);
  font-family: "Source Serif 4", "Liberation Serif", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
}

.eyebrow {
  margin: 1rem 0 0.3rem;
  color: var(--copper);
  font-size: 0.95rem;
  font-weight: 600;
}

html[lang="fr"] .eyebrow {
  font-family: "Source Sans 3", Inter, "Liberation Sans", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

h1,
h2,
h3 {
  font-family: "Source Serif 4", "Noto Kufi Arabic", "Liberation Serif", Georgia, serif;
  font-weight: 650;
  line-height: 1.35;
  text-wrap: balance;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 {
  font-family: "Noto Kufi Arabic", "Noto Sans Arabic", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.45;
}

h1 {
  margin: 0;
  font-size: 1.65rem;
}

.latin-name,
.arabic-name {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

html[lang="ar"] .latin-name {
  font-family: "Source Serif 4", "Liberation Serif", Georgia, serif;
  letter-spacing: 0;
  line-height: 1.4;
}

html[lang="fr"] .arabic-name {
  font-family: "Noto Kufi Arabic", "Noto Sans Arabic", sans-serif;
  letter-spacing: 0;
  line-height: 1.7;
}

.rule {
  width: 2.5rem;
  height: 2px;
  margin: 0.85rem auto 0.75rem;
  background: var(--copper);
  border: 0;
}

.role {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

html[lang="ar"] .role {
  line-height: 1.85;
}

.lede {
  margin: 1rem 0 0;
  text-align: start;
  font-size: 1.05rem;
}

html[lang="ar"] .lede {
  line-height: 2;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 0.85rem;
  margin: 1.35rem 0 0.25rem;
  padding: 0.35rem 0 0;
  border-top: 1px solid var(--line);
}

.toc a,
.links a,
.piece h3 a,
.piece .meta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.toc a {
  font-weight: 600;
  text-decoration-thickness: 1px;
}

section[id] {
  scroll-margin-top: 0.75rem;
  margin-top: 0.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0 0 0.85rem;
  font-size: 1.32rem;
}

section p {
  margin: 0 0 0.9rem;
}

section p:last-child {
  margin-bottom: 0;
}

.facts,
.pieces,
.links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.facts li {
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.facts li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.facts h3,
.piece h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.facts p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.piece {
  margin: 0 0 0.85rem;
  padding: 0.15rem 0 0.7rem;
  padding-inline-start: 0.85rem;
  border-inline-start: 3px solid var(--copper);
}

.piece:last-child {
  margin-bottom: 0;
}

.kicker {
  margin: 0;
  color: var(--copper);
  font-size: 0.95rem;
  font-weight: 600;
}

html[lang="fr"] .kicker {
  font-family: "Source Sans 3", Inter, "Liberation Sans", sans-serif;
  font-size: 0.92rem;
}

.piece h3 a {
  color: var(--ink);
  text-decoration-color: var(--teal);
}

.piece h3 a:hover {
  color: var(--teal);
}

.meta {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.links a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.12rem;
  min-height: 44px;
  padding-block: 0.7rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.links li:first-child a {
  border-top: 1px solid var(--line);
}

.links-label {
  color: var(--ink);
  font-weight: 700;
}

.links-url {
  color: var(--teal);
  font-size: 0.98rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.links a:hover .links-label {
  color: var(--copper);
}

html[lang="fr"] .club-name {
  direction: rtl;
  width: max-content;
  max-width: 100%;
  margin-top: -0.35rem;
  margin-left: 0;
  margin-right: auto;
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 1.35rem;
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.98rem;
  text-align: center;
}

.site-footer p {
  margin: 0 0 0.35rem;
}

.site-footer strong {
  color: var(--ink);
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 760px) {
  :root {
    --pad: 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .hero {
    padding-top: 1.35rem;
  }

  .wrap {
    padding-bottom: 3.5rem;
  }
}

@media (forced-colors: active) {
  body::before,
  .rule,
  .portrait-slot,
  .piece {
    forced-color-adjust: auto;
  }

  .portrait-slot,
  .lang a[aria-current="page"] {
    border: 1px solid CanvasText;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  body::before,
  .site-header,
  .toc,
  .skip {
    display: none;
  }

  a {
    color: #000;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }
}
