/*
 Theme Name: Mountain Fold Architecture theme, 2025
 Theme URI: http://mountainfold.uk/
 Author: Matthew Barrass
 Author URI: http://mountainfold.uk/
 Description: Custom theme for the Mountain Fold Architecture website
 Version: 1.2 - iOS Safari Viewport Units Fixed
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ===================================
   FONTS & GLOBAL RESETS
   =================================== */

@font-face {
  font-family: 'Fuller Sans DT Medium';
  src: url('../fonts/FullerSansDTMedium.eot');
  src: url('../fonts/FullerSansDTMedium.eot?#iefix') format('embedded-opentype'),
       url('../fonts/FullerSansDTMedium.woff2') format('woff2'),
       url('../fonts/FullerSansDTMedium.woff') format('woff'),
       url('../fonts/FullerSansDTMedium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Performance improvement */
}

/* Modern CSS Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth; /* Smooth scrolling */
}

/* ===================================
   CSS CUSTOM PROPERTIES & VIEWPORT MANAGEMENT
   =================================== */

:root {
  /* Typography */
  --font-primary: InterVariable, Inter, Helvetica, sans-serif;
  --font-heading: "Fuller Sans DT Medium", sans-serif;
  --font-serif: "IBM Plex Serif", serif;
  
  /* Colors */
  --color-bg: #fff;
  --color-text: #1b1917;
  --color-text-home: #fff;
  --color-link: #1b1917;
  --color-link-hover: #000;
  --color-accent: #ec762d;
  --color-accent-2: #4192d8;
  --color-accent-3: #44484e;
  --color-accent-4: #faf9f8;
  
  /* Typography Scale (Minor Third - 1.2) */
  --text-small: 0.833rem;
  --text-base: 1rem;
  --text-h6: 1.2rem;
  --text-h5: 1.44rem;
  --text-h4: 1.728rem;
  --text-h3: 2.074rem;
  --text-h2: 2.488rem;
  --text-h1: 2.986rem;
  
  /* Layout & Grid */
  --body-width: 100vw;
  --column-count-mobile: 2;
  --column-count-tablet: 8;
  --column-count-desktop: 16;
  --row-height: 84px;
  --gap: 21px;
  --gap-mobile: 21px;
  --gap-tablet: 21px;
  --gap-desktop: 21px;
  
  /* Spacing */
  --margin-mobile: 21px;
  --margin-tablet: 42px;
  --margin-desktop: 63px;
  --margin-large: 84px;
  
  /* Calculated widths */
  --column-width-mobile: calc(50vw - (var(--gap-mobile) * 1.5));
  --column-width-desktop: calc(((var(--body-width) - (2 * var(--margin-desktop))) - ((var(--column-count-desktop) - 1) * var(--gap-desktop))) / var(--column-count-desktop));
  
  /* Transitions */
  --transition-fast: 0.125s ease-out;
  --transition-base: 0.25s ease-out;
  --transition-slow: 0.3s ease;
  
  /* ===================================
     VIEWPORT UNITS - iOS Safari Fixed
     =================================== */
  
  /* Full viewport - adaptive to browser UI changes */
  --viewport-full: 100vh;
  --viewport-half: 50vh;
  --viewport-third: 33.333vh;
  --viewport-quarter: 25vh;
  
  /* Safe viewport - always fits visible area */
  --viewport-safe: 100vh;
  --viewport-safe-half: 50vh;
  
  /* Large viewport - maximum immersion when UI hidden */
  --viewport-large: 100vh;
  
  /* Common calculations for layouts */
  --slideshow-height: 100vh;
  --project-meta-offset: calc(100vh - 176px);
  --studio-grid-height: calc(100vh - 196px);
  --slideshow-overlay-content: calc(100vh - 130px);
  --slideshow-overlay-tablet: calc(100vh - 151px);
}

/* Progressive enhancement for modern viewport units */
@supports (height: 100svh) {
  :root {
    --viewport-full: 100svh;
    --viewport-half: 50svh;
    --viewport-third: 33.333svh;
    --viewport-quarter: 25svh;
    --slideshow-height: 100svh;
    --project-meta-offset: calc(100svh - 176px);
    --studio-grid-height: calc(100svh - 196px);
    --slideshow-overlay-content: calc(100svh - 130px);
    --slideshow-overlay-tablet: calc(100svh - 151px);
  }
}

@supports (height: 100svh) {
  :root {
    --viewport-safe: 100svh;
    --viewport-safe-half: 50svh;
  }
}

@supports (height: 100lvh) {
  :root {
    --viewport-large: 100lvh;
  }
}

/* Modern font loading with variable fonts */
@supports (font-variation-settings: normal) {
  :root { 
    font-family: var(--font-primary);
    font-feature-settings: 'liga' 1, 'calt' 1;
  }
}

/* ===================================
   BASE TYPOGRAPHY
   =================================== */

body {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.2;
  text-transform: capitalize;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }
h5 { font-size: var(--text-h5); }
h6 { font-size: var(--text-h6); }

small { font-size: var(--text-small); }
strong { font-weight: 600; }

/* Typography spacing */
p + p, 
p + ul, 
ul + p {
  margin-top: var(--gap);
}

p.no-bottom + p,
p.practice + p.practice {
  margin-top: 0;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

p a {
  font-weight: 500;
  text-decoration: underline;
}

/* Lists */
ul, ol {
  list-style: none;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===================================
   LAYOUT SYSTEM
   =================================== */

.page-wrapper {
  min-height: var(--viewport-safe);
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.container {
  width: 100%;
  padding: 0 var(--margin-mobile);
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(var(--column-count-mobile), 1fr);
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */

header {
  height: var(--row-height);
  margin-top: var(--gap);
  position: relative;
}

header .container {
  height: 100%;
}

header .grid {
  height: 100%;
  align-items: end;
  gap: 0;
}

#mountain-fold-logo {
  grid-column: 1;
  align-self: start;
  justify-self: start;
  height: 28px;
  z-index: 1001;
}

a#mountain-fold-logo {
  width: fit-content;
}

#mountain-fold-logo img {
  height: 28px;
}

h3#mountain-fold-title {
  display: none;
  font-family: var(--font-primary);
}

