/*
  Quality Ag Inc site styles.

  Matches the old Enfold-based site. Sizes, spacing, and colors were measured from the
  live pages at 1280 px wide on October 25, 2026. Colors and fonts are tokens in :root;
  everything else reads from them.
*/

@font-face {
  font-family: "Metrophobic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/metrophobic-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Palette (Enfold "main", "alternate", "footer" and "socket" color sets) */
  --gold: #efbb20;
  --gold-dark: #db9d00;
  --heading: #2c353d;
  --text: #9c9c9c;
  --meta: #919191;
  --excerpt: #808080;
  --number: #222222;
  --border: #e1e1e1;
  --bg: #ffffff;
  --bg-soft: #f8f8f8;
  --dark: #2c353d;
  --dark-border: #5b646b;
  --socket: #5b646b;
  --nav-text: #e6e6e6;

  /* Type: body is Helvetica Neue (Arial on Windows), headings are Metrophobic */
  --font-body: "Helvetica Neue", HelveticaNeue, Helvetica, Arial, sans-serif;
  --font-heading: "Metrophobic", "Helvetica Neue", HelveticaNeue, Helvetica, Arial, sans-serif;
  --font-amp: Baskerville, "Palatino Linotype", Palatino, "Times New Roman", serif;

  /* Layout */
  --container: 1310px;
  --container-pad: 50px;
  --col-gap: 6%;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
}

body.no-scroll {
  overflow: hidden;
}

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

svg {
  display: block;
  fill: currentColor;
}

.icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  color: var(--gold-dark);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--heading);
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.1;
}

p {
  margin: 0.85em 0;
}

strong {
  font-weight: 700;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: var(--heading);
  color: #fff;
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 100;
  margin-bottom: 3px;
  background: var(--bg);
  box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.1);
}

.header-meta {
  height: 29px;
  background: var(--bg-soft);
}

.header-main .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 195px;
  transition: height 0.2s ease;
}

.logo img {
  width: auto;
  height: 180px;
  transition: height 0.2s ease;
}

.social-links {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #808080;
  transition: background-color 0.2s, color 0.2s;
}

.social-links svg {
  width: 15px;
  height: 15px;
}

.social-links .social-facebook:hover {
  background: #37589b;
  color: #fff;
}

.social-links .social-linkedin:hover {
  background: #419cca;
  color: #fff;
}

.nav-toggle {
  display: none;
}

.site-nav {
  background: var(--dark);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0 13px;
  color: var(--nav-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 50px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #fff;
}

.site-nav .container {
  padding-left: var(--container-pad);
}

/* Sticky, shrinking header on desktop (only with JS, which adds .js and .is-scrolled) */
@media (min-width: 990px) {
  .js .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin-bottom: 0;
  }

  .js body {
    padding-top: 277px;
  }

  .js .site-header.is-scrolled .header-main .container {
    height: 98px;
  }

  .js .site-header.is-scrolled .logo img {
    height: 88px;
  }
}

@media (max-width: 989px) {
  .header-main .container {
    justify-content: center;
    height: 100px;
  }

  .logo img {
    height: 70px;
  }

  .header-main .social-links {
    display: none;
  }

  .js .nav-toggle {
    position: absolute;
    top: 50%;
    right: var(--container-pad);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #333;
    cursor: pointer;
  }

  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    display: block;
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s, background-color 0.2s;
  }

  .nav-toggle-bars {
    position: relative;
  }

  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .nav-toggle-bars::before { top: -8px; }
  .nav-toggle-bars::after { top: 8px; }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars {
    background: transparent;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
    transform: translateY(8px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Side panel menu, like the old site's mobile menu */
  .js .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    width: min(350px, 85vw);
    padding-top: 129px;
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s;
  }

  .js .site-nav.is-open {
    transform: none;
    visibility: visible;
  }

  .js .site-nav .container {
    padding: 0;
  }

  .js .site-nav ul {
    display: block;
    border-top: 1px solid var(--border);
  }

  .js .site-nav a {
    padding: 12px 30px;
    border-bottom: 1px solid var(--border);
    color: #333;
    font-size: 15px;
    line-height: 1.5;
  }

  .js .site-nav a:hover,
  .js .site-nav a:focus-visible,
  .js .site-nav a[aria-current="page"] {
    color: var(--gold);
  }

  .nav-open .site-header {
    z-index: 300;
  }

  .nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.4);
  }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  padding: 15px 30px 13px;
  border: 3px solid #fff;
  border-radius: 100px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  transition: background-color 0.2s, color 0.2s;
}

