/*
Theme Name: Visual History Lab
Theme URI: https://visualhistorylab.org
Author: The Visual History Lab
Description: An editorial block theme joining art-historical inquiry with scientific analysis.
Version: 1.0.10
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: visual-history-lab
*/

:root {
  --vhl-border: 1px solid rgba(25, 24, 20, 0.22);
  --vhl-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

a {
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--wp--preset--color--signal);
  outline-offset: 3px;
}

::selection {
  color: var(--wp--preset--color--ink);
  background: var(--wp--preset--color--signal);
}

.wp-site-blocks {
  min-height: 100vh;
}

.wp-site-blocks > main > .wp-block-post-content {
  display: contents;
}

.vhl-header {
  position: relative;
  z-index: 20;
  border-bottom: var(--vhl-border);
}

.vhl-header__inner,
.vhl-footer__inner {
  min-height: 84px;
}

.vhl-wordmark {
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.vhl-wordmark a {
  text-decoration: none;
}

.vhl-kicker {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.vhl-kicker::before {
  width: 0.72rem;
  height: 0.72rem;
  content: "";
  background: var(--wp--preset--color--signal);
  clip-path: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0 50%);
}

.vhl-hero {
  position: relative;
  min-height: calc(100vh - 85px);
  border-bottom: var(--vhl-border);
}

.vhl-hero__copy {
  position: relative;
  z-index: 2;
}

.vhl-display {
  max-width: 13ch;
  text-wrap: balance;
  letter-spacing: -0.065em;
}

.vhl-hero__visual {
  min-height: 640px;
  overflow: hidden;
  border-left: var(--vhl-border);
  background: #bfcac6;
}

.vhl-hero-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 640px;
}

.vhl-section {
  border-bottom: var(--vhl-border);
}

.vhl-section-title {
  max-width: 17ch;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.vhl-grid {
  border-top: var(--vhl-border);
  border-left: var(--vhl-border);
}

.vhl-card {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border-right: var(--vhl-border);
  border-bottom: var(--vhl-border);
  transition: color 350ms var(--vhl-ease), background 350ms var(--vhl-ease);
}

.vhl-card::after {
  position: absolute;
  right: 1.5rem;
  bottom: 1.3rem;
  width: 1.1rem;
  height: 1.1rem;
  content: "↗";
  font-size: 1.1rem;
  transition: transform 350ms var(--vhl-ease);
}

.vhl-card:hover {
  background: var(--wp--preset--color--ink);
  color: var(--wp--preset--color--paper);
}

.vhl-card:hover::after {
  transform: translate(0.25rem, -0.25rem);
}

.vhl-card a {
  color: inherit;
}

.vhl-card__index {
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.vhl-service {
  min-height: 500px;
  border-right: var(--vhl-border);
  border-bottom: var(--vhl-border);
}

.vhl-service__number {
  font-size: clamp(4rem, 9vw, 8rem);
  line-height: 0.75;
  letter-spacing: -0.08em;
  opacity: 0.14;
}

.vhl-band {
  overflow: hidden;
  color: var(--wp--preset--color--paper);
  background: var(--wp--preset--color--ink);
}

.vhl-marquee {
  display: flex;
  width: max-content;
  animation: vhl-marquee 28s linear infinite;
}

.vhl-marquee span {
  display: block;
  padding-right: 1.5ch;
  white-space: nowrap;
}

.vhl-hex-field {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(38, 71, 112, 0.88), rgba(148, 61, 43, 0.7)),
    var(--wp--preset--color--cobalt);
}

.vhl-hex-field::before,
.vhl-hex-field::after {
  position: absolute;
  width: 52%;
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(245, 241, 230, 0.44);
  clip-path: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0 50%);
  animation: vhl-orbit 18s linear infinite;
}

.vhl-hex-field::before {
  top: -6%;
  left: 5%;
}

.vhl-hex-field::after {
  right: -2%;
  bottom: -12%;
  animation-direction: reverse;
}

