/* Repair Case pages. Loaded by /repair-cases/, and by service pages only when their Repair Cases
   block renders; builds on style.css tokens. */

.rc-case {
  overflow-wrap: break-word;
}

.rc-case :where(.rc-hero-grid, .rc-gallery) > * {
  min-width: 0;
}

/* Breadcrumb */

.rc-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.rc-breadcrumb li + li::before {
  content: "›";
  margin: 0 8px;
  color: var(--line);
  font-weight: 900;
}

.rc-breadcrumb a {
  color: var(--navy);
}

.rc-breadcrumb a:hover,
.rc-breadcrumb a:focus-visible {
  text-decoration: underline;
}

/* Hero: what was repaired, where, proof, and how to call */

.rc-hero {
  padding: 24px 0 36px;
}

.rc-hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
}

.rc-hero-grid:not(.rc-has-photo) {
  max-width: 820px;
}

.rc-title {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

/* Discreet detail line under the H1: model (when known) and location. */
.rc-details {
  margin: 0 0 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

.rc-summary {
  margin: 0;
}

.rc-hero .actions {
  margin-top: 24px;
}

/* Panel colour = the photo processor's neutral padding (235, 235, 233): a padded portrait reads as one
   framed photo showing the complete appliance, never stretched, cropped or filled. */
.rc-hero-photo {
  overflow: hidden;
  border-radius: var(--radius);
  background: #ebebe9;
  box-shadow: var(--shadow);
}

.rc-hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

/* Photos */

.rc-photo {
  margin: 0;
}

.rc-zoom {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 16px;
  background: #ebebe9;
  box-shadow: 0 8px 22px rgba(22, 40, 66, 0.1);
}

.rc-zoom img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  transition: transform 0.2s ease;
}

/* Small magnifier badge: the photo opens larger. */
.rc-zoom::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(22, 40, 66, 0.78) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E") center / 17px no-repeat;
}

.rc-zoom:hover img {
  transform: scale(1.03);
}

.rc-zoom:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

.rc-photo figcaption {
  margin-top: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Repair story: one reading column. A section's photo floats beside that section's text and stays
   inside the section, so it never drifts into the next section or beside the photo group. */

.rc-story {
  padding: 0 0 16px;
}

/* flow-root contains the floated photos so nothing below the story is pulled up beside them. */
.rc-article {
  display: flow-root;
  max-width: 780px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.rc-chapter {
  display: flow-root;
}

.rc-chapter + .rc-chapter {
  margin-top: 28px;
}

.rc-chapter h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.rc-chapter-body {
  font-size: 1.08rem;
  line-height: 1.75;
}

.rc-chapter-body p {
  margin: 0 0 14px;
}

.rc-chapter-body p:last-child {
  margin-bottom: 0;
}

.rc-chapter-photo {
  float: right;
  clear: right;
  width: clamp(210px, 36%, 280px);
  margin: 4px 0 20px 28px;
}

.rc-sep {
  margin: 0 6px;
  color: var(--muted);
  font-weight: 600;
}

/* Secondary photos: small thumbnails that open larger (photo stages are not inferred).
   A separate group that always starts below the story and its section photos. */

.rc-photos {
  clear: both;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.rc-photos-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.rc-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 200px));
  gap: 18px;
}

.rc-thumb figcaption {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.82rem;
}

/* Photo viewer (native <dialog>: focus trap, Esc to close) */

.rc-viewer {
  width: min(1100px, 94vw);
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #0f1d31;
  color: #fff;
}

.rc-viewer::backdrop {
  background: rgba(10, 18, 30, 0.82);
}

.rc-viewer-bar {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
}

.rc-viewer-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 29, 49, 0.78);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.rc-viewer-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.rc-viewer-frame img {
  width: 100%;
  height: auto;
  max-height: calc(94vh - 64px);
  object-fit: contain;
  background: #ebebe9;
}