.button:hover,
.button:focus-visible {
  background: #fff;
  color: var(--heading);
}

.button-small {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ---------- Sections ---------- */

.section {
  padding: 50px 0;
}

.section-large {
  padding: 70px 0;
}

.section-gold {
  background: var(--gold);
}

.section-dark {
  background: var(--dark);
  color: #fff;
}

.section-dark h2,
.section-dark h3 {
  color: #fff;
}

.section-bordered {
  border-top: 1px solid var(--border);
}

.section-title {
  margin: 0 0 46px;
  font-size: 28px;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
}

.section-title::after {
  content: "";
  display: block;
  width: 50px;
  height: 2px;
  margin: 17px auto 0;
  background: var(--gold);
}

.section-title-plain {
  margin: 0;
}

.section-title-plain::after {
  display: none;
}

.page-title {
  font-size: 34px;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
}

.page-title::after {
  content: "";
  display: block;
  width: 250px;
  height: 2px;
  margin: 73px auto 0;
  background: var(--gold);
}

/* Left-aligned heading with a short gold rule under it */
.ruled {
  margin-bottom: 20px;
}

.ruled::after {
  content: "";
  display: block;
  width: 50px;
  height: 2px;
  margin-top: 21px;
  background: var(--gold);
}

.content-title {
  font-size: 28px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.content-title.ruled {
  margin-bottom: 35px;
}

.content-subtitle {
  font-size: 20px;
}

.rule {
  display: block;
  width: 50px;
  height: 2px;
  margin: 35px 0 21px;
  border: 0;
  background: var(--gold);
}

.divider {
  height: 1px;
  margin: 12px 0;
  border: 0;
  background: var(--border);
}

/* Baskerville italic ampersand in headings */
.amp {
  color: var(--gold);
  font-family: var(--font-amp);
  font-size: 1.3em;
  font-style: italic;
  line-height: 0.5;
}

.lead {
  font-size: 18px;
}

.lead strong,
.content strong {
  color: var(--gold);
}

/* ---------- Photo sliders ---------- */

.slider {
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.slides {
  position: relative;
  aspect-ratio: 1500 / 430;
}

.slider-service .slides { aspect-ratio: 845 / 321; }
.slider-wide .slides { aspect-ratio: 1500 / 630; }
.slider-company .slides { aspect-ratio: 1210 / 423; }

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s linear, visibility 0.45s;
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slider-content {
  margin-bottom: 50px;
}

.slider-content .slide img {
  border-radius: 3px;
}

.slider-prev,
.slider-next {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-top: -30px;
  padding: 0;
  border: 0;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
}

.slider-prev { left: 15px; }
.slider-next { right: 15px; }

.slider-prev svg,
.slider-next svg {
  width: 26px;
  height: 26px;
}

.slider-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.3s;
}

.slider-dot {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
}

.slider-dot[aria-current="true"] {
  background: #fff;
}

.slider:hover .slider-prev,
.slider:hover .slider-next,
.slider:hover .slider-dots,
.slider:focus-within .slider-prev,
.slider:focus-within .slider-next,
.slider:focus-within .slider-dots {
  opacity: 1;
}

/* Home slider caption */
.slider-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100px;
  z-index: 2;
  padding: 20px 0;
  color: #fff;
  pointer-events: none;
}

.slider-caption .container > * {
  pointer-events: auto;
}

.slider-title {
  margin: 0 0 14px;
  color: #fff;
  font-size: 30px;
  font-weight: 600;
  text-transform: uppercase;
}

.slider-text {
  margin: 15px 0;
  font-size: 40px;
  line-height: 1.3;
  text-transform: uppercase;
}

.slider-text a {
  color: inherit;
}

.slider-caption .button {
  margin: 20px 0 3px;
}

@media (max-width: 1279px) {
  .slider-caption { bottom: 7.8vw; }
  .slider-title { font-size: 2.34vw; }
  .slider-text { font-size: 3.125vw; }
}

@media (max-width: 767px) {
  .slider-caption,
  .slider-prev,
  .slider-next,
  .slider-dots {
    display: none;
  }
}

/* ---------- Home: gold callout ---------- */

.callout .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.callout-text {
  max-width: 73.5%;
  margin: 0;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 1.1;
}

.callout .button {
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .callout .container {
    flex-direction: column;
    align-items: flex-end;
  }

  .callout-text {
    max-width: none;
    font-size: 24px;
  }
}

/* ---------- Home: services ---------- */

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--col-gap);
  padding-bottom: 50px;
}

