/*
Theme Name: Maya Portfolio
Theme URI: https://example.com/maya-portfolio
Author: Your Name
Description: A clean, mobile-first portfolio theme for a filmmaker & anthropologist.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: maya-portfolio
Tags: portfolio, custom-logo, custom-menu, one-column, grid-layout, responsive-layout
*/

@font-face {
  font-family: "Sligoil";
  src: url("assets/fonts/Sligoil-Micro.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sligoil";
  src: url("assets/fonts/Sligoil-MicroMedium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sligoil";
  src: url("assets/fonts/Sligoil-MicroBold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── 3 base colors: only these need to be changed ───────────────
     oklch(lightness%  chroma  hue)
     lightness : 0%=black → 100%=white
     chroma    : 0=grey  → 0.2+=vivid
     hue       : 0=red  50=orange  120=green  185=teal  270=purple
  ─────────────────────────────────────────────────────────────── */
  --bg:     oklch(20% 0.03 50);
  --text:   oklch(91% 0.03 50);
  --accent: oklch(79% 0.09 25);

  /* ── Optional overrides ───────────────────────────────────────── */
  --heading:         var(--text);   /* color of all headings */
  --heading-project: var(--accent); /* h1 color on individual film/book/collab pages */

  /* ── Derived automatically — do not edit below this line ──────── */
  --bg-soft:    oklch(from var(--bg)     calc(l + 0.04)        c              h);
  --bg-dark:    oklch(from var(--bg)     calc(l * 0.4)         c              h);
  --text-muted: oklch(from var(--text)   calc(l - 0.09)        c              h);
  --accent-2:   oklch(from var(--accent) calc(l + 0.06)        calc(c * 0.8)  calc(h + 160));
  --line:       oklch(from var(--bg)     calc(l + 0.55)        c              h);
  --error:      oklch(65% 0.18 25);
  /* ─────────────────────────────────────────────────────────────── */

  --max-w: 1600px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* offset for sticky header when jumping to anchors */
  scroll-padding-top: 80px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Sligoil", "Karla", system-ui, sans-serif;
  color: var(--heading);
}

/* Single project pages: accent-colored h1 */
.single-film .section-title,
.single-book .section-title,
.single-collaboration .section-title {
  color: var(--heading-project);
}

body {
  margin: 0;
  font-family: "Karla", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.content {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.content p,
.content .wp-block-paragraph {
  max-width: 72ch;
  margin: 0 0 1rem;
}

.content .wp-block-image.alignright,
.content figure.alignright {
  margin-left: 2.5rem;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(var(--max-w), 82vw);
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--accent);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  transition: backdrop-filter 0.3s ease, background 0.3s ease;
}

.site-header.scrolled {
  backdrop-filter: blur(8px);
  background: oklch(from var(--bg) l c h / 0.92);
  border-bottom-color: oklch(from var(--accent) l c h / 0.4);
}

.site-title {
  font-family: "Sligoil", "Karla", system-ui, sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.site-title:hover {
  text-decoration: none;
  color: var(--accent);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.navbar-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative; /* anchor for mobile dropdown */
}

/* ── Language switcher (Polylang / TranslatePress) ───── */
.lang-switcher {
  display: flex;
  align-items: center;
}

/* Polylang renders a ul > li structure */
.lang-switcher ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
}

.lang-switcher li {
  display: flex;
  align-items: center;
}

.lang-switcher li + li::before {
  content: '/';
  margin: 0 0.3rem;
  color: var(--line);
  font-size: 0.75rem;
}

.lang-switcher a,
.lang-switcher span {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease;
}

.lang-switcher a:hover,
.lang-switcher .current-lang a {
  color: var(--accent);
}

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 0.4rem;
  cursor: pointer;
}

.menu-toggle:hover .menu-toggle__bar {
  background: var(--accent);
}

.menu-toggle__bar {
  width: 24px;
  height: 2px;
  background: var(--text);
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.2s ease;
  transform-origin: center;
}

/* Animate to X when open */
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Nav menu ────────────────────────────────────────── */
/* Mobile: hidden floating dropdown anchored to navbar-end */
.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  z-index: 200;
  min-width: 180px;
}

.nav-menu.is-open {
  display: block;
}

.menu,
.menu ul,
.page_item {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0;
  margin: 0;
  align-items: flex-start;
}

/* WordPress fallback page menu */
.nav-menu > div > ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0;
  margin: 0;
}

.menu a,
.page_item a {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-muted);
  padding: 0.3rem 0;
  transition: color 0.2s ease;
  display: block;
  white-space: nowrap;
  text-decoration: none;
}

