/* ==========================================================================
   Why Somerset County — "Set for Work" section
   Loaded after css/styles.css, css/components/page-chrome.css and whichever
   components a page needs. Work is the blue section: unlike Life, its accent
   and its on-dark nav colour are the same value.
   Design reference: WhySomerset_Website_2026_Work.pdf, pages 1, 3, 4
   ========================================================================== */

:root {
  --ws-section-accent: var(--ws-blue);
  --ws-section-nav: var(--ws-blue);
  --ws-work-btn: linear-gradient(90deg, #85b5d9 0%, #eef5fa 100%);
  --ws-work-tint: #d8e7f2;             /* the pale blue behind a roused logo */
}

/* Work's "Learn more" is a blue-to-pale gradient with dark type, the same
   shape as Fun's amber one and Life's green. */
.btn-pill--work {
  background: var(--ws-work-btn);
  color: var(--ws-ink);
  padding: .42em 1.5em;
}
a:hover .btn-pill--work,
a:focus-visible .btn-pill--work { background: var(--ws-work-btn); color: var(--ws-ink); }

/* --------------------------------------------------------------------------
   1. Landing sub-page pills
   Two wide buttons rather than the three "Set for X!" pills — comp draws them
   501.1 x 85.7 on a 37.8 gap, radius 21.4, across the 1040 column.
   -------------------------------------------------------------------------- */
.work-pills {
  list-style: none;
  margin: clamp(4px, .56vw, 8px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.63vw, 38px);
}
.work-pill {
  display: grid;
  place-items: center;
  min-height: clamp(56px, 5.95vw, 86px);
  padding: .5em 1rem;
  border-radius: clamp(12px, 1.49vw, 21px);
  background: var(--ws-blue);
  font-weight: 700;
  font-size: clamp(.9375rem, 1.25vw, 1.125rem);
  line-height: 1.2;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .02em;
  text-decoration: none;
  transition: transform .25s var(--ws-ease), box-shadow .25s var(--ws-ease);
}
.work-pill--dark { background: var(--ws-teal); }
.work-pill:hover,
.work-pill:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 79, 90, .28);
  color: #fff;
}

/* --------------------------------------------------------------------------
   2. Industry tiles — a narrow + wide row, then three across
   Layout comes from components/experience-tiles.css; these are Work's own
   measurements off its comp: 330 : 685 on a 24.9 gap, all in the 1040 column.
   -------------------------------------------------------------------------- */
.work-tiles {
  --tile-gap-x: clamp(16px, 1.73vw, 25px);
  --tile-gap-y: clamp(14px, 1.5vw, 22px);
  --tile-sm: 330;
  --tile-lg: 685;
  --tile-span: 1015;
}
.work-tiles .exp-card {
  min-height: 0;
  height: clamp(180px, 23.63vw, 340px);
  border-radius: 14px;
  --card-title-size: clamp(.9375rem, 1.25vw, 1.125rem);
  --card-pill-size:  clamp(.8125rem, 1vw, .9375rem);
}

/* --------------------------------------------------------------------------
   3. Quick info — Work sets the label in ink and the items in teal, where
   Life does the reverse. Measured, not assumed.
   -------------------------------------------------------------------------- */
.work-quick-info__label { margin: 0 0 clamp(6px, .69vw, 10px); font-weight: 700; }
.prose .list--teal li { font-weight: 700; color: var(--ws-teal-ink); }
.prose .list--teal li::marker { color: var(--ws-teal-ink); }

/* --------------------------------------------------------------------------
   5. Top Employers — the featured employer banner
   Comp: a full-bleed photograph 1076 - 1735 with a gradient feather to white
   over its bottom 248, and the employer's wordmark centred across the join —
   336 x 75, its top 10 above the bottom of the picture. The mark therefore
   hangs 65 below the photo box, which is why the banner reserves that below
   itself rather than letting the mark collide with the logo wall.
   -------------------------------------------------------------------------- */
.employer-banner { margin-bottom: clamp(62px, 7.65vw, 110px); }

.employer-banner__frame {
  position: relative;
  height: clamp(260px, 45.77vw, 659px);
  overflow: visible;
}
.employer-banner__photo { width: 100%; height: 100%; object-fit: cover; }

/* The feather. Solid white in the comp's drawing list, but it is a gradient
   feather in the InDesign file — a solid rect would simply erase the picture. */
.employer-banner__frame::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 37.63%;                       /* 248 of the photo's 659 */
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #fff 78%);
  pointer-events: none;
}

.employer-banner__mark {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  width: clamp(190px, 23.33vw, 336px);
  /* 65 of the mark's own 75 sits below the photo, so the shift is a share of
     the element, not of the banner — hence translate rather than `bottom`. */
  transform: translate(-50%, 86.1%);
}

/* Intro copy in place of the wordmark. Starts where the frame ends rather than
   up inside the feather — pulled into the feather it read as crowding the
   photograph — and flows, so any length of copy pushes the logo wall down. */
