/*
Theme Name: Marengo Creative
Description: Portfolio theme based on the approved Marengo Creative design.
Version: 0.2.3
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: marengo-creative
*/

:root {
  --site-font: "Avenir Next", Avenir, system-ui, sans-serif;
  color: #1b1b19;
  background: #fff;
  font: 100%/1.45 var(--site-font);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--site-font); }
a { color: inherit; }
:focus-visible { outline: 3px solid #474e9b; outline-offset: 3px; }

.sr,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  height: 88px;
  padding-inline: clamp(16px, 2.6vw, 48px);
}

.site-header img {
  display: block;
  width: clamp(120px, 14vw, 184px);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 30px);
  font-weight: 600;
}

.site-header nav > * { padding-block: 8px; }
.site-header [aria-current] { color: #626262; }

.site-header a,
.site-footer a,
.card { text-decoration: none; }

.site-footer {
  width: min(1440px, 91%);
  margin-inline: auto;
  border-top: 1px solid #dadad6;
  padding: 22px 0 32px;
  font-size: .88rem;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer a:hover,
.back:hover { text-decoration: underline; text-underline-offset: 5px; }

#home h1 {
  width: min(92%, 1250px);
  margin: 0 auto;
  padding-block: clamp(52px, 9vw, 145px);
  color: #151515;
  font: 600 clamp(2rem, 4.25vw, 3.75rem)/1.05 var(--site-font);
  letter-spacing: -.055em;
  text-align: center;
  text-wrap: balance;
}

.profession { display: block; }

#filters {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 10px;
  padding: 24px 16px 30px;
}

#filters a {
  padding: 6px;
  text-decoration: none;
  font-size: .94rem;
  font-weight: 600;
}

#filters a:is([aria-current], :hover) { color: #616161; }

#grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  position: relative;
  display: block;
  isolation: isolate;
  overflow: hidden;
}

.card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #f1f1ef;
}

.card .caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  color: white;
  background: rgba(16, 16, 16, .78);
  opacity: 0;
  transition: opacity .2s ease;
}

.caption strong { font: 600 1.375rem/1.12 var(--site-font); }
.caption small { margin-top: 6px; font-size: .82rem; }
.card:is(:hover, :focus-visible) .caption { opacity: 1; }
.card:focus-visible { outline-offset: -3px; }

.portfolio-more {
  text-align: center;
  margin: 30px 0 48px;
}

#load-more-projects {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: .55rem 1.15rem;
  border: 1px solid #767676;
  border-radius: 3px;
  font-weight: 600;
  text-decoration: none;
}

#load-more-projects:hover { background: #f1f1ef; }
#load-more-projects[aria-disabled="true"] { cursor: progress; }

.portfolio-empty { width: min(91%, 1320px); margin-inline: auto; }

.clients {
  width: min(91%, 1320px);
  margin-inline: auto;
  padding: 24px 0 42px;
}

.clients h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -.045em;
}

#home .clients .wp-block-gallery.marengo-client-logos {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  margin: 0;
  scroll-snap-type: x proximity;
}

#home .clients .marengo-client-logos.is-carousel {
  scrollbar-width: none;
}

#home .clients .wp-block-gallery.has-nested-images.marengo-client-logos .wp-block-image {
  display: block;
  flex: 0 0 25%;
  width: 25%;
  min-width: 164px;
  height: 116px;
  margin: 0;
  scroll-snap-align: start;
}

#home .clients .wp-block-gallery.marengo-client-logos .wp-block-image img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 20px clamp(18px, 3.2vw, 48px);
  object-fit: contain;
  transform: scale(.65);
}

#detail {
  width: min(91%, 1320px);
  min-height: 65vh;
  padding-block: 32px;
  margin-inline: auto;
}

#detail h1 { color: #303033; }

.information-page h1 {
  margin: 32px 0;
  font-size: clamp(2.1rem, 6.35vw, 7rem);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -.072em;
}

.information-page p { max-width: 72ch; white-space: pre-line; }

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 700px) minmax(0, 400px);
  gap: clamp(34px, 6vw, 88px);
  justify-content: center;
  margin: 36px auto 64px;
}

.project-gallery { grid-area: 1 / 1; }
.project-copy {
  grid-area: 1 / 2;
  display: flex;
  flex-direction: column;
}
.project-gallery img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto 20px;
}

.project-copy h1 {
  margin: 0 0 .3em;
  font: 600 clamp(1.75rem, 2.3vw, 2.25rem)/1.14 var(--site-font);
  letter-spacing: -.035em;
  order: -3;
}

.project-copy p,
.project-copy li {
  max-width: 72ch;
  color: #66666a;
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.project-copy p { margin: 0 0 .85em; }

.project-copy .project-category {
  margin: 0 0 1.35rem;
  color: #57575b;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .035em;
  order: -2;
}

.project-copy dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .3em 1.25em;
  margin: 0 0 1em;
  padding: 1em 0;
  border-block: 1px solid #dededa;
  order: -1;
}

.project-copy dt,
#project-description h2 {
  font: 600 1rem/1.3 var(--site-font);
}

.project-copy dt { line-height: 1.45; }
.project-copy dd { margin: 0; color: #66666a; }
#project-description h2 { margin: 1.65em 0 .4em; }
#project-description ul { padding-left: 1.25rem; margin-top: .4em; }
.project-toggle { display: none; }

@media (hover: none) {
  .card .caption {
    inset: auto 0 0;
    padding: 30px 12px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .85));
    opacity: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .profession { animation: type-arrival .65s ease-out both; }

  @keyframes type-arrival {
    from { opacity: 0; transform: translateY(.15em); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .caption strong { transform: translateY(5px); transition: transform .22s ease-out; }
  .card:is(:hover, :focus-visible) .caption strong { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .card .caption { transition: none; }
}

@media (max-width: 800px) {
  #grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .project-layout { display: flex; flex-direction: column; gap: 20px; }
  .project-copy .lead { order: -1; }
  .project-copy dl { margin-top: 1em; }

  .project-toggle:not([hidden]) {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: .65em;
    min-height: 44px;
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    font: 600 .875rem var(--site-font);
    cursor: pointer;
  }

  .project-toggle::after {
    content: '';
    width: .45em;
    height: .45em;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
  }

  .project-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
  .project-toggle:not([hidden])[aria-expanded="false"] + #project-description { display: none; }
}

@media (max-width: 530px) {
  .site-header { height: 72px; }
  .site-header nav { font-size: .88rem; }
  #filters { padding: 14px 12px 20px; }
  #grid { grid-template-columns: minmax(0, 1fr); }
  .card img { aspect-ratio: 4 / 3; }
  .information-page h1 { font-size: 9.3vw; }
  .clients h2 { font-size: 1.6rem; }
}