/* Main navigation - hidden on mobile */
nav.main-menu {
  display: none;
}

nav.main-menu ul {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  font-size: 1rem;
  font-weight: 500;
}

nav.main-menu ul li a {
  position: relative;
  transition: all var(--transition-base);
}

nav.main-menu ul li a:hover {
  text-decoration: none;
}

nav.main-menu ul li a::before {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  top: 1.728rem;
  left: 0;
  background-color: var(--color-accent);
  visibility: hidden;
  transition: all var(--transition-base);
}

nav.main-menu ul li a:hover::before {
  visibility: visible;
  width: 100%;
}

/* ===================================
   MOBILE MENU
   =================================== */

.menu-toggle {
  display: block;
  grid-column: 2 / -1;
  justify-self: end;
  align-self: start;
  margin-top: 10px;
  width: 24px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1000;
}

.menu-toggle span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background-color: var(--color-text);
  border-radius: 1px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg) translate(0, 5px);
  transition: var(--transition-base);
}

.menu-toggle.white span {
  background-color: #fff;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 10px; }

/* Hamburger animation */
body.menu-open .menu-toggle span:nth-child(1) {
  top: 10px;
  transform: rotate(135deg);
}

body.menu-open .menu-toggle span:nth-child(2) {
  top: 10px;
  transform: rotate(-135deg);
}

.menu-open .menu-toggle span,
body.menu-open .menu-toggle.white span {
  background-color: #fff;
}

.inverted {
  filter: invert(100%);
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-accent);
  z-index: 999;
  padding-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: start;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
  overflow: hidden;
}

body.menu-open .mobile-menu-overlay {
  opacity: 1;
  visibility: visible;
}

body.menu-open {
  overflow: hidden;
}

.mobile-menu-overlay ul {
  display: flex;
  flex-direction: column;
  align-items: start;
  --animation-delay: 0.1s;
}

.mobile-menu-overlay li {
  margin: 0 0 0.15rem;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  animation-delay: calc(1.5s + (var(--animation-delay) * var(--item-index, 1)));
}

.mobile-menu-overlay li:nth-child(1) { --item-index: 1; }
.mobile-menu-overlay li:nth-child(2) { --item-index: 2; }
.mobile-menu-overlay li:nth-child(3) { --item-index: 3; }
.mobile-menu-overlay li:nth-child(4) { --item-index: 4; }
.mobile-menu-overlay li:nth-child(5) { --item-index: 5; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mobile-menu-overlay a {
  font-size: var(--text-h4);
  padding: 0.5rem 1rem;
  color: #fff;
  transition: color var(--transition-slow);
}

/* ===================================
   SLIDESHOW COMPONENT - iOS Safari Fixed
   =================================== */

.slideshow-container {
  position: relative;
  width: 100vw;
  height: var(--slideshow-height); /* Uses dynamic viewport unit with fallback */
  overflow: hidden;
  margin-left: calc(-50vw + 50%);
  /* iOS Safari hardware acceleration */
  transform: translate3d(0,0,0);
  -webkit-transform-style: preserve-3d;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  /* iOS Safari optimizations */
  transform: translate3d(0,0,0);
  -webkit-backface-visibility: hidden;
}

.slide.active {
  opacity: 1;
}

.slide img,
.slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* iOS Safari background attachment fix */
  -webkit-transform: translateZ(0);
}

/* Zoom animation */
.slide.zoom-in img,
.slide.zoom-in video {
  animation: slowZoom 8s ease-out;
}

@keyframes slowZoom {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* Alignment classes - consolidated */
.align-top img, .align-top video { object-position: center top; }
.align-quarter img, .align-quarter video { object-position: center 25%; }
.align-center img, .align-center video { object-position: center center; }
.align-three-quarter img, .align-three-quarter video { object-position: center 75%; }
.align-bottom img, .align-bottom video { object-position: center bottom; }
.align-left img, .align-left video { object-position: left center; }
.align-right img, .align-right video { object-position: right center; }
.align-top-left img, .align-top-left video { object-position: left top; }
.align-top-right img, .align-top-right video { object-position: right top; }
.align-bottom-left img, .align-bottom-left video { object-position: left bottom; }
.align-three-quarter-three-quarter img, .align-three-quarter-three-quarter video { object-position: 75% 75%; }
.align-bottom-right img, .align-bottom-right video { object-position: right bottom; }

/* Duration indicators (hidden by default) */
.slide::before {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  z-index: 10000;
  display: none;
}

/* Slideshow overlay - iOS Safari Fixed */
.slideshow-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--slideshow-height); /* Matches container height */
  color: white;
  z-index: 10;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.5) 100%);
  /* iOS Safari optimizations */
  transform: translate3d(0,0,0);
  -webkit-transform-style: preserve-3d;
}

.slideshow-overlay div div {
  margin: 0 var(--margin-mobile);
}

.slideshow-overlay div div.mobile-menu-overlay {
  margin: 0;
}

.slideshow-overlay div.logo {
  height: 28px;
  width: fit-content;
  margin-left: 0;
  align-self: start;
  z-index: 1001;
}

.slideshow-overlay div.logo img {
  height: 100%;
}

.slideshow-overlay div div.menu-toggle {
  margin: 0;
  margin-top: 10px;
}

.slideshow-overlay section {
  display: flex;
  flex-direction: column;
  justify-content: end;
  height: var(--slideshow-overlay-content);
}

.slideshow-overlay h1 {
  display: none;
}

.slideshow-overlay h2 {
  margin: 0 var(--margin-mobile);
  line-height: 1;
  font-size: var(--text-h3);
  margin-bottom: var(--gap);
  text-transform: none;
}