.vhl-judgment-image {
  min-height: 620px;
  background-color: var(--wp--preset--color--ink);
  background-image:
    linear-gradient(180deg, transparent 68%, rgba(25, 24, 20, 0.32)),
    url("assets/images/in-situ-artwork-analysis.webp");
  background-repeat: no-repeat;
  background-position: center 46%;
  background-size: cover;
}

.vhl-image-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: minmax(330px, 38vw) minmax(260px, 27vw);
  gap: 1px;
  overflow: hidden;
  background: rgba(25, 24, 20, 0.22);
}

.vhl-image-grid .wp-block-image {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--wp--preset--color--ink);
}

.vhl-image-grid .wp-block-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 500ms var(--vhl-ease), transform 700ms var(--vhl-ease);
}

.vhl-image-grid .wp-block-image:hover img {
  filter: saturate(0.82) contrast(1.05);
  transform: scale(1.018);
}

.vhl-image-grid .wp-element-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1rem;
  margin: 0;
  color: var(--wp--preset--color--paper);
  font-size: var(--wp--preset--font-size--xs);
  letter-spacing: 0.035em;
  background: linear-gradient(transparent, rgba(25, 24, 20, 0.86));
}

.vhl-image-grid__scan {
  grid-column: 1 / 8;
  grid-row: 1 / 3;
}

.vhl-image-grid__field {
  grid-column: 8 / 13;
  grid-row: 1;
}

.vhl-image-grid__field img {
  object-position: center 38%;
}

.vhl-image-grid__micro {
  grid-column: 8 / 10;
  grid-row: 2;
}

.vhl-image-grid__instrument {
  grid-column: 10 / 13;
  grid-row: 2;
}

.vhl-meta {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vhl-method-step {
  border-top: var(--vhl-border);
}

.vhl-method-step:last-child {
  border-bottom: var(--vhl-border);
}

.vhl-button .wp-block-button__link {
  display: inline-flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  min-width: 13rem;
  transition: transform 250ms var(--vhl-ease), box-shadow 250ms var(--vhl-ease);
}

.vhl-button .wp-block-button__link::after {
  content: "↗";
}

.vhl-button .wp-block-button__link:hover {
  box-shadow: 4px 4px 0 var(--wp--preset--color--signal);
  transform: translate(-2px, -2px);
}

.vhl-form {
  border-top: var(--vhl-border);
}

.vhl-form__trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.vhl-form__notice {
  padding: 1rem;
  border: 1px solid currentColor;
}

.vhl-form label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vhl-form input,
.vhl-form textarea,
.vhl-form select {
  width: 100%;
  padding: 1rem 0;
  color: var(--wp--preset--color--ink);
  font: inherit;
  border: 0;
  border-bottom: var(--vhl-border);
  border-radius: 0;
  outline: 0;
  background: transparent;
}

.vhl-form input:focus,
.vhl-form textarea:focus,
.vhl-form select:focus {
  border-bottom-color: var(--wp--preset--color--cobalt);
  box-shadow: 0 2px 0 var(--wp--preset--color--cobalt);
}

.vhl-partnership-cta {
  min-height: 680px;
  background-image:
    linear-gradient(
      90deg,
      #d54b35 0%,
      #d54b35 38%,
      rgba(213, 75, 53, 0.84) 46%,
      rgba(213, 75, 53, 0.08) 63%,
      transparent 100%
    ),
    url("assets/images/technical-portrait-cta.webp");
  background-repeat: no-repeat;
  background-position: center, right 42%;
  background-size: 100% 100%, 66% auto;
}

.vhl-partnership-cta > .wp-block-group > * {
  max-width: 44%;
  margin-right: auto !important;
  margin-left: 0 !important;
}

.vhl-personnel__portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  background: var(--wp--preset--color--celadon);
}

.vhl-personnel__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.88);
}

.vhl-personnel__bio {
  max-width: 66ch;
  line-height: 1.65;
}

.vhl-ai-hero-panel {
  position: relative;
  align-self: stretch;
  min-height: 28rem;
  padding: 0;
  overflow: hidden;
  background: var(--wp--preset--color--paper);
  border-left: var(--vhl-border);
}

