/* Imaginary Art: styles for the long-form pages built by _tools/imaginaryart-build-pages.mjs.
   Uses the colours and fonts from shared.css. Keep this file in step with the template. */

/* ── Hero ── */
.lp-hero { position: relative; padding: calc(var(--nav-h) + 72px) 10vw 72px; border-bottom: 1px solid var(--border-soft); overflow: hidden; }
.lp-hero-inner { position: relative; z-index: 3; max-width: 1300px; margin: 0 auto; }
.lp-hero .hero-bg-img { opacity: .55; }
.lp-crumbs { font-size: .78rem; color: var(--text-faint); margin-bottom: 22px; }
.lp-crumbs a { color: var(--text-muted); text-decoration: none; }
.lp-crumbs a:hover { color: var(--accent); }
.lp-crumbs span { margin: 0 8px; }
.lp-tag { display: inline-flex; align-items: center; gap: 10px; font-size: .74rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin-bottom: 24px; }
.lp-tag::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); flex: none; transform: translateY(-1px); }
.lp-hero h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; color: #fff; line-height: 1.1; letter-spacing: -1.2px; margin-bottom: 22px; max-width: 900px; text-wrap: balance; }
.lp-hero h1 em { font-style: normal; color: var(--accent); }
.lp-hero .lead { font-size: 1.08rem; color: var(--text-muted); max-width: 620px; line-height: 1.75; margin-bottom: 34px; }
.lp-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ── Long-form layout: contents on the side, text in a readable column ── */
.lp-body { padding: 72px 10vw; }
.lp-wrap { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; align-items: start; }
.lp-toc { position: sticky; top: calc(var(--nav-h) + 24px); border-left: 1px solid var(--border-soft); padding-left: 20px; }
.lp-toc h2 { font-family: var(--font-display); font-size: .75rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }
.lp-toc ol { list-style: none; display: grid; gap: 10px; }
.lp-toc a { font-size: .86rem; color: var(--text-muted); text-decoration: none; line-height: 1.45; display: block; }
.lp-toc a:hover { color: var(--accent); }