.slideshow-overlay h3 {
  font-size: var(--text-h6);
  margin: 0 var(--margin-mobile);
  margin-bottom: var(--gap);
  line-height: 1.2;
  font-family: var(--font-primary);
  font-weight: 400;
  text-transform: none;
}

.slideshow-overlay h2:first-of-type {
  font-size: var(--text-h3);
}

.slideshow-overlay div div.grid {
  margin: 0;
}

.slideshow-overlay p {
  float: left;
  vertical-align: top;
  font-weight: 300;
  font-size: 16px;
}

.slideshow-overlay p a {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: none;
  outline: 0;
  background-color: #fff;
  color: var(--color-text);
  text-align: left;
  transition: all var(--transition-base);
  appearance: none;
  border-radius: 2rem;
  text-decoration: none;
}

.slideshow-overlay p a:hover {
  background-color: var(--color-accent);
  color: var(--color-text-home);
  cursor: pointer;
}

.slideshow-overlay p:not(:first-of-type) {
  margin-top: 0;
}

.slideshow-overlay p + p {
  margin-left: var(--gap);
}

/* ===================================
   PAGE COMPONENTS
   =================================== */

.page-title {
  grid-column: 1 / -1;
  margin-top: 10px;
  margin-bottom: 0;
  color: var(--color-accent);
}

.page-title h1 {
  font-size: var(--text-h2);
}

/* Gradient utility */
.grad-top {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0) 250px);
}

/* ===================================
   STUDIO PAGE
   =================================== */

main.studio {
  margin-bottom: var(--margin-tablet);
}

main.studio div.container section {
  margin-top: 2rem;
}

main.studio div.container section.grid {
  grid-template-rows: var(--studio-grid-height);
  grid-auto-rows: auto;
}

main.studio div.container section h6.practice {
  grid-column: 1 / -1;
}

main.studio div.container section p.practice {
  grid-column: 1 / -1;
}

main.studio div.container section p.practice:first-of-type {
  font-family: var(--font-primary);
  font-size: var(--text-h5);
  font-weight: 400;
  line-height: 1.5;
  grid-column: 1 / -1;
  align-self: end;
  margin-bottom: var(--gap);
}

main.studio div.container section .people {
  grid-column: 1 / -1;
  height: fit-content;
}

main.studio div.container section div.project-hero-bg {
  display: none;
}

hr {
  margin-top: var(--gap);
  grid-column: 1 / -1;
  height: 1px;
  border: 0 !important;
  background: var(--color-accent-3);
}

/* ===================================
   PROJECT GRID & PORTFOLIO
   =================================== */

main.portfolio {
  margin-bottom: var(--margin-tablet);
}

main.portfolio div.container section.page-content {
  margin-top: 2rem;
}

main.portfolio div.container section.page-content div.grid p {
  grid-column: 1 / -1;
}

.project-grid {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin-top: 16px;
}

.project-item {
  width: 100%;
  overflow: clip;
}

.project-title {
  line-height: 1;
  margin-bottom: 7px;
}

.project-excerpt {
  display: inline-block;
  margin-top: -4px;
  margin-bottom: 16px;
  pointer-events: none;
}

.project-excerpt p {
  font-size: 14px;
}

.project-image {
  width: 100%;
  overflow: hidden;
  margin-bottom: 26px;
}

.project-item a .project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(50%);
  aspect-ratio: 4 / 3;
  transition: filter var(--transition-fast);
}

.project-item a:hover .project-image img {
  filter: grayscale(0%);
}

/* ===================================
   PROJECT DETAIL PAGES
   =================================== */

.project-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--slideshow-height);
  z-index: -1;
  /* iOS Safari optimizations */
  transform: translate3d(0,0,0);
  -webkit-transform-style: preserve-3d;
}

.project-hero-bg div {
  width: 100%;
  height: 100%;
}

.project-hero-bg div figure {
  width: 100%;
  height: 100%;
}

.project-hero-bg div figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* iOS Safari background attachment fix */
  -webkit-transform: translateZ(0);
}

.project-meta {
  grid-column: 1 / -1;
  margin-top: var(--project-meta-offset);
  margin-bottom: 40px;
  font-size: var(--text-small);
  font-style: italic;
  line-height: 1.5;
}

.project-content {
  margin: 0;
}

.project-text {
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: var(--margin-tablet);
}

.project-text p {
  margin-bottom: var(--gap);
}

.project-text p:last-of-type {
  margin-bottom: 16px;
}

.emph,
.pull-quote {
  grid-column: 1 / -1;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-h6);
}

/* Image Classes */
.image-full,
.image-large,
.image-left,
.image-right {
  grid-column: 1 / -1;
  width: 100%;
}

.image-full img,
.image-large img,
.image-left img,
.image-right img {
  width: 100%;
}

figcaption {
  display: none;
}

/* ===================================
   NAVIGATION LINKS
   =================================== */

nav#portfolio-links {
  display: inline-block;
  width: 100%;
  margin-top: var(--gap);
  margin-bottom: var(--margin-tablet);
}

nav#portfolio-links p {
  display: inline-block;
  margin: 0;
  font-size: var(--text-small);
}

nav#portfolio-links ul {
  float: left;
  padding: 0;
}

nav#portfolio-links ul li {
  float: left;
  margin-left: 14px;
  padding: 0;
  font-size: var(--text-small);
}

nav#portfolio-links p a,
nav#portfolio-links ul li a {
  font-weight: 300;
}

nav#portfolio-links ul li:first-of-type {
  margin-left: 0;
}

nav#portfolio-links ul li.previous a,
nav#portfolio-links ul li.next a {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 2.5rem;
  margin: 0;
  padding: 0.45rem 0.85rem;
  border: none;
  outline: 0;
  background-color: var(--color-accent-4);
  color: var(--color-accent-3);
  text-align: left;
  transition: all var(--transition-base);
  appearance: none;
  border-radius: 2rem;
  font-size: var(--text-small);
  font-weight: 500;
}