.service-card img {
  width: 100%;
  max-width: 300px;
  margin: 0 auto 33px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 3px;
}

.service-card h3 {
  font-size: 20px;
}

.service-card h3::before {
  content: "";
  display: block;
  width: 50px;
  height: 2px;
  margin-bottom: 20px;
  background: var(--gold);
}

@media (max-width: 989px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 40px;
  }
}

@media (max-width: 767px) {
  .service-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Icon boxes ("Why us?") ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--col-gap);
}

.feature {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  column-gap: 22px;
  align-items: start;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--heading);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
}

.feature h3 {
  margin-bottom: -3px;
  padding-top: 2px;
  font-size: 18.75px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.feature p {
  margin: 0.85em 0 0;
}

.section-dark .feature-icon {
  border-color: var(--dark-border);
  color: #fff;
}

.features-after-text {
  margin-top: 65px;
}

@media (max-width: 989px) {
  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 30px;
  }
}

/* ---------- Home: counters ---------- */

.counters {
  padding: 50px 0;
  border-top: 1px solid var(--border);
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--col-gap);
  text-align: center;
}

.counter-value {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  color: var(--number);
  font-size: 40px;
  letter-spacing: -2px;
  line-height: 40px;
}

.counter-icon svg {
  width: 42px;
  height: 42px;
  margin-right: 10px;
}

.counter-label {
  display: block;
  color: var(--number);
  font-size: 18px;
  line-height: 1.3;
}

@media (max-width: 767px) {
  .counter-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 20px;
  }
}

/* ---------- Home: featured work ---------- */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 65px;
}

.featured-tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 384.5 / 304.6;
  background: var(--bg);
}

.featured-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease-in-out;
}

/* On mouse screens the photos sit at 70% and come up to full on hover, as before */
@media (hover: hover) and (pointer: fine) {
  .featured-tile img {
    opacity: 0.7;
  }

  .featured-tile:hover img,
  .featured-tile:focus-visible img {
    opacity: 1;
  }
}

.featured-tile-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px;
  background: var(--bg-soft);
}

.featured-tile-body::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--bg-soft);
  transform: rotate(45deg);
}

.featured-tile-title {
  display: block;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.featured-tile-sub {
  display: block;
  padding-top: 4px;
  color: var(--text);
}

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

@media (max-width: 479px) {
  .featured-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Pages with the left sidebar (Our Services) ---------- */

.sidebar-layout {
  display: grid;
  grid-template-columns: 27% minmax(0, 1fr);
}

.sidebar-layout .content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 50px 0 50px 50px;
}

.sidebar {
  grid-column: 1;
  grid-row: 1;
  padding: 50px 50px 50px 0;
  border-right: 1px solid var(--border);
  color: var(--meta);
  text-align: right;
}

.sidebar a {
  color: inherit;
}

.sidebar-nav {
  padding-bottom: 54px;
}

.sidebar-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-nav a {
  display: block;
  padding: 4px 0 5px;
  font-size: 13px;
  line-height: 24.75px;
}

.sidebar-nav a:hover {
  color: var(--heading);
}

.sidebar-nav a[aria-current="page"] {
  margin: 0 -52px 4px 0;
  padding: 7px 59px 7px 0;
  background: var(--bg-soft);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
  color: var(--heading);
  font-weight: 700;
}

.widget {
  padding: 30px 0;
}

.widget-title {
  margin: 0 0 15px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--heading);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar strong {
  color: var(--gold);
}

.map {
  display: block;
  width: 100%;
  height: 230px;
  border: 0;
  background: var(--bg-soft);
}

.map-wide {
  height: 400px;
}

.content ul {
  margin: 0 0 20px 7px;
  padding: 0;
}

.content li {
  margin-left: 15px;
  padding: 3px 0;
}

/* Two-column rows of text and photos */
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: start;
}