.employer-banner__intro {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.employer-banner__intro > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   6. Logo wall
   The comp draws this as one flattened placeholder sheet cut into strips, so
   there is no measured grid to match. Six across rather than the comp's eight:
   the marks are normalised to a common ink height (see tools/logo-walls.py), and
   a wide wordmark is then limited by the cell, so a wider cell is the only thing
   that lets a 10:1 mark stand as tall as a square one. Centred rather than
   justified, so a wall whose count is not a multiple of six sits in the middle.
   -------------------------------------------------------------------------- */
.logo-wall {
  --wall-gap: clamp(12px, 1.53vw, 22px);
  --wall-cols: 6;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--wall-gap);
  margin: 0;
  padding: 0;
}
.logo-wall > li {
  position: relative;                   /* the popover anchors to its own cell */
  flex: 0 0 calc((100% - (var(--wall-cols) - 1) * var(--wall-gap)) / var(--wall-cols));
}

.logo-chip {
  display: block;
  width: 100%;
  padding: clamp(6px, .7vw, 10px);
  border: 0;
  background: none;
  cursor: pointer;
}

/* Every mark is exported onto the same 440 x 180 canvas, so one aspect-ratio box
   and object-fit: contain puts them all on the same centre line. Nothing here
   depends on an individual mark's proportions. */
.logo-chip__art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 440 / 180;
}
.logo-chip__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity .35s var(--ws-ease), transform .35s var(--ws-ease);
}
/* The comp prints the wall in one flat teal. The duotone lives in an SVG filter
   (partials/logo-tint.html) so both layers can share a src — one download per
   mark — and the full-colour copy fades up over the tinted one on hover. */