nav#portfolio-links ul li.previous a:hover,
nav#portfolio-links ul li.next a:hover {
  background-color: var(--color-text);
  color: var(--color-text-home);
  cursor: pointer;
}

/* ===================================
   BLOG & NOTES
   =================================== */

main.notes {
  margin-bottom: var(--margin-tablet);
}

.blog-entries {
  margin-top: 2rem;
}

.blog-entries div.grid {
  grid-template-columns: 1fr;
}

main article.post {
  background-color: var(--color-accent-4);
  grid-column: 1 / -1;
  padding: 0 var(--gap);
  margin: 0 calc(-1 * var(--gap));
  transition: all var(--transition-base);
}

main article.post:has(a.post-link:hover) {
  background-color: var(--color-accent-2);
  color: #fff;
}

main article.post:has(a.post-link:hover) p.date {
  color: #fff;
}

main article.post a.post-link {
  grid-column: 1 / -1;
  display: grid;
  gap: 0 var(--gap);
  grid-template-columns: 1fr;
  grid-template-rows: min-content min-content min-content auto;
  text-decoration: none;
  height: 100%;
}

main article.post a.post-link img {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  margin-bottom: var(--margin-tablet);
  padding: 0 var(--gap);
  padding-top: var(--gap);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

main article.post a.post-link h6 {
  grid-row: 2;
  padding: 0 var(--gap);
}

main article.post a.post-link section.post-excerpt {
  grid-row: 3;
  padding: 0 var(--gap);
  margin-bottom: var(--gap);
}

main article.post a.post-link p.date {
  transition: all var(--transition-base);
  grid-row: 4;
  padding: 0 var(--gap);
  font-size: var(--text-small);
  color: var(--color-accent-3);
  margin-bottom: var(--gap);
}

/* Single blog post */
article.single {
  margin-top: 2rem;
  margin-bottom: var(--margin-tablet);
}

article.single section.post-meta {
  grid-column: 1 / -1;
  color: var(--color-accent-3);
  font-size: var(--text-small);
  font-style: italic;
  line-height: 1.65;
}

article.single section.post-meta p + p {
  margin-top: 0;
  margin-bottom: var(--gap);
}

article.single section.post-content {
  grid-column: 1 / -1;
}

article.single section.post-content p + figure,
article.single section.post-content figure + p,
article.single section.post-content h6,
article.single section.post-content h5 + figure,
article.single section.post-content hr + p {
  margin-top: var(--gap);
}

article.single section.post-content h5 {
  margin-top: calc(2 * var(--gap));
}

article.single div.grid section.post-content ul li::before {
  content: "- ";
  margin-right: 8px;
}

/* Blog navigation */
section.blog-entries div.grid nav#blog-links {
  margin-top: var(--gap);
}

nav#blog-links {
  display: inline-block;
  width: 100%;
  color: var(--color-accent-3);
  font-size: var(--text-small);
  line-height: 1.65;
}

nav#blog-links p {
  display: inline-block;
  margin: 0;
  font-size: var(--text-small);
}

nav#blog-links ul {
  float: left;
  padding: 0;
}

nav#blog-links ul li {
  float: left;
  margin-left: 16px;
  padding: 0;
  font-size: var(--text-small);
  font-weight: 500;
}

nav#blog-links p a,
nav#blog-links ul li a {
  font-weight: 500;
}

nav#blog-links ul li:first-of-type {
  margin-left: 0;
}

nav#blog-links ul li.previous a,
nav#blog-links ul li.next a {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 2.5rem;
  margin: 0;
  padding: 0.45rem 0.85rem;
  border: none;
  outline: 0;
  background-color: var(--color-accent-4);
  color: var(--color-accent-3);
  text-align: left;
  transition: all var(--transition-base);
  appearance: none;
  border-radius: 2rem;
  font-size: var(--text-small);
  font-weight: 500;
}

nav#blog-links ul li.previous a:hover,
nav#blog-links ul li.next a:hover {
  background-color: var(--color-text);
  color: var(--color-text-home);
  cursor: pointer;
}

section#blog-categories {
  display: none;
}

/* ===================================
   CONTACT FORMS
   =================================== */

main.contact div.container section.grid {
  margin-top: 2rem;
}

.information-package-form {
  display: none;
  grid-column: 1 / -1;
  margin-bottom: 1rem;
  margin: 0 calc(-1 * var(--gap)) var(--gap) calc(-1 * var(--gap));
  background-color: var(--color-accent-2);
  color: var(--color-text-home);
  padding: var(--gap);
}

div.contact-intro {
  grid-column: 1 / -1;
  margin-bottom: 1rem;
}

#form-messages {
  grid-column: 1 / -1;
}

#contact-form {
  grid-column: 1 / -1;
  margin-bottom: 3rem;
}

label {
  display: inline-block;
  font-size: var(--text-small);
  margin-bottom: 0.5625rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="datetime"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="time"],
input[type="url"],
textarea,
select {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 0.25rem;
  padding: 0.5625rem;
  border: none;
  outline: 0;
  background-color: var(--color-accent-4);
  color: var(--color-text);
  font-family: var(--font-primary);
}

textarea {
  height: 7rem;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border: 1px solid var(--color-accent);
  box-shadow: 0 0 4px 0 var(--color-accent);
}

input[type="submit"] {
  display: block;
  height: 2.25rem;
  margin: 18px 0 0 0;
  margin-top: 1.125rem;
  padding: 0.5625rem 1.2rem;
  border: none;
  outline: 0;
  background-color: var(--color-accent);
  color: var(--color-text-home);
  text-align: left;
  transition: all var(--transition-base);
  appearance: none;
  border-radius: 2rem;
  font-size: var(--text-small);
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-primary);
}

input[type="submit"]:hover {
  background-color: var(--color-text);
  color: var(--color-text-home);
}

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-weight: bold;
}
        
.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
        
.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
        
.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 5px;
  display: none;
}
        
.error-message.show {
  display: block;
}
        