.rc-viewer-caption {
  margin: 0;
  padding: 12px 18px 16px;
  font-size: 0.95rem;
  color: #dbe4ef;
}

/* Closing: main CTA, then quiet related-service links */

.rc-closing {
  padding: 8px 0 80px;
}

.rc-cta {
  background: linear-gradient(145deg, var(--navy), var(--navy2));
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow);
}

.rc-cta h2 {
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 0;
}

.rc-cta .actions {
  justify-content: center;
  margin-top: 22px;
}

.rc-cta .primary {
  background: #fff;
  color: var(--navy);
  box-shadow: none;
}

.rc-cta .secondary {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.rc-related {
  margin-top: 28px;
}

.rc-related p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.rc-related-label {
  margin-right: 4px;
}

.rc-related a {
  font-weight: 700;
  color: var(--navy);
}

.rc-related a:hover,
.rc-related a:focus-visible {
  text-decoration: underline;
}

/* Repair Case card: content only. Layout comes from the parent container. */

.rc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(22, 40, 66, 0.06);
  transition: box-shadow 0.18s, transform 0.18s;
}

.rc-card:hover {
  box-shadow: 0 16px 36px rgba(16, 34, 56, 0.13);
  transform: translateY(-3px);
}

/* Fixed 4:3 thumbnail regardless of the source photo's shape (centered crop).
   overflow: hidden also stops the aspect-ratio box from growing to a tall image's height. */
.rc-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--soft);
}

.rc-card-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.rc-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 22px 22px;
}

.rc-card-eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.rc-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.rc-card-link {
  color: var(--navy);
}

/* Stretches the single title link over the whole card. */
.rc-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.rc-card:hover .rc-card-link {
  text-decoration: underline;
}

.rc-card-location {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.rc-card-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0 0 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.rc-card-cta {
  margin-top: auto;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--navy);
}

/* Keyboard focus ring on the whole card (falls back to the link's own outline). */
@supports selector(:has(*)) {
  .rc-card:has(.rc-card-link:focus-visible) {
    outline: 3px solid var(--navy);
    outline-offset: 3px;
  }

  .rc-card-link:focus-visible {
    outline: none;
  }
}

/* Hub container: vertical on mobile, 2 columns on tablet, 3 on desktop. */

.rc-case-grid {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rc-case-grid > li {
  min-width: 0;
}

/* Repair Cases block on existing service pages: up to three Hub cards, centred when fewer. */

.rc-service-cases .rc-case-grid {
  margin-top: 34px;
}

/* Service pages centre every section eyebrow; card text stays left-aligned as on the Hub. */
.rc-service-cases .rc-card .rc-card-eyebrow {
  text-align: left;
}

.rc-service-more {
  margin: 28px 0 0;
  text-align: center;
  font-weight: 800;
}

.rc-service-more a {
  color: var(--navy);
}

.rc-service-more a:hover,
.rc-service-more a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 560px) {
  /* Swipe row, like the homepage gallery, so several cards do not lengthen the page. */
  /* Bottom padding leaves room for the card shadow, which the scroll container would otherwise clip. */
  .rc-service-cases .rc-case-grid:not(.rc-count-1) {
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px 2px 32px;
  }

  .rc-service-cases .rc-case-grid > li {
    scroll-snap-align: start;
  }

  .rc-service-cases .rc-case-grid:not(.rc-count-1) + .rc-service-more {
    margin-top: 4px;
  }
}

@media (min-width: 561px) {
  .rc-service-cases .rc-case-grid.rc-count-1 {
    grid-template-columns: minmax(0, 380px);
    justify-content: center;
  }

  .rc-service-cases .rc-case-grid.rc-count-2 {
    grid-template-columns: repeat(2, minmax(0, 380px));
    justify-content: center;
  }
}

/* Repair Cases Hub */

.rc-hub-top {
  padding: 28px 0 56px;
}

.rc-hub-header {
  max-width: 820px;
  margin-bottom: 32px;
}