.split + .split {
  margin-top: 50px;
}

.split-photo {
  width: 100%;
  aspect-ratio: 495 / 400;
  object-fit: cover;
  border-radius: 3px;
}

.split > div > :first-child {
  margin-top: 0;
}

.split-offset {
  padding-top: 75px;
}

/* Keeps the old site's spacing, where an empty image slot sat under these photos */
.split-photo-gap {
  margin-bottom: 35px;
}

.split-graphic {
  margin: 24px auto 0;
}

@media (max-width: 767px) {
  .sidebar-layout {
    display: block;
  }

  .sidebar-layout .content {
    padding: 40px 0 20px;
  }

  .sidebar {
    padding: 20px 0 30px;
    border-top: 1px solid var(--border);
    border-right: 0;
    text-align: left;
  }

  .sidebar-nav a[aria-current="page"] {
    margin: 0 0 4px;
    padding: 7px 7px 7px 10px;
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 30px;
  }

  .split-offset {
    padding-top: 0;
  }

  .split-photo-first {
    order: -1;
  }
}

/* ---------- Projects list ---------- */

.sort-bar {
  display: none;
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  color: var(--meta);
  font-size: 13.5px;
  text-align: center;
}

.js .sort-bar {
  display: block;
}

.sort-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--meta);
  font: inherit;
  cursor: pointer;
}

.sort-button:hover,
.sort-button[aria-pressed="true"] {
  color: var(--gold);
}

.sort-sep {
  padding: 0 6px;
}

.project-row {
  display: grid;
  grid-template-columns: 33.3% minmax(0, 1fr);
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.project-row[hidden] {
  display: none;
}

.project-row-text {
  align-self: center;
  padding: 20px;
}

.project-row-title {
  margin: 0 0 20px;
  font-size: 25px;
  font-weight: 600;
}

.project-row-sub {
  display: block;
  color: var(--excerpt);
}

.project-row-image {
  position: relative;
  background: var(--bg-soft);
}

.project-row-image::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  z-index: 1;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  background: var(--bg);
  transform: rotate(45deg);
}

.project-row-image img {
  width: 100%;
}

.project-row-text:hover .project-row-title {
  color: var(--gold-dark);
}

/* White overlay that fades to 70% over a hovered photo (mouse screens), as before */
@media (hover: hover) and (pointer: fine) {
  .project-row-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg);
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
  }

  .project-row-image:hover::after,
  .project-row:focus-visible .project-row-image::after {
    opacity: 0.7;
  }
}

@media (max-width: 989px) {
  .project-row-title {
    margin-bottom: 10px;
    font-size: 20px;
  }
}

@media (max-width: 767px) {
  .project-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-row-image::before {
    top: -5px;
    left: 50%;
    margin: 0 0 0 -5px;
  }
}

/* ---------- Project pages ---------- */

.project-hero {
  position: relative;
  overflow: hidden;
  background: var(--dark);
  color: #fff;
  text-align: center;
}

.project-hero-bg,
.project-hero::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The old site's parallax layer was about 2.16 times the section height, bottom showing */
.project-hero-bg {
  top: auto;
  bottom: 0;
  height: 216%;
  object-fit: cover;
}

.project-hero::before {
  content: "";
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
}

.project-hero .container {
  position: relative;
  z-index: 2;
  padding-top: 50px;
  padding-bottom: 50px;
}

