/* ===========================================================================
   Portfolio — the full portfolio, category pages, item pages, case studies,
   the credit list, and the portfolio editors in the admin. Tokens from
   flayr.css only; no borders.
   ======================================================================== */

/* ------------------------------------------------------------ general ---- */
.pf-hero { padding-bottom: clamp(32px, 5vw, 56px); }
.pf-hero a.eyebrow { display: inline-block; }
.pf-hero-body { margin: 20px auto 0; color: var(--muted); }
.pf-prose { max-width: 760px; }
.pf-prose p { color: var(--text); }
.pf-prose h3 { font-size: var(--fs-4); margin-top: 1.4em; }
.pf-prose h3:first-child { margin-top: 0; }
.pf-section-title { font-size: var(--fs-3); margin-bottom: 20px; }

/* --------------------------------------------------------------- grid ---- */
.pf-grid { display: grid; gap: 32px 18px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.pf-grid.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .pf-grid.is-three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pf-grid.is-three { grid-template-columns: minmax(0, 1fr); } }

.pf-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; min-width: 0; }
.pf-card:hover { text-decoration: none; }
.pf-card[hidden] { display: none; }
.pf-card .media { border-radius: var(--r-lg); margin-bottom: 14px; background: var(--surface-2); }
.pf-card .media img { transition: transform .6s var(--ease); }
.pf-card:hover .media img { transform: scale(1.03); }
.pf-card-blank { display: grid; place-items: center; width: 100%; height: 100%; padding: 20px; text-align: center; background: var(--mint-soft); color: var(--teal-ink); font-weight: 600; letter-spacing: -0.02em; }
.pf-card-play { position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--ink); opacity: 0; transform: scale(.9); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.pf-card-play .icon { width: 14px; height: 14px; fill: currentColor; stroke: none; margin-left: 2px; }
.pf-card:hover .pf-card-play, .pf-card:focus-visible .pf-card-play { opacity: 1; transform: none; }
.pf-card-cat { font-size: var(--fs-2xs); color: var(--teal-ink); font-weight: 500; margin-bottom: 3px; }
.pf-card-title { font-size: var(--fs-body); font-weight: 600; margin: 0 0 4px; letter-spacing: -0.015em; line-height: 1.3; }
.pf-card-text { font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; }
.section-white .pf-card .media { background: var(--surface-2); }

/* ------------------------------------------------------ full portfolio --- */
.pf-ways-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pf-way { display: flex; flex-direction: column; }
.pf-way p { flex: 1; margin-bottom: 14px; }
.pf-way .card-title { font-size: 19px; }
@media (max-width: 1100px) { .pf-ways-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pf-ways-grid { grid-template-columns: minmax(0, 1fr); } }

.pf-toolbar { position: sticky; top: 60px; z-index: 20; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; margin-bottom: 28px; background: var(--bg); }
.pf-filter { max-width: 100%; }
.pf-search { flex: 0 1 300px; min-width: 200px; }
.pf-search input { background: var(--surface); }
.pf-tag-note { margin: -12px 0 24px; }
.pf-more { display: flex; justify-content: center; margin-top: 40px; }
@media (max-width: 760px) { .pf-toolbar { top: 52px; } .pf-search { flex: 1 1 100%; } }