.rc-hub-intro,
.rc-hub-page-label {
  margin: 0;
}

.rc-hub-page-label {
  font-weight: 800;
  color: var(--muted);
}

/* Filtered Hub: back to the service page and to the unfiltered Hub. */
.rc-hub-filter {
  margin: 0 0 20px;
  font-weight: 800;
}

.rc-hub-filter a {
  color: var(--navy);
}

.rc-hub-filter a:hover,
.rc-hub-filter a:focus-visible {
  text-decoration: underline;
}

.rc-hub-empty {
  max-width: 760px;
  margin: 0;
  padding: 24px 28px;
  border-radius: 18px;
  background: var(--soft);
  font-size: 1.05rem;
}

/* Numbered pagination (server-rendered links only) */

.rc-pagination {
  margin-top: 44px;
}

.rc-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rc-page-number,
.rc-page-step,
.rc-page-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  border-radius: 999px;
  font-weight: 800;
}

.rc-page-number,
.rc-page-step {
  padding: 0 14px;
  color: var(--navy);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.rc-page-step {
  padding: 0 18px;
}

a.rc-page-number:hover,
a.rc-page-number:focus-visible,
.rc-page-step:hover,
.rc-page-step:focus-visible {
  background: var(--soft);
}

.rc-page-current {
  color: #fff;
  background: var(--navy);
  box-shadow: none;
}

.rc-page-gap {
  min-width: 24px;
  color: var(--muted);
}

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

/* Error and status pages */

.rc-status {
  padding: 72px 0 96px;
}

/* Responsive */

@media (max-width: 560px) {
  .rc-hero .rc-breadcrumb li[aria-current] {
    display: none;
  }

  .rc-case .actions {
    flex-direction: column;
  }

  .rc-case .actions .btn {
    width: 100%;
  }

  .rc-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 561px) {
  .rc-case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Narrow screens: no float; the section photo follows its text at a comfortable width. */
@media (max-width: 700px) {
  .rc-chapter {
    display: flex;
    flex-direction: column;
  }

  .rc-chapter-body {
    order: 1;
  }

  .rc-chapter-photo {
    order: 2;
    float: none;
    width: auto;
    max-width: 440px;
    margin: 18px 0 0;
  }
}

@media (min-width: 901px) {
  .rc-hero {
    padding: 32px 0 44px;
  }

  .rc-hub-top {
    padding: 36px 0 72px;
  }

  .rc-hero-grid.rc-has-photo {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 48px;
  }

  .rc-case-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rc-cta {
    padding: 48px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rc-card,
  .rc-zoom img {
    transition: none;
  }

  .rc-card:hover,
  .rc-zoom:hover img {
    transform: none;
  }
}

/* =========================================================
   Sticky mobile call bar on Repair Case articles
   - markup: the shared includes/mobile-cta.php
   - rules mirror "Sticky Mobile Call Bar" in service-page-additions.css, which case pages do not load
   - scoped to body.rc-mobile-cta, so service pages keep their own rules
   ========================================================= */

body.rc-mobile-cta .mobile-cta-bar {
  display: none; /* hidden on desktop */
}

@media (max-width: 900px) {
  body.rc-mobile-cta .mobile-cta-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    gap: 0;
    background: var(--navy);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  body.rc-mobile-cta .mobile-cta-call {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--gold);
    color: var(--navy);
    font-size: 1rem;
    font-weight: 900;
    text-decoration: none;
    letter-spacing: 0.01em;
  }

  body.rc-mobile-cta .mobile-cta-call:hover {
    background: #b8892e;
    color: var(--navy);
  }

  body.rc-mobile-cta .mobile-cta-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: transparent;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
  }

  body.rc-mobile-cta .mobile-cta-form:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
  }

  /* Keep the end of the page (footer phone and legal links) reachable above the fixed bar */
  body.rc-mobile-cta {
    padding-bottom: 60px;
  }
}
