/* ===========================================================================
 * Kabir Family Law - the "find your nearest office" band (footer, every page)
 * File   : wp-content/themes/kabir-child/css/kfl-offices-slider.css
 * Loaded : by inc/kfl-offices-slider.php on every front-end view.
 * Written: 10 September 2026
 *
 * EVERY SIZE IS IN PIXELS ON PURPOSE. This theme sets html{font-size:10px}, so
 * 1rem is 10px here, not 16px, and any rem would render at 62.5% of intent.
 * clamp() uses px and vw only.
 *
 * Colours are the site's settled tokens (navy #35354E, gold #B28E2E, paper
 * #FAF9F7, line #E4E1DB, muted #54546B - the same values declared in
 * css/kfl-office-design.css and css/kfl-people-profile.css). They are
 * re-declared locally so this file does not depend on another stylesheet's
 * load order. No new colour is introduced.
 *
 * The focus indicator is the two-ring pattern already settled in
 * kfl-people-profile.css: a navy ring, which carries the contrast on the pale
 * surfaces, inside a gold halo, which carries it on the navy button.
 *
 * Motion: one shadow transition, switched OFF by prefers-reduced-motion. There
 * is no carousel, no auto-advance and no script.
 * ======================================================================== */

#location-wrap.kfloff {
  --kfloff-navy:       #35354E;
  --kfloff-navy-deep:  #262639;
  --kfloff-muted:      #54546B;
  --kfloff-gold:       #B28E2E;
  --kfloff-paper:      #FAF9F7;
  --kfloff-line:       #E4E1DB;
  --kfloff-white:      #FFFFFF;
  --kfloff-ring:       #17243E;
  --kfloff-halo:       #E8B84B;
  --kfloff-r:          6px;
  --kfloff-ease:       cubic-bezier(.22,.61,.36,1);

  display: block;
  margin: 0;
  padding: 48px 0 56px;
  background: var(--kfloff-paper);
  border-top: 1px solid var(--kfloff-line);
}

#location-wrap.kfloff *,
#location-wrap.kfloff *::before,
#location-wrap.kfloff *::after { box-sizing: border-box; }

.kfloff .kfloff__inner {
  width: min(1160px, 100% - 32px);
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 600px) {
  .kfloff .kfloff__inner { width: min(1160px, 100% - 48px); }
}

/* ---- heading ----------------------------------------------------------- */

.kfloff .kfloff__head {
  margin: 0 0 28px;
  padding: 0;
  max-width: 760px;
  text-align: left;
}

.kfloff .kfloff__title {
  margin: 0;
  padding: 0;
  border: 0;
  /* 22px at 320px, 30px from about 1170px up. Never below 22px. */
  font-size: clamp(22px, 1.2vw + 16px, 30px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--kfloff-navy);
}

.kfloff .kfloff__rule {
  display: block;
  width: 56px;
  height: 2px;
  margin: 14px 0 0;
  background: var(--kfloff-gold);
}

/* ---- the grid ---------------------------------------------------------- */
/* auto-fill, not auto-fit: with ten cards an incomplete last row keeps the
   same card width as the rows above it instead of stretching two cards across
   the whole container. 212px is chosen so a 1160px container holds five, so
   the desktop case is two clean rows of five. */

.kfloff .kfloff__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 600px) {
  .kfloff .kfloff__grid { gap: 20px; }
}

/* Below 768px, ten stacked cards made the band 2,764px tall on every page -
   measured at 375x900 before this rule existed. The same ten cards become one
   horizontally scroll-snapping rail instead: about 300px tall, every card still
   in the document, still visible to assistive technology, still one Tab stop
   per link (the browser scrolls a focused card into view by itself), and still
   no JavaScript. Snap is `proximity`, not `mandatory`, so it does not fight
   that focus scrolling. */