.menu a:hover,
.page_item a:hover {
  color: var(--accent);
  text-decoration: none;
}

.menu .current-menu-item > a,
.menu .current_page_item > a,
.current_page_item > a {
  color: var(--accent);
  font-weight: 700;
}


.main {
  flex: 1;
  padding: 2.5rem 0 3rem;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Video background */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: oklch(from var(--bg-dark) l c h / 0.5);
  z-index: 1;
}

/* Text content sits above video */
.hero__content {
  position: relative;
  z-index: 2;
  padding: 4rem 0 4rem 2rem;
}

.hero__content,
.hero__content p,
.hero__content h1,
.hero__content h2 {
  font-family: "Sligoil", "Karla", system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.15;
  margin: 0;
  color: var(--text);
}

.hero__content h2 {
  font-size: clamp(1rem, 2.5vw, 1.625rem);
}

.section {
  margin: 3rem 0;
}

/* Front-page sections get a top border as dividers */
.fp-section {
  border-top: 1px solid var(--line);
  padding-top: 3rem;
}

/* Contact: links left, form right on desktop */
.fp-contact {
  display: grid;
  gap: 2rem;
  margin-top: 1.5rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Icon link grid */
.fp-contact__links .wp-block-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
}

.fp-contact__links {
  padding-bottom: 2.5rem;
}

.fp-contact__links .wp-block-list li {
  margin: 0;
}

.fp-contact__links a {
  display: flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
}

.fp-contact__links a::before {
  content: '';
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  flex-shrink: 0;
}

.fp-contact__links a[href*="vimeo.com"]::before {
  mask-image: url(assets/icons/vimeo.svg);
}

.fp-contact__links a[href*="instagram.com"]::before {
  mask-image: url(assets/icons/instagram.svg);
}

.fp-contact__links a[href*="linkedin.com"]::before {
  mask-image: url(assets/icons/linkedin.svg);
}

.fp-contact__links a[href*="crew-united.com"]::before {
  mask-image: url(assets/icons/crewunited.svg);
}

/* Photo column */
.fp-contact__photo figure {
  margin: 0;
}

.fp-contact__photo img {
  width: 100%;
  height: auto;
  display: block;
}

.fp-contact__form {
  max-width: 600px;
}

@media (min-width: 860px) {
  .fp-contact {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "links links"
      "photo form";
    align-items: start;
  }
  .fp-contact__links { grid-area: links; }
  .fp-contact__photo { grid-area: photo; }
  .fp-contact__form  { grid-area: form; }
}

.section-title {
  font-family: "Sligoil", "Karla", system-ui, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 1rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.card-body {
  padding: 1rem 1.1rem 1.3rem;
}

.card-title {
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
  font-weight: 700;
}

.card-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.project-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.project-meta span {
  color: var(--text-muted);
}

.mosaic-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--accent);
}

.site-footer {
  border-top: 2px solid var(--line);
  padding: 2rem 0;
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 700;
}

/* ── Thumb grid ──────────────────────────────────────── */
.thumb-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.thumb-card {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  background: var(--bg-soft);
}

.thumb-card__img {
  width: 100%;
  height: 100%;
}

.thumb-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.thumb-card__placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-soft);
}

.thumb-card__overlay {
  position: absolute;
  inset: 0;
  background: oklch(from var(--bg-dark) l c h / 0.65);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.thumb-card__title {
  font-family: "Sligoil", "Karla", system-ui, sans-serif;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.3;
}

.thumb-card:hover .thumb-card__overlay,
.thumb-card:focus .thumb-card__overlay,
.thumb-card[aria-expanded="true"] .thumb-card__overlay {
  opacity: 1;
}

.thumb-card:hover .thumb-card__img img,
.thumb-card[aria-expanded="true"] .thumb-card__img img {
  transform: scale(1.04);
}

.thumb-card[aria-expanded="true"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Project inline panel ────────────────────────────── */
.project-panels {
  margin-top: 0;
}

.project-panel {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  margin-top: 1.5rem;
  animation: panel-in 0.35s ease;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.project-panel__close {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s, color 0.2s;
}

.project-panel__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.project-panel__inner {
  display: grid;
  gap: 2rem;
}

.project-panel__title {
  font-family: "Sligoil", "Karla", system-ui, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 1.25rem;
}

.project-panel__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}

.project-panel__meta dt {
  color: var(--text-muted);
  font-weight: 600;
}

.project-panel__meta dd {
  margin: 0;
}

.project-panel__right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

/* ── Single project page two-column layout ───────────── */
.single-project {
  display: grid;
  gap: 2rem;
}

.single-project__media img {
  width: 100%;
  border-radius: 2px;
}

/* Photos page: full-width grid, no container margins */
.photos-wrap {
  width: min(var(--max-w), 96vw);
  margin: 0 auto;
}

/* Photo grid — CSS columns for natural masonry, each image at its own ratio */
#photos-grid {
  display: block;
  column-width: 380px;
  column-gap: 0.5rem;
}

#films-grid .thumb-card {
  aspect-ratio: 16 / 9;
}

#photos-grid .thumb-card {
  border-radius: 0;
  aspect-ratio: auto;
  break-inside: avoid;
  margin-bottom: 0.5rem;
  display: block;
}

#photos-grid .thumb-card .thumb-card__img {
  height: auto;
}

#photos-grid .thumb-card .thumb-card__img img {
  width: 100%;
  height: auto;
  object-fit: initial;
  display: block;
}

#photos-grid .thumb-card__overlay {
  display: none;
}

@media (min-width: 860px) {
  .project-panel__inner.has-images {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Photo lightbox modal ────────────────────────────── */
.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: oklch(from var(--text) calc(l + 0.06) calc(c * 0.2) h / 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-in 0.2s ease;
}

.photo-modal[hidden] {
  display: none;
}

@keyframes modal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.photo-modal__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
}

.photo-modal__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: 1px solid oklch(from var(--bg) calc(l + 0.45) c h);
  color: var(--bg);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}

.photo-modal__close:hover {
  border-color: oklch(from var(--accent) calc(l - 0.2) c h);
  color: oklch(from var(--accent) calc(l - 0.2) c h);
}

/* ── Collaborations nav + panel ──────────────────────── */
.collab-nav {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}

.collab-nav__item {
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: "Sligoil", "Karla", system-ui, sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--text);
  text-align: left;
  transition: color 0.2s;
  width: 100%;
}

.collab-nav__item:hover,
.collab-nav__item[aria-expanded="true"] {
  color: var(--accent);
}

.collab-nav__arrow {
  font-size: 1rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.collab-nav__item[aria-expanded="true"] .collab-nav__arrow {
  transform: rotate(180deg);
}

.collab-panel-area {
  margin-top: 0;
}

.collab-panel {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  animation: panel-in 0.3s ease;
}

.collab-panel[hidden] {
  display: none;
}

.collab-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.collab-item {
  border-left: 2px solid var(--line);
  padding-left: 1rem;
}

.collab-item__title {
  font-family: "Sligoil", "Karla", system-ui, sans-serif;
  font-size: 1rem;
  margin: 0 0 0.3rem;
}

.collab-item__excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.collab-item__body {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.collab-item__body img {
  max-width: 100%;
  border-radius: 4px;
  height: auto;
}

.collab-item__body .wp-block-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.collab-item__body .wp-block-group .wp-block-image {
  flex: 1 1 min(200px, 100%);
}

.project-panel__right img {
  width: 100%;
  border-radius: 4px;
}

.project-panel__right .wp-block-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-panel__right .wp-block-group .wp-block-image {
  flex: 1 1 min(180px, 100%);
}

@media (min-width: 860px) {
  /* Nav menu: inline horizontal row to the left of hamburger */
  .nav-menu {
    position: static;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    min-width: unset;
  }

  .nav-menu.is-open {
    display: flex;
    align-items: center;
  }

  .menu,
  .menu ul {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    padding: 0;
  }

  .nav-menu > div > ul {
    flex-direction: row;
    gap: 1.5rem;
  }

  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }

  .project-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Two-column layout on single project pages */
  .single-film .single-project,
  .single-book .single-project,
  .single-collaboration .single-project {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ── Contact Form 7 overrides ────────────────────────── */
.wpcf7-form {
  margin-top: 2rem;
}

.wpcf7-form p {
  margin: 0 0 1rem;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
  width: 100%;
  background: var(--bg-soft) !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  color: var(--text) !important;
  font-family: "Karla", system-ui, sans-serif;
  font-size: 1rem;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form textarea:focus {
  border-color: var(--accent);
}

.wpcf7-form textarea {
  min-height: 140px;
  resize: vertical;
}

.wpcf7-form input[type="submit"] {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: "Karla", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.wpcf7-form input[type="submit"]:hover {
  background: var(--accent);
  color: var(--bg);
}

.wpcf7-not-valid-tip {
  color: var(--error);
  font-size: 0.85rem;
}

.wpcf7-response-output {
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  padding: 0.75rem 1rem !important;
  margin-top: 1rem !important;
  font-size: 0.9rem;
}