.logo-chip__img--tint { filter: url(#ws-logo-tint); }
.logo-chip__img--full { opacity: 0; }

/* Roused, a mark comes up to full colour and zooms. Nothing sits behind it: no
   plate, no shadow. A logo wall is a field of other companies' trademarks, and a
   tinted plate behind one of them reads as branding applied to it. */
.logo-chip:hover .logo-chip__img--full,
.logo-chip:focus-visible .logo-chip__img--full,
.logo-chip[aria-expanded="true"] .logo-chip__img--full { opacity: 1; }
.logo-chip:hover .logo-chip__img--tint,
.logo-chip:focus-visible .logo-chip__img--tint,
.logo-chip[aria-expanded="true"] .logo-chip__img--tint { opacity: 0; }
.logo-chip:hover .logo-chip__img,
.logo-chip:focus-visible .logo-chip__img,
.logo-chip[aria-expanded="true"] .logo-chip__img { transform: scale(1.1); }

/* Without the cross-fade there is nothing to see but a snap, so reduced motion
   gets the marks in colour from the start. */
@media (prefers-reduced-motion: reduce) {
  .logo-chip__img { transition: none; }
  .logo-chip__img--tint { opacity: 0; }
  .logo-chip__img--full { opacity: 1; }
}

/* The gap before the second Purpose Driven Work heading — two walls running
   straight into one another read as one. */
.media-block--wall-gap { padding-top: clamp(34px, 4.51vw, 65px); }

/* The popover -------------------------------------------------------------
   Same white-panel-and-shadow as the county map's card, but anchored above its
   chip with a caret rather than tracking the pointer: a chip is a small fixed
   target and the card holds a link the pointer has to be able to travel to.
   --pop-shift is written by main.js when a card at the end of a row would hang
   off the wall; the caret takes the shift back off so it stays over the chip. */
.logo-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 6;
  width: max(220px, 100%);
  padding: clamp(12px, 1.1vw, 16px) clamp(14px, 1.25vw, 18px);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  text-align: center;
  transform: translateX(calc(-50% + var(--pop-shift, 0px)));
}
.logo-pop[hidden] { display: none; }
.logo-pop::after {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(50% - var(--pop-shift, 0px));
  margin-left: -9px;
  border: 9px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}

.logo-pop__name {
  margin: 0 0 .25em;
  font-family: var(--ws-font-display);
  font-weight: 400;
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.15;
  color: var(--ws-teal-ink);
  text-transform: uppercase;
  letter-spacing: .01em;
}
.logo-pop__town {
  margin: 0 0 .6em;
  font-size: .875rem;
  line-height: 1.3;
  color: #5a6367;
}
.logo-pop__link {
  font-size: .875rem;
  font-weight: 700;
  color: var(--ws-teal-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.logo-pop__link:hover { color: var(--ws-blue); }

/* The wall's own heading — Roboto Bold 30 in the comp, centred */
.wall-heading {
  margin: 0 0 clamp(20px, 2.29vw, 33px);
  font-family: var(--ws-font-body);
  font-weight: 700;
  font-size: clamp(1.125rem, 2.083vw, 1.875rem);
  line-height: 1.2;
  color: var(--ws-teal-ink);
  text-align: center;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   7. Employer Spotlight — the teal band
   Comp: band 2110 - 3250, heading 64 under the top wave, a 1040 x 576 picture,
   the caption under it and five dots. The wave images are cut from the client's
   flattened band graphic by tools/export-work-images.py.
   -------------------------------------------------------------------------- */
/* The wave's crest rides high on the right, and the wall's bottom row was
   landing on it. The comp leaves 26 between the two; at these line-heights that
   still reads as a collision, so this is wider than the comp on purpose. */
.band--spotlight { margin-top: clamp(30px, 4.03vw, 58px); }

.band--spotlight .band__inner {
  background: var(--ws-teal);
  padding: clamp(28px, 4.43vw, 64px) 0 clamp(20px, 2.05vw, 30px);
  color: #fff;
}

.spotlight {
  position: relative;
  margin-top: clamp(30px, 4.27vw, 62px);   /* comp: 2340.3 heading to 2401.8 photo */
}
.spotlight .carousel-item img {
  width: 100%;
  aspect-ratio: 1040 / 576;
  object-fit: cover;
}
.spotlight__caption {
  margin: clamp(10px, 1vw, 14px) 0 0;
  font-size: 1.125rem;
  line-height: 1.5;
  color: #fff;
}
.spotlight__credit { color: #9fc9cf; }

/* Chevrons sit outside the 1040 picture, at 100 and 1340 — the wide column's
   own edges — and centre on the picture, not on the picture plus its caption. */
.spotlight .carousel-control-prev,
.spotlight .carousel-control-next {
  top: 0;
  bottom: auto;
  height: clamp(210px, 40vw, 576px);
  width: clamp(34px, 4.5vw, 64px);
  opacity: 1;
  color: #e6e7e8;
}
.spotlight .carousel-control-prev { left: max(clamp(-64px, -6.94vw, -14px), var(--ws-rail-out)); }
.spotlight .carousel-control-next { right: max(clamp(-64px, -6.94vw, -14px), var(--ws-rail-out)); }
.spotlight .carousel-control-prev:hover,
.spotlight .carousel-control-next:hover { color: #fff; }
.spotlight__chevron svg {
  width: clamp(18px, 2.28vw, 33px);
  height: auto;
  display: block;
  transition: transform .25s var(--ws-ease);
}
.spotlight .carousel-control-prev:hover .spotlight__chevron svg { transform: translateX(-3px); }
.spotlight .carousel-control-next:hover .spotlight__chevron svg { transform: translateX(3px); }

.spotlight__dots {
  position: static;
  justify-content: center;
  gap: 12px;                            /* 16 dots on a 28 pitch */
  margin: clamp(26px, 3.3vw, 48px) 0 0;
}
.spotlight__dots [data-bs-target] {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  opacity: 1;
  text-indent: 0;
  transition: transform .2s var(--ws-ease), background .2s var(--ws-ease);
}
.spotlight__dots [data-bs-target]:hover { transform: scale(1.15); }
.spotlight__dots .active { background: var(--ws-green); }

/* --------------------------------------------------------------------------
   8. Did you know? — three squares with copy under them
   Comp: 320 squares at 200 / 560.6 / 920.1, so a 41.6 gutter across the 1040.
   -------------------------------------------------------------------------- */
.dyk-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.89vw, 42px);
  margin: 0;
  padding: 0;
}
.dyk-grid figure { margin: 0; }
/* The comp rounds these: measured 13.4 at the top-left corner of the first
   picture, which is the 14 the Work tiles and the logo chips already use. */
.dyk-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; }
.dyk-grid figcaption {
  margin-top: clamp(8px, .83vw, 12px);
  font-size: 1.125rem;
  line-height: 1.33;
}
.dyk-grid .spotlight__credit { color: #6c7478; }

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */
/* The wall steps down a column at a time. Eight across at tablet width left the
   marks too small to read and the cards too wide for their cells. */
@media (max-width: 1199.98px) { .logo-wall { --wall-cols: 5; } }

@media (max-width: 991.98px) {
  .logo-wall { --wall-cols: 4; }
  .dyk-grid { gap: clamp(16px, 2.4vw, 28px); }
}

@media (max-width: 767.98px) {
  .work-pills { grid-template-columns: minmax(0, 1fr); }
  .work-tiles .exp-card { height: clamp(190px, 52vw, 260px); }
  .logo-wall { --wall-cols: 3; }
  /* A popover as wide as a third of the screen is unreadable, so on a phone it
     spans the wall and the caret does the pointing. */
  .logo-pop { width: max(260px, 300%); }
  .logo-chip { padding: 4px; }
  .dyk-grid { grid-template-columns: minmax(0, 1fr); }
  /* --ws-rail-out already keeps these on the page; nothing extra at phone width. */
}

/* Below about 480 three marks across leaves each one too small to recognise. */
@media (max-width: 479.98px) {
  .logo-wall { --wall-cols: 2; }
  .logo-pop { width: max(240px, 200%); }
}
