/* ==========================================================================
   Coming soon page: a full-bleed picture of a man walking into the desert,
   al-Mutanabbi's verse written into the sky above him, and the date and the
   links to the blog set around him like a poster. Loaded after home.css and
   reuses its header.
   ========================================================================== */

.soon {
  position: relative;
  display: flex;
  flex-direction: column;
  min-block-size: 100svh;
  overflow-x: clip;
  background: #efe9df;           /* the sand's own colour, shown while it loads */
}

/* --- Background ----------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Overhangs the viewport so the parallax never shows an edge. */
.backdrop__photo {
  position: absolute;
  inset: -5%;
  inline-size: 110%;
  block-size: 110%;
  max-inline-size: none;
  object-fit: cover;
  /* On very wide screens the frame is cropped top and bottom: keep the
     calligraphy in. */
  object-position: 50% 30%;
}

/* A light veil at the top for the header and a warmer one at the foot,
   where the text sits on the sand. */
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgb(244 240 233 / 0.55) 0%,
    rgb(244 240 233 / 0) 18%,
    rgb(244 240 233 / 0) 62%,
    rgb(244 240 233 / 0.55) 100%);
}

.soon .site-header,
.soon__main,
.soon__footer {
  position: relative;
  z-index: 1;
}

/* --- Layout -----------------------------------------------------------------
   A poster. The picture carries the calligraphy and the walker, so the text
   keeps clear of both. Wide screens: two blocks at the foot of the frame,
   either side of the man (the date at the start, the intro and the links to
   the blog at the end). Phones (tall frame): everything stacks in the sky,
   the date, the verse, then the intro and links, with the walker below. */

.soon__main {
  flex: 1;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  grid-template-areas:
    "when"
    "verse"
    "more"
    ".";
  padding-block: var(--space-2) var(--space-4);
}

/* --- The verse, written into the sky ----------------------------------------
   Real text, so every letter and haraka is exact (an image model can't
   promise that). Warm umber, a touch translucent, like ink on haze. */

.verse {
  grid-area: verse;
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  margin: 0;
  padding-block: var(--space-5) 0;
  text-align: center;
  pointer-events: none;
}

.verse__lines {
  margin: 0;
  font-family: var(--font-naskh);
  font-size: min(clamp(1.6rem, 0.8rem + 3.8vw, 5rem), 7.5svh);
  line-height: 2;                /* room for the harakat above and below */
  color: rgb(118 84 58 / 0.88);
}

.verse__line {
  white-space: nowrap;
}

.verse__poet {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: rgb(118 84 58 / 0.9);
}

.verse__poet::before {
  content: "— ";
}

.soon__when {
  grid-area: when;
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  text-align: center;
}

.soon__more {
  grid-area: more;
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  text-align: center;
}

.soon__kicker {
  display: none;
  font-size: var(--text-2xs);
  letter-spacing: 0.24em;
  color: var(--muted);
}

.soon__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 0.35em;
  font-family: var(--font-naskh);
  font-size: clamp(2.25rem, 1.6rem + 3vw, 2.75rem);
  font-weight: var(--weight-regular);
  line-height: 1.2;
}

/* The date in the naskh with Arabic digits, in tomato: the one loud thing. */
.soon__date {
  font-family: var(--font-naskh);
  color: var(--tomato);
}

.soon__time {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.soon__lede {
  max-inline-size: 22rem;
  font-size: var(--text-sm);
  line-height: 1.8;
  text-wrap: balance;
}

@media (orientation: landscape) and (min-width: 48em) {
  .soon__main {
    grid-template-columns: minmax(0, 1fr) clamp(10rem, 22vw, 22rem) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "verse verse verse"
      ".     .     .    "
      "when  .     more";
    align-items: end;
    padding-block-end: var(--space-6);
  }

  .soon__when,
  .soon__more {
    justify-items: start;
    text-align: start;
  }

  .soon__kicker {
    display: block;
    margin-block-end: var(--space-2);
  }

  .soon__title {
    display: grid;
    justify-content: start;
    font-size: min(clamp(3rem, 1.6rem + 3.6vw, 5.25rem), 10svh);
    line-height: 1.1;
  }

  .soon__lede {
    max-inline-size: 26rem;
    font-size: var(--text-base);
    text-wrap: pretty;
  }
}

/* --- The latest article, as the headline --------------------------------- */

.soon__new {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.25em 0.9em;
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 0.65);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--tomato);
}

