/* ════════════════════════════════════════════════════════════════
   Fourka — showcase page (نمونه‌کارها).

   Loaded only on that page, after front.css, and built out of the
   landing's own pieces (.hero.page-hero, .eyebrow, .lead, .section,
   .section-mist, .btn) so it matches the site by construction.

   Mobile first — roughly 90% of visitors are on a phone. Every
   project is the same record in the same order; the only thing that
   varies is the frame around the screenshot, which follows the kind
   of project (phone for an app, browser for a website).

   RTL: inline-start is the right edge. No letter-spacing on Persian.
   ════════════════════════════════════════════════════════════════ */

/* ── Intro additions ─────────────────────────────────────────────── */
.pf-facts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0;
  margin: 16px 0 0; font-size: .9rem; color: var(--ink-soft);
}
.pf-facts span + span::before { content: "·"; margin-inline: 12px; color: var(--sky); }
.pf-empty { text-align: center; margin-inline: auto; }

/* Tighter than the landing's section rhythm: the list is the content here. */
.pf-section { padding: 22px 0 48px; }
.page-hero + .pf-section { padding-top: 22px; }

.pf-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* ── Index — a table of contents ─────────────────────────────────── */
.pf-index {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px 4px;
}
.pf-index-title {
  display: flex; align-items: center; gap: 9px; margin: 0 0 4px;
  font-family: var(--font-display); font-weight: 800; font-size: .98rem;
}
.pf-index-title span {
  font-size: .76rem; font-weight: 700; color: var(--blue-dark);
  background: var(--mist); border: 1px solid var(--line);
  padding: 1px 9px; border-radius: 999px;
}
.pf-index ol { list-style: none; margin: 0; padding: 0; }
.pf-index li + li { border-block-start: 1px solid var(--line); }
.pf-index a {
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 7px 0;
  color: var(--ink); text-decoration: none;
}
.pf-index a b, .pf-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mist); border: 1px solid var(--line);
  color: var(--blue-dark); font-size: .78rem; font-weight: 700;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
/* Name over kind, not beside it: side by side, a long name and a long kind fight
   for one row and the name ends up broken across four lines. Stacked, each row
   is two calm lines whatever the words are. */
.pf-index-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pf-index-name { font-size: .92rem; font-weight: 700; line-height: 1.45; }
.pf-index-kind { font-size: .73rem; color: var(--ink-soft); line-height: 1.4; }
.pf-index a:hover .pf-index-name,
.pf-index a.is-current .pf-index-name { color: var(--blue-dark); }
.pf-index a.is-current b { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ── Project card — the repeated record ──────────────────────────── */
.pf-list { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pf-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 16px 18px;
  box-shadow: 0 2px 12px rgba(20, 98, 132, .05);
}
.pf-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.pf-kind {
  font-size: .8rem; font-weight: 700; color: var(--blue-dark);
  background: var(--mist); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
}

/* Browser frame: a website-shaped project. */
.pf-browser {
  border-radius: 14px; overflow: hidden; background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(13, 43, 58, .12);
}
.pf-browser-bar {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  background: var(--mist); border-block-end: 1px solid var(--line);
  direction: ltr; /* browser chrome is the same shape everywhere */
}
.pf-browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--sky); }
.pf-browser-url {
  margin-left: 10px; height: 20px; line-height: 18px; min-width: 40%;
  max-width: 260px; padding: 0 12px;
  border-radius: 10px; background: var(--white); border: 1px solid var(--line);
  font-size: .7rem; color: var(--ink-soft); text-align: center;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
/* A website screenshot is a top-anchored page: if the upload is taller than
   16:10 the bottom is trimmed, which is the part that matters least. The sides
   are never cut. */
.pf-browser img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 16 / 10; object-fit: cover; object-position: top;
}

/* Phone frame: an app. Ink-coloured bezel so it belongs to the palette. */
.pf-phone {
  width: min(100%, 236px); margin: 0 auto; padding: 9px;
  border-radius: 38px; background: var(--ink);
  box-shadow: 0 18px 44px rgba(13, 43, 58, .24);
}
.pf-phone-screen {
  position: relative; overflow: hidden; border-radius: 30px;
  background: var(--white); aspect-ratio: 9 / 19;
}
.pf-phone-screen::before {
  content: ""; position: absolute; z-index: 1;
  top: 8px; left: 50%; transform: translateX(-50%);
  width: 78px; height: 21px; border-radius: 11px; background: var(--ink);
}
.pf-phone img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top;
}

.pf-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.22rem; line-height: 1.45; margin: 16px 0 4px;
}
.pf-for { margin: 0 0 14px; font-size: .9rem; color: var(--ink-soft); }
.pf-result {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 14px; padding: 12px 14px; border-radius: 14px;
  background: var(--mist); border: 1px solid var(--line);
  font-size: .97rem; line-height: 1.7; color: var(--ink);
}
.pf-result svg { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--blue); }
.pf-result b { color: var(--blue-dark); }
.pf-desc { margin: 0 0 14px; font-size: .95rem; line-height: 1.9; color: var(--ink-soft); }
.pf-link { display: flex; justify-content: center; width: 100%; min-height: 48px; }