.form-submitting {
  opacity: 0.7;
  pointer-events: none;
}

/* ===================================
   FOOTER
   =================================== */

footer {
  height: calc((1.5 * var(--row-height)) + 1 + (var(--gap-mobile) / 2));
  padding: var(--gap) 0 var(--margin-tablet) 0;
  background-color: var(--color-accent-4);
}

footer div.container div.grid {
  gap: 0;
}

footer h4 {
  grid-column: 1 / -1;
  margin-top: 13px;
  margin-bottom: var(--margin-tablet);
  line-height: 2.55rem;
  text-transform: none;
}

footer p {
  font-size: var(--text-small);
  line-height: 1.62;
}

footer div.newsletter,
footer div.external-links,
footer p.copyright,
footer div.memberships,
footer div.address {
  grid-column: 1 / -1;
}

footer div.newsletter {
  margin-bottom: 1.5rem;
  display: none;
}

footer div.newsletter p {
  margin-bottom: 1rem;
}

footer div.newsletter form.grid {
  gap: 0 var(--gap);
}

footer div.newsletter form div.form-group {
  grid-column: 1 / -1;
}

footer div.newsletter form input[type="email"] {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
  padding: 0.5625rem;
  border: none;
  outline: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
}

footer div.newsletter form button[type="submit"] {
  display: block;
  height: 2rem;
  width: fit-content;
  margin: 0;
  padding: 0.5625rem 1.2rem;
  border: none;
  outline: 0;
  background-color: var(--color-link);
  color: var(--color-text-home);
  text-align: left;
  transition: all var(--transition-base);
  appearance: none;
  border-radius: 2rem;
  font-size: var(--text-small);
  font-weight: 500;
  cursor: pointer;
}
footer div.newsletter form button[type="submit"]:hover {
  background-color: var(--color-accent);
  color: var(--color-text-home);
}

/* Loading spinner */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-message {
  font-size: var(--text-small);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.success-message {
  background-color: #d4edda;
  color: #155724;
  padding: 12px;
  border-radius: 8px;
  margin-top: 1rem;
  display: none;
}

footer div.external-links {
  margin-bottom: 24px;
}

footer div.external-links a {
  display: block;
  width: fit-content;
}

footer div.memberships {
  height: 28px;
  margin-top: 1rem;
}

footer div.memberships a {
  display: inline-block;
}

footer div.memberships a svg {
  height: 28px;
  margin-top: 3px;
}

footer div.memberships a svg:first-of-type {
  margin-right: var(--gap-mobile);
}

footer p + p {
  margin: 0;
}

footer p.copyright {
  margin-top: 6px;
}

footer div.external-links a, footer p.copyright a {
  text-decoration: underline;
  font-weight: 500;
}

footer div.address {
  margin-top: var(--gap);
}

.privacy {
  grid-column: 1 / -1;
  max-width: 800px;
  margin-bottom: 2rem;
}

.privacy h5 {
  margin-top: 2rem;
}

/* 404 Page */
main.fourohfour div.container section.grid {
  margin-top: 2rem;
}

main.fourohfour div.container section.grid p,
main.fourohfour div.container section.grid form {
  grid-column: 1 / -1;
}

main.fourohfour div.container section.grid form label {
  width: 100%;
  max-width: 400px;
}



/* ===================================
   MEDIA QUERIES - iOS Safari Fixed
   =================================== */

/* Tablet - 8 columns */
@media (min-width: 768px) {
  .container {
    padding: 0 var(--margin-tablet);
  }
  
  .grid {
    grid-template-columns: repeat(var(--column-count-tablet), 1fr);
  }
  
  .slideshow-overlay {
    background: linear-gradient(180deg,rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.5) 100%);
  }
  
  .slideshow-overlay section {
    height: var(--slideshow-overlay-tablet);
  }
  
  .slideshow-overlay h2 {
    font-size: var(--text-h2);
    margin: 0 var(--margin-tablet);
    margin-bottom: var(--gap);
  }
  
  .slideshow-overlay h3 {
    font-size: var(--text-h5);
    margin: 0 var(--margin-tablet);
    margin-bottom: var(--gap);
    line-height: 1.2;
    font-family: var(--font-primary);
    font-weight: 400;
    text-transform: none;
  }
  
  .slideshow-overlay h2:first-of-type {
    font-size: var(--text-h2);
  }
  
  .slideshow-overlay div {
    margin-left: var(--margin-tablet);
    margin-right: var(--margin-tablet);
  }
  
  .slideshow-overlay div.container {
    margin-left: 0;
  }
  
  .slideshow-overlay div div:not(.grid, .menu-toggle, .mobile-menu-overlay) {
    margin: 0;
  }
  
  .slideshow-overlay section div div p:not(:first-of-type) {
    float: left;
    margin-right: var(--gap);
  }
  
  .mobile-menu-overlay a {
    padding-left: var(--margin-tablet);
  }

  .page-title h1 {
    font-size: var(--text-h1);
  }
  
  main.studio div.container section.grid {
    grid-template-rows: calc(var(--viewport-full) - 205px);
    grid-auto-rows: auto;
  }
  
  main.studio div.container section div.project-hero-bg {
    display: block;
  }

  main.studio div.container section p.practice:first-of-type {
    margin-top: calc(var(--viewport-full) - 380px);
    margin-bottom: var(--margin-tablet);
    font-size: var(--text-h5);
  }
  
  main.studio div.container section h6.practice:first-of-type {
    grid-row-start: 2;
  }
  
  main.studio div.container section h6.practice,
  main.studio div.container section p.practice {
    grid-column: 1 / 5;
  }
  
  main.studio div.container section figure.practice {
    grid-column: 5 / -1;
    grid-row: span 8;
  }
  
  main.studio div.container section figure.people {
    grid-column: 1 / 5;
    grid-row: span 2;
  }
  
  main.studio div.container section div.people {
    grid-column: 5 / -1;
  }
  
  main.studio div.container section div.people.name {
    grid-column: 5 / -1;
  }
  
  div.people div figure {
    display: inline-block;
    width: calc((4 * var(--column-width-desktop)) + (3 * var(--gap)));
    float: left;
    margin-right: var(--gap);
  }
  
  div.people div p {
    grid-column: 5 / -1;
    display: inline-block;
    width: 100%;
  }
  
  p.no-combine {
    margin: 0;
  }
  
  main.portfolio div.container section.page-content div.grid p {
    grid-column: 1 / -1;
  }
  
  .project-item {
    width: calc((100% - var(--gap)) / 2);
    overflow: clip;
  }
  
  .project-text {
    grid-column: 1 / 5;
  }
  
  .image-left {
    grid-column: 1 / 5;
  }
  
  .image-right {
    grid-column: 5 / -1;
  }
  
  .emph {
    grid-column: 1 / 5;
  }
  
  .blog-entries div.grid {
    grid-template-columns: repeat(var(--column-count-tablet), 1fr);
    gap: var(--gap);
    grid-auto-flow: row;
  }
  
  main article.post {
    padding: 0;
    margin: 0;
    border: none;
    grid-column: span 4;
  }
  
  main article.post a.post-link img {
    grid-column: 1;
    grid-row: 1;
    max-width: 100%;
    width: 100%;
    margin: 0;
    margin-bottom: var(--margin-tablet);
  }
  
  nav#blog-links {
    grid-column: 1 / 5;
  }
  
  div.contact-intro {
    grid-column: 1 / 5;
    grid-row: 2 / 3;
    margin-bottom: 1rem;
  }
  #form-messages {
    grid-column: 5 / -1;
    grid-row: 2 / 3;
  }
  #contact-form {
    grid-column: 5 / -1;
    grid-row: 2 / 3;
    margin-bottom: 3rem;
  }
  
  footer div.container div.grid {
    gap: 0 var(--gap);
  }
  
  footer div.newsletter form div.form-group {
    grid-column: 1 / 5;
  }
  
  footer div.newsletter form button[type="submit"]:hover {
    grid-column: 5 / -1;
  }
}