.soon__new-dot {
  inline-size: 0.55em;
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
}

.soon__title--article {
  max-inline-size: 18ch;
  font-size: clamp(2rem, 1.5rem + 2vw, 2.6rem);
  line-height: 1.35;
  text-wrap: balance;
}

.soon__title--article a {
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .soon__title--article a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.25em;
  }
}

@media (orientation: landscape) and (min-width: 48em) {
  .soon__title--article {
    max-inline-size: 14ch;
    font-size: min(clamp(2.6rem, 1.6rem + 2.4vw, 4rem), 8svh);
  }
}

/* --- Links to the blog ---------------------------------------------------- */

.soon__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3) var(--space-5);
}

.soon__all {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap);
  font-weight: var(--weight-bold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.soon__latest {
  max-inline-size: 26rem;
  font-size: var(--text-xs);
  color: var(--muted);
}

.soon__latest a {
  color: var(--ink);
}

@media (orientation: landscape) and (min-width: 48em) {
  .soon__links {
    justify-content: start;
  }
}

.soon__footer {
  padding-block: var(--space-3) max(var(--space-4), env(safe-area-inset-bottom));
  font-size: var(--text-2xs);
  color: var(--muted);
  text-align: center;
}



/* Phones: the text stacks in the sky, so the picture reaches a little below
   the fold to walk the man lower, clear of it. The verse tightens to leave
   room for the intro and the links under it. */
@media (orientation: portrait) {
  .backdrop__photo {
    inset-block: -2% auto;
    block-size: 120%;
    object-position: 50% 0;
  }

  .verse {
    padding-block-start: var(--space-3);
    gap: var(--space-1);
  }

  .verse__lines {
    font-size: min(clamp(1.5rem, 0.8rem + 3.6vw, 2.25rem), 5.2svh);
    line-height: 2;
  }

  .soon__more {
    gap: var(--space-3);
    padding-block-start: var(--space-4);
  }

  .soon__lede {
    max-inline-size: 21rem;
    font-size: var(--text-xs);
    line-height: 1.75;
  }

  .soon__links .pill {
    min-block-size: var(--tap);
    padding-inline: 1.3em;
    font-size: var(--text-sm);
  }
}

/* Phones: the article title is the headline; keep it compact. */
@media (orientation: portrait) {
  .soon__title--article {
    font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2rem);
    line-height: 1.3;
  }
}

/* Short phones: tighter still, so the button sits above the walker. */
@media (orientation: portrait) and (max-height: 760px) {
  .soon__title--article {
    font-size: 1.5rem;
  }

  .verse__lines {
    font-size: min(1.45rem, 4.4svh);
  }

  .verse__poet {
    display: none;
  }

  .soon__more {
    padding-block-start: var(--space-2);
  }
}

/* Short phones (and Instagram's in-app browser): the «أوّل مقال» line goes;
   the button already leads there. */
@media (orientation: portrait) and (max-height: 760px) {
  .soon__latest {
    display: none;
  }
}

/* --- Motion -----------------------------------------------------------------
   Once per session the picture settles from a slow zoom. `scale` and
   `opacity` only: parallax.js owns its `translate`. Text never moves. */

@keyframes backdrop-settle {
  from {
    opacity: 0;
    scale: 1.1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html:not(.intro-seen) .backdrop__photo {
    animation: backdrop-settle 1600ms var(--ease-out) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.intro-seen) .backdrop__photo {
    animation: hero-fade-in var(--dur-fade) ease both;
  }
}
