/* «رياضتنا»: «قصص تروى» (Figma 824:157041, dialog 856:165563) and «حصاد المتوجين» (854:159332). Sizes from the
   Figma layer CSS at 1440 px. */

/* ---------- stories: headline beside a photo collage ---------- */
.stories-hero { display: flex; align-items: center; gap: var(--sp-9); max-width: 1440px; min-height: 639px; margin: var(--sp-6) auto var(--sp-4); }
.stories-hero__text { order: -1; flex: 0 0 670px; align-self: flex-start; margin-top: var(--sp-9); padding-inline-start: var(--sp-8); }
.stories-hero__headline { max-width: 534px; font-size: var(--fs-h1); font-weight: 700; line-height: 1.8; text-align: start; color: var(--text); }
.stories-hero__highlight { color: var(--gold-strong); }
.stories-hero__intro { max-width: 551px; margin-top: var(--sp-4); font-size: var(--fs-lead); line-height: var(--lh-body); color: var(--text-2); }
.stories-hero__collage { position: relative; flex: 0 0 690px; height: 500px; align-self: flex-start; margin-top: var(--sp-8); }
.stories-hero__photo { position: absolute; overflow: hidden; border-radius: var(--r-md); }
.stories-hero__photo img { width: 100%; height: 100%; object-fit: cover; }
/* Positions, turns, corners and shadows as drawn (the frame's SVG); each box keeps its photo undistorted. Boxes are
   placed in percentages of the 690 × 500 px collage so it scales as one picture on narrower screens. */
.stories-hero__photo--1 { /* 184, 39; 454 × 400 */ left: 26.667%; top: 7.8%; width: 65.797%; height: 80%; border-radius: var(--r-lg) var(--r-lg) var(--r-lg) var(--r-sm); box-shadow: var(--shadow-sm); }
.stories-hero__photo--2, .stories-hero__photo--4 { transform-origin: 0 0; border-radius: var(--r-sm) var(--r-lg); }
.stories-hero__photo--2 { /* 14.06, 296.04; 210.49², turned −9.75° */ left: 2.038%; top: 59.208%; width: 30.506%; height: 42.098%; transform: rotate(-9.75deg); box-shadow: var(--shadow-sm); }
.stories-hero__photo--3 { /* 621, −32; 165 × 192 */ left: 90%; top: -6.4%; width: 23.913%; height: 38.4%; border-radius: var(--r-md) var(--r-lg); box-shadow: var(--shadow-sm); }
.stories-hero__photo--4 { /* 28, 0.99; 160², turned −7.72° */ left: 4.058%; top: .198%; width: 23.188%; height: 32%; transform: rotate(-7.72deg); box-shadow: var(--shadow-sm); }

/* ---------- stories: the portraits ---------- */
.stories { position: relative; isolation: isolate; background: var(--selected-bg); padding-bottom: var(--sp-8); }
.stories::before {
  content: ""; position: absolute; inset: 17px 0 0; z-index: -1; opacity: .04;
  background: url("../core/img/pattern-sports-gold.7e6ab857a03f.webp") repeat-y center 0 / 1752px auto;
}
.stories__title { display: flex; align-items: center; max-width: 1440px; min-height: 188px; margin-inline: auto; padding: var(--sp-2) var(--sp-8) 0; font-size: var(--fs-h2); font-weight: 800; line-height: var(--lh-heading); }
.stories__grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: var(--sp-9); row-gap: var(--sp-9); max-width: 1157px; margin: 0 auto; list-style: none; }
.story-card__link { display: flex; flex-direction: column; align-items: center; width: 294px; gap: var(--sp-6); color: var(--text); text-align: center; }
.story-card__photo { display: block; width: 294px; height: 294px; border-radius: 50%; overflow: hidden; background: var(--surface-2); }
.story-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.story-card__name { font-size: var(--fs-h3); font-weight: 800; line-height: var(--lh-heading); }
.story-card__role { margin-top: -5px; font-size: var(--fs-h4); font-weight: 700; line-height: 160%; color: var(--text-2); }
/* The middle portrait of each row of three is drawn larger, on a framed card. */
.story-card:nth-child(3n+2):not(:last-child) .story-card__link { width: 389px; min-height: 485px; padding: var(--sp-5) var(--sp-4) var(--sp-6); gap: var(--sp-7); justify-content: center; background: var(--selected-bg); border: 3px solid var(--gold-strong); border-radius: var(--r-lg); }
.story-card:nth-child(3n+2):not(:last-child) .story-card__name { font-size: var(--fs-h2-sm); }
.story-card:nth-child(3n+2):not(:last-child) .story-card__role { font-size: var(--fs-h3); margin-top: -28px; }
.story-card__link:hover .story-card__name { color: var(--gold-strong); }

