/* ==========================================================================
   Layout: header, nav, footer, back-to-top, section/column grid
   ========================================================================== */

body {
  padding-top: var(--header-height);
}

body.page--home {
  padding-top: 0;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--color-white);
  transition: background-color 0.3s ease;
}

.site-header__inner {
  padding: 0 clamp(20px, 4vw, 45px);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: height 0.3s ease;
}

.site-header__logo img {
  height: 100px;
  width: auto;
  transition: height 0.3s ease;
}

.site-header__logo .logo-alt {
  display: none;
}

/* Home page: transparent header over the hero image until scrolled or the
   mobile menu is open (opening the menu should match the solid header look
   every other page has). */
body.page--home .site-header:not(.is-scrolled):not(.is-menu-open) {
  background: transparent;
}

body.page--home .site-header:not(.is-scrolled):not(.is-menu-open) .site-header__logo .logo-default {
  display: none;
}

body.page--home .site-header:not(.is-scrolled):not(.is-menu-open) .site-header__logo .logo-alt {
  display: block;
}

body.page--home .site-header:not(.is-scrolled):not(.is-menu-open) .nav-item a {
  color: var(--color-white);
}

body.page--home .site-header:not(.is-scrolled):not(.is-menu-open) .menu-toggle {
  color: var(--color-white);
}

/* Scrolled state: solid greyish bar, shrunk logo/height. */
.site-header.is-scrolled {
  background-color: var(--color-header-scrolled);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.11);
}

.site-header.is-scrolled .site-header__inner {
  height: 60px;
}

.site-header.is-scrolled .site-header__logo img {
  height: 60px;
}

.nav-menu {
  display: flex;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item a {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-heading);
}

.nav-item a:hover,
.nav-item--active a {
  color: var(--color-accent);
}

.nav-item__icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
  fill: currentColor;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--color-heading);
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-top: 1px solid var(--color-bg-light);
  z-index: 99;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.nav-mobile.is-open {
  display: block;
}

.nav-mobile__list {
  list-style: none;
  margin: 0;
  padding: 10px 0;
}

.nav-mobile__list a {
  display: block;
  padding: 14px 20px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-heading);
  border-bottom: 1px solid var(--color-bg-light);
}

.nav-mobile__list .nav-item--active a {
  color: var(--color-accent);
}

@media only screen and (max-width: 1000px) {
  .nav-menu { display: none; }
  .site-header__inner > nav { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .menu-toggle { grid-column: 1; grid-row: 1; justify-self: start; }
  .site-header__logo { grid-column: 2; grid-row: 1; justify-self: center; }
}

/* ---- Page banner (legal/content page title strip) ---- */

.page-banner {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-link);
}

.page-banner--tall {
  height: 275px;
}

.page-banner--photo {
  background-size: cover;
  background-position: center;
}

