/*
Theme Name:  Modular Card Portfolio
Theme URI:   https://ryannickell.com
Description: Full-screen hero with editable headline and footer, card-based portfolio feed.
Version:     1.0.0
Author:      Ryan Nickell
Text Domain: mcp
*/

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:  #ffec00;
  --dark:    #0d0d0d;
  --light:   #f5f5f5;
  --font:    'Inter', 'Helvetica Neue', Arial, sans-serif;
}

html, body {
  font-family: var(--font);
  min-height: 100vh;
}

/* Home page starts yellow; JS transitions to #f0efed on scroll */
body.home,
body.front-page {
  background: #ffec00;
  color: var(--dark);
}

body.single-portfolio {
  background: var(--light);
  color: var(--dark);
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; height: auto; }

/* ── HEADLINE LETTER ANIMATION ── */
@keyframes letter-rise {
  from {
    transform: translateY(110%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.hero-headline .word {
  display: inline-block;
  overflow: hidden;        /* the horizon line — letters clip at the baseline */
  vertical-align: bottom;
  padding-bottom: 0.05em; /* prevents descender clipping */
}

.hero-headline .letter {
  display: inline-block;
  opacity: 0;
  animation: letter-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* space between words */
.hero-headline .word-space {
  display: inline-block;
  width: 0.35em;
}

/* ── HERO PAGE ── */
.hero-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: transparent; /* body bg color shows through and gets animated */
  color: var(--dark);
}

/* ── GLOBAL NAV (all pages except home) ── */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem clamp(1.25rem, 5vw, 5rem);
}

.site-nav-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

/* Hide global nav on the front page — the hero has its own header */
.home .site-nav,
.front-page .site-nav {
  display: none;
}

/* ── SITE HEADER (hero page internal header) ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2.5rem;
  position: relative;
  z-index: 10;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── HERO HEADLINE ── */
.hero-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
}

.hero-headline {
  font-size: clamp(2.4rem, 9.6vw, 8.8rem);
  font-weight: 900;
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  text-align: center;
  word-break: break-word;
}

/* ── HERO FOOTER ── */
.hero-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  padding: 1.5rem 2.5rem 2rem;
  gap: 1rem;
}

.hero-footer-left   { text-align: left; }
.hero-footer-center { text-align: center; }
.hero-footer-right  { text-align: right; }

.hero-footer span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ── PORTFOLIO FEED (inner pages / future use) ── */
.site-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}


/* ==============================================
   PORTFOLIO FEED (home page)
============================================== */

.pf-feed {
  background: transparent; /* inherits animated body bg */
  padding: 2rem clamp(0.75rem, 2.5vw, 2rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pf-feed-row {
  display: flex;
  gap: 1rem;
}

.pf-feed-row--pair .pf-card { flex: 1; }
.pf-feed-row--pair .pf-card-inner { aspect-ratio: 4 / 5; }
.pf-feed-row--full .pf-card { flex: 1; }
.pf-feed-row--full .pf-card-inner { aspect-ratio: 16 / 7; }

.pf-card {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: #ddd;
}

.pf-card-inner {
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}

.pf-card-img {
  position: absolute;
  inset: -22% 0;
  background-size: cover;
  background-position: center;
  will-change: transform;
  font-size: 1.5rem;
}

.pf-card-img--empty { background: #bbb; }

/* Darken overlay — fades in/out on hover */
.pf-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.4s ease;
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}
.pf-card:hover::after {
  background: rgba(0,0,0,0.15);
}

/* Zoom + parallax handled entirely by JS so transforms compose correctly */

.pf-card-client {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 3;
}

@media (max-width: 600px) {
  .pf-feed-row--pair { flex-direction: column; }
  .pf-feed-row--full .pf-card-inner { aspect-ratio: 4 / 3; }
}

/* ═══════════════════════════════════════════════
   PORTFOLIO SINGLE PAGE
═══════════════════════════════════════════════ */

.pf-single {
  background: var(--light);
  color: var(--dark);
  min-height: 100vh;
  padding: 3rem clamp(1.25rem, 5vw, 5rem) 6rem;
  overflow: visible;
}

/* Client label above headline */
.pf-topbar {
  margin-bottom: 0.5rem;
}
.pf-client-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* Big headline */
.pf-headline {
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

/* 70 / 30 split */
.pf-meta-row {
  display: grid;
  grid-template-columns: 70% 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

/* Body copy */
.pf-body {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #222;
}
.pf-body p { margin-bottom: 1em; }

/* Sidebar */
.pf-sidebar {
  padding-top: 0.15rem;
}
.pf-sidebar-block {
  margin-bottom: 1.4rem;
}
.pf-sidebar-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.pf-sidebar p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #333;
}

/* ── Gutenberg content area ── */
.pf-content {
  margin-top: 3rem;
  border-top: 1px solid rgba(0,0,0,0.1);
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  overflow: visible;
}

/* Block spacing — use margin-bottom on every direct child so nothing collapses */
.pf-content > * {
  margin-top: 0;
  margin-bottom: 1.5rem;
}
.pf-content > *:last-child {
  margin-bottom: 0;
}

/* Paragraphs & headings */
.pf-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #222;
}
.pf-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pf-content h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.75rem; }
.pf-content h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }

/* Images & figures */
.pf-content img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}
.pf-content figure {
  margin: 0;
}
.pf-content figcaption {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.4rem;
  letter-spacing: 0.03em;
}

/* Standalone image blocks — full width */
.pf-content > .wp-block-image,
.pf-content > figure {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 1.5rem !important;
}
.pf-content > .wp-block-image img,
.pf-content > figure img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
}

/* Images inside columns/gallery — fill their cell, not the whole page */
.pf-content .wp-block-column figure,
.pf-content .wp-block-column .wp-block-image,
.pf-content .wp-block-gallery figure,
.pf-content .wp-block-gallery .wp-block-image {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}
.pf-content .wp-block-column img,
.pf-content .wp-block-gallery img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
}
.pf-content .wp-block-image.alignfull img,
.pf-content .wp-block-image.alignwide img {
  border-radius: 0;
}

/* Gutenberg layout classes — provide flex/grid since we dequeued wp-block-library-theme */
.pf-content .is-layout-flex {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 1.25rem !important;
  align-items: flex-start;
}
.pf-content .is-layout-grid {
  display: grid !important;
  gap: 1.25rem !important;
}

/* Columns block */
.pf-content .wp-block-columns {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 1.25rem !important;
  margin-bottom: 1.5rem !important;
  align-items: flex-start;
}
.pf-content .wp-block-column {
  flex: 1 1 0 !important;
  min-width: 0;
  margin: 0 !important;
}

@media (max-width: 600px) {
  .pf-content .wp-block-columns {
    flex-wrap: wrap !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }
  .pf-content .wp-block-column {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* Spacing between blocks stacked inside a column */
.pf-content .wp-block-column > * {
  margin-top: 0 !important;
  margin-bottom: 1.25rem !important;
}
.pf-content .wp-block-column > *:last-child {
  margin-bottom: 0 !important;
}

/* Spacing between sibling figures/images stacked in the same column */
.pf-content .wp-block-column figure + figure,
.pf-content .wp-block-column .wp-block-image + .wp-block-image {
  margin-top: 1.25rem !important;
}

/* Gallery block */
.pf-content .wp-block-gallery {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 1.25rem !important;
  margin-bottom: 1.5rem !important;
  align-items: flex-start;
}
.pf-content .wp-block-gallery .wp-block-image,
.pf-content .wp-block-gallery figure {
  flex: 1 1 200px;
  margin: 0 !important;
}
.pf-content .wp-block-gallery img {
  width: 100% !important;
  height: auto !important;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .pf-content .wp-block-gallery {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Responsive */
@media (max-width: 640px) {
  .pf-meta-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pf-headline {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .pf-gallery-pair .pf-gallery-item img {
    aspect-ratio: 1 / 1;
  }
}

/* ═══════════════════════════════════════════
   CONTACT CARD
═══════════════════════════════════════════ */

.ct-wrap {
  background: transparent;
  padding: 1rem clamp(0.75rem, 2.5vw, 2rem) 2rem;
}

.ct-card {
  background: #e8e6e1;
  border-radius: 20px;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

/* Availability dot + label */
.ct-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #333;
}

.ct-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
}

/* Headline */
.ct-headline {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--dark);
  margin: 0;
}

/* Links row */
.ct-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.ct-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.ct-link:hover {
  opacity: 0.5;
}

@media (max-width: 480px) {
  .ct-card { padding: 3rem 1.25rem; }
  .ct-links { gap: 0.5rem 1.25rem; }
}

.ct-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem clamp(1.25rem, 5vw, 5rem);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark);
  opacity: 0.6;
}

.ct-footer-bar a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 480px) {
  .ct-footer-bar {
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════
   MORE WORK SECTION (single portfolio)
═══════════════════════════════════════════ */

.more-work {
  background: var(--light);
  padding-bottom: 4rem;
  overflow: hidden;
  clear: both;
  position: relative;
}

/* ── Marquee ── */
.mw-marquee {
  overflow: hidden;
  padding: 3rem 0 2rem;
  border-top: 1px solid rgba(0,0,0,0.08);
}

@keyframes mw-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.mw-track {
  display: flex;
  width: max-content;
  animation: mw-scroll 36s linear infinite;
}

.mw-word {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0;
  line-height: 1;
}

.mw-dark { color: var(--dark); }
.mw-grey { color: #c8c8c8; }

/* ── Cards ── */
.mw-cards {
  display: flex;
  gap: 1rem;
  padding: 0 clamp(1.25rem, 5vw, 5rem);
}

.mw-card {
  flex: 1;
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: #ddd;
}

.mw-card-inner {
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 4 / 5;
  position: relative;
}

.mw-card-img {
  position: absolute;
  inset: -22% 0;
  background-size: cover;
  background-position: center;
  will-change: transform;
}

.mw-card-img--empty { background: #bbb; }

.mw-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.4s ease;
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

.mw-card:hover::after {
  background: rgba(0,0,0,0.15);
}

.mw-card-client {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 3;
}

@media (max-width: 600px) {
  .mw-cards { flex-direction: column; }
}