/* Desktop - 16 columns */
@media (min-width: 1024px) {
  .container {
    padding: 0 var(--margin-desktop);
  }
  
  .grid {
    grid-template-columns: repeat(var(--column-count-desktop), 1fr);
  }
  
  .slideshow-overlay .logo {
    margin-left: var(--margin-desktop);
  }
  
  .slideshow-overlay section {
    height: var(--slideshow-overlay-tablet);
  }
  
  .slideshow-overlay h2 {
    font-size: var(--text-h1);
    margin: 0 var(--margin-desktop);
    margin-bottom: var(--margin-tablet);
    max-width: 1000px;
  }
  
  .slideshow-overlay h3 {
    font-size: var(--text-h4);
    margin: 0 var(--margin-desktop);
    margin-bottom: var(--margin-tablet);
    max-width: 1000px;
    line-height: 1.2;
    font-family: var(--font-primary);
    font-weight: 400;
    text-transform: none;
  }
  
  .slideshow-overlay h2:first-of-type {
    font-size: var(--text-h1);
    margin-bottom: var(--gap);
  }
  
  .slideshow-overlay div {
    margin-left: var(--margin-desktop);
    margin-right: var(--margin-desktop);
  }
  
  .slideshow-overlay div div div {
    margin: 0;
  }
  
  h3#mountain-fold-title {
    display: inline-block;
    grid-column: 1 / 10;
    grid-row: 2;
    align-self: start;
    margin-top: -10px;
    margin-left: 49px;
  }
  
  nav.main-menu { 
    display: inline-block;
    align-content: end;
    justify-self: right;
    margin-bottom: 16px;
    grid-column: 10 / -1;
    grid-row: 2;
    z-index: 1001;
  }
  
  nav.main-menu ul li {
    font-size: var(--text-h6);
  }
  
  .menu-toggle {
    display: none;
  }
  
  .mobile-menu-overlay {
    display: none;
  }
  
  .page-title {
    grid-column: 3 / -1;
    margin-top: 52px;
  }
  
  main.studio div.container section.grid h6.practice {
    grid-column: 3 / 9;
  }
  
  main.studio div.container section.grid p.practice {
    grid-column: 3 / 9;
  }
  
  main.studio div.container section.grid p.practice + p.practice {
    margin-top: 0;
  }
  
  main.studio div.container section.grid p.practice:first-of-type {
    grid-column: 3 / 14;
    margin-bottom: var(--row-height);
    max-width: 840px;
  }
  
  main.studio div.container section .pull-quote {
    margin: 0;
  }
  
  main.studio div.container section figure.practice {
    grid-column: 9 / -1;
    grid-row: span 11;
    max-width: 600px;
  }
  
  main.studio div.container section hr {
    grid-column: 1 / -1;
    margin: var(--margin-tablet) 0;
    border: none;
    height: 1px;
    background-color: var(--color-accent-3);
  }
  
  main.studio div.container section figure.people {
    grid-column: 3 / 9;
    grid-row: span 3;
  }
  
  main.studio div.container section div.people {
    grid-column: 9 / 15;
  }
  
  main.studio div.container section div.people.name {
    grid-column: 9 / 15;
  }
  
  div.people div figure {
    display: inline-block;
    width: calc((7 * var(--column-width-desktop)) + (6 * var(--gap)));
    float: left;
    margin-right: var(--gap);
  }
  
  div.people div p {
    display: inline-block;
    width: calc((6 * var(--column-width-desktop)) + (5 * var(--gap)));
  }
  
  main.portfolio div.container section.page-content div.grid p {
    grid-column: 3 / 10;
  }
  
  .project-grid {
    grid-column: 3 / -1;
  }
  
  .project-item {
    width: calc((100% - (2 * var(--gap))) / 3);
    overflow: clip;
  }
  
  .project-meta {
    grid-column: 3 / -1;
    margin-top: calc(var(--viewport-full) - 218px);
  }
  
  .project-text {
    grid-column: 3 / 10;
  }
  
  .pull-quote {
    grid-column: 1;
    font-family: var(--font-serif);
    font-style: italic;
    margin: 24px 0;
  }

  .image-full {
    grid-column: 1 / -1;
  }
  
  .image-large { 
    grid-column: 3 / 17;
    position: relative;
  }
  
  .image-left {
    grid-column: 3 / 10;
    position: relative;
  }
  
  .image-right {
    grid-column: 10 / 17;
    position: relative;
  }

  figcaption {
    display: inline-block;
    font-size: var(--text-small);
    width: calc((2 * var(--column-width-desktop)) + var(--margin-desktop));
    text-align: right;
    color: var(--color-accent-3);
    margin-top: 0 !important;
  }
  
  .project-hero-bg div figure figcaption {
    position: absolute;
    top: calc(var(--viewport-full) + 17px);
    right: calc(var(--margin-desktop) + (14 * (var(--column-width-desktop) + var(--gap))));
  }

  .image-large figcaption {
    position: absolute;
    top: 0;
    left: calc((-2 * (var(--column-width-desktop) + var(--gap))) - var(--margin-desktop) + var(--gap));
  }
  
  .image-left figcaption {
    position: absolute;
    top: 0;
    left: calc((-2 * (var(--column-width-desktop) + var(--gap))) - var(--margin-desktop) + var(--gap));
  }
  
  .image-right figcaption {
    position: absolute;
    top: 5rem;
    left: calc((-9 * (var(--column-width-desktop) + var(--gap))) - var(--margin-desktop) + var(--gap));
  }

  .project-hero-bg div figure figcaption::before {
    font-weight: 600;
    content: "above: ";
  }
  
  .image-large figcaption::before,
  .image-left figcaption::before {
    font-weight: 600;
    content: "right: ";
  }
  
  .image-right figcaption::before {
    font-weight: 600;
    content: "far-right: ";
  }
  
  nav#portfolio-links ul {
    margin-left: calc(2 * (var(--column-width-desktop) + var(--gap)))
  }
  
  .blog-entries div.grid {
    grid-template-columns: repeat(var(--column-count-desktop), 1fr);
    gap: var(--gap);
    grid-auto-flow: row;
  }
  
  main article.post {
    grid-column: span 6;
  }
  
  main article.post:nth-child(1) {
    grid-column: 3 / 9;
  }

  main article.post:nth-child(2) {
    grid-column: 9 / 15;
  }

  main article.post:nth-child(2n + 1) {
    grid-column: 3 / 9;
  }

  main article.post:nth-child(2n + 2) {
    grid-column: 9 / 15;
  }
  
  main article.post a.post-link {
    grid-template-columns: 1fr;
  }
  
  main article.post:not(:first-of-type) a.post-link img {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: var(--margin-tablet);
  }
  
  main article.post a.post-link h6 {
    grid-row: 2;
    padding: 0 var(--gap);
  }
  
  main article.post a.post-link section.post-excerpt {
    grid-row: 3;
    padding: 0 var(--gap);
  }
  
  main article.post a.post-link p.date {
    grid-row: 4;
    padding: 0 var(--gap);
  }
  
  nav#blog-links {
    grid-column: 3 / -1;
    display: inline-block;
    width: 100%;
  }
  
  article.single {
    display: grid;
    margin-bottom: var(--margin-tablet);
  }
  
  article.single div.grid h1 {
    grid-column: 3 / -1;
  }
  
  article.single div.grid section.post-meta {
    grid-column: 3 / -1;
  }
  
  article.single div.grid section.post-content {
    grid-column: 3 / -1;
  }
  
  article.single div.grid section.post-content figure {
    width: calc((10 * var(--column-width-desktop)) + (9 * var(--gap)));
    position: relative;
  }
  
  article.single div.grid section.post-content p,
  article.single div.grid section.post-content ul,
  article.single div.grid section.post-content figure,
  article.single div.grid section.post-content hr {
    width: calc((8 * var(--column-width-desktop)) + (7 * var(--gap)));
  }
  
  article.single div.grid section.post-content figure.image-left {
    width: calc((6 * var(--column-width-desktop)) + (5 * var(--gap)));
  }
  
  article.single div.grid section.post-content figure figcaption {
    position: absolute;
    top: 0;
    left: calc((-2 * (var(--column-width-desktop) + var(--gap))) - var(--margin-desktop) + var(--gap));
  }
  
  article.single div.grid section.post-content figure figcaption::before {
    font-weight: 600;
    content: "right: ";
  }
  
  .information-package-form {
    grid-column: 3 / -3;
  }
  
  div.contact-intro {
    grid-column: 3 / 9;
  }
  
  #form-messages {
    grid-column: 9 / -3;
  }
  
  #contact-form {
    grid-column: 9 / -3;
  }
  
  footer h4 {
    grid-column: 3 / -1;
  }
  
  footer div.newsletter {
    grid-column: 3 / -1;
    grid-row: 2;
    align-self: start;
  }
  
  footer div.newsletter form div.form-group {
    grid-column: 1 / 8;
  }
  
  footer div.newsletter form button[type="submit"]:hover {
    grid-column: 8 / -1;
  }
  
  footer p.copyright {
    grid-column: 3 / 11;
    grid-row: 3 / 5;
    align-self: end;
    margin: 0;
  }
  
  footer div.external-links {
    grid-column: 3 / 11;
    grid-row: 3 / 5;
    align-self: flex-start;
  }
  
  footer div.memberships {
    grid-column: 11 / -1;
    grid-row: 3 / 4;
    align-self: flex-start;
    margin-top: 0;
  }
  
  footer div.address {
    grid-column: 11 / -1;
    grid-row: 4 / 5;
    margin-top: 15px;
  }
  
  .privacy {
    grid-column: 3 / -1;
  }
  
  main.fourohfour div.container section.grid p,
  main.fourohfour div.container section.grid form {
    grid-column: 3 / -1;
  }
}

