
/* ==========================================
   YALLA MEDITERRANEO
   STORIES PAGE — 3 × 3 GRID + PAGINATION
========================================== */


/* ==========================================
   01 / PAGE OPENING
========================================== */

.st-opening {
  position: relative;
  overflow: hidden;

  padding-block: 88px 32px;

  background: var(--off-white);
}

.st-opening::before {
  content: "";

  position: absolute;
  top: -190px;
  right: -135px;

  width: 400px;
  height: 400px;

  border: 65px solid var(--mist);
  border-radius: 50%;

  opacity: .7;
  pointer-events: none;
}

.st-opening-grid {
  position: relative;
  z-index: 1;

  display: grid;
  grid-template-columns: 1.3fr .7fr;

  align-items: end;
  gap: 65px;

  padding-bottom: 85px;
}

.st-opening h1 {
  max-width: 900px;
  margin-bottom: 0;

  color: var(--navy);

  font-size: clamp(3.2rem, 6.6vw, 7rem);
  font-weight: 900;

  line-height: 1.05;
  letter-spacing: -.075em;
}

.st-opening h1 span {
  display: block;
}

.st-opening-accent {
  color: var(--coral);
}

.st-opening-aside {
  padding-bottom: 8px;
}

.st-opening-aside > p {
  max-width: 460px;
  margin-bottom: 28px;

  font-size: 1.09rem;
  line-height: 1.85;
}

.st-opening-rule {
  height: 3px;

  background: linear-gradient(
    to right,
    var(--blue) 0 35%,
    var(--saffron) 35% 60%,
    var(--coral) 60% 83%,
    var(--teal) 83% 100%
  );
}


/* ==========================================
   02 / STORIES GRID SECTION
========================================== */

.st-stories-section {
  background: var(--off-white);
}

.st-results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  flex-wrap: wrap;
  gap: 16px;

  margin-bottom: 28px;
  padding-bottom: 20px;

  border-bottom: 1px solid var(--sand);
}

.st-results-bar > p {
  margin: 0;

  color: var(--navy);

  font-size: 1rem;
  font-weight: 850;
}

.st-completed-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;

  color: var(--blue);

  font-size: .73rem;
  font-weight: 850;
  letter-spacing: .09em;
}

.st-completed-dot {
  display: inline-block;

  width: 9px;
  height: 9px;

  border-radius: 50%;

  background: var(--teal);
}


/* ==========================================
   03 / EXACTLY THREE COLUMNS
========================================== */

.st-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  align-items: stretch;

  gap: 23px;
}


/* ==========================================
   04 / STORY CARD
========================================== */

.st-card {
  display: flex;
  flex-direction: column;

  min-width: 0;
  overflow: hidden;

  border: 1px solid var(--sand);
  border-radius: var(--radius);

  background: #fff;

  transition:
    transform .3s var(--ease),
    box-shadow .3s var(--ease);
}

.st-card:hover {
  transform: translateY(-7px);

  box-shadow:
    0 18px 34px rgba(21,43,85,.11);
}


/* ==========================================
   STORY IMAGE
========================================== */

.st-card-image {
  position: relative;
  display: block;

  width: 100%;
  aspect-ratio: 4 / 3;

  overflow: hidden;

  background: var(--blue);
  color: var(--off-white);

  isolation: isolate;
}

.st-card:nth-child(3n + 2) .st-card-image {
  background: var(--teal);
}

.st-card:nth-child(3n + 3) .st-card-image {
  background: var(--coral);
}

.st-card-image img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  transition: transform .45s var(--ease);
}

/* TRANSPARENT BRAND COLOR OVERLAY */

.st-card-image::after {
  content: "";

  position: absolute;
  z-index: 2;
  inset: 0;

  background: rgba(36,69,130,.37);

  opacity: 0;

  transition: opacity .35s;
  pointer-events: none;
}

.st-card:nth-child(3n + 2)
.st-card-image::after {
  background: rgba(43,154,154,.40);
}