.page-banner h1 {
  color: var(--color-white);
  margin: 0;
  text-align: center;
  font-size: 54px;
  line-height: 1.25em;
  text-transform: uppercase;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

@media only screen and (max-width: 480px) {
  .page-banner h1 {
    font-size: 32px;
  }
}

/* ---- Hero (home page fullscreen banner) ---- */

.hero {
  position: relative;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero__content {
  text-align: center;
  color: var(--color-white);
  max-width: 1000px;
  padding: 0 20px 20vh;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 2s cubic-bezier(0.165, 0.84, 0.44, 1),
    transform 2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hero__content.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero__subtitle {
  display: block;
  font-family: "Crete Round", sans-serif;
  font-style: italic;
  font-size: 28px;
  margin-bottom: 10px;
}

.hero__title {
  color: var(--color-white);
  font-size: 64px;
  line-height: 1.2em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 28px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

@media only screen and (max-width: 480px) {
  .hero__subtitle {
    font-size: 20px;
  }

  .hero__title {
    font-size: 38px;
  }
}

/* ---- Quote / parallax section ---- */

.quote-section {
  position: relative;
  height: 400px;
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* `background-attachment: fixed` is badly broken on iOS/iPadOS Safari - it
   miscalculates the background's sizing box, so `background-size: cover`
   ends up covering something much larger than the viewport and only a
   small, heavily zoomed-in crop of the image is visible. Touch-primary
   devices (and, as a width-based fallback, narrower viewports in general)
   get a plain scrolling background instead, which renders `cover` sizing
   correctly everywhere and only loses the subtle parallax drift. */
@media (hover: none), (max-width: 1024px) {
  .hero,
  .quote-section {
    background-attachment: scroll;
  }
}

.quote-section__text {
  color: var(--color-white);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  max-width: 900px;
  padding: 0 20px;
  margin: 0;
}

@media only screen and (max-width: 480px) {
  .quote-section__text {
    font-size: 24px;
  }
}

/* ---- Section / column grid (replaces WPBakery vc_row/vc_column) ---- */

.section {
  padding: 40px 0;
}

.section > .container {
  max-width: var(--container-max-width);
}

.columns {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.column {
  flex: 1 1 0;
  min-width: 260px;
}

.container.gallery-section {
  max-width: 990px;
  margin: 0 auto;
}

.gallery-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* Gallery source images vary in native resolution (e.g. 300x300 vs 600x600),
   so without an explicit fill rule a smaller image renders at its own
   intrinsic size instead of stretching to its grid cell, leaving it
   undersized and left-aligned instead of filling/centered like the rest. */
.gallery-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Service page galleries use 4 columns (matches the original's larger photo sets). */
body.page--service .gallery-section {
  grid-template-columns: repeat(4, 1fr);
}

@media only screen and (max-width: 780px) {
  .columns {
    flex-direction: column;
  }

  .gallery-section,
  body.page--service .gallery-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media only screen and (max-width: 480px) {
  .gallery-section,
  body.page--service .gallery-section {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* Single-column gallery: extra side padding keeps photos from spanning
     the full screen width edge-to-edge. */
  .container.gallery-section {
    padding: 0 50px;
  }
}

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

.site-footer {
  background: var(--color-white);
}

.site-footer__top {
  padding: 60px 0;
  background-color: var(--color-heading);
  color: #a2a2a2;
}

.site-footer__top a {
  color: #a2a2a2;
}

.site-footer__top a:hover {
  color: var(--color-accent);
}

.site-footer__column p a {
  color: var(--color-accent);
  font-weight: 600;
}

.site-footer__column p a:hover {
  text-decoration: underline;
}

/* Small inline icon prefixing a text link (footer contact links, contact page). */
.link-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 6px;
  fill: currentColor;
}

.site-footer__columns {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
}

.site-footer__column {
  flex: 1 1 260px;
}

.site-footer__column h2 {
  font-size: 15px;
  line-height: var(--line-height-base);
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.site-footer__column p {
  font-size: 15px;
}

.site-footer__column--brand {
  text-align: center;
}

.site-footer__column--hours {
  text-align: right;
}

.site-footer__logo {
  height: 150px;
  width: auto;
  margin: 0 auto;
}

.site-footer__bottom {
  background-color: transparent;
  padding-top: 10px;
  line-height: 1.4;
  padding-bottom: 20px;
}

.footer-legal-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 0 0 10px;
  padding: 0;
}

.footer-legal-menu a {
  color: var(--color-heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.footer-legal-menu a:hover {
  color: var(--color-accent);
}

.site-footer__copyright {
  display: block;
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-text);
}

/* 900px matches where .site-footer__columns' flex items (3 x flex-basis
   260px + 2 x 40px gap, inside the .container's own padding) actually run
   out of room and start wrapping - switching to the stacked layout exactly
   there (instead of at an arbitrary smaller breakpoint) skips the messy
   partially-wrapped state in between. */
@media only screen and (max-width: 900px) {
  .site-footer__columns {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  .site-footer__column,
  .site-footer__column--brand,
  .site-footer__column--hours {
    text-align: center;
  }

  /* flex-basis: 260px was sized as a min-*width* for the 3-column row
     layout; once flex-direction flips to column above, that same value
     becomes a forced min-*height* per stacked section, padding each one out
     with empty space well past its actual content height. */
  .site-footer__column {
    flex: 0 0 auto;
  }
}

/* ---- Back to top ---- */

.back-to-top {
  position: fixed;
  right: -60px;
  bottom: 90px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-heading);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: right 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  z-index: 90;
}

.back-to-top.is-visible {
  right: 15px;
  opacity: 1;
}

.back-to-top svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media only screen and (max-width: 480px) {
  .back-to-top {
    bottom: 70px;
  }
}