/* Case study cards */
.pf-cs-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.pf-cs-grid.is-large { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .pf-cs-grid.is-large { grid-template-columns: minmax(0, 1fr); } }
.pf-cs-card { display: flex; flex-direction: column; }
.pf-cs-card p { flex: 1; margin-bottom: 14px; }
.pf-cs-card .pf-card-cat { margin-bottom: 4px; }
.pf-cs-card-sub { display: block; color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------- films ---- */
.pf-film { margin: 0; min-width: 0; }
.reel-frame { position: relative; border-radius: var(--r-xl); overflow: hidden; background: var(--ink); }
button.reel { width: 100%; padding: 0; border: 0; margin: 0; font: inherit; text-align: left; cursor: pointer; }
.reel:focus-visible { outline: none; box-shadow: inset var(--ring); }
.reel-blank { display: block; aspect-ratio: 16 / 9; background: var(--navy); }
.reel-frame .embed { border-radius: 0; }
.pf-film.is-vertical .reel img, .pf-film.is-vertical .reel-blank, .pf-film.is-vertical .embed { aspect-ratio: 9 / 16; }
.pf-film.is-vertical .reel-frame { border-radius: var(--r-lg); }
.pf-film-caption { margin-top: 10px; color: var(--muted); font-size: var(--fs-sm); text-align: center; }
.pf-films { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pf-films > .pf-film:only-child { grid-column: 1 / -1; }
.pf-films-vertical { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .pf-films-vertical { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pf-films, .pf-films-vertical { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pf-films { grid-template-columns: minmax(0, 1fr); } }
.pf-films-vertical .reel-play { width: 48px; height: 48px; margin: -24px 0 0 -24px; }

/* --------------------------------------------------------- item page ---- */
.pf-item-hero .lead { margin-top: 14px; }
.pf-item-cats a { color: inherit; }
.pf-item-media .pf-film:not(.is-vertical) { max-width: 1400px; margin: 0 auto; }
.pf-item-media .pf-film.is-vertical { max-width: 380px; margin: 0 auto; }
.pf-facts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); margin: 0; }
.pf-fact { background: var(--surface); border-radius: var(--r-lg); padding: 20px 22px; }
.pf-fact dt { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 6px; }
.pf-fact dd { margin: 0; font-size: var(--fs-body); font-weight: 600; color: var(--ink); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.pf-fact dd span { display: block; font-weight: 400; font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.pf-item-story { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.pf-item-story > :only-child { grid-column: 1 / -1; max-width: 760px; }
@media (max-width: 860px) { .pf-item-story { grid-template-columns: minmax(0, 1fr); } }
.pf-story { font-size: var(--fs-lead); line-height: 1.5; color: var(--text); }
.pf-story p { margin-bottom: .9em; }
.pf-story h2 { font-size: var(--fs-4); }
.pf-credits-box .kv { grid-template-columns: minmax(90px, max-content) 1fr; }
.pf-gallery { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pf-gallery figure { margin: 0; }
.pf-gallery figure:only-child, .pf-gallery figure:nth-child(odd):last-child { grid-column: 1 / -1; }
.pf-gallery .media { aspect-ratio: 16 / 9; border-radius: var(--r-xl); }
.pf-gallery figcaption, .pf-figure figcaption { font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; text-align: center; }
.pf-figure { margin: 0; }
@media (max-width: 640px) { .pf-gallery { grid-template-columns: minmax(0, 1fr); } }
.pf-cs-callout { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--mint-soft); border-radius: var(--r-xl); padding: clamp(22px, 3vw, 32px); }
.pf-cs-callout > .icon { color: var(--teal-deep); }
.pf-cs-callout .grow p { margin: 2px 0 0; color: var(--text); font-size: var(--fs-sm); }
.pf-tags { padding-top: 8px; }
.pf-tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pf-tag-list .pill { font-size: var(--fs-xs); padding: 5px 12px; color: var(--text); }
.pf-tag-list .pill:hover { background: var(--surface-3); text-decoration: none; }
.pf-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 32px; padding-bottom: clamp(48px, 7vw, 80px); }
.pf-pager a { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; background: var(--surface); border-radius: var(--r-lg); color: var(--ink); text-decoration: none; transition: transform .25s var(--ease); min-width: 0; }
.pf-pager a:hover { transform: translateY(-2px); text-decoration: none; }
.pf-pager span { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--muted); }
.pf-pager strong { font-weight: 600; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-pager-next { text-align: right; align-items: flex-end; grid-column: 2; }

/* ------------------------------------------------------ case studies ---- */
.pf-cs-sub { display: block; color: var(--muted); }
.pf-cs-hero .lead { max-width: 820px; }
.pf-cs-summary { max-width: 760px; margin: 14px auto 0; color: var(--muted); }
.pf-block-head { margin-bottom: clamp(24px, 3vw, 36px); max-width: 820px; }
.pf-block-head.is-centred { text-align: center; margin-left: auto; margin-right: auto; }
.pf-block-head h2 { margin-bottom: 0; }
.pf-block-intro { margin: -12px 0 28px; }
.pf-parts .feature p, .pf-steps .feature p { font-size: var(--fs-body); color: var(--text); margin: 0 0 .8em; }
.pf-parts .feature p:last-child, .pf-steps .feature p:last-child { margin-bottom: 0; }
.pf-steps { list-style: none; margin: 0; padding: 0; }
.pf-steps .feature p { font-size: var(--fs-sm); color: var(--muted); }
.pf-figures .figure { display: flex; flex-direction: column; gap: 6px; padding: 32px 22px; background: var(--surface-2); }
.pf-figures .figure strong { margin-bottom: 4px; }
.pf-figure-label { color: var(--ink) !important; font-weight: 500; font-size: var(--fs-sm); }
.pf-figure-note { color: var(--muted); font-size: var(--fs-xs) !important; }
.pf-stats-body { margin: clamp(32px, 4vw, 48px) auto 0; }
.pf-quote-eyebrow { text-align: center; margin-bottom: 18px; }
.pf-quote { margin: 0; text-align: center; }
.pf-quote blockquote { margin: 0; }
.pf-quote blockquote p { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.35; color: var(--ink); font-weight: 500; letter-spacing: -0.02em; }
.pf-quote blockquote p:first-child::before { content: '“'; }
.pf-quote blockquote p:last-child::after { content: '”'; }
.pf-quote figcaption { margin-top: 8px; color: var(--muted); font-size: var(--fs-sm); }

/* --------------------------------------------------------- category ---- */
.pf-category-section + .pf-category-section { padding-top: 0; }
.pf-chips { list-style: none; margin: 18px 0 0; padding: 0; }
.pf-chips .chip:hover { background: var(--surface-3); text-decoration: none; }

/* ------------------------------------------------------- credit list ---- */
.pf-credits-note { max-width: 680px; margin: 16px auto 0; color: var(--muted); font-size: var(--fs-sm); }
.pf-credit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pf-credit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(20px, 4vw, 48px); }
.pf-credit-head h2 { margin-bottom: 10px; }
.pf-credit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.pf-credit-meta .pill { white-space: normal; }
.pf-credit-body p { color: var(--text); }
.pf-credit-details { margin: 18px 0 16px; padding: 16px 18px; background: var(--surface-2); border-radius: var(--r); font-size: var(--fs-xs); }
@media (max-width: 760px) { .pf-credit { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------------------- CTA ---- */
.pf-cta h2 { font-size: var(--fs-2); }

/* =========================================================== admin ==== */
.pf-admin-toolbar .select { width: auto; }
.sort-list { list-style: none; margin: 0; padding: 0; }
.sort-list > li { display: flex; align-items: center; gap: 14px; padding: 10px 22px; background: var(--surface); }
.sort-list > li + li { box-shadow: inset 0 1px 0 var(--hairline); }
.sort-list > li.is-dragging { opacity: .45; }
.sort-list > li[hidden] { display: none; }
.sort-handle { cursor: grab; color: var(--faint); display: grid; place-items: center; width: 24px; flex: none; }
.sort-handle:hover { color: var(--ink); }
.sort-thumb { width: 96px; flex: none; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.sort-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sort-arrows { display: flex; flex-direction: column; gap: 2px; }
.sort-arrows .btn { width: 26px; min-height: 22px; padding: 0; }
.sort-arrows .icon { width: 14px; height: 14px; }
.pf-row-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pf-row-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.pf-row-actions .switch { font-size: var(--fs-xs); }
.pf-star { color: var(--faint); }
.pf-star.is-on { color: var(--warn); }
.pf-star.is-on .icon { fill: currentColor; }
.slug-field { display: flex; align-items: center; gap: 6px; }
.slug-field span { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.cover-preview { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); font-size: var(--fs-xs); }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.video-preview { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); font-size: var(--fs-xs); text-align: center; padding: 0; }
.video-preview iframe, .video-preview video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gallery-edit > li { align-items: flex-start; padding: 14px 0; background: none; }
.gallery-edit .sort-thumb { width: 140px; }
.gallery-edit .fields { display: grid; gap: 8px; flex: 1; min-width: 0; }
.pf-checks { display: grid; gap: 8px 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.pf-checks-head { font-size: var(--fs-2xs); font-weight: 600; color: var(--faint); margin: 12px 0 6px; grid-column: 1 / -1; }
.pf-film-rows > li { align-items: flex-start; padding: 12px 0; background: none; }
.pf-film-rows .fields { display: grid; gap: 8px; flex: 1; min-width: 0; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pf-film-rows .sort-thumb { width: 110px; }

/* Block editor */
.pf-blocks { display: flex; flex-direction: column; gap: 12px; }
.pf-block-edit { background: var(--surface); border-radius: var(--r-lg); }
.pf-block-edit-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 12px; }
.pf-block-edit-head .grow { min-width: 0; }
.pf-block-edit-head strong { font-size: var(--fs-sm); color: var(--ink); font-weight: 600; }
.pf-block-edit-head .xsmall { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-block-edit-head > .icon { color: var(--teal-deep); }
.pf-block-edit-body { padding: 4px 18px 18px; display: grid; gap: 14px; }
.pf-block-edit.is-collapsed .pf-block-edit-body { display: none; }
.pf-block-edit.is-dragging { opacity: .45; }
.pf-list-edit { display: grid; gap: 8px; }
.pf-list-row { display: grid; gap: 8px; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; padding: 10px; background: var(--surface-2); border-radius: var(--r); }
.pf-list-row .form-grid { gap: 8px; }
.pf-list-row .input, .pf-list-row .textarea, .pf-list-row .select { background: var(--surface); }
.pf-list-row .textarea { min-height: 80px; }
.pf-image-field { display: flex; gap: 10px; align-items: center; }
.pf-image-field .sort-thumb { width: 88px; }
.pf-image-field .input { flex: 1; }
.pf-add-block { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-up { transform: rotate(180deg); }
.pf-block-toggle { justify-content: space-between; gap: 10px; min-width: 0; padding: 6px 10px; border-radius: var(--r-sm); white-space: normal; }
.pf-block-toggle > .grow { display: flex; flex-direction: column; text-align: left; min-width: 0; }
.pf-block-edit-head > .btn-icon { flex: none; }
.pf-items-mini { max-height: 420px; overflow-y: auto; }
.pf-credit-edit { padding: 0; min-height: 0; justify-content: flex-start; white-space: normal; text-align: left; background: none; }
.pf-credit-edit:hover { background: none; text-decoration: underline; }
