/*
Theme Name: Carta Blanca Dance
Theme URI: https://cartablancadance.com
Author: Carta Blanca Dance
Description: Editorial theme for Carta Blanca Dance. All text and images are editable through Advanced Custom Fields PRO (required). Includes Projects and Events post types and a one-click archive import under Tools → Carta Blanca Setup.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: cartablanca
*/

/* ---------- Tokens: bone canvas, ink foreground, terracotta accent ---------- */
:root {
  --background: oklch(0.953 0.012 85);
  --foreground: oklch(0.18 0.005 70);
  --muted: oklch(0.9 0.012 80);
  --muted-foreground: oklch(0.45 0.012 70);
  --accent: oklch(0.5 0.12 38);
  --accent-foreground: oklch(0.98 0 0);
  --border: oklch(0.18 0.005 70 / 0.1);
  --radius: 0.5rem;

  --font-display: "Anton", "Inter", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);

  --gutter: 1.5rem;
}
@media (min-width: 768px) {
  :root { --gutter: 3rem; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--border); }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.5;
}
::selection { background: var(--accent); color: var(--accent-foreground); }
img, svg, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure { margin: 0; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.font-display { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.num {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.btn--light { background: var(--background); color: var(--foreground); }
.btn--light:hover { background: var(--accent); color: var(--accent-foreground); }
.btn--outline {
  border: 1px solid var(--border);
  background: var(--background);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.btn--outline:hover { background: var(--accent); color: var(--accent-foreground); }
.btn--outline-dark {
  border: 1px solid oklch(0.953 0.012 85 / 0.3);
  background: transparent;
  color: var(--background);
}
.btn--outline-dark:hover { background: var(--background); color: var(--foreground); }
.btn--link {
  height: auto;
  padding: 0;
  margin-top: 0.75rem;
  color: var(--background);
  text-underline-offset: 4px;
}
.btn--link:hover { text-decoration: underline; }

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  mix-blend-mode: difference;
  color: var(--background);
  padding: 1.5rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
@media (min-width: 768px) { .site-nav { padding-block: 2rem; } }
.admin-bar .site-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-nav { top: 46px; } }
.site-nav__logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1;
  text-transform: uppercase;
}
.site-nav__logo img { max-height: 4rem; width: auto; }
@media (min-width: 768px) { .site-nav__logo { font-size: 1.5rem; } }
.site-nav__menu {
  display: none;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
.site-nav__menu a { transition: opacity 0.15s; }
.site-nav__menu a:hover { opacity: 0.6; }
@media (min-width: 768px) { .site-nav__menu { display: flex; } }

/* Mobile menu: toggle sits in the blended nav; the panel sits beneath it. */
.site-nav__toggle {
  background: none;
  border: none;
  padding: 0.75rem 0 0;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
@media (min-width: 768px) { .site-nav__toggle { display: none; } }
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  padding: 8rem var(--gutter) 3rem;
  overflow-y: auto;
  background: var(--foreground);
  color: var(--background);
}
.mobile-menu[hidden] { display: none; }
@media (min-width: 768px) { .mobile-menu { display: none; } }
.mobile-menu__links { width: 100%; border-top: 1px solid oklch(0.953 0.012 85 / 0.15); }
.mobile-menu__links a {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding-block: 1rem;
  border-bottom: 1px solid oklch(0.953 0.012 85 / 0.15);
  font-family: var(--font-display);
  font-size: 2.75rem;
  line-height: 1;
  text-transform: uppercase;
  animation: fade-up 700ms var(--ease-out-expo) both;
  animation-delay: calc(var(--i, 0) * 60ms);
  transition: color 0.15s;
}
.mobile-menu__links a:hover, .mobile-menu__links a:focus-visible { color: var(--accent); }
.mobile-menu__links .num { opacity: 0.5; }
body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 85vh;
  min-height: 85svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--gutter);
  overflow: hidden;
  background: var(--foreground);
}
.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}
.hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--foreground), oklch(0.18 0.005 70 / 0.3), oklch(0.18 0.005 70 / 0.4));
}
.hero__content {
  position: relative;
  z-index: 10;
  color: var(--background);
  animation: fade-up 900ms var(--ease-out-expo) both;
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  opacity: 0.8;
}
@media (min-width: 768px) { .hero__eyebrow { font-size: 0.75rem; } }
.hero__title {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 4.5rem;
  line-height: 0.85;
  text-transform: uppercase;
  text-wrap: balance;
}
@media (min-width: 640px) { .hero__title { font-size: 6rem; } }
@media (min-width: 768px) { .hero__title { font-size: 8rem; } }
.accent-italic { font-style: italic; color: var(--accent); }
.hero__row {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}
@media (min-width: 768px) { .hero__row { flex-direction: row; align-items: flex-end; } }
.hero__intro {
  max-width: 42ch;
  font-size: 1.125rem;
  line-height: 1.25;
  font-weight: 500;
  text-wrap: pretty;
}
.hero__intro p { margin: 0; }
.hero__intro p + p { margin-top: 0.75em; }