.st-card:nth-child(3n + 3)
.st-card-image::after {
  background: rgba(201,104,79,.40);
}

.st-card:hover .st-card-image::after,
.st-card-image:focus-visible::after {
  opacity: 1;
}

.st-card:hover .st-card-image img {
  transform: scale(1.06);
}


/* PLACEHOLDER WHEN NO PHOTO IS PROVIDED */

.st-card-placeholder {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  overflow: hidden;
}

.st-card-placeholder::before {
  content: "";

  position: absolute;

  width: 82%;
  aspect-ratio: 1;

  border: 28px solid var(--saffron);
  border-radius: 50%;

  opacity: .5;

  transform: translate(30%, -20%);
}

.st-card-placeholder span {
  position: relative;

  font-size: clamp(5rem, 8vw, 8rem);
  font-weight: 900;

  line-height: 1;
  letter-spacing: -.12em;

  transform: rotate(-12deg);
}


/* CATEGORY PILL ON IMAGE */

.st-card-category {
  position: absolute;
  z-index: 3;

  inset-inline-start: 17px;
  bottom: 17px;

  max-width: calc(100% - 34px);

  padding: 7px 12px;

  border-radius: 100px;

  background: var(--navy);
  color: var(--off-white);

  font-size: .67rem;
  font-weight: 850;

  line-height: 1.4;
}


/* ==========================================
   STORY CONTENT
========================================== */

.st-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;

  padding: 25px;
}

.st-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 8px;

  margin-bottom: 16px;

  color: var(--coral);

  font-size: .75rem;
  font-weight: 850;
}

.st-card h3 {
  margin-bottom: 16px;

  color: var(--navy);

  font-size: clamp(1.45rem, 2vw, 1.95rem);
  font-weight: 850;

  line-height: 1.23;
  overflow-wrap: anywhere;
}

.st-card h3 a {
  transition: color .2s;
}

.st-card h3 a:hover {
  color: var(--coral);
}

.st-card-description {
  margin-bottom: 23px;

  color: var(--ink);

  font-size: .92rem;
  line-height: 1.8;
}

.st-card-location {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-top: auto;

  color: var(--blue);

  font-size: .82rem;
  font-weight: 750;
}

.st-card-location-icon {
  font-size: 1.15rem;
  line-height: 1;
}


/* ==========================================
   VIEW STORY DETAILS BUTTON
========================================== */

.st-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  min-height: 47px;
  margin-top: 24px;
  padding: 12px 17px;

  border-radius: 100px;

  background: var(--navy);
  color: var(--off-white);

  font-size: .83rem;
  font-weight: 850;

  transition:
    background .2s,
    transform .2s;
}

.st-card-button:hover {
  background: var(--coral);
}

.st-card-button span:last-child {
  font-size: 1rem;
}


/* ==========================================
   05 / PAGINATION
========================================== */

.st-pagination {
  display: flex;
  justify-content: center;

  margin-top: 55px;
  padding-top: 30px;

  border-top: 1px solid var(--sand);
}

.st-pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;

  flex-wrap: wrap;
  gap: 9px;

  direction: ltr;
}

.st-page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 46px;
  min-height: 46px;

  padding: 10px 14px;

  border: 1px solid var(--sand);
  border-radius: 12px;

  background: #fff;
  color: var(--navy);

  font-size: .89rem;
  font-weight: 850;

  cursor: pointer;

  transition:
    background .2s,
    color .2s,
    border-color .2s,
    transform .2s;
}

.st-page-button:hover:not(:disabled) {
  background: var(--sand);
  border-color: var(--blue-light);
  transform: translateY(-2px);
}

.st-page-button.is-current {
  border-color: var(--navy);

  background: var(--navy);
  color: var(--off-white);
}

.st-page-button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.st-page-arrow {
  min-width: 46px;
  padding-inline: 13px;
}

.st-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 27px;
  min-height: 46px;

  color: var(--blue);

  font-size: 1rem;
  font-weight: 850;
}