.project-hero h1 {
  color: #fff;
  font-size: 40px;
}

.project-hero-sub {
  margin: 4.5px 0 0;
  font-size: 15px;
  line-height: 1.3;
  opacity: 0.8;
}

.project-hero-sub::after {
  content: "";
  display: block;
  width: 50px;
  height: 2px;
  margin: 17px auto 47px;
  background: var(--gold);
}

.scroll-down {
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 60px;
  margin-left: -40px;
  color: #fff;
  opacity: 0.95;
}

.scroll-down:hover {
  color: #fff;
  opacity: 1;
}

.scroll-down svg {
  width: 40px;
  height: 40px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-bottom: 2px;
}

.gallery-item {
  display: block;
  padding: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.gallery-item:hover {
  opacity: 0.5;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--col-gap);
  margin: 0;
  text-align: center;
}

.stat {
  display: flex;
  flex-direction: column-reverse;
}

.stat dd {
  margin: 0 0 4px;
  color: #fff;
  font-size: 40px;
  letter-spacing: -2px;
  line-height: 40px;
}

.stat-unit {
  font-size: 32px;
  opacity: 0.5;
}

.stat dt {
  font-size: 15px;
  line-height: 1.3;
}

/* Previous/next project tabs on the screen edges */
.post-nav a {
  position: fixed;
  top: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  width: 31px;
  height: 110px;
  margin-top: -55px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.1);
  color: #fff;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.post-nav-prev {
  left: 0;
  border-radius: 0 4px 4px 0;
}

.post-nav-next {
  right: 0;
  flex-direction: row-reverse;
  border-radius: 4px 0 0 4px;
}

.post-nav-arrow {
  flex: 0 0 31px;
  display: flex;
  justify-content: center;
}

.post-nav-arrow svg {
  width: 18px;
  height: 18px;
}

.post-nav-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 0 0 auto;
  padding-right: 15px;
  font-size: 13px;
  line-height: 1.65;
}

.post-nav-next .post-nav-info {
  flex-direction: row-reverse;
  padding: 0 0 0 15px;
  text-align: right;
}

.post-nav-title {
  width: 140px;
}

.post-nav-info img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.post-nav a:hover,
.post-nav a:focus-visible {
  width: 285px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

@media (max-width: 767px) {
  .project-hero h1 {
    font-size: 32px;
  }

  .gallery-item {
    padding: 3px;
  }

  .stats {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 20px;
  }

  .post-nav {
    display: none;
  }
}

/* ---------- Contact ---------- */

.contact-text {
  margin-top: 83px;
}

.contact-text strong {
  color: var(--gold);
}

.contact-text a {
  color: inherit;
}

@media (max-width: 767px) {
  .contact-text {
    margin-top: 40px;
  }
}

/* ---------- Company ---------- */

.company-text {
  padding-top: 30px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--dark-border);
  background: var(--dark);
  color: #fff;
}

.footer-main {
  padding: 15px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--col-gap);
}

.site-footer .widget {
  padding: 0;
  margin: 30px 0;
}

.site-footer .widget-title {
  margin-top: 14px;
  border-color: var(--dark-border);
  color: #fff;
}

.site-footer address {
  font-style: normal;
}

.site-footer a {
  color: inherit;
}

.site-footer a:hover {
  color: var(--gold);
}

.socket {
  margin-top: -1px;
  border-top: 1px solid var(--socket);
  background: var(--socket);
  color: #fff;
  font-size: 11px;
}

.socket .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 55px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.socket p {
  margin: 0;
}

.socket .social-links a {
  color: var(--border);
}

.scroll-top {
  position: fixed;
  right: 50px;
  bottom: 50px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 2px;
  background: var(--socket);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.scroll-top.is-visible {
  opacity: 0.5;
  visibility: visible;
}

.scroll-top:hover,
.scroll-top:focus-visible {
  color: #fff;
  opacity: 1;
}

.scroll-top svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .socket .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .socket .social-links {
    align-self: flex-end;
  }

  .scroll-top {
    right: 20px;
    bottom: 20px;
  }
}

/* ---------- Small screens: container ---------- */