/* Large desktop breakpoint */
@media (min-width: 1400px) {
  :root {
    --margin-desktop: var(--margin-large);
  }
  
  .project-text,
  .emph {
    grid-column: 3 / 9;
  }
  
  main article.post {
    grid-column: span 4;
  }
  
  .image-large { 
    grid-column: 3 / 15;
  }
  
  .image-left {
    grid-column: 3 / 9;
  }
  
  .image-right {
    grid-column: 9 / 15;
  }
  
  .image-large figcaption {
    left: calc((-2 * (var(--column-width-desktop) + var(--gap))) - var(--margin-desktop) + var(--gap));
  }
  
  .image-left figcaption {
    left: calc((-2 * (var(--column-width-desktop) + var(--gap))) - var(--margin-desktop) + var(--gap));
  }
  
  .image-right figcaption {
    left: calc((-8 * (var(--column-width-desktop) + var(--gap))) - var(--margin-desktop) + var(--gap));
  }
  
  main article.post:nth-child(1) {
    grid-column: 3 / 7;
  }

  main article.post:nth-child(2) {
    grid-column: 7 / 11;
  }

  main article.post:nth-child(3) {
    grid-column: 11 / 15;
  }

  main article.post:nth-child(3n + 1) {
    grid-column: 3 / 7;
  }
  
  main article.post:nth-child(3n + 2) {
    grid-column: 7 / 11;
  }

  main article.post:nth-child(3n + 3) {
    grid-column: 11 / 15;
  }

  article.single div.grid section.post-content p,
  article.single div.grid section.post-content ul,
  article.single div.grid section.post-content figure,
  article.single div.grid section.post-content hr {
    width: calc((7 * var(--column-width-desktop)) + (6 * var(--gap)));
  }
  article.single div.grid section.post-content figure.image-left {
    width: calc((5 * var(--column-width-desktop)) + (4 * var(--gap)));
  }
  
  div.contact-intro {
    grid-column: 3 / 8;
  }
  
  #form-messages {
    grid-column: 8 / 13;
  }
  
  #contact-form {
    grid-column: 8 / 13;
  }
  
  footer div.newsletter form div.form-group {
    grid-column: 1 / 7;
  }
  
  footer div.newsletter form button[type="submit"]:hover {
    grid-column: 7 / -1;
  }
}

