/**
 * Creative portfolio: clay project tiles ([projects] shortcode) and the
 * project page template (single-mm_project.php). Follows the Claude Design
 * "Creative Pages" boards (1a hub, 2e project page, 3f clay tiles) on the
 * site's existing tokens: Poppins 200/300, Mistgak script in sage, hairlines.
 */

:root {
  --mm-pj-ink: var(--wp--preset--color--mm-hero, #3a3e35);
  --mm-pj-body: #57544c;
  --mm-pj-label: #8a8578;
  --mm-pj-line: #dcdad4;
  --mm-pj-sage: var(--wp--preset--color--mm-sage, #8c9082);
}

/* --- Clay tile --------------------------------------------------------- */
.mm-proj-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e9e6df;
  color: var(--mm-pj-ink);
  text-decoration: none;
  isolation: isolate;
}
.mm-proj-tile::before { /* the shared clay texture, same on every tile */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../images/clay-texture.jpg") left top / 250% auto no-repeat;
  opacity: 0.2;
  pointer-events: none;
}
.mm-proj-tile:hover,
.mm-proj-tile:focus-visible { color: var(--mm-pj-ink); }
.mm-proj-tile__text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8% 16px 0;
  text-align: center;
  pointer-events: none;
}
.mm-proj-tile__tags {
  font-family: "Mistgak Signature", var(--mm-font);
  font-size: 30px;
  line-height: 1;
  color: var(--mm-pj-sage);
}
.mm-proj-tile__name {
  margin-top: 4px;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 200;
  line-height: 1.1;
}
.mm-proj-tile__work {
  position: absolute;
  left: 13%;
  right: 13%;
  top: 44%;
  bottom: -20px;            /* runs past the tile's bottom edge (clipped), so the hover lift reveals more image, not a gap */
  overflow: hidden;
  background: #fff;
  box-shadow: 0 -8px 28px -12px rgba(38, 37, 29, 0.35);
  transition: transform 0.45s ease;
}
.mm-proj-tile__work img { display: block; width: 100%; height: auto; min-height: 100%; object-fit: cover; object-position: center top; } /* full width, bottom cut off (sides only if the image is too short to fill) */
.mm-proj-tile:hover .mm-proj-tile__work,
.mm-proj-tile:focus-visible .mm-proj-tile__work { transform: translateY(-8px); }

/* Selected work mosaic: one tall tile + two beside it */
.mm-projects__mosaic {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
  height: clamp(520px, 56vw, 780px);
}
.mm-projects__mosaic[data-n="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.mm-projects__mosaic[data-n="2"] { grid-template-rows: 1fr; }
.mm-projects__mosaic .mm-proj-tile { aspect-ratio: auto; height: 100%; }
.mm-proj-tile--big { grid-row: span 2; }
.mm-projects__mosaic[data-n="2"] .mm-proj-tile--big { grid-row: auto; }
.mm-proj-tile--big .mm-proj-tile__text,
.mm-proj-tile--mid .mm-proj-tile__text { padding-top: 40px; }
.mm-proj-tile--big .mm-proj-tile__name,
.mm-proj-tile--mid .mm-proj-tile__name { margin-top: 6px; font-size: clamp(28px, 2.9vw, 40px); }
.mm-proj-tile--big .mm-proj-tile__work { top: 22%; }
.mm-proj-tile--big:hover .mm-proj-tile__work,
.mm-proj-tile--mid:hover .mm-proj-tile__work { transform: translateY(-10px); }

/* --- [projects] section ------------------------------------------------ */
.mm-projects { padding-block: clamp(48px, 9vh, 104px); }
.mm-projects + .mm-projects { padding-top: 0; }
.mm-projects__head { margin-bottom: clamp(24px, 4vh, 40px); }
.mm-projects__script {
  margin: 0;
  font-family: "Mistgak Signature", var(--mm-font);
  font-size: clamp(30px, 2.6vw, 36px);
  line-height: 1;
  color: var(--mm-pj-sage);
}
.mm-projects__heading {
  margin: 10px 0 0;
  font-size: clamp(32px, 3.2vw, 44px);
  font-weight: 200;
  line-height: 1.06;
  color: var(--mm-pj-ink);
}
.mm-projects__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--mm-pj-ink);
}
.mm-projects__label { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mm-pj-ink); }
.mm-projects__chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.mm-projects__chip {                 /* text links; the selected one is a sage pill */
  padding: 7px 14px;
  border: 0;
  border-radius: 300px;
  background: transparent;
  color: var(--mm-pj-body);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.mm-projects__chip:hover,
.mm-projects__chip:focus-visible { color: var(--mm-pj-ink); }
.mm-projects__chip.is-active { background: var(--mm-pj-sage); color: #fff; }
.mm-projects__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 32px;
}
.mm-projects__head + .mm-projects__body .mm-projects__grid:first-child { padding-top: 0; }
.mm-projects__grid .mm-proj-tile[hidden] { display: none; }

@media (max-width: 1000px) {
  .mm-projects__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .mm-projects__grid { grid-template-columns: 1fr; }
  .mm-projects__mosaic { grid-template-columns: 1fr; grid-template-rows: none; height: auto; }
  /* taller tiles on phones so the 30px services line + name clear the work image */
  .mm-proj-tile,
  .mm-projects__mosaic .mm-proj-tile { aspect-ratio: 5 / 4; height: auto; grid-row: auto; }
  .mm-proj-tile--big .mm-proj-tile__text,
  .mm-proj-tile--mid .mm-proj-tile__text { padding-top: 8%; }
  .mm-proj-tile--big .mm-proj-tile__name,
  .mm-proj-tile--mid .mm-proj-tile__name { font-size: clamp(22px, 6vw, 28px); }
  .mm-proj-tile--big .mm-proj-tile__work { top: 46%; }
  .mm-proj-tile__work { top: 46%; }
}

/* --- Project page ------------------------------------------------------ */
.mm-project {
  --mm-rail: clamp(58px, 7vw, 84px);
  --mm-pl: clamp(24px, 4vw, 56px);                 /* lines up with the logo */
  --mm-pr: calc(var(--mm-rail) + clamp(24px, 3vw, 56px));
  padding: 0;
  color: var(--wp--preset--color--mm-ink, #26251d);
}
/* Top: clay-textured block with the title centred and the work
   rising out of its bottom edge (like the tiles). */
.mm-project__top {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: var(--mm-rail);
  padding: clamp(110px, 16vh, 160px) var(--mm-pl) 0;
  overflow: hidden;
  background: #e9e6df;
  text-align: center;
}
.mm-project__top::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../images/clay-texture.jpg") center / cover no-repeat;
  opacity: 0.2;
  pointer-events: none;
}
.mm-project__script {
  margin: 0;
  font-family: "Mistgak Signature", var(--mm-font);
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1;
  color: var(--mm-pj-sage);
}
.mm-project__title {
  margin: 10px 0 0;
  font-size: min(60px, 12vw); /* 60px; only narrower on small phones so long names fit */
  font-weight: 200;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--mm-pj-ink);
  text-wrap: balance;
}
.mm-project__shot {                /* full width of the image always; only the bottom is cut off */
  position: relative;
  width: min(74%, 1200px);
  max-height: clamp(280px, 38vw, 600px);
  margin: clamp(40px, 7vh, 72px) 0 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 -12px 44px -16px rgba(38, 37, 29, 0.35);
}
.mm-project__shot img { display: block; width: 100%; height: auto; }

/* Strip under the top block: "In this project" - the numbered sections as jump links, across */
.mm-project__facts-wrap { display: block; margin-right: var(--mm-rail); border-bottom: 1px solid var(--mm-pj-line); }
/* label to the left of the links when it all fits on one line; when it doesn't,
   flex wrapping drops the links to their own line and the label sits centred above */
