/* Sector gateway cards. Phase 3, AI Search Authority hub redesign, 19 November 2026.
   Linked from the AI Search Authority hub and the Services hub feature panel only.
   Design decision (Option B, two columns and five rows of photographic sector
   cards), full comparison in the sprint repository, research/sector-expansion-
   2026-11-19/phase-3/design-decision.md. Reuses core.css tokens, no new colours. */

.sector-gateway-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}
@media (min-width: 700px) {
  .sector-gateway-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sector-card {
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  border: 1px solid rgba(168, 137, 76, 0.15);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              border-color 0.4s ease;
}
@media (hover: hover) and (pointer: fine) {
  .sector-card:hover {
    transform: scale(1.015);
    box-shadow: 0 12px 40px rgba(168, 137, 76, 0.16);
    border-color: rgba(168, 137, 76, 0.4);
  }
  .sector-card:hover .sector-card-title { color: var(--c-accent-dark); }
}
.sector-card:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* Fixed box so a missing hero file never shifts the grid. core.css --c-navy-bg
   fills the box until the image paints, and stays as the visible fallback if
   the image 404s (onerror hides the broken-image glyph on the <img>). */
.sector-card-media {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--c-navy-bg);
  overflow: hidden;
}
.sector-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sector-card-body {
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.sector-card-title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 400;
  color: var(--c-fg);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
  transition: color 0.4s ease;
}
.sector-card-prop {
  font-size: var(--step--1);
  color: var(--c-muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}
.sector-card-enter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background-image: var(--c-accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0.25rem;
}
.sector-card-enter-arrow {
  transition: transform 0.3s ease;
}
.sector-card:hover .sector-card-enter-arrow {
  transform: translateX(3px);
}

/* Equal prominence (directive 20.4): every card shares one media ratio, one
   body padding and one title size. No sector card is widened, tinted or
   otherwise raised above the other nine. */

/* Compact variant for the Services hub feature panel (directive 20.5). Five
   columns at desktop, naming all ten industries without photography, so the
   panel stays a feature strip and never competes with the hub's own cards. */
.sector-gateway-grid--mini {
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}
@media (min-width: 640px) {
  .sector-gateway-grid--mini { grid-template-columns: repeat(5, 1fr); }
}
/* The thumbnail runs the full height of its card, however many lines the industry name takes,
   and takes the card's start corners, left in English and right in Arabic (DBSP 17.15 H, gotcha 18).
   It stays at least square, and the name centres in the remaining height. */
.sector-card--mini {
  flex-direction: row;
  align-items: stretch;
  gap: 0;
}
.sector-card--mini .sector-card-media {
  aspect-ratio: auto;
  width: clamp(3rem, 6vw, 4rem);
  min-height: clamp(3rem, 6vw, 4rem);
  flex-shrink: 0;
  border-start-start-radius: 15px;
  border-end-start-radius: 15px;
}
.sector-card--mini .sector-card-body {
  padding: 0.75rem 0.9rem;
  gap: 0.15rem;
  justify-content: center;
}
.sector-card--mini .sector-card-title {
  font-size: var(--step--1);
  line-height: 1.25;
}
.sector-card--mini .sector-card-prop {
  display: none;
}

/* Option A and C prototype-only hooks (phase 3 comparison, never shipped on
   the live hub; kept here so the chosen option needs no class rename). */
.sector-gateway-grid--optionA {
  grid-template-columns: 1fr;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}
@media (min-width: 900px) {
  .sector-gateway-grid--optionA { grid-template-columns: repeat(5, 1fr); }
}
.sector-gateway-grid--optionA .sector-card-media { aspect-ratio: 4 / 3; }
.sector-gateway-grid--optionA .sector-card-title { font-size: var(--step-0); }

.sector-list--optionC {
  display: flex;
  flex-direction: column;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.sector-list-item--optionC {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.5rem);
  padding-block: clamp(1rem, 2vw, 1.5rem);
  border-top: 1px solid rgba(168, 137, 76, 0.18);
  text-decoration: none;
  transition: padding-inline-start 0.3s ease;
}
.sector-list--optionC a.sector-list-item--optionC:last-child {
  border-bottom: 1px solid rgba(168, 137, 76, 0.18);
}
.sector-list-item--optionC:hover {
  padding-inline-start: 0.5rem;
}
.sector-list-item--optionC .sector-card-media {
  aspect-ratio: 1 / 1;
  width: clamp(3.5rem, 7vw, 5rem);
  flex-shrink: 0;
  border-radius: 10px;
}
.sector-list-item--optionC .sector-list-body {
  flex: 1;
  min-width: 0;
}
.sector-list-item--optionC .sector-card-title {
  font-size: var(--step-0);
}

/* Ten sector rail, AI Search Authority hub only (directive 20.7, 20.10 to 20.13, 19 November
   2026). Every rule below is scoped to `.sector-rail`, a class only the six hub editions carry,
   so the Services hub feature panel that shares this file keeps its exact look. Without JS, or
   with reduced motion, the ten cards stay the readable two column grid above, in reading order.
   sector-rail.js adds `sector-rail--pinned` where a whole card fits one screen: the frame then
   pins and the page scroll moves the track sideways, one centred landing per card. Rules and
   gotchas, DBSP section 17.15 and memory/skills/scroll-snap-alignment.md, Sector rail. */

/* Card anatomy in both modes. Photograph, centred title, justified description whose last
   line sits at the start edge of the language, centred action. */
.sector-rail .sector-card-body { text-align: center; }
.sector-rail .sector-card-title { text-align: center; }
.sector-rail .sector-card-prop {
  /* The full body width, past the sitewide paragraph measure, so a wide card's text block stays
     centred under its title. */
  max-width: none;
  align-self: stretch;
  text-align: justify;
  text-align-last: start;
  -webkit-hyphens: none;
  hyphens: none;
}
.sector-rail .sector-card-enter { align-self: center; justify-content: center; }
/* The action arrow points along the reading direction. Its parent clips the gold gradient to its
   text, which ignores a mirror, so Arabic hides the right arrow and draws a left one in its place
   (the Services hub link rule in i18n.css). */
[dir="rtl"] .sector-rail .sector-card-enter-arrow { position: relative; display: inline-block; visibility: hidden; }
[dir="rtl"] .sector-rail .sector-card-enter-arrow::before {
  content: '\2190';
  position: absolute;
  inset: 0;
  visibility: visible;
  background-image: var(--c-accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  [dir="rtl"] .sector-rail .sector-card:hover .sector-card-enter-arrow { transform: translateX(-3px); }
}

/* Linear fallback. The section is never shorter than one small screen. */
.sector-rail {
  height: auto;
  min-height: 100svh;
}
.sector-rail:not(.sector-rail--pinned) .sector-rail__track {
  width: min(100% - (var(--gutter) * 2), var(--max-w));
  margin-inline: auto;
}

/* Pinned sequence. The section is as tall as the frame plus the track's travel, set by
   sector-rail.js; the frame holds the heading and one screen of stage and sticks with its
   heading above the screen where the heading and a whole card cannot share one screen. */
.page-service .section.sector-rail.sector-rail--pinned {
  display: block;
  min-height: 100svh;
  padding: 0;
  overflow: visible;
}
.sector-rail--pinned > .sector-rail__frame {
  position: sticky;
  top: var(--sr-sticky, 0px);
  height: var(--sr-frame-h, 100svh);
  overflow: hidden;
  overflow: clip;
}
.sector-rail--pinned .sector-rail__head {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--header-h, 3.5rem) + clamp(1rem, 3svh, 2rem));
  padding-bottom: clamp(0.5rem, 2svh, 1.25rem);
  box-sizing: border-box;
}
.sector-rail--pinned .sector-rail__head > h2 { margin-top: 0; }
.sector-rail--pinned .sector-rail__head > p { margin-bottom: 0; }
.sector-rail--pinned .sector-rail__viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  overflow: clip;
}
.sector-rail--pinned .sector-rail__track {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: var(--sr-gap, 1.5rem);
  width: max-content;
  margin: 0;
  padding-inline: var(--sr-inset, 0px);
  box-sizing: border-box;
  will-change: transform;
}
.sector-rail--pinned .sector-card {
  flex: 0 0 var(--sr-card-w);
  width: var(--sr-card-w);
  height: var(--sr-card-h, auto);
  box-sizing: border-box;
}
.sector-rail--pinned .sector-card-media {
  aspect-ratio: auto;
  height: var(--sr-img-h, auto);
  flex: 0 0 auto;
}
.sector-rail--pinned .sector-card-body {
  justify-content: center;
  gap: var(--sr-body-gap, 0.5rem);
  padding: var(--sr-pad, 1.5rem);
  min-height: 0;
}
.sector-rail--pinned .sector-card-title {
  font-size: var(--sr-fs-h, var(--step-1));
  min-height: var(--sr-band-h, 0px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sector-rail--pinned .sector-card-prop {
  font-size: var(--sr-fs-p, var(--step--1));
  min-height: var(--sr-band-p, 0px);
  flex: 0 0 auto;
}
.sector-rail--pinned .sector-card-enter { margin-top: 0; }
/* Side by side card on a wide or short landscape screen: photograph at the start, text at the
   end, the photograph filling the card's height. */
.sector-rail--pinned[data-sr-layout="split"] .sector-card { flex-direction: row; }
.sector-rail--pinned[data-sr-layout="split"] .sector-card-media {
  flex: 0 0 var(--sr-img-w);
  width: var(--sr-img-w);
  height: auto;
  align-self: stretch;
}
.sector-rail--pinned[data-sr-layout="split"] .sector-card-body { flex: 1 1 auto; min-width: 0; }
/* Measuring: natural heights, no fixed card height, no bands. */
.sector-rail--pinned[data-sr-measure] .sector-card { height: auto; }
.sector-rail--pinned[data-sr-measure] .sector-card-title,
.sector-rail--pinned[data-sr-measure] .sector-card-prop { min-height: 0; }
/* While the track moves the cards take no pointer, so a card passing under a resting mouse
   starts no hover lift. */
.sector-rail--moving .sector-card { pointer-events: none; }
/* The gold end rule sits at the frame's foot through the whole sequence (sector-rail.js moves
   it into the frame). */
.sector-rail--pinned .sector-rail__frame > .section-end-rule { z-index: 1; }

/* Understanding AI search authority on the hub (directive 20.8, data-two-stop-all). One section, Pattern 2 with two landing
   points (Hamad, 21 November 2026, DBSP 17.15 H25, superseding the two snap-half wrappers of 20 November 2026). One
   section, one continuous .wrap holding the heading and every paragraph in source order, height auto with a 100svh floor,
   centred when shorter than the screen. Paragraph to paragraph spacing is the sitewide default (core.css, p + p), the same
   gap the rest of the page uses, and the scroll button lands on the section top, then on its foot with the end rule 2vw
   above it. */
.page-service .dark-video-wrap .deepdive-split-section.snap-section--200[data-two-stop-all] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: auto;
  min-height: 100svh;
  overflow: visible;
  box-sizing: border-box;
  /* Pattern 2 clearances, scroll snap skill section 33 rules 2 and 3: the measured header plus the approved buffer at the
     top, the scroll button footprint plus clamp(2.5rem, 4vw, 3rem) at the foot, per tier. */
  padding: calc(var(--header-h, 3.5rem) + 1rem + env(safe-area-inset-top, 0px) + clamp(0.5rem, 2svh, 1.5rem)) 0 calc(var(--scroll-indicator-reserve-desktop, 103px) + clamp(2.5rem, 4vw, 3rem));
  gap: 0;
}
@media (max-width: 768px) {
  .page-service .dark-video-wrap .deepdive-split-section.snap-section--200[data-two-stop-all] {
    padding-top: calc(var(--header-h, 3.5rem) + 1.125rem + env(safe-area-inset-top, 0px) + clamp(0.5rem, 2svh, 1.5rem));
    padding-bottom: calc(max(1.5rem, env(safe-area-inset-bottom, 0px) + 0.75rem) + 57px + clamp(2.5rem, 4vw, 3rem));
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .page-service .dark-video-wrap .deepdive-split-section.snap-section--200[data-two-stop-all] { padding-bottom: calc(0.5rem + 36px + clamp(2.5rem, 4vw, 3rem)); }
}
/* CA25, 21 November 2026: this section's own end rule sits exactly 2vw above its own section foot, never the sitewide
   mobile floor at core.css (max(2vw, env(safe-area-inset-bottom) plus 0.75rem)), which is correct for a section whose
   foot can sit at the screen foot but wrong here, since this section's foot scrolls clear of the device edge under its
   own scroll button clearance padding above. One offset, every width. */
.page-service .dark-video-wrap .deepdive-split-section.snap-section--200[data-two-stop-all] > .section-end-rule {
  bottom: 2vw;
}

/* The industries rail's end rule (Hamad, 20 November 2026, superseding workstream M's frame held rule). sector-rail.js
   moves the section's rule into the pinned frame, where it stays hidden, so no rule is held to the screen foot while the ten
   cards pass. The section's own ::after draws the one rule 2vw above the rail section's foot, where the section ends.
   DBSP 17.15 H23. */
.sector-rail--pinned .sector-rail__frame > .section-end-rule { display: none; }

/* The industry, service and platform card titles on the hub in the approved gold gradient (final directive, workstream L;
   generalised from the industries rail alone to every sector-rail instance, directive 2.19/20.19/51.25.5, 22 November 2026),
   the same treatment as the section heading, var(--c-accent-gradient) clipped to the text. A browser without text clipping,
   or forced colours, keeps solid readable text. Text, size, weight and the h3 stay as they are. */
[data-sector-rail] .sector-card-title { color: var(--c-accent-dark, #8b6d35); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  [data-sector-rail] .sector-card-title {
    background-image: var(--c-accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
@media (forced-colors: active) {
  [data-sector-rail] .sector-card-title { background-image: none; -webkit-text-fill-color: CanvasText; color: CanvasText; }
}
