/* Homepage sections. Shared nav, buttons and footer live in site.css. */

.section {
  padding: 110px 32px;
}

.section-inner {
  max-width: 1440px;
  margin: 0 auto;
}

/* ---------- Hero ---------- */
/* On a navy panel: the text on white inside a thin white frame on the left, the van photo on the
   right, the frame and the photo the same size and shape. The photo is never covered or darkened. */
.hero {
  margin-top: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
  /* On wide screens the side padding grows so the hero lines up with the 1440 px page column */
  padding: clamp(40px, 5vw, 72px) max(clamp(24px, 5vw, 88px), calc((100% - 1440px) / 2));
  background: var(--navy);
  color: var(--white);
}

/* The frame: same 3:2 shape and corner as the photo; text sizes follow the frame's width */
.hero-copy {
  container-type: inline-size;
  aspect-ratio: 3 / 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* The thin white line, a narrow navy gap, then the white card inside */
  padding: 7px;
  border: 1px solid var(--white);
  border-radius: var(--r-lg);
  background: var(--white) content-box;
  color: var(--navy);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

/* On the white, the keyboard focus ring is navy again */
.hero .hero-copy :focus-visible {
  outline-color: var(--navy);
}

.hero-copy-in {
  padding: 0 7cqi;
  text-align: center;
}

.hero-title {
  color: var(--navy);
  font-size: 7.4cqi;
  line-height: 1.05;
  animation: heroTitleUp 0.8s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* "Need a plumber?", "Call", and "Rowland's", each on its own line; a little air under the
   question, and "Call" sitting close on top of "Rowland's" */
.hero-line {
  display: block;
  white-space: nowrap;
}

.hero-line:first-child {
  margin-bottom: 0.22em;
}

/* "Rowland's" drawn with the real van lettering, in the logo red */
.hero-script {
  display: block;
  height: 1.5em;
  aspect-ratio: 900 / 266;
  margin: -0.12em auto 0;
  background: var(--red);
  -webkit-mask: url("images/wordmark-script.png") center / contain no-repeat;
  mask: url("images/wordmark-script.png") center / contain no-repeat;
}

.hero-sub {
  text-wrap: balance;
  margin-top: 3.2cqi;
  font-size: max(0.95rem, 2.6cqi);
  line-height: 1.55;
  color: var(--gray-500);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4cqi;
}

.hero-hours {
  text-wrap: balance;
  margin-top: 1.8cqi;
  font-size: max(0.9rem, 2.2cqi);
  color: var(--gray-500);
}

/* The whole photo, framed */
.hero-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
  aspect-ratio: 3 / 2;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes heroTitleUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Section bands ---------- */
/* Each home section gets its own background so it reads as a separate block. */
.fix,
.work {
  background: var(--white);
}

.fix {
  border-bottom: 1px solid rgba(28, 53, 83, 0.08);
}

/* Home section headings (Services, The Rowland's Promise, Our work, Reviews): one size, centred */
.section-title,
.work-head h2,
.promise-intro h2,
.reviews h2 {
  font-size: clamp(2.4rem, 3.9vw, 3.8rem);
  text-align: center;
}

.section-title {
  margin-bottom: 36px;
}

/* ---------- What we do ---------- */

/* Big tiles: two per row on wide screens, one per row below 1024 px */
.fix-list {
  list-style: none;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.fix-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  min-width: 0;
  padding: 30px 33px;
  border-radius: var(--r-md);
  background: var(--cream);
  border: 1px solid rgba(28, 53, 83, 0.08);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.62rem;
  line-height: 1.2;
  color: var(--navy);
  text-decoration: none;
}

.fix-list svg {
  width: 27px;
  height: 27px;
  flex: none;
  color: var(--red);
}

.fix-list a:hover {
  border-color: var(--red);
}

.fix-list span {
  min-width: 0;
}

/* A service's details, opened from its tile: white card over a dimmed page */
.service-pop {
  width: min(540px, calc(100% - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: 0 30px 80px rgba(20, 40, 64, 0.35);
}

.service-pop::backdrop {
  background: rgba(20, 40, 64, 0.55);
}

.service-pop-card {
  position: relative;
  padding: 34px 32px 30px;
}

.service-pop h2 {
  margin-right: 52px;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
}

.service-pop-text {
  margin: 12px 0 24px;
  color: var(--gray-500);
  line-height: 1.65;
}

.service-pop-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.service-pop .service-pop-close {
  top: 14px;
  right: 14px;
  background: var(--cream);
  color: var(--navy);
}

@media (hover: hover) {
  .service-pop .service-pop-close:hover {
    background: rgba(28, 53, 83, 0.12);
  }
}

.promise-more a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}

.promise-more svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.promise-more a:hover svg {
  transform: translateX(4px);
}

/* ---------- Our work: a sideways photo strip that drifts on its own (gallery.js) ---------- */
.gallery {
  margin-top: 36px;
}

.gallery-track {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-radius: var(--r-md);
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-row {
  list-style: none;
  display: flex;
  gap: 16px;
  width: max-content;
}

.gallery-card {
  display: block;
  height: clamp(240px, 28vw, 340px);
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--gray-100);
  cursor: zoom-in;
}

.gallery-card img {
  display: block;
  width: auto;
  height: 100%;
  transition: transform 0.3s ease;
}

.gallery-card:hover img {
  transform: scale(1.03);
}

.gallery-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* Get a free quote sits at the right end of the controls, like Read all reviews */
.gallery-controls .btn {
  margin-left: auto;
}

.gallery-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  width: 44px;
  border: 1px solid rgba(28, 53, 83, 0.2);
  border-radius: var(--pill);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
}

.gallery-btn svg {
  width: 18px;
  height: 18px;
}

/* Pause/play: shows pause while the photos move on by themselves, play while they're paused */
.gallery-play {
  margin-left: 6px;
}

.gallery-play .icon-play,
.gallery-play.is-paused .icon-pause {
  display: none;
}

.gallery-play.is-paused .icon-play {
  display: block;
}

@media (hover: hover) {
  .gallery-btn:hover {
    border-color: var(--navy);
  }
}

/* ---------- Full-size photo viewer ---------- */
/* Solid background, so the page and the Call bar never show through */
.viewer {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--navy-deep);
  overflow: hidden;
}

/* The page's scrollbar gap (kept so nothing jumps) matches the viewer too */
html.viewer-open {
  background: var(--navy-deep);
}

.viewer::backdrop {
  background: var(--navy-deep, #142840);
}

/* Photo, with "3 of 10" under it, centred. JS sets each photo's width so every photo fits the same
   box, and the width of the widest one (--photo-widest), so the arrows can stay put beside it. */
.viewer-figure {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 24px 20px;
}

.viewer-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
}

/* One photo on its own (the van): no arrows, no count */
.viewer.is-single .viewer-nav,
.viewer.is-single .viewer-count {
  display: none;
}

.viewer-count {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  white-space: nowrap;
}

.viewer-close,
.viewer-nav {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  cursor: pointer;
}

@media (hover: hover) {
  .viewer-close:hover,
  .viewer-nav:hover {
    background: rgba(255, 255, 255, 0.24);
  }
}

.viewer-close svg,
.viewer-nav svg {
  width: 22px;
  height: 22px;
}

.viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* Fixed just outside the widest photo, level with the middle of the photo area */
.viewer-nav {
  position: absolute;
  z-index: 1;
  top: calc(50% + 4px);
  transform: translateY(-50%);
}

.viewer-prev {
  left: max(8px, calc(50% - var(--photo-widest, 900px) / 2 - 64px));
}

.viewer-next {
  right: max(8px, calc(50% - var(--photo-widest, 900px) / 2 - 64px));
}

.viewer :focus-visible {
  outline-color: var(--white);
}

/* Phones: the photo uses the full width, and the arrows sit over its edges */
@media (max-width: 640px) {
  .viewer-figure {
    padding: 64px 12px 16px;
  }

  .viewer-nav {
    background: rgba(20, 40, 64, 0.6);
  }
}

/* ---------- Two reviews, side by side ---------- */
.reviews h2 {
  color: var(--white);
}




/* Memberships page: cards side by side, centred */
.mem .plan-cards {
  max-width: 860px;
  margin: 0 auto;
}

.mem .plan-note {
  text-align: center;
}

/* ---------- Rowland's Promise ---------- */
/* Heading and "Full Promise terms" centred above the list of five */
.promise-wrap {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  gap: 32px;
}

.promise-intro {
  text-align: center;
}

@keyframes sealSpin {
  to { transform: rotate(360deg); }
}

.promise-intro h2 {
  margin-bottom: 10px;
}

/* "Rowland's Promise" always stays on one line; the size steps down to fit its column */
.promise-intro {
  container-type: inline-size;
}

.promise-name {
  white-space: nowrap;
}

/* "The [Rowland's in van lettering, red] Promise" */
.promise-script {
  display: inline-block;
  height: 1.3em;
  aspect-ratio: 900 / 266;
  margin: 0 0.04em;
  vertical-align: -0.34em;
  background: var(--red);
  -webkit-mask: url("images/wordmark-script.png") left center / contain no-repeat;
  mask: url("images/wordmark-script.png") left center / contain no-repeat;
}

.promise-more {
  margin-top: 0;
}

.promise-list {
  list-style: none;
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(28, 53, 83, 0.06);
  padding: 10px 36px;
}

.promise-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 24px 0;
}