.mm-project__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 14px clamp(28px, 4vw, 56px);
  padding: clamp(28px, 5vh, 44px) var(--mm-pl);
  text-align: center;
}
.mm-project__facts-label { flex: none; margin: 0; font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mm-pj-body); }
.mm-project__index { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px clamp(24px, 3.5vw, 48px); list-style: none; margin: 0; padding: 0; }
.mm-project__index a { display: inline-flex; align-items: baseline; gap: 10px; color: var(--mm-pj-ink); text-decoration: none; font-size: 15px; transition: color 0.2s ease; }
.mm-project__index a:hover,
.mm-project__index a:focus-visible { color: var(--mm-pj-sage); }
.mm-project__index-n { font-family: "Mistgak Signature", var(--mm-font); font-size: 30px; line-height: 1.1; color: var(--mm-pj-sage); }
.mm-project__sec[id] { scroll-margin-top: calc(var(--wp--preset--spacing--50, 1.5rem) + 40px); }
html:has(.mm-project__index) { scroll-behavior: smooth; }
/* the website section's platform / package tags */
.mm-project__tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 2px 0 0; padding: 0; }
.mm-project__tags a { color: inherit; text-decoration: none; }
.mm-project__tags li { padding: 6px 14px; border: 1px solid #c9c6bd; border-radius: 300px; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mm-pj-ink); } /* rounded, like the site's buttons */

.mm-project__intro {
  max-width: 62ch;
  padding: clamp(56px, 9vh, 104px) var(--mm-pr) 0 var(--mm-pl);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.7;
  color: var(--mm-pj-body);
}
.mm-project__intro p { margin: 0 0 1em; }

.mm-project__sec {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding: clamp(64px, 11vh, 104px) var(--mm-pr) 0 var(--mm-pl);
}
.mm-project__copy {
  position: sticky;
  top: calc(var(--wp--preset--spacing--50, 1.5rem) + 64px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-bar .mm-project__copy { top: calc(var(--wp--preset--spacing--50, 1.5rem) + 96px); }
.mm-project__n { font-family: "Mistgak Signature", var(--mm-font); font-size: 42px; line-height: 1; color: var(--mm-pj-sage); } /* like the Creative page "01" */
.mm-project__label { margin-top: -6px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mm-pj-ink); }
.mm-project__sec-title { margin: 0; font-size: clamp(26px, 2.4vw, 34px); font-weight: 200; line-height: 1.12; color: var(--mm-pj-ink); text-wrap: pretty; }
.mm-project__sub-title { margin: 0; font-size: clamp(20px, 1.7vw, 24px); font-weight: 300; line-height: 1.2; color: var(--mm-pj-ink); text-wrap: pretty; }
.mm-project__text { font-size: 15px; line-height: 1.75; color: var(--mm-pj-body); text-wrap: pretty; }
.mm-project__text > * { margin: 0 0 1em; }
.mm-project__text > *:last-child { margin-bottom: 0; }
.mm-project__text h3,
.mm-project__text h4 { font-size: 15px; font-weight: 500; color: var(--mm-pj-ink); }
.mm-project__text a { color: var(--mm-pj-ink); }
.mm-project__imgs {                 /* one column; also sticky, so whichever column is shorter stays in view */
  position: sticky;
  top: calc(var(--wp--preset--spacing--50, 1.5rem) + 64px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 24px);
}
.admin-bar .mm-project__imgs { top: calc(var(--wp--preset--spacing--50, 1.5rem) + 96px); }
.mm-project__img { margin: 0; background: var(--wp--preset--color--mm-greige, #eae9e5); }
.mm-project__img img { display: block; width: 100%; height: auto; }

.mm-project__quote {                                  /* full width of the screen (up to the rail) */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: clamp(64px, 11vh, 104px) var(--mm-rail) 0 0;
  padding: clamp(48px, 8vh, 88px) var(--mm-pr) clamp(48px, 8vh, 88px) var(--mm-pl);
  background: var(--mm-pj-sage);
  color: #fff;
}
.mm-project__quote-mark {          /* the glyph sits ~0.08-0.19em down its line box: box trimmed to it */
  display: block;
  font-family: "Mistgak Signature", var(--mm-font);
  font-size: clamp(72px, 7vw, 110px);
  line-height: 1;
  height: 0.22em;
  margin-bottom: 0.18em;
  overflow: visible;
  color: rgba(255, 255, 255, 0.75);
}
.mm-project__quote > div { max-width: 62rem; }
.mm-project__quote blockquote { margin: 0; }
.mm-project__quote blockquote p { margin: 0; font-size: 20px; font-weight: 300; line-height: 1.6; text-wrap: pretty; }
.mm-project__quote figcaption { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.mm-project__quote-name { font-family: "Mistgak Signature", var(--mm-font); font-size: clamp(30px, 2.4vw, 36px); line-height: 1; }
.mm-project__quote-role { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; }

.mm-project__pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: clamp(80px, 13vh, 120px) var(--mm-rail) 0 0;
  border-top: 1px solid var(--mm-pj-line);
}
.mm-project__pager-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 40px var(--mm-pl);
  color: var(--mm-pj-ink);
  text-decoration: none;
  transition: background-color 0.25s ease;
}
.mm-project__pager-link + .mm-project__pager-link { border-left: 1px solid var(--mm-pj-line); }
.mm-project__pager-link--next { align-items: flex-end; text-align: right; }
.mm-project__pager-link:hover,
.mm-project__pager-link:focus-visible { background: var(--wp--preset--color--mm-greige, #eae9e5); color: var(--mm-pj-ink); }
.mm-project__pager-label { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mm-pj-body); }
.mm-project__pager-name { font-size: clamp(22px, 2vw, 28px); font-weight: 200; }

.mm-project__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px 40px;
  margin-right: var(--mm-rail);
  padding: clamp(56px, 10vh, 80px) var(--mm-pl);
  background: var(--mm-pj-ink);
  color: #fff;
}
.mm-project__cta-script { margin: 0; font-family: "Mistgak Signature", var(--mm-font); font-size: clamp(30px, 2.6vw, 36px); line-height: 1; color: #c9cdbf; }
.mm-project__cta-heading { margin: 10px 0 0; font-size: clamp(30px, 3.2vw, 44px); font-weight: 200; line-height: 1.05; color: #fff; }
.mm-project__cta-btn {             /* same size and type as the site's Spectra buttons */
  background: var(--wp--preset--color--mm-base, #f2f1ee);
  color: var(--mm-pj-ink);
  display: inline-flex;
  align-items: center;
  gap: 30px;
  padding: 5px 20px;
  border-radius: 300px;
  font-size: var(--wp--preset--font-size--small, 0.9rem);
  font-weight: 200;
  letter-spacing: 2px;
  line-height: 1.6;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.mm-project__cta-btn::after { content: ""; flex: none; width: 10px; height: 10px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z'/%3E%3C/svg%3E") center / contain no-repeat; } /* the site buttons' arrow */
.mm-project__cta-btn:hover,
.mm-project__cta-btn:focus-visible { background: var(--mm-pj-sage); color: #fff; }

@media (max-width: 900px) {
  .mm-project { --mm-pr: var(--mm-pl); }
  .mm-project__top { margin-right: 0; padding-top: 104px; }
  .mm-project__shot { width: 100%; max-height: 62vw; }
  .mm-project__facts-wrap { margin-right: 0; }
  .mm-project__sec,
  .mm-project__sec--text { grid-template-columns: 1fr; }
  .mm-project__copy,
  .mm-project__imgs { position: static; }
  .mm-project__pager { margin-right: 0; }
  .mm-project__cta { margin-right: 0; }
}
@media (max-width: 767px) {
  .mm-project__cta { flex-direction: column; justify-content: center; text-align: center; }   /* CTA bands stack and centre on phones */
}
@media (max-width: 600px) {
  .mm-project__quote { margin-right: 0; }
  .mm-project__pager { grid-template-columns: 1fr; }
  .mm-project__pager-link + .mm-project__pager-link { border-left: 0; border-top: 1px solid var(--mm-pj-line); }
}