.prose { max-width: 68ch; min-width: 0; color: var(--text-main); }
.prose section { scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose section + section { margin-top: 64px; }
.prose h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.15rem); font-weight: 800; color: #fff; line-height: 1.2; letter-spacing: -.6px; margin-bottom: 20px; text-wrap: balance; }
.prose h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: #fff; margin: 32px 0 10px; }
.prose p { font-size: 1rem; line-height: 1.8; color: var(--text-muted); margin-bottom: 18px; }
.prose p strong { color: var(--text-main); font-weight: 600; }
.prose ul { margin: 0 0 20px 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.prose ul li { position: relative; padding-left: 22px; font-size: 1rem; line-height: 1.7; color: var(--text-muted); }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 2px; background: var(--accent); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* A still with a caption, as a break in long text */
.lp-figure { margin: 32px 0; }
.lp-figure img { width: 100%; height: auto; display: block; border-radius: var(--radius-md); border: 1px solid var(--border-soft); aspect-ratio: 16 / 9; object-fit: cover; }
.lp-figure figcaption { font-size: .82rem; color: var(--text-faint); margin-top: 10px; line-height: 1.5; }

/* Simple table */
.lp-table-wrap { overflow-x: auto; margin: 24px 0 8px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); }
.lp-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 480px; }
.lp-table th, .lp-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: top; line-height: 1.55; }
.lp-table th { font-family: var(--font-display); font-weight: 700; color: #fff; background: var(--bg-card); font-size: .82rem; letter-spacing: .5px; }
.lp-table td { color: var(--text-muted); }
.lp-table tr:last-child td { border-bottom: 0; }

/* ── Film grid (uses .pgrid / .pcard from shared.css) ── */
.lp-films { padding: 72px 10vw; background: var(--bg-card); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.lp-films-inner { max-width: 1300px; margin: 0 auto; }
.lp-films .lp-films-head { margin-bottom: 32px; max-width: 68ch; }
.lp-films .lp-films-head p { color: var(--text-muted); line-height: 1.7; margin-top: 10px; }
.lp-films .pthumb { background-size: cover; background-position: center; }
.lp-films .pcard .pdesc { font-size: .78rem; color: var(--text-muted); line-height: 1.45; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-films .pcard .mini-play { opacity: 1; transform: translate(-50%, -50%) scale(.85); }

/* ── FAQ ── */
.lp-faq details { border-bottom: 1px solid var(--border-soft); padding: 18px 0; }
.lp-faq details:first-of-type { border-top: 1px solid var(--border-soft); }
.lp-faq summary { cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 1.02rem; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; line-height: 1.4; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; flex: none; }
.lp-faq details[open] summary::after { content: "\2212"; }
.lp-faq details p { margin: 12px 0 0; }
.lp-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* ── Portfolio filter buttons ── */
.lp-filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
.lp-filter button { font: 600 .85rem var(--font-body, inherit); color: var(--text-muted); background: transparent; border: 1px solid var(--border-soft); border-radius: 50px; padding: 10px 18px; min-height: 44px; cursor: pointer; transition: color .25s, border-color .25s, background .25s; }
.lp-filter button span { color: var(--text-faint); font-weight: 500; margin-left: 4px; }
.lp-filter button:hover { color: #fff; border-color: var(--border); }
.lp-filter button[aria-pressed="true"] { color: var(--accent); background: var(--accent-dim); border-color: var(--border); }
.lp-filter button[aria-pressed="true"] span { color: var(--accent); }
.lp-filter button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── Portfolio page numbers (16 films per page) ── */
.lp-pager { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 40px; }
.lp-pager[hidden] { display: none; }
.lp-pager-count { margin: 0; font-size: .85rem; color: var(--text-faint); }
.lp-pager-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lp-pager button { font: 600 .9rem var(--font-body, inherit); color: var(--text-muted); background: transparent; border: 1px solid var(--border-soft); border-radius: 50%; width: 44px; height: 44px; cursor: pointer; transition: color .25s, border-color .25s, background .25s; }
.lp-pager button:hover:not(:disabled) { color: #fff; border-color: var(--border); }
.lp-pager button[aria-current="page"] { color: var(--accent); background: var(--accent-dim); border-color: var(--border); }
.lp-pager button:disabled { opacity: .3; cursor: default; }
.lp-pager button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pcard[hidden] { display: none !important; }

/* ── Keep watching: picture cards to related pages ── */
.lp-next { padding: 72px 10vw 88px; border-top: 1px solid var(--border-soft); }
.lp-next-inner { max-width: 1300px; margin: 0 auto; }
.lp-next-head { margin-bottom: 32px; }
.lp-next-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.lp-next-card { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-md); overflow: hidden; text-decoration: none; transition: border-color .3s, transform .3s; }
.lp-next-img { aspect-ratio: 16 / 10; background-size: cover; background-position: center; transition: transform .6s ease; }
.lp-next-text { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; flex: 1; position: relative; }
.lp-next-kind { font-size: .7rem; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
.lp-next-card strong { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; color: #fff; line-height: 1.3; }
.lp-next-line { font-size: .88rem; color: var(--text-muted); line-height: 1.55; }
.lp-next-go { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--text-main); }
.lp-next-go svg { transition: transform .3s; }
.lp-next-card:hover, .lp-next-card:focus-visible { border-color: var(--border); transform: translateY(-3px); }
.lp-next-card:hover .lp-next-img { transform: scale(1.05); }
.lp-next-card:hover .lp-next-go, .lp-next-card:focus-visible .lp-next-go { color: var(--accent); }
.lp-next-card:hover .lp-next-go svg { transform: translateX(4px); }
.lp-next-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lp-next-card { isolation: isolate; }
.lp-next-card .lp-next-img { will-change: transform; }
@media (prefers-reduced-motion: reduce) { .lp-next-card, .lp-next-img, .lp-next-go svg { transition: none; } }

.lp-cta { padding: 0 10vw 88px; }
.lp-cta .ctablock { max-width: 1300px; margin: 0 auto; }

/* ── Phones and tablets ── */
@media (max-width: 1024px) {
  .lp-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .lp-wrap > div[aria-hidden="true"] { display: none; }
  .lp-toc { position: static; border-left: 0; padding: 20px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-md); }
  .lp-toc ol { grid-template-columns: 1fr 1fr; gap: 10px 20px; }
}
@media (max-width: 768px) {
  .lp-hero { padding: calc(var(--nav-h) + 40px) 5vw 52px; }
  .lp-hero .lead { font-size: 1rem; }
  .lp-body, .lp-films { padding: 52px 5vw; }
  .lp-cta { padding: 0 5vw 64px; }
  .lp-toc ol { grid-template-columns: 1fr; }
  .prose section + section { margin-top: 48px; }
  .lp-actions a { flex: 1 1 100%; text-align: center; }
  .lp-next { padding: 52px 5vw 64px; }
  .lp-next-grid { grid-template-columns: 1fr; gap: 14px; }
  .lp-next-card { flex-direction: row; }
  .lp-next-img { aspect-ratio: auto; width: 38%; flex: none; min-height: 132px; }
  .lp-next-text { padding: 16px 18px; gap: 6px; }
  .lp-next-card strong { font-size: 1.02rem; }
  .lp-filter { flex-wrap: nowrap; overflow-x: auto; margin: 0 -5vw 24px; padding: 0 5vw 4px; scrollbar-width: none; }
  .lp-filter::-webkit-scrollbar { display: none; }
  .lp-filter button { flex: none; }
  /* Portfolio (has filter buttons): 2-column grid on phones instead of a long sideways carousel */
  .lp-filter + .pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; overflow: visible; scroll-snap-type: none; padding-bottom: 0; margin-bottom: 0; }
  .lp-filter + .pgrid .pcard { flex: none; aspect-ratio: 4 / 3; }
  .lp-filter + .pgrid .poverlay { padding: 10px; }
  .lp-filter + .pgrid .ptitle { font-size: .8rem; line-height: 1.25; }
  .lp-filter + .pgrid .pcat { font-size: .6rem; }
  .lp-filter + .pgrid .mini-play { transform: translate(-50%, -50%) scale(.6); }
}

/* ── Legal pages (Privacy Policy, Terms of Use) ── */
.lp-hero-plain { padding-bottom: 56px; background: radial-gradient(ellipse at 20% 0%, rgba(68, 200, 245, .08), transparent 60%); }
.lp-updated { font-size: .82rem; color: var(--text-faint); margin: -14px 0 0; }
.lp-legal h3 { margin-top: 26px; }
.lp-legal .lp-lang { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--border-soft); }
.lp-legal address { font-style: normal; color: var(--text-muted); line-height: 1.8; margin-bottom: 18px; }

/* ── Visual check fixes (28 Nov 2026, docs/VISUAL_CHECK_2026-11-27.md) ── */
/* "Keep watching": 4 cards in one row on desktop, 2 x 2 on tablets (no lone card on a second row) */
@media (min-width: 1100px) { .lp-next-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 769px) and (max-width: 1099px) { .lp-next-grid { grid-template-columns: repeat(2, 1fr); } }
/* No single word left alone on the last line of a heading */
.lp-hero h1, .prose h2, .prose h3, .lp-films h2, .lp-next h2, .ctablock h2, .lp-faq summary, .ptitle, .lp-next-card strong { text-wrap: balance; }
.prose p, .lp-films-head p, .lp-next-line { text-wrap: pretty; }
/* Button text centred when the buttons stretch full width on phones */
.lp-actions a { justify-content: center; text-align: center; }
@media (max-width: 768px) {
  /* Tables become stacked cards on phones: column name above each value, nothing cut off */
  .lp-table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .lp-table { min-width: 0; }
  .lp-table thead { display: none; }
  .lp-table, .lp-table tbody, .lp-table tr, .lp-table td { display: block; width: 100%; }
  .lp-table tr { border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--bg-card); padding: 8px 0; margin-bottom: 12px; }
  .lp-table tr:last-child { margin-bottom: 0; }
  .lp-table td, .lp-table tr:last-child td { border-bottom: 0; padding: 7px 18px; }
  .lp-table td[data-label]::before { content: attr(data-label); display: block; font-size: .66rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 3px; }
  .lp-table td:first-child { color: #fff; font-weight: 600; }
  /* Small play button in the corner, so it never sits on the card text */
  .lp-films .pcard .mini-play { top: 10px; right: 10px; left: auto; transform: scale(.6); transform-origin: top right; }
  .lp-films .pcard:hover .mini-play { transform: scale(.7); }
}