/* ---------- stories: the dialog ---------- */
.story-dialog { width: 1155px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: var(--r-lg); background: transparent; overflow: auto; }
.story-dialog::backdrop { background: rgb(16 19 20 / .7); backdrop-filter: blur(8px); }
.story-dialog__head { position: relative; height: 596px; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; background: #000; }
.story-dialog__head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0.83deg, #000 0.71%, rgb(102 102 102 / 0) 99.29%); }
.story-dialog__photo, .story-dialog__head picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-dialog__close { position: absolute; z-index: 2; inset-inline-end: var(--sp-5); top: var(--sp-5); } /* the look is shared (components.css) */
.story-dialog__nav { position: absolute; z-index: 2; top: 252px; }
.story-dialog__nav--prev { inset-inline-start: var(--sp-5); }
.story-dialog__nav--next { inset-inline-end: var(--sp-5); }
.story-dialog__name { position: absolute; z-index: 1; inset-inline: 0; top: 440px; display: grid; place-items: center; min-height: 69px; font-size: var(--fs-h2-sm); font-weight: 800; line-height: var(--lh-heading); color: #fff; }
.story-dialog__role { position: absolute; z-index: 1; inset-inline: 0; top: 510px; display: grid; place-items: center; min-height: 56px; font-size: var(--fs-h3); font-weight: 700; line-height: var(--lh-heading); color: #fff; }
.story-dialog__body { position: relative; isolation: isolate; min-height: 454px; padding: var(--sp-5) var(--sp-8) var(--sp-5); background: #fff; border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: var(--fs-lead); line-height: var(--lh-body); text-align: start; } /* reading size (R-89) */
.story-dialog__body::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .07; border-radius: inherit;
  background: url("../core/img/pattern-sports-gold.7e6ab857a03f.webp") no-repeat center -170px / 1161px auto;
}

/* ---------- champions ---------- */
.champions-highlights {
  display: grid; grid-template-columns: repeat(3, 400px); justify-content: start; column-gap: var(--sp-8); align-items: start;
  max-width: 1352px; height: 734px; margin-inline: auto; padding-top: var(--sp-9); padding-inline-start: var(--sp-6);
}
.champions-highlight { position: relative; margin: 0; width: 400px; height: 500px; border-radius: var(--r-lg); overflow: hidden; }
.champions-highlight img { width: 100%; height: 100%; object-fit: cover; }
.champions-highlight::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #000 0%, rgb(0 0 0 / .2) 50%, rgb(0 0 0 / 0) 100%); }
.champions-highlight figcaption { position: absolute; z-index: 1; inset-inline: 0; bottom: 0; display: flex; flex-direction: column; padding: var(--sp-6); }
.champions-highlight__label { font-size: var(--fs-h4); font-weight: 800; line-height: 1.3; color: var(--gold); /* on the dark photo gradient: light gold reads 7:1 */ }
.champions-highlight__title { padding-top: var(--sp-2); font-size: var(--fs-h4); font-weight: 800; line-height: var(--lh-heading); color: #fff; }
.champions-highlight--large { width: 454px; height: 567px; margin: -35px -27px 0; }
.champions-highlight--large figcaption { padding-inline: var(--sp-6) var(--sp-4); }

.podium { position: relative; isolation: isolate; height: 527px; background: var(--selected-bg); }
.podium::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .04;
  background: url("../core/img/pattern-sports-gold.7e6ab857a03f.webp") no-repeat -15px -300px / 1465px auto;
}
.podium__list { display: flex; justify-content: center; align-items: flex-end; gap: var(--sp-5); height: 399px; padding-top: var(--sp-8); list-style: none; }
.podium__card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); width: 320px; height: 310px; margin-inline: var(--sp-7); padding: var(--sp-7) var(--sp-5) 0;
  background: rgb(250 250 248 / .85); border: 2px solid var(--silver); border-radius: var(--r-md);
  box-shadow: var(--shadow-raised);
}
.podium__card--3 { border-color: var(--gold-strong); }
.podium__card--1 { width: 317px; height: 346px; margin-inline: var(--sp-7); gap: var(--sp-4); padding: var(--sp-7) var(--sp-5) 0; border: 5px solid var(--gold); box-shadow: var(--shadow-raised); }
.podium__rank {
  position: absolute; top: -26px; inset-inline-start: calc(50% - 28px); display: grid; place-items: center; width: 56px; height: 56px;
  background: #fff; border: 2px solid var(--gold-strong); border-radius: 50%; font-size: var(--fs-h3); font-weight: 800; line-height: var(--lh-heading);
  box-shadow: var(--shadow-sm);
}
.podium__card--2 .podium__rank { border-color: var(--silver); }
.podium__card--1 .podium__rank { top: -37px; inset-inline-start: calc(50% - 32px); width: 64px; height: 64px; font-size: var(--fs-h2-sm); line-height: var(--lh-heading); }
.podium__photo { display: grid; place-items: center; width: 128px; height: 128px; border-radius: 50%; overflow: hidden; background: #F1F5F9; box-shadow: inset 0 2px 4px 4px rgb(0 0 0 / .05); color: var(--silver); }
.podium__card--1 .podium__photo { width: 144px; height: 144px; background: var(--banner-from); box-shadow: var(--shadow-sm); }
.podium__photo img { width: 100%; height: 100%; object-fit: cover; }
.podium__name { display: grid; place-items: center; min-height: 54px; padding-top: var(--sp-1); font-size: var(--fs-lead); font-weight: 700; line-height: var(--lh-heading); color: #0F172A; text-align: center; }
.podium__card--1 .podium__name { min-height: 50px; padding-top: 0; font-size: var(--fs-h4); font-weight: 800; line-height: var(--lh-heading); }
.medal { display: inline-flex; align-items: center; justify-content: center; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-full); font-size: var(--fs-small); font-weight: 800; line-height: 20px; color: #fff; box-shadow: var(--shadow-sm); }
.medal--gold { background: var(--gold); color: var(--text); }
.medal--silver { background: #CBD5E1; color: var(--text); }
.medal--bronze { background: var(--gold-strong); }
.podium__card--1 .medal { padding: var(--sp-2) var(--sp-5); font-size: var(--fs-ui); line-height: 24px; box-shadow: var(--shadow-sm); }

.champions { padding-bottom: var(--sp-9); }
.champions .events-filters { margin-top: var(--sp-8); }
.champions .events-select select { width: 204px; max-width: 100%; text-align: center; text-align-last: center; }
@media (max-width: 640px) { .champions .events-select select { width: 100%; } }
.leaderboard { display: grid; gap: var(--sp-4); max-width: 1196px; margin: var(--sp-8) auto 0; list-style: none; }
.leaderboard__row {
  display: flex; align-items: center; gap: var(--sp-5); min-height: 104px; padding: var(--sp-4) var(--sp-7);
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
}
.leaderboard__rank { min-width: 40px; font-size: var(--fs-h2-sm); font-weight: 700; line-height: var(--lh-heading); }
.leaderboard__photo { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: #F1F5F9; border: 2px solid var(--silver); color: var(--silver); box-shadow: var(--shadow-sm); }
.leaderboard__photo .icon { width: 24px; height: 24px; }
.leaderboard__photo img { width: 100%; height: 100%; object-fit: cover; }
.leaderboard__who { display: flex; flex-direction: column; gap: var(--sp-2); }
.leaderboard__name { font-size: var(--fs-h3); font-weight: 800; line-height: var(--lh-heading); }
.leaderboard__club { font-size: var(--fs-ui); font-weight: 800; line-height: 20px; color: var(--gold-strong); }
.leaderboard__tags { display: flex; align-items: center; gap: var(--sp-4); margin-inline-start: auto; }
.medal--row { padding: var(--sp-2) var(--sp-5); font-size: var(--fs-ui); line-height: 24px; box-shadow: none; }
.medal--row.medal--silver { background: #CACED3; color: var(--text); }
.leaderboard__title { padding: var(--sp-2) var(--sp-5); background: var(--selected-bg); border: 1px solid var(--gold-strong); border-radius: var(--r-full); font-size: var(--fs-ui); font-weight: 800; line-height: 24px; }

@media (max-width: 1440px) {
  .stories-hero { flex-direction: column; gap: var(--sp-7); min-height: 0; padding: var(--sp-7) var(--gutter); }
  .stories-hero__text { flex: none; align-self: auto; margin-top: 0; padding: 0; }
  /* the drawn photos reach 96 px past the collage's 690 px, so it takes 86 % of the width */
  .stories-hero__collage { flex: none; align-self: auto; width: min(690px, 86%); height: auto; aspect-ratio: 690 / 500; margin: var(--sp-6) 0 0; transform: translateX(-7%); }
  .champions-highlights { grid-template-columns: repeat(3, minmax(0, 1fr)); height: auto; padding: var(--sp-7) var(--gutter); column-gap: var(--sp-5); }
  .champions-highlight, .champions-highlight--large { width: auto; height: 420px; margin: 0; }
  .podium__list { gap: var(--sp-3); }
  .podium__card, .podium__card--1 { margin-inline: 0; }
  .leaderboard { margin-inline: var(--gutter); }
}
@media (max-width: 900px) {
  .stories-hero__headline { font-size: var(--fs-h2); line-height: 1.8; text-align: start; }
  .stories__title { font-size: var(--fs-h2); min-height: 0; padding: var(--sp-7) var(--gutter) var(--sp-5); }
  .stories__grid { column-gap: var(--sp-6); row-gap: var(--sp-7); padding-inline: var(--gutter); }
  .story-card__link, .story-card:nth-child(3n+2):not(:last-child) .story-card__link { width: 220px; min-height: 0; padding: 0; gap: var(--sp-4); border: 0; background: none; }
  .story-card__photo { width: 200px; height: 200px; }
  .story-card__name, .story-card:nth-child(3n+2):not(:last-child) .story-card__name { font-size: var(--fs-h4); }
  .story-card__role, .story-card:nth-child(3n+2):not(:last-child) .story-card__role { font-size: var(--fs-ui); margin: 0; }
  .story-dialog__head { height: 360px; }
  .story-dialog__name { top: 230px; font-size: var(--fs-h3); }
  .story-dialog__role { top: 290px; font-size: var(--fs-lead); }
  .story-dialog__nav { top: 140px; }
  .story-dialog__body { padding: var(--sp-5); font-size: var(--fs-lead); line-height: 1.9; min-height: 0; }
  .champions-highlights { grid-template-columns: 1fr; }
  .podium { height: auto; padding-bottom: var(--sp-7); }
  .podium__list { flex-direction: column; align-items: center; height: auto; gap: var(--sp-7); padding-top: var(--sp-8); }
  .podium__card--1 { order: -1; } /* stacked, the places read 1 – 2 – 3 (side by side they are drawn 2 – 1 – 3) */
  .leaderboard__row { flex-wrap: wrap; padding: var(--sp-4); }
  .leaderboard__tags { margin-inline-start: 0; flex-wrap: wrap; }
}

/* Phones: the first three as compact rows (rank, photo, name, medal), about 96 px each, in rank order (R-89) */
@media (max-width: 640px) {
  .podium .podium__list { flex-direction: column; align-items: stretch; height: auto; gap: var(--sp-3); padding: var(--sp-4) var(--gutter) 0; }
  .podium .podium__card { order: var(--rank); display: grid; grid-template-columns: 40px 64px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3);
    width: auto; height: auto; min-height: 0; margin: 0; padding: var(--sp-3) var(--sp-4); border-width: 2px; }
  .podium .podium__card--1 { --rank: 1; border-width: 3px; } .podium .podium__card--2 { --rank: 2; } .podium .podium__card--3 { --rank: 3; }
  .podium .podium__rank { position: static; width: 40px; height: 40px; font-size: var(--fs-ui); }
  .podium .podium__photo, .podium .podium__card--1 .podium__photo { width: 64px; height: 64px; }
  .podium .podium__name, .podium .podium__card--1 .podium__name { min-height: 0; padding: 0; font-size: var(--fs-body); text-align: start; }
  .podium .podium__card .medal { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-xs); }
}