/* ==========================================
   06 / EMPTY STATE
========================================== */

.st-empty {
  position: relative;

  overflow: hidden;

  padding: 70px 35px;

  border: 1px solid var(--sand);
  border-radius: var(--radius);

  background: var(--sand);
  text-align: center;
}

.st-empty::before {
  content: "";

  position: absolute;
  top: -115px;
  right: -105px;

  width: 275px;
  height: 275px;

  border: 45px solid var(--mist);
  border-radius: 50%;

  pointer-events: none;
}

.st-empty-art {
  position: relative;

  margin-bottom: 15px;

  color: var(--coral);

  font-size: 5rem;
  line-height: 1;
}

.st-empty h3 {
  position: relative;

  max-width: 600px;

  margin: 0 auto 18px;

  color: var(--navy);

  font-size: clamp(1.85rem, 3vw, 2.75rem);
  font-weight: 850;
}

.st-empty p {
  position: relative;

  max-width: 540px;

  margin: 0 auto 30px;

  font-size: 1rem;
  line-height: 1.8;
}

.st-empty .btn {
  position: relative;
}


/* ==========================================
   07 / TABLET
========================================== */

@media (max-width: 1050px) {

  .st-opening-grid {
    gap: 40px;
  }

  .st-grid {
    gap: 17px;
  }

  .st-card-content {
    padding: 21px;
  }

}

@media (max-width: 900px) {

  .st-opening {
    padding-top: 65px;
  }

  .st-opening-grid {
    grid-template-columns: 1fr;

    gap: 27px;
    padding-bottom: 60px;
  }

  .st-opening h1 {
    max-width: 800px;

    font-size: clamp(3rem, 8vw, 5.8rem);
  }

  .st-opening-aside > p {
    max-width: 650px;
  }

  /* TWO COLUMNS ON TABLET */

  .st-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


/* ==========================================
   08 / MOBILE
========================================== */

@media (max-width: 650px) {

  .st-opening {
    padding-top: 48px;
    padding-bottom: 20px;
  }

  .st-opening-grid {
    gap: 24px;
    padding-bottom: 45px;
  }

  .st-opening h1 {
    font-size: clamp(2.8rem, 10.5vw, 4.4rem);
    letter-spacing: -.05em;
  }

  .st-opening-aside > p {
    font-size: 1rem;
  }

  .st-results-bar {
    align-items: flex-start;
    flex-direction: column;

    gap: 9px;
  }

  /* ONE COLUMN ON MOBILE */

  .st-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .st-card-image {
    aspect-ratio: 4 / 3;
  }

  .st-card-content {
    padding: 25px;
  }

  .st-card h3 {
    font-size: 1.8rem;
  }

  .st-pagination {
    margin-top: 38px;
  }

  .st-pagination-controls {
    gap: 6px;
  }

  .st-page-button {
    min-width: 40px;
    min-height: 42px;

    padding: 9px;
  }

  .st-page-arrow {
    min-width: 42px;
  }

  .st-empty {
    padding: 48px 23px;
  }

}


/* ==========================================
   09 / RTL — ARABIC
========================================== */

html[dir="rtl"] .st-opening h1,
html[dir="rtl"] .st-card h3 {
  letter-spacing: 0;
  line-height: 1.3;
}

html[dir="rtl"] .st-completed-label {
  letter-spacing: 0;
}

html[dir="rtl"] .st-card-placeholder {
  direction: ltr;
}

html[dir="rtl"] .st-card-content {
  text-align: right;
}

html[dir="rtl"] .st-card-location {
  direction: rtl;
}

html[dir="rtl"] .st-pagination-controls {
  direction: ltr;
}


/* ==========================================
   10 / REDUCED MOTION
========================================== */

@media (prefers-reduced-motion: reduce) {

  .st-card,
  .st-card-image img,
  .st-page-button {
    transition: none;
  }

  .st-card:hover {
    transform: none;
  }

}