.vhl-ai-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

.vhl-ai-hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.vhl-ai-hero-caption {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  margin: 0;
  padding: clamp(1.5rem, 4vw, 3rem);
  color: var(--wp--preset--color--paper);
  font-size: var(--wp--preset--font-size--lead);
  line-height: 1.35;
  text-shadow: 0 1px 12px rgba(25, 24, 20, 0.5);
  background: linear-gradient(
    to bottom,
    transparent 25%,
    rgba(25, 24, 20, 0.18) 48%,
    rgba(25, 24, 20, 0.9) 100%
  );
}

.vhl-ai-research-figure {
  width: 100%;
  max-width: none !important;
  margin: 0;
  background: #fff;
}

.vhl-ai-research-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.vhl-personnel__layout--alternate > .wp-block-column:first-child {
  order: 2;
}

.vhl-footer {
  color: var(--wp--preset--color--paper);
  background: var(--wp--preset--color--ink);
}

.vhl-footer a {
  color: inherit;
}

.wp-block-details {
  margin: 0;
  border-top: var(--vhl-border);
}

.wp-block-details:last-child {
  border-bottom: var(--vhl-border);
}

.wp-block-details summary {
  position: relative;
  padding: 1.5rem 3rem 1.5rem 0;
  font-size: var(--wp--preset--font-size--lead);
  cursor: pointer;
  list-style: none;
}

.wp-block-details summary::-webkit-details-marker {
  display: none;
}

.wp-block-details summary::after {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  content: "+";
  transform: translateY(-50%);
}

.wp-block-details[open] summary::after {
  content: "−";
}

.wp-block-details > :not(summary) {
  max-width: 62ch;
  padding-bottom: 1.5rem;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.has-js .vhl-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--vhl-ease), transform 700ms var(--vhl-ease);
}

.has-js .vhl-reveal.is-visible,
.editor-styles-wrapper .vhl-reveal {
  opacity: 1;
  transform: none;
}

@keyframes vhl-marquee {
  to { transform: translateX(-50%); }
}

@keyframes vhl-orbit {
  to { transform: rotate(360deg); }
}

@media (max-width: 781px) {
  .vhl-header__inner {
    width: 100%;
    min-height: 68px;
  }

  .vhl-hero {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: auto;
  }

  .vhl-hero > .wp-block-column,
  .vhl-section.wp-block-columns > .wp-block-column {
    width: 100%;
    flex-basis: 100% !important;
  }

  .vhl-hero__copy {
    overflow: hidden;
  }

  .vhl-hero__visual {
    width: 100%;
    min-height: min(120vw, 620px);
    border-top: var(--vhl-border);
    border-left: 0;
  }

  .vhl-hero-canvas {
    min-height: min(120vw, 620px);
  }

  .vhl-card {
    min-height: 290px;
  }

  .vhl-service {
    min-height: 380px;
  }

  .vhl-method-step {
    grid-template-columns: 1fr !important;
  }

  .vhl-judgment-image {
    min-height: min(125vw, 680px);
  }

  .vhl-image-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, minmax(320px, 112vw));
  }

  .vhl-image-grid .wp-block-image {
    grid-column: 1;
    grid-row: auto;
  }

  .vhl-partnership-cta {
    min-height: 700px;
    background-image:
      linear-gradient(
        180deg,
        rgba(213, 75, 53, 0.9) 0%,
        rgba(213, 75, 53, 0.78) 48%,
        rgba(213, 75, 53, 0.22) 76%,
        transparent 100%
      ),
      url("assets/images/technical-portrait-cta.webp");
    background-position: center, center 35%;
    background-size: cover;
  }

  .vhl-partnership-cta > .wp-block-group > * {
    max-width: 100%;
  }

  .vhl-personnel__layout--alternate > .wp-block-column:first-child {
    order: initial;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .has-js .vhl-reveal {
    opacity: 1;
    transform: none;
  }
}