/* ── Closing invitation ──────────────────────────────────────────── */
.pf-cta { text-align: center; padding: 52px 0 68px; }
.pf-cta p {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.25rem, 5vw, 1.9rem); line-height: 1.5; margin: 0 0 20px;
}

/* ── Desktop ─────────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .pf-section { padding: 36px 0 76px; }
  .page-hero + .pf-section { padding-top: 36px; }
  .pf-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; }
  .pf-index { position: sticky; inset-block-start: 96px; }
  body.admin-bar .pf-index { inset-block-start: 128px; }
  .pf-list { max-width: 740px; gap: 24px; }
  .pf-card { padding: 22px 22px 24px; }
  .pf-title { font-size: 1.42rem; }
  .pf-link { display: inline-flex; width: auto; }

  /* A phone frame is tall and narrow; on a wide card it sits beside the text
     instead of leaving a column of white either side of it. */
  .pf-card.is-app {
    display: grid; grid-template-columns: 236px minmax(0, 1fr);
    grid-template-areas: "head head" "frame body"; column-gap: 28px;
  }
  .pf-card.is-app .pf-head { grid-area: head; }
  .pf-card.is-app .pf-frame { grid-area: frame; margin: 0; }
  .pf-card.is-app .pf-body { grid-area: body; }
  .pf-card.is-app .pf-title { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-index a b, .pf-num { transition: none; }
}

/* ── Card actions: project page first, live link second ─────────────── */
.pf-actions { display: flex; flex-direction: column; gap: 10px; }
.pf-actions .pf-link { margin: 0; }
@media (min-width: 900px) { .pf-actions { flex-direction: row; flex-wrap: wrap; } }

/* ── Closing note — the page shows a selection, and says so ─────────── */
.pf-note {
  max-width: 52ch; margin: 0 auto 22px;
  font-size: 1rem; line-height: 1.9; color: var(--ink-soft);
}


/* ── Centred intro ─────────────────────────────────────────────────── */
.pf-hero .container { text-align: center; }
.pf-hero .eyebrow { justify-content: center; }
.pf-hero .lead { margin-inline: auto; }
.pf-hero .pf-facts { justify-content: center; }
.pf-note { text-align: center; }

/* Landing on a card from the mosaic or the index: a brief ring so the eye
   finds it. scroll-margin keeps it clear of the sticky nav. */
.pf-card { scroll-margin-top: 96px; }
.pf-card:target { box-shadow: 0 0 0 3px var(--sky), 0 2px 12px rgba(20, 98, 132, .05); }

/* ── Mosaic under the intro ─────────────────────────────────────────
   A few featured projects as a masonry of images. Columns, not a grid, so
   the tiles keep their own proportions — a phone capture stands tall next to
   a wide browser shot, which is what gives it the Pinterest rhythm. Every
   tile is an anchor to its project's card. */
.pf-mosaic-wrap { padding: 4px 0 26px; }
.pf-mosaic { columns: 2; column-gap: 10px; }
.pf-tile {
  display: block; position: relative; overflow: hidden;
  break-inside: avoid; margin: 0 0 10px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--mist);
  box-shadow: 0 2px 10px rgba(13, 43, 58, .06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.pf-tile img { display: block; width: 100%; height: auto; object-fit: cover; object-position: top; }
/* Vary the wide shots so the wall is not a grid of identical rectangles. */
.pf-tile:nth-child(3n+2) img { aspect-ratio: 4 / 5; }
.pf-tile:nth-child(4n+1) img { aspect-ratio: 1 / 1; }
.pf-tile-cap {
  position: absolute; inset-inline: 0; inset-block-end: 0;
  padding: 26px 12px 10px; color: #fff; text-align: start;
  background: linear-gradient(180deg, rgba(13, 43, 58, 0), rgba(13, 43, 58, .82));
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.pf-tile-cap b { font-size: .88rem; line-height: 1.45; }
.pf-tile-cap small { font-size: .72rem; opacity: .85; }
.pf-tile:hover, .pf-tile:focus-visible { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(13, 43, 58, .16); }
.pf-tile:hover .pf-tile-cap, .pf-tile:focus-visible .pf-tile-cap { opacity: 1; transform: none; }
/* No pointer to hover with: the name is simply always there. */
@media (hover: none) { .pf-tile-cap { opacity: 1; transform: none; } }
@media (min-width: 700px)  { .pf-mosaic { columns: 3; column-gap: 12px; } .pf-tile { margin-bottom: 12px; } }
@media (min-width: 1000px) { .pf-mosaic { columns: 4; column-gap: 14px; } .pf-tile { margin-bottom: 14px; } .pf-mosaic-wrap { padding-bottom: 34px; } }

/* ── Slides: several images in one frame, cross-faded ───────────────
   The container keeps the frame's proportion; every image sits on top of
   the first, invisible until it is the current one. With JavaScript off the
   first image simply shows. */
.pf-slides { position: relative; overflow: hidden; }
.pf-browser .pf-slides { aspect-ratio: 16 / 10; }
.pf-phone-screen .pf-slides { position: absolute; inset: 0; }
.pf-slides img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  opacity: 0; transition: opacity .9s ease;
}
.pf-slides img.is-on { opacity: 1; }
/* Single-image frames keep their original rules. */
.pf-browser > img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

.pf-slider-ctl { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0 0; }
.pf-slider-dots { display: flex; align-items: center; gap: 2px; }
.pf-slider-dot {
  width: 30px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pf-slider-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sky); transition: transform .2s ease, background .2s ease; }