.promise-item + .promise-item {
  border-top: 1px dashed rgba(28, 53, 83, 0.18);
}

.promise-num {
  font-family: var(--display);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--red);
  text-align: center;
}

.promise-item h3 {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.promise-item p {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--gray-500);
}

@media (max-width: 560px) {
  .promise-list {
    padding: 4px 20px;
  }

  .promise-item {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 20px 0;
  }

  .promise-num {
    font-size: 2.2rem;
  }
}

/* ---------- Reviews ---------- */
.reviews {
  background: var(--navy);
  color: var(--white);
  padding: 110px 32px;
  position: relative;
  overflow: hidden;
}

.reviews-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.reviews-inner > .btn {
  display: flex;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.slide-stars {
  color: var(--gold);
  font-size: 1.3rem;
  letter-spacing: 3px;
  margin-bottom: 18px;
}

/* One review at a time, like the original site */
.reviews .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #F08A8A;
}

.reviews .eyebrow svg {
  width: 18px;
  height: 18px;
}

.quote-mark {
  position: absolute;
  top: -40px;
  right: 0;
  font-family: Georgia, serif;
  font-size: 16rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.slides {
  position: relative;
  min-height: 250px;
  margin-top: 18px;
}

.slide {
  position: absolute;
  inset: 0 0 auto;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.slide.active {
  position: relative;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.slide blockquote p {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--white);
}

.slide.is-long blockquote p {
  font-size: clamp(1.15rem, 1.7vw, 1.5rem);
  font-weight: 700;
  line-height: 1.45;
}

.slide figcaption {
  margin-top: 22px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.slider-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 44px;
}

.slider-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.slider-btn:hover {
  background: var(--white);
  color: var(--navy);
}

.slider-btn svg {
  width: 20px;
  height: 20px;
}

.slider-dots {
  display: flex;
  margin: 0 12px 0 0;
}

/* Small dots, but each sits in a 32 px tap area */
.slider-dots button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.slider-dots button::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: width 0.2s;
}

.slider-dots button[aria-current="true"]::before {
  width: 26px;
  border-radius: 6px;
  background: #F08A8A;
}

.reviews-inner .slider-controls .btn {
  margin: 0 0 0 auto;
}

@media (max-width: 860px) {
  .quote-mark {
    font-size: 9rem;
    top: -24px;
  }

  .slides {
    min-height: 200px;
  }

  .slide blockquote p {
    font-size: 1.2rem;
    line-height: 1.4;
  }

  .slide.is-long blockquote p {
    font-size: 1.05rem;
  }

  .slider-controls {
    margin-top: 28px;
  }

  .slider-btn {
    width: 46px;
    height: 46px;
  }

  .reviews-inner .slider-controls .btn,
  .gallery-controls .btn {
    margin: 12px 0 0;
    width: 100%;
  }
}

/* ---------- Recent work ---------- */
/* "Our work", with Get a free quote under it, centred */
.work-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.work-sub {
  font-size: 1.1rem;
  color: var(--gray-500);
}

@media (max-width: 860px) {
  .section {
    padding: 80px 18px;
  }

  /* Phones: the frame grows to fit its text */
  .hero {
    padding: 20px 18px 36px;
  }

  .hero-photo {
    border-radius: var(--r-md);
  }

  .hero-copy {
    border-radius: var(--r-md);
  }

  .hero-copy-in {
    padding: 28px 22px;
  }

  .hero-title {
    font-size: clamp(1.5rem, 7.6vw, 2.8rem);
  }

  .hero-sub,
  .hero-hours {
    margin-top: 14px;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .promise-more a {
    min-height: 44px;
  }


  .reviews {
    padding: 88px 18px;
  }

}

@media (max-width: 560px) {
  .fix-list {
    gap: 8px;
  }

  .fix-list a {
    gap: 10px;
    min-height: 52px;
    padding: 13px 16px;
    font-size: 1.08rem;
  }

  .fix-list svg {
    width: 18px;
    height: 18px;
  }
}

/* Tablets and small laptops: the framed text on top, the photo under it, both the full width */
@media (max-width: 1199px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 24px;
  }

  .hero-copy,
  .hero-photo {
    width: 100%;
    max-width: 720px;
  }

}

/* Phones, tablets, and small laptops: one tile per row */
@media (max-width: 1023px) {
  .fix-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {

  .hero-copy {
    aspect-ratio: auto;
  }

  .hero-actions .btn,
  .footer-buttons .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title {
    animation: none;
  }
}

/* ---------- Phones: tighter type and spacing ---------- */
@media (max-width: 560px) {
  .section {
    padding: 60px 18px;
  }

  .section-title,
  .work-head h2,
  .reviews h2 {
    font-size: 2.1rem;
  }

  .promise-intro h2 {
    font-size: 2.1rem;
    margin-bottom: 10px;
  }

  .promise-item {
    padding: 16px 0;
  }

  .promise-num {
    font-size: 1.8rem;
  }

  .promise-item h3 {
    font-size: 0.98rem;
  }

  .promise-item p {
    font-size: 0.92rem;
  }

  .reviews {
    padding: 64px 18px;
  }
}

/* ---------- Memberships ---------- */
.mem.page-top {
  padding-top: calc(var(--nav-h) + 72px);
  padding-bottom: 80px;
}

.mem-head {
  max-width: 760px;
  margin: 0 auto 52px;
  text-align: center;
}

/* Good to know (shared look in site.css), in the same centred column width as the booking page's */
.mem-fine {
  max-width: 820px;
  margin: 52px auto 0;
  line-height: 1.6;
}

/* Three steps in a row (number and name), a little wider together than the two plans above, then Good to know */
.mem-steps {
  list-style: none;
  max-width: 1000px;
  margin: 44px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.mem-steps li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 26px;
  border-radius: var(--r-md);
  background: var(--white);
  border: 1px solid rgba(28, 53, 83, 0.1);
}

.mem-step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--pill);
  background: var(--navy);
  color: var(--white);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
}

.mem-steps strong {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
}

/* Below 1100 px the three steps stack, so each name stays on one line */
@media (max-width: 1099px) {
  .mem-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

@media (max-width: 860px) {
  .mem.page-top {
    padding-top: calc(var(--nav-h) + 40px);
    padding-bottom: 48px;
  }

  .mem-head {
    margin-bottom: 36px;
  }

}

/* The Promise heading never grows wider than its column, so "Rowland's Promise" fits on one line */
.promise-intro .promise-title {
  font-size: min(clamp(2.4rem, 3.9vw, 3.8rem), 10.6cqi);
}

@media (max-width: 560px) {
  .promise-intro .promise-title {
    font-size: min(2.1rem, 10.6cqi);
  }
}
