/* =========================================================
   HOME - SAFETY & QUALITY
   Light warm section. Topics on the left, one reading panel on the right.
   Long text only makes the single panel taller - never four cards.
   (loaded automatically on the Home page)
   ========================================================= */
.sf .section{
padding-top:0 !important;
} 

/* ---- header row (same pattern as Services) ---- */
.sf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
  flex-wrap: wrap;
  margin-bottom: clamp(32px, 4vw, 48px);
}
.sf-head-text {
  flex: 0 1 auto;
}
.sf-head h2 {
  margin-bottom: 0;
  color: var(--ink-900);
}
.sf-lead {
  flex: 1 1 320px;
  max-width: 520px;
  margin: 0;
  color: var(--steel-500);
}

/* ---- layout ---- */
.sf-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) 1.5fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

/* ---- topic list ---- */
.sf-tabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sf-tab {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 18px;
  text-align: left;
  font: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.sf-tab:hover {
  background: rgba(255, 255, 255, 0.65);
}
.sf-tab.is-active {
  background: var(--white);
  border-color: var(--line);
  box-shadow: 0 10px 28px rgba(13, 24, 30, 0.08);
}
.sf-tab:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.sf-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(214, 154, 45, 0.18);
  color: var(--accent-ink);
  font-size: 1.15rem;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}
.sf-tab.is-active .sf-ico {
  background: var(--accent);
  color: var(--ink-900);
}
.sf-title {
  flex: 1;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.3;
  color: var(--ink-900);
}
.sf-num {
  flex: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--steel-500);
}

/* ---- reading panel ---- */
.sf-panels {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 48px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(13, 24, 30, 0.07);
}
.sf-panels::before {
  /* amber line on top */
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 96px;
  height: 4px;
  background: var(--accent);
}
.sf-panel {
  position: relative;
  z-index: 1; /* text always sits above the big number */
}
.sf-panel ~ .sf-panel {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
} /* no-JS view */
.sf-panel h3 {
  margin: 0 0 16px;
  max-width: 24ch;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.2;
  color: var(--ink-900);
}
.sf-panel p {
  margin: 0 0 14px;
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--steel-500);
}
.sf-panel p:last-child {
  margin-bottom: 0;
}

/* big outlined number in the corner of the white card (one per topic; only the active one shows) */
.sf-ghost {
  position: absolute;
  right: 0;
  bottom: -1rem;
  z-index: 0;
  font-size: clamp(5rem, 12vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(214, 154, 45, 0.35);
  pointer-events: none;
  user-select: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s ease,
    visibility 0s linear 0.35s;
}
.sf-ghost.is-active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.sf:not(.is-ready) .sf-ghost {
  display: none;
}

/* ---- JS on: one panel at a time. All panels share one grid cell, so the box keeps a steady height. ---- */
.sf.is-ready .sf-panels {
  display: grid;
}
.sf.is-ready .sf-panel {
  grid-area: 1 / 1;
  margin: 0;
  padding: 0;
  border: 0;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    visibility 0s linear 0.35s;
}
.sf.is-ready .sf-panel.is-active {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

/* ---- JS off: no tabs, everything in one column ---- */
.sf:not(.is-ready) .sf-tabs {
  display: none;
}
.sf:not(.is-ready) .sf-grid {
  grid-template-columns: 1fr;
}

/* ---- things that only exist for phones are hidden on desktop / laptop ---- */
.sf-panel-ico,
.sf-nav {
  display: none;
}
.sf-right {
  min-width: 0;
}

/* =========================================================
   PHONES & SMALL TABLETS (up to 860px): no tabs - a swipe slider with arrow buttons
   ========================================================= */
@media (max-width: 860px) {
  .sf-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .sf-tabs,
  .sf:not(.is-ready) .sf-tabs {
    display: none;
  }
  .sf-head {
    align-items: flex-start;
  }

  /* the track: panels side by side, snapping, running to the screen edges */
  .sf .sf-panels,
  .sf.is-ready .sf-panels {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    margin: 0 calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 12px;
    scroll-padding-left: var(--gutter);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .sf .sf-panels::-webkit-scrollbar {
    display: none;
  }
  .sf .sf-panels::before {
    display: none;
  }
  .sf .sf-panels::after {
    content: "";
    flex: 0 0 2px;
  } /* breathing room after the last card */

  /* each topic becomes its own card */
  .sf .sf-panels .sf-panel,
  .sf.is-ready .sf-panels .sf-panel {
    position: relative;
    flex: 0 0 86%;
    max-width: 430px;
    margin: 0;
    padding: 26px 22px 24px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(13, 24, 30, 0.08);
    scroll-snap-align: start;
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: none;
    grid-area: auto;
  }
  .sf .sf-panels .sf-panel::before {
    /* amber line on top */
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 72px;
    height: 4px;
    background: var(--accent);
  }
  .sf-panel-ico {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: var(--accent);
    color: var(--ink-900);
    font-size: 1.2rem;
  }
  .sf-panel h3 {
    max-width: none;
    margin-bottom: 12px;
    font-size: 1.3rem;
  }
  .sf-panel p {
    font-size: 0.98rem;
    line-height: 1.65;
  }

  /* the big number is a desktop-only detail - it sits outside the swipe cards */
  .sf-ghost,
  .sf.is-ready .sf-ghost {
    display: none;
  }

  /* arrows + counter */
  .sf.is-ready .sf-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
  }
  .sf-count {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--steel-500);
  }
  .sf-count b {
    font-size: 1.1rem;
    color: var(--ink-900);
  }
  .sf-arrows {
    display: flex;
    gap: 10px;
  }
  .sf-arrow {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1.5px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    color: var(--ink-900);
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(13, 24, 30, 0.08);
    transition:
      background 0.25s ease,
      color 0.25s ease,
      border-color 0.25s ease,
      opacity 0.25s ease;
  }
  .sf-arrow:active:not(:disabled),
  .sf-arrow:hover:not(:disabled) {
    background: var(--ink-900);
    border-color: var(--ink-900);
    color: var(--white);
  }
  .sf-arrow:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
  }
  .sf-arrow:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sf-tab,
  .sf-ico,
  .sf-arrow,
  .sf-ghost,
  .sf.is-ready .sf-panel {
    transition: none;
  }
  .sf.is-ready .sf-panel {
    transform: none;
  }
}