@media (max-width: 767px) {
  :root {
    --container-pad: 7.5%;
  }

  .section-large {
    padding: 50px 0;
  }

  .page-title {
    font-size: 26px;
  }

  .page-title::after {
    width: 150px;
    margin-top: 40px;
  }
}

/* ---------- 404 ---------- */

.not-found {
  text-align: center;
}

.not-found .button {
  margin: 10px 5px 0;
  border-color: var(--gold);
  color: var(--gold);
}

.not-found .button:hover,
.not-found .button:focus-visible {
  background: var(--gold);
  color: #fff;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 11, 11, 0.9);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  max-width: calc(100vw - 8rem);
  max-height: calc(100vh - 6rem);
  text-align: center;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  margin: 0 auto;
}

.lightbox-figure figcaption {
  margin-top: 0.75rem;
  color: #ccc;
  font-size: 13px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close {
  top: 0.75rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  font-size: 2.25rem;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 80px;
  font-size: 3rem;
}

.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

@media (max-width: 600px) {
  .lightbox-figure { max-width: 100vw; }
  .lightbox-prev,
  .lightbox-next { top: auto; bottom: 0.5rem; transform: none; }
}

/* ---------- Fade-ins on load ----------
   The first photo of each slider fades in once loaded, then the home caption slides in;
   Projects page photos fade in 100 ms apart. early.js adds .anim before the page is
   drawn (unless the visitor prefers reduced motion); site.js adds the rest. */

.anim .slider:not(.is-loaded) .slide.is-active {
  opacity: 0;
}

.anim .slider:not(.caption-in) .slider-caption .container > * {
  visibility: hidden;
}

.anim .caption-in .slider-title,
.anim .caption-in .slider-caption .button {
  animation: caption-from-top 0.5s ease-out;
}

.anim .caption-in .slider-caption .button {
  animation-duration: 1.2s;
}

.anim .caption-in .slider-text {
  animation: caption-from-bottom 0.5s ease-out;
}

.anim .project-row-image img {
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.anim .project-row-image img.is-loaded {
  opacity: 1;
}

@keyframes caption-from-top {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: none; }
}

@keyframes caption-from-bottom {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Scroll-in animations ----------
   Same motion and timing as the old theme. early.js adds .anim, plus .anim-desktop on
   mouse-driven screens, only when the visitor hasn't asked for reduced motion. */

.anim-desktop [data-animate]:not(.is-animated) {
  opacity: 0;
}

.anim-desktop [data-animate="up"].is-animated {
  animation: fly-up 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.anim-desktop [data-animate="from-left"].is-animated {
  animation: fly-from-left 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.anim-desktop [data-animate="from-right"].is-animated {
  animation: fly-from-right 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.anim-desktop [data-masonry] > :not(.is-animated) {
  opacity: 0;
  visibility: hidden;
}

.anim-desktop [data-masonry] > .is-animated {
  animation: flip-up 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.075);
}

.anim [data-gallery] > :not(.is-animated) {
  opacity: 0.1;
  transform: scale(0.5);
}

.anim [data-gallery] > .is-animated {
  animation: pop-in 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fly-up {
  from { opacity: 0; transform: translateY(50%); }
  to { opacity: 1; transform: none; }
}

@keyframes fly-from-left {
  from { opacity: 0; transform: translateX(-10%); }
  to { opacity: 1; transform: none; }
}

@keyframes fly-from-right {
  from { opacity: 0; transform: translateX(10%); }
  to { opacity: 1; transform: none; }
}

@keyframes flip-up {
  from { opacity: 0.1; transform: perspective(600px) translateZ(300px) translateY(200px) rotateX(-70deg); }
  50% { opacity: 1; }
  to { opacity: 1; transform: perspective(600px); }
}

@keyframes pop-in {
  from { opacity: 0.1; transform: scale(0.5); }
  to { opacity: 1; transform: none; }
}

@media print {
  [data-animate],
  [data-masonry] > *,
  [data-gallery] > *,
  .slide.is-active,
  .slider-caption .container > *,
  .project-row-image img {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