/* ---------- Co-directors ---------- */
.about { padding: 5rem var(--gutter); }
@media (min-width: 768px) { .about { padding-block: 7rem; } }
.about__head {
  margin-bottom: 3rem;
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 768px) { .about__head { grid-template-columns: 1fr 1fr; align-items: end; } }
.about__heading {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 3rem;
  line-height: 1;
  text-transform: uppercase;
}
@media (min-width: 768px) { .about__heading { font-size: 3.75rem; } }
.about__text {
  max-width: 48ch;
  font-size: 1.125rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}
.directors { display: grid; gap: 2.5rem; }
@media (min-width: 640px) { .directors { grid-template-columns: 1fr 1fr; } }
.director__frame { overflow: hidden; background: var(--muted); }
.director__frame img, .director__placeholder {
  aspect-ratio: 3 / 4;
  max-height: 620px;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.director__caption {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top-width: 1px;
}
.director__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.875rem;
  text-transform: uppercase;
}
@media (min-width: 768px) { .director__name { font-size: 2.25rem; } }
.director__role { margin-top: 0.75rem; color: var(--muted-foreground); }

/* ---------- Works ---------- */
.works { padding-block: 8rem; background: var(--foreground); color: var(--background); }
.section-bar {
  padding: 0 var(--gutter) 1rem;
  margin-bottom: 5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid oklch(0.953 0.012 85 / 0.1);
}
.section-bar__title { display: flex; align-items: baseline; gap: 1.5rem; }
.section-bar .num, .section-bar__meta { opacity: 0.5; }
.section-bar__meta { font-family: var(--font-mono); font-size: 0.75rem; }
.section-bar h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
@media (min-width: 768px) { .section-bar h2 { font-size: 2.25rem; } }
.works__more { padding: 2.5rem var(--gutter) 0; }