@media (max-width: 767px) {
  .kfloff .kfloff__grid {
    display: flex;
    grid-template-columns: none;
    gap: 12px;
    /* Bleed to the screen edges so the rail reads as a rail. */
    margin: 0 -16px;
    /* Top and bottom room so a focus ring is not clipped by the scroll box. */
    padding: 4px 16px 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-left: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .kfloff .kfloff__card {
    flex: 0 0 78%;
    max-width: 280px;
    scroll-snap-align: start;
  }
}

/* ---- the card ---------------------------------------------------------- */
/* Every card in a row is the same height because grid items stretch; the
   address takes the slack so the phone number always sits on the baseline of
   the card, whether the address runs to three lines or seven. */

.kfloff .kfloff__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 20px 20px 16px;
  background: var(--kfloff-white);
  border: 1px solid var(--kfloff-line);
  border-radius: var(--kfloff-r);
  list-style: none;
  transition: border-color .28s var(--kfloff-ease), box-shadow .28s var(--kfloff-ease);
}

.kfloff .kfloff__card::before,
.kfloff .kfloff__card::after { content: none; }

.kfloff .kfloff__card:hover,
.kfloff .kfloff__card:focus-within {
  border-color: var(--kfloff-gold);
  box-shadow: 0 6px 18px -8px rgba(38,38,57,.28);
}

.kfloff .kfloff__name {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--kfloff-navy);
}

/* The name is the card's link. display:block plus the padding/negative-margin
   pair gives the link a 44px target box without moving anything on screen. */
.kfloff .kfloff__name a {
  display: block;
  padding: 11px 0;
  margin: -11px 0;
  color: inherit;
  text-decoration: none;
}

.kfloff .kfloff__name a:hover,
.kfloff .kfloff__name a:focus-visible {
  color: var(--kfloff-navy-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.kfloff .kfloff__name::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin: 14px 0 0;
  background: var(--kfloff-gold);
}

.kfloff .kfloff__addr {
  flex: 1 1 auto;
  margin: 12px 0 14px;
  padding: 0;
  border: 0;
  font-style: normal;
  font-size: 16px;
  line-height: 1.5;
  color: var(--kfloff-muted);
  overflow-wrap: anywhere;
}

.kfloff .kfloff__addr p { margin: 0; padding: 0; font-size: inherit; line-height: inherit; color: inherit; }

.kfloff .kfloff__tel {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--kfloff-navy);
  text-decoration: none;
}

.kfloff .kfloff__tel:hover,
.kfloff .kfloff__tel:focus-visible {
  color: var(--kfloff-navy-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.kfloff .kfloff__tel .fa { font-size: 14px; color: var(--kfloff-gold); }

/* ---- the one call to action -------------------------------------------- */

.kfloff .kfloff__cta { margin: 28px 0 0; padding: 0; }

.kfloff .kfloff__cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  background: var(--kfloff-navy);
  color: var(--kfloff-white);
  border: 0;
  border-radius: var(--kfloff-r);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .28s var(--kfloff-ease);
}

.kfloff .kfloff__cta a:hover,
.kfloff .kfloff__cta a:focus-visible {
  background: var(--kfloff-navy-deep);
  color: var(--kfloff-white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- focus -------------------------------------------------------------
   Written with the #id so it outranks the parent theme's a:focus{outline:0}
   and anything else that has reached these links before. */

#location-wrap.kfloff a:focus-visible {
  outline: 3px solid var(--kfloff-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--kfloff-halo);
  border-radius: 2px;
}

/* Browsers without :focus-visible still get a visible indicator. */
#location-wrap.kfloff a:focus {
  outline: 3px solid var(--kfloff-ring);
  outline-offset: 2px;
}

#location-wrap.kfloff a:focus:not(:focus-visible) {
  outline: 0;
  box-shadow: none;
}

/* ---- motion ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  #location-wrap.kfloff .kfloff__card,
  #location-wrap.kfloff .kfloff__cta a { transition: none; }
}
