/* Shared styles for the static pages (work / project / about / contact). */

/* Body on inner pages — no fixed-position scroll-trap, normal page flow. */
.page-static {
  display: block;
  min-height: 100vh;
  background: var(--bg);
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px var(--pad) 140px;
}

.page-title {
  font-family: 'Edict Display', Georgia, 'Times New Roman', serif;
  font-weight: 300;
  font-size: clamp(44px, 6vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 24px 0 16px;
}
.page-title em { font-style: italic; }
.page-lede {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--muted);
  max-width: 720px;
  margin: 0 0 56px;
}

/* The Work grid */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 56px 40px;
}
.work-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.work-card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #f4f4f4;
  margin-bottom: 18px;
  box-shadow:
    0 1px 2px rgba(15, 17, 22, 0.04),
    0 12px 36px rgba(15, 17, 22, 0.06);
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
.work-card-img img,
.work-card-img video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.work-card:hover .work-card-img {
  transform: translateY(-3px);
  box-shadow:
    0 1px 2px rgba(15, 17, 22, 0.05),
    0 20px 56px rgba(15, 17, 22, 0.10);
}
.work-card:hover .work-card-img img,
.work-card:hover .work-card-img video {
  transform: scale(1.04);
}
.work-card-title {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 95%;
}

.work-error {
  font-family: 'Inter', sans-serif;
  color: var(--muted);
  font-size: 14px;
}

/* Topbar — active link state for inner pages */
.topnav a.active { color: var(--ink); }

/* ─── Project detail template ─────────────────────────────────
   This is the SINGLE template used by every /project/<slug> page.
   Edit here → all 13 projects update. */

.project-back {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 64px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  padding-left: 18px;
  transition: color 200ms ease;
}
.project-back::before {
  content: '←';
  position: absolute;
  left: 0;
  transition: transform 200ms ease;
}
.project-back:hover { color: var(--ink); }
.project-back:hover::before { transform: translateX(-4px); }

/* Project hero — title + intro body, generous breathing room */
.project-hero {
  max-width: 1000px;
  margin: 0 auto 96px;
  text-align: center;
}
.project-title {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: clamp(40px, 6vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.028em;
  color: var(--ink);
  margin: 0 0 32px;
  font-style: italic;
}
.project-body {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto;
}
.project-body p { margin: 0 0 18px; }
.project-body p:last-child { margin-bottom: 0; }
.project-body strong, .project-body b { color: var(--ink); font-weight: 500; }

/* Sidebar metadata under the project title — role / visit / year etc. */
.project-side {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 36px;
  max-width: 800px;
  margin: 0 auto 32px;
  padding: 0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.project-side-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.project-side dt { font-weight: 500; color: var(--muted); }
.project-side dd { margin: 0; color: var(--ink); font-weight: 400; }
.project-side a { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; }
.project-side a:hover { color: var(--ink); }

/* Hero looping reel — appears above the body blocks when meta.video exists. */
.project-hero-video {
  margin: 0 auto 80px;
  max-width: 1240px;
  border-radius: 16px;
  overflow: hidden;
  background: #f4f4f4;
  box-shadow:
    0 1px 2px rgba(15, 17, 22, 0.04),
    0 16px 48px rgba(15, 17, 22, 0.08);
}
.project-hero-video video {
  width: 100%; height: auto; display: block;
}

/* The content body — text, images, videos, and embeds rendered in
   document order (matching the original joonasvirtanen.com page). */
.project-blocks {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.project-block { margin: 0; }

.project-block--paragraph,
.project-block--heading {
  max-width: 720px;
  align-self: center;
  text-align: center;
}
.project-block--paragraph {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.project-block--paragraph strong { color: var(--ink); font-weight: 500; }

.project-block--heading {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.project-block--h3 { font-size: clamp(32px, 4vw, 56px); line-height: 1.05; margin-top: 16px; }
.project-block--h4 { font-size: clamp(24px, 2.6vw, 36px); line-height: 1.1; }
.project-block--h5,
.project-block--h6 {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.project-block--image,
.project-block--video,
.project-block--embed {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #f4f4f4;
  box-shadow:
    0 1px 2px rgba(15, 17, 22, 0.04),
    0 16px 48px rgba(15, 17, 22, 0.08);
}
.project-block--image img,
.project-block--video video {
  width: 100%; height: auto; display: block;
}

/* Embeds keep aspect ratio with a CSS variable so the iframe fills the
   frame without an "infinite tall" iframe issue. */
.project-embed-frame {
  position: relative;
  width: 100%;
}
.project-embed-frame--16x9 { aspect-ratio: 16 / 9; }
.project-embed-frame--1x1  { aspect-ratio: 1 / 1;  }
.project-embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Next/prev navigation at the bottom */
.project-nav {
  margin-top: 120px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.project-nav-side { min-width: 0; }
.project-nav-side.end { text-align: right; }
.project-nav-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms ease;
}
.project-nav-link:hover { color: var(--ink); }
.project-nav-mid {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 200ms ease;
}
.project-nav-mid:hover { color: var(--ink); }

@media (max-width: 700px) {
  .project-hero { margin-bottom: 56px; }
  .project-blocks { gap: 40px; }
  .project-hero-video { margin-bottom: 56px; }
  .project-nav { margin-top: 72px; grid-template-columns: 1fr; text-align: center; gap: 14px; }
  .project-nav-side.end { text-align: center; }
  .project-side { font-size: 11px; gap: 6px 20px; }
}

/* ─── About / contact static pages ─────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}
.about-photo {
  border-radius: 16px;
  width: 100%;
  height: auto;
  display: block;
  box-shadow: var(--shadow);
}
.about-text {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.about-text p { margin: 0 0 20px; }
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--ink); font-weight: 500; }

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}
.contact-list a {
  display: inline-block;
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: clamp(28px, 3.6vw, 52px);
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  font-style: italic;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: currentColor;
  transition: text-decoration-color 280ms ease;
}
.contact-list a:hover {
  text-decoration-color: transparent;
}

@media (max-width: 800px) {
  .page { padding: 36px var(--pad) 80px; }
  .work-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
}