/* ---------- Project grid ---------- */
.project-grid { display: grid; gap: 1px; background: var(--border); }
@media (min-width: 640px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .project-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .project-grid { grid-template-columns: repeat(4, 1fr); } }
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  padding: 1.5rem;
  background: var(--foreground);
  color: var(--background);
}
.project-card:focus-visible { outline: 2px solid var(--accent); }
.project-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  transition: transform 700ms, opacity 700ms;
}
.project-card:hover .project-card__image { transform: scale(1.05); opacity: 0.9; }
.project-card__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--foreground), oklch(0.18 0.005 70 / 0.2), oklch(0.18 0.005 70 / 0.2));
}
.project-card__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.project-card__top svg { width: 1.25rem; height: 1.25rem; }
.project-card__bottom { position: relative; }
.project-card__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.875rem;
  line-height: 1.25;
  text-transform: uppercase;
}
.project-card__kind {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ---------- Events ---------- */
.agenda { padding: 8rem var(--gutter); }
.agenda__head { display: flex; align-items: baseline; gap: 1.5rem; margin-bottom: 4rem; }
.agenda__head .num { color: var(--muted-foreground); }
.agenda__head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 3.75rem;
  text-transform: uppercase;
}
@media (min-width: 768px) { .agenda__head h2 { font-size: 6rem; } }
.agenda__list { border-top-width: 1px; }
.agenda__row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 0.5rem;
  padding-block: 2rem;
  border-bottom-width: 1px;
  align-items: center;
  transition: all 500ms;
}
a.agenda__row:hover { padding-inline: 1rem; }
@media (min-width: 768px) {
  .agenda__row { grid-template-columns: repeat(12, 1fr); }
  .agenda__date { grid-column: span 2; }
  .agenda__title { grid-column: span 6; }
  .agenda__note { grid-column: span 3; }
  .agenda__info { grid-column: span 1; }
}
.agenda__date { font-family: var(--font-mono); font-size: 0.875rem; letter-spacing: 0.1em; }
.agenda__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  transition: color 0.15s;
}
@media (min-width: 768px) { .agenda__title { font-size: 1.875rem; } }
a.agenda__row:hover .agenda__title { color: var(--accent); }
.agenda__note {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.agenda__info {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Contact ---------- */
.contact { padding: var(--gutter); background: var(--accent); color: var(--accent-foreground); }
.contact__grid { display: grid; gap: 4rem; padding-top: 4rem; }
@media (min-width: 768px) { .contact__grid { grid-template-columns: 1fr 1fr; gap: 6rem; } }
.contact__main > * + * { margin-top: 3rem; }
.contact__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  opacity: 0.7;
}
.contact__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.25rem;
  line-height: 0.9;
  text-transform: uppercase;
}
@media (min-width: 640px) { .contact__title { font-size: 3.75rem; } }
@media (min-width: 768px) { .contact__title { font-size: 4.5rem; } }
.contact__title .italic { font-style: italic; }
.contact__email {
  display: block;
  word-break: break-all;
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  text-underline-offset: 8px;
}
.contact__email:hover { text-decoration: underline; }
@media (min-width: 768px) { .contact__email { font-size: 1.875rem; } }
.contact__meta {
  padding-top: 1rem;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  opacity: 0.8;
}
.contact__meta p + p { margin-top: 0.25rem; }
.contact__meta a:hover { text-decoration: underline; }
.contact__bar {
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 1px solid oklch(0.98 0 0 / 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
}
@media (min-width: 768px) { .contact__bar { flex-direction: row; align-items: center; } }

/* ---------- Page header (archive, single, pages) ---------- */
.page-header { padding: 10rem var(--gutter) 4rem; }
@media (min-width: 768px) { .page-header { padding-top: 12rem; } }
.page-header--tight { padding-bottom: 3rem; }
.page-title {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 4.5rem;
  text-transform: uppercase;
}
@media (min-width: 768px) { .page-title { font-size: 8rem; } }
.page-title--project {
  max-width: 64rem;
  overflow-wrap: break-word;
  font-size: 3rem;
  line-height: 1.25;
}
@media (min-width: 640px) { .page-title--project { font-size: 3.75rem; } }
@media (min-width: 768px) { .page-title--project { font-size: 6rem; } }
.archive-grid { padding-bottom: 5rem; }

/* ---------- Single project ---------- */
.project-cover { max-height: 760px; width: 100%; height: auto; background: var(--muted); object-fit: contain; }
.project-body {
  display: grid;
  gap: 3rem;
  padding: 4rem var(--gutter);
}
@media (min-width: 768px) {
  .project-body { grid-template-columns: repeat(12, 1fr); padding-block: 6rem; }
  .project-body__text { grid-column: span 8; }
  .project-body__credits { grid-column: span 4; }
}
.project-body__text { font-size: 1.125rem; line-height: 1.625; }
.project-body__text > * + * { margin-top: 1.5rem; }
.project-body__text h2, .project-body__text h3, .project-body__text h4 {
  padding-top: 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.33;
  text-transform: uppercase;
}
.project-body__text p, .project-body__text ul, .project-body__text ol {
  max-width: 70ch;
  color: var(--muted-foreground);
}
.project-body__text a { text-decoration: underline; text-underline-offset: 3px; }
.project-body__credits { padding-top: 1.5rem; border-top-width: 1px; }
@media (min-width: 768px) {
  .project-body__credits { padding: 0 0 0 2rem; border-top-width: 0; border-left-width: 1px; }
}
.project-body__credits h2, .project-film h2, .project-photos h2 {
  margin-bottom: 1.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  text-transform: uppercase;
}
.project-film h2, .project-photos h2 { margin-bottom: 2rem; font-size: 1.875rem; }
.project-body__credits p { font-size: 0.875rem; line-height: 1.625; color: var(--muted-foreground); }
.project-body__credits p + p { margin-top: 1rem; }
.project-film { padding: 4rem var(--gutter); background: var(--foreground); color: var(--background); }
.project-film__item + .project-film__item { margin-top: 3rem; }
.project-film iframe, .project-film video { aspect-ratio: 16 / 9; width: 100%; height: auto; border: 0; }
.project-photos { padding: 4rem var(--gutter); }
.project-photos__grid { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .project-photos__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .project-photos__grid { grid-template-columns: repeat(3, 1fr); } }
.project-photos__grid img { aspect-ratio: 4 / 3; width: 100%; height: auto; background: var(--muted); object-fit: contain; }
.project-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.5rem var(--gutter);
  border-top-width: 1px;
}
.project-footer p { align-self: center; font-size: 0.875rem; color: var(--muted-foreground); }

/* ---------- Generic page content ---------- */
.entry-content { padding: 0 var(--gutter) 6rem; max-width: calc(70ch + 2 * var(--gutter)); font-size: 1.125rem; line-height: 1.625; }
.entry-content > * + * { margin-top: 1.5rem; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.not-found { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; text-align: center; }
.not-found h1 { font-size: 4.5rem; font-weight: 700; }
.not-found h2 { margin-top: 1rem; font-size: 1.25rem; font-weight: 600; }
.not-found p { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); }
.not-found .btn { margin-top: 1.5rem; background: var(--foreground); color: var(--background); }

/* ---------- Motion ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