/* Extra large desktop breakpoint */
@media (min-width: 1800px) {
  article.single div.grid section.post-content p,
  article.single div.grid section.post-content ul,
  article.single div.grid section.post-content figure,
  article.single div.grid section.post-content hr {
    width: calc((6 * var(--column-width-desktop)) + (5 * var(--gap)));
  }
  article.single div.grid section.post-content figure.image-left {
    width: calc((4 * var(--column-width-desktop)) + (3 * var(--gap)));
  }
  
  main.studio div.container section.grid h6.practice {
    grid-column: 3 / 5;
  }
  
  main.studio div.container section.grid h6.practice:first-of-type {
    grid-row: 2 span 2;
  }
  
  main.studio div.container section.grid p.practice {
    grid-column: 5 / 10;
  }
  
  main.studio div.container section.grid p.practice:nth-of-type(2) {
    grid-row: 2;
  }

  main.studio div.container section figure.practice {
    grid-column: 10 / -3;
  }
  
  main.studio div.container section figure.people {
    grid-column: 3 / 8;
    grid-row: span 3;
  }
  
  main.studio div.container section div.people {
    grid-column: 9 / 15;
  }
  
  div.people div figure {
    width: calc((6 * var(--column-width-desktop)) + (5 * var(--gap)));
    max-width: 800px;
    justify-self: end;
  }
  
  div.people div p {
    width: calc((6 * var(--column-width-desktop)) + (5 * var(--gap)));
    max-width: 800px;
  }
  
  .project-text,
  .emph {
    grid-column: 3 / 8;
  }
  
  .image-large { 
    grid-column: 3 / 13;
  }
  
  .image-left {
    grid-column: 3 / 8;
  }
  
  .image-right {
    grid-column: 8 / 13;
  }
  
  .image-right figcaption {
    left: calc((-7 * (var(--column-width-desktop) + var(--gap))) - var(--margin-desktop) + var(--gap));
  }
  
  div.contact-intro {
    grid-column: 3 / 7;
  }
  
  #form-messages {
    grid-column: 7 / 11;
  }
  
  #contact-form {
    grid-column: 7 / 11;
  }
  
  footer div.newsletter form div.form-group {
    grid-column: 1 / 6;
  }
  
  footer div.newsletter form button[type="submit"]:hover {
    grid-column: 6 / -1;
  }
}

/* Small screen optimization */
@media (max-width: 365px) {
  .slideshow-overlay section div div p + p {
    clear: left;
    margin-left: 0;
    margin-top: 1rem !important;
  }
}

/* Small screen optimization - iOS Safari Fixed */
@media (max-width: 400px) and (max-height: 750px) {
  .slideshow-overlay section {
    height: var(--slideshow-overlay-content);
  }
}

/* iOS Safari specific optimizations */
@supports (-webkit-touch-callout: none) {
  .slideshow-container,
  .slideshow-overlay,
  .project-hero-bg {
    -webkit-transform-style: preserve-3d;
    -webkit-perspective: 1000px;
  }
  
  .slide img,
  .slide video,
  .project-hero-bg div figure img {
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
  }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.hidden { display: none; }
.hidden-visually {     
  border: 0!important;
  clip: rect(0 0 0 0)!important;
  height: 1px!important;
  margin: -1px!important;
  overflow: hidden!important;
  padding: 0!important;
  position: absolute!important;
  width: 1px!important;
}
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-24 { margin-bottom: 24px; }
.mt-24 { margin-top: 24px; }
.white { color: white; }
.two-rows { grid-row: span 2; }
.no-combine { margin: 0; }
.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;
}