/* ============================================================
   MAE FILMS — theme styles
   Colours and fonts are set in theme.json (Appearance > Editor >
   Styles). The names below point at those presets.
   ============================================================ */
:root {
  --paper: var(--wp--preset--color--paper, #F4EEE1);
  --oat: var(--wp--preset--color--oat, #E9E1CF);
  --ink: var(--wp--preset--color--ink, #2B2A24);
  --sage: var(--wp--preset--color--sage, #8A9A7B);
  --sage-deep: var(--wp--preset--color--sage-deep, #5E6E52);
  --sage-dark: var(--wp--preset--color--sage-dark, #4A5840);
  --ochre: var(--wp--preset--color--ochre, #C58B2A);
  --ochre-soft: var(--wp--preset--color--ochre-soft, #DDB566);
  --ochre-deep: var(--wp--preset--color--ochre-deep, #85590F);
  --clay: var(--wp--preset--color--clay, #B5694A);
  --clay-deep: var(--wp--preset--color--clay-deep, #8F4A30);
  --umber: var(--wp--preset--color--umber, #6B5A45);
  --rule: rgba(43, 42, 36, .22);
  --rule-light: rgba(244, 238, 225, .3);

  --serif: var(--wp--preset--font-family--serif, "Cormorant Garamond", Georgia, serif);
  --body: var(--wp--preset--font-family--body, "Lora", Georgia, serif);
  --mono: var(--wp--preset--font-family--mono, "Courier Prime", "Courier New", monospace);

  --radius: 2px;
  --header-h: 4.5rem;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
html.is-locked { overflow: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, iframe { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ochre-deep); outline-offset: 4px; border-radius: var(--radius); }
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--ochre-soft); }
::selection { background: var(--ochre-soft); color: var(--ink); }

.container { width: min(100% - 2.5rem, 76rem); margin-inline: auto; }
.section { padding-block: clamp(4.5rem, 10vw, 9rem); }
.section--oat { background: var(--oat); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.icon { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.with-icon { display: inline-flex; align-items: center; gap: .5rem; }

.skip-link.screen-reader-text:focus {
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: .8125rem;
}

/* typewriter "credit line" */
.mono {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.6;
}
:root .eyebrow { display: flex; align-items: center; gap: 1rem; color: var(--umber); margin-bottom: 1.25rem; }
.eyebrow::before { content: ""; width: 2.5rem; height: 1px; background: currentColor; flex: none; }
.display {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.012em;
  font-size: clamp(2.375rem, 5.4vw, 4.25rem);
  text-wrap: balance;
}
.display em { font-style: italic; }
.lead { font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); color: var(--umber); max-width: 38rem; }

/* ---------- Buttons (theme .btn and the core Button block) ---------- */
.btn,
.wp-block-button .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .75rem 1.5rem;
  font-family: var(--mono); font-size: .875rem; font-weight: 700; line-height: 1.4;
  letter-spacing: .02em; text-transform: none; text-decoration: none;
  border: 1px solid transparent; border-radius: var(--radius);
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.btn:active, .wp-block-button .wp-block-button__link:active { transform: scale(.98); }
.btn--primary,
.wp-block-button:not(.is-style-ghost) .wp-block-button__link { background: var(--ochre); color: var(--ink); }
.btn--primary:hover,
.wp-block-button:not(.is-style-ghost) .wp-block-button__link:hover { background: var(--ochre-soft); color: var(--ink); }
.btn--ghost,
.wp-block-button.is-style-ghost .wp-block-button__link { border-color: currentColor; background: transparent; color: inherit; }
.btn--ghost:hover,
.wp-block-button.is-style-ghost .wp-block-button__link:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn:disabled { opacity: .6; cursor: progress; }

/* Links typed into paragraphs and lists */
.text-link,
main :where(p, li, dd) a:not(.wp-element-button):not(.scroll-link) {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .28em;
  text-decoration-color: var(--ochre);
  transition: text-decoration-color .18s var(--ease), color .18s var(--ease);
}
.text-link:hover,
main :where(p, li, dd) a:not(.wp-element-button):not(.scroll-link):hover { color: var(--ochre-deep); text-decoration-color: currentColor; }
.on-dark .text-link,
.on-dark :where(p, li, dd) a:not(.wp-element-button) { text-decoration-color: var(--ochre-soft); }
.on-dark .text-link:hover,
.on-dark :where(p, li, dd) a:not(.wp-element-button):hover { color: var(--ochre-soft); }

/* sprocket-hole strip, used as a divider (Separator block, "Film sprockets" style) */
.sprockets,
.wp-block-separator.is-style-sprockets {
  height: 8px; opacity: .2; border: 0; margin: 0; width: auto; max-width: none;
  background: repeating-linear-gradient(90deg, var(--ink) 0 12px, transparent 12px 28px);
}

/* ---------- Scroll reveals (only when JS is running, never in the editor) ---------- */
.js body:not(.block-editor-iframe__body) .reveal {
  opacity: 0; transform: translateY(.5rem);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  transition-delay: calc(var(--i, 0) * 50ms);
}
.js body:not(.block-editor-iframe__body) .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  color: var(--paper);
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.site-header.is-scrolled, .site-header.is-open, body:not(.home) .site-header {
  background: rgba(244, 238, 225, .84);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--ink);
  border-bottom-color: var(--rule);
}
.site-header.is-open { background: var(--paper); }
.site-header:not(.is-scrolled):not(.is-open) :focus-visible { outline-color: var(--ochre-soft); }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.wordmark {
  font-family: var(--serif); font-size: 1.625rem; font-weight: 600; font-style: normal;
  letter-spacing: .01em; line-height: 1;
}
.wordmark a { text-decoration: none; }
.wordmark em { font-weight: 500; }

.site-header .nav .wp-block-navigation__container { display: flex; flex-wrap: nowrap; gap: clamp(1.5rem, 3vw, 2.75rem); }
.site-header .nav .wp-block-navigation-item__content {
  display: inline-block; padding: .5rem 0;
  font-family: var(--mono); font-size: .875rem; letter-spacing: .02em; text-transform: none;
  text-decoration: none; color: inherit;
  background: linear-gradient(currentColor, currentColor) left calc(100% - .3rem) / 0 1px no-repeat;
  transition: background-size .3s var(--ease);
}
.site-header .nav .wp-block-navigation-item__content:hover,
.site-header .nav .wp-block-navigation-item__content[aria-current] { background-size: 100% 1px; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid currentColor; border-radius: var(--radius);
  min-height: 2.75rem; padding: .5rem 1rem;
  font-family: var(--mono); font-size: .875rem; letter-spacing: .02em; text-transform: none;
}
@media (max-width: 719px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-header .nav.wp-block-navigation {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); color: var(--ink);
    border-bottom: 1px solid var(--rule);
    padding: 1rem 1.25rem 2rem;
  }
  .site-header.is-open .nav.wp-block-navigation { display: block; }
  .site-header .nav .wp-block-navigation__container { flex-direction: column; gap: 0; align-items: stretch; }
  .site-header .nav .wp-block-navigation-item + .wp-block-navigation-item { border-top: 1px solid var(--rule); }
  .site-header .nav .wp-block-navigation-item__content {
    display: block; padding: 1rem 0;
    font-family: var(--serif); font-size: 1.875rem; letter-spacing: 0; text-transform: none;
    background: none;
  }
}

/* ---------- Hero (Cover block) ---------- */
.hero.wp-block-cover {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  padding: 0;
  align-items: flex-end;
  background: var(--ink); color: var(--paper);
}
.hero .wp-block-cover__image-background,
.hero .wp-block-cover__video-background {
  filter: saturate(.7) sepia(.22);
}
.hero .wp-block-cover__background {
  opacity: 1 !important;
  background: linear-gradient(180deg, rgba(43,42,36,.72) 0%, rgba(43,42,36,.56) 32%, rgba(43,42,36,.9) 100%) !important;
}
.hero .wp-block-cover__inner-container { color: var(--paper); width: 100%; }
.hero__content { padding-block: calc(var(--header-h) + 3rem) clamp(5.5rem, 13vh, 9rem); }
:root .hero__sub { color: var(--paper); margin-bottom: 1.5rem; font-size: .8125rem; }
.hero__title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(3rem, 9.2vw, 7.5rem);
  line-height: .98; letter-spacing: -.02em;
  max-width: 14ch;
  color: inherit;
}
.hero__title em { font-style: italic; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.hero__title .line > span { display: block; }
.js .hero__title .line > span { transform: translateY(110%); transition: transform .7s var(--ease); }
.js .hero__title .line:nth-child(2) > span { transition-delay: .08s; }
.js .hero .fade { opacity: 0; transform: translateY(.5rem); transition: opacity .5s var(--ease) .3s, transform .5s var(--ease) .3s; }
.js .is-loaded .hero__title .line > span { transform: none; }
.js .is-loaded .hero .fade { opacity: 1; transform: none; }
.block-editor-iframe__body .hero .fade { opacity: 1; transform: none; }
:root .hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: clamp(2rem, 4vw, 3rem); }
.scroll-cue {
  position: absolute; right: max(1.25rem, calc((100% - 76rem) / 2)); bottom: 2rem;
  writing-mode: vertical-rl;
  font-size: .6875rem;
}
.scroll-cue a {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  text-decoration: none;
}
.scroll-cue a::after {
  content: ""; width: 1px; height: 3.5rem; background: currentColor; opacity: .7;
}
@media (max-width: 599px) { .scroll-cue { display: none; } }

/* ---------- Selected work ---------- */
:root .work__head { display: grid; gap: 1.25rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
:root .work__head .eyebrow { margin-bottom: 0; }

/* ---------- About ---------- */
.about__grid { display: grid; gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
@media (min-width: 820px) { .about__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
:root .portrait.wp-block-image {
  position: relative; aspect-ratio: 4 / 5; max-width: 30rem; width: 100%;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--ink); border-radius: var(--radius);
  overflow: hidden;
}
.portrait.wp-block-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Editor: the empty portrait shows the Upload / Media Library box filling the frame */
:root .portrait.wp-block-image .components-placeholder { position: absolute; inset: 0; min-height: 0; height: 100%; }
:root .about__bio { font-size: clamp(1.125rem, 1.7vw, 1.3125rem); line-height: 1.65; margin-top: 1.75rem; max-width: 40rem; }
:root .about__bio + .about__bio { margin-top: 1rem; }
:root .services { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.5rem; border-top: 1px solid var(--rule); }
:root .services__title { color: var(--umber); margin-bottom: 1rem; }
.services__list { columns: 2; column-gap: 2.5rem; counter-reset: s; }
.services__list li {
  counter-increment: s; break-inside: avoid;
  display: flex; gap: 1rem; align-items: baseline;
  padding-block: .75rem; border-bottom: 1px solid var(--rule);
  font-family: var(--serif); font-size: 1.375rem; line-height: 1.2;
}
.services__list li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; color: var(--sage-dark); }
@media (max-width: 479px) { .services__list { columns: 1; } }

/* ---------- Also by Mae ---------- */
.also { padding-block: clamp(4rem, 8vw, 6.5rem); }
.also__grid { display: grid; gap: 2.5rem; }
@media (min-width: 820px) { .also__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2.5rem, 6vw, 6rem); } }
.also__title { font-family: var(--serif); font-weight: 500; font-style: italic; font-size: clamp(1.875rem, 3.4vw, 2.625rem); line-height: 1.1; }
:root .also__note { color: var(--umber); margin-top: 1rem; max-width: 26rem; }
.also__cols { display: grid; gap: 2rem; }
@media (min-width: 560px) { .also__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.also__col { border-top: 1px solid var(--ink); padding-top: 1rem; }
:root .also__col h3 { color: var(--sage-dark); font-weight: 400; margin-bottom: .75rem; }
.also__col p { color: var(--umber); font-size: 1rem; }
.also__col li { font-family: var(--serif); font-style: italic; font-size: 1.4375rem; line-height: 1.3; padding-block: .25rem; }

/* ---------- Contact ---------- */
.contact { background: var(--sage-dark); color: var(--paper); }
:root .contact .eyebrow { color: var(--paper); }
.contact__title { font-size: clamp(2.5rem, 6.4vw, 5.25rem); max-width: 16ch; }
.contact__title em { color: var(--ochre-soft); }
:root .contact__lead { margin-top: 1.5rem; max-width: 36rem; font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); }
:root .contact__grid { display: grid; gap: clamp(3rem, 6vw, 6rem); margin-top: clamp(3rem, 6vw, 5rem); }
@media (min-width: 860px) { .contact__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.details__row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; align-items: baseline; padding-block: 1rem; border-top: 1px solid var(--rule-light); }
.details__row:last-child { border-bottom: 1px solid var(--rule-light); }
.details__value { font-family: var(--serif); font-size: 1.375rem; line-height: 1.25; overflow-wrap: anywhere; }
:root .contact__where { margin-top: 1.75rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding-block: 2.5rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.site-footer .mono { font-size: .875rem; letter-spacing: .02em; text-transform: none; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ochre-soft); }

/* ---------- Other pages (privacy policy, 404, posts) ---------- */
.page-main { padding-block: calc(var(--header-h) + clamp(3rem, 7vw, 6rem)) clamp(4rem, 8vw, 7rem); min-height: 70vh; }
.page-main .entry-title { font-family: var(--serif); font-weight: 500; font-size: clamp(2.375rem, 5.4vw, 4.25rem); line-height: 1.04; margin-bottom: 2rem; }
.prose { max-width: 42rem; }
.prose > * + * { margin-top: 1.25em; }
.prose h2, .prose h3 { line-height: 1.15; margin-top: 2em; }
.prose h2 { font-size: 2rem; }
.prose h3 { font-size: 1.5rem; }
.prose ul { list-style: disc; padding-left: 1.25em; }
.prose ol { list-style: decimal; padding-left: 1.25em; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js body .reveal, .js .hero .fade { opacity: 1; transform: none; }
  .js .hero__title .line > span { transform: none; }
  .btn:active, .wp-block-button .wp-block-button__link:active { transform: none; }
}

/* Hide the hero title until theme.js splits it into lines (shows anyway after 2s) */
.js body:not(.block-editor-iframe__body) .hero__title:not(.is-split) { opacity: 0; animation: mae-show 0s 2s forwards; }
@keyframes mae-show { to { opacity: 1; } }
.page-main .lead { margin-top: 1.5rem; }

/* Player controls are typewriter but not uppercase (overrides .mono) */
.modal .modal__close, .modal .modal__arrow, .modal .modal__yt { font-size: .875rem; letter-spacing: .02em; text-transform: none; }