.pf-slider-dot.is-on::before { background: var(--blue); transform: scale(1.5); }
.pf-slider-btn {
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; flex: none;
  border: 1px solid var(--line); background: var(--white); color: var(--blue-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.pf-slider-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--mist); }
.pf-slider-btn:focus-visible, .pf-slider-dot:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .pf-slides img { transition: none; }
  .pf-tile, .pf-tile-cap, .pf-slider-dot::before { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════
   Project page — /p/<slug>. A case file, not an article.
   ══════════════════════════════════════════════════════════════════ */
.pp-band { background: var(--mist); border-block-end: 1px solid var(--line); padding: 26px 0 26px; }
.pp-back {
  display: flex; width: max-content; align-items: center; gap: 8px; min-height: 44px;
  color: var(--blue-dark); text-decoration: none; font-weight: 700; font-size: .92rem; margin: 0 0 6px;
}
.pp-back:hover { color: var(--blue); }
.pp-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(1.7rem, 6.4vw, 2.8rem); line-height: 1.3; margin: 0 0 12px;
}
.pp-lead { font-size: 1.05rem; line-height: 1.9; color: var(--ink-soft); margin: 0 0 18px; max-width: 60ch; }

/* The spec strip: small labelled facts, the result given the most room. Flex,
   not a grid, so however many facts a project has they share the row evenly and
   never leave one stranded beside a gap. */
.pp-specs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.pp-spec {
  flex: 1 1 28%; background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; min-width: 0;
}
.pp-spec dt { font-size: .74rem; font-weight: 700; color: var(--ink-soft); margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.pp-spec dt svg { width: 16px; height: 16px; color: var(--blue); }
.pp-spec dd { margin: 0; font-weight: 700; font-size: .95rem; line-height: 1.55; overflow-wrap: anywhere; }
.pp-spec.is-result { flex-basis: 100%; border-color: var(--sky); }
.pp-spec.is-result dd { color: var(--blue-dark); font-family: var(--font-display); font-size: 1.08rem; }

.pp-media { padding: 22px 0 6px; }
.pf-slider { max-width: 900px; margin: 0 auto; }
.pf-slider.is-app { max-width: 300px; }
.pp-frame { margin: 0; }

.pp-body { padding: 22px 0 36px; }
.pp-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.pp-content { margin: 0; }
.pp-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: 0 2px 12px rgba(20, 98, 132, .05);
  display: flex; flex-direction: column; gap: 14px;
}
.pp-card .pf-result { margin: 0; }
.pp-live { display: flex; justify-content: center; min-height: 48px; }
.pp-card-cta { border-block-start: 1px solid var(--line); padding-block-start: 14px; }
.pp-card-cta h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; margin: 0 0 4px; }
.pp-card-cta p { color: var(--ink-soft); font-size: .92rem; margin: 0 0 12px; }
.pp-card-cta .btn { display: flex; justify-content: center; min-height: 48px; }

.pp-more { padding: 48px 0 60px; }
.pp-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.pp-mini {
  display: flex; gap: 14px; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; text-decoration: none; color: var(--ink);
  transition: border-color .2s ease, transform .2s ease;
}
.pp-mini:hover { border-color: var(--sky); transform: translateY(-2px); }
.pp-mini-shot { flex: none; width: 96px; border-radius: 10px; overflow: hidden; background: var(--mist); border: 1px solid var(--line); }
.pp-mini-shot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.pp-mini-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pp-mini-kind { font-size: .74rem; color: var(--blue-dark); font-weight: 700; }
.pp-mini-title { font-weight: 700; font-size: .95rem; line-height: 1.5; }


@media (min-width: 900px) {
  .pp-band { padding: 48px 0 36px; }
  .pp-spec.is-result { flex: 2 1 36%; }
  .pp-media { padding: 34px 0 10px; }
  .pp-body { padding: 30px 0 56px; }
  .pp-cols { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
  .pp-side { position: sticky; inset-block-start: 96px; }
  body.admin-bar .pp-side { inset-block-start: 128px; }
  .pp-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .pp-mini { flex-direction: column; align-items: stretch; padding: 12px 12px 14px; }
  .pp-mini-shot { width: auto; }
}
