/* Member Spotlight directory — self-contained, scoped under .smd.
   Tokens mirror the approved Stitch mockup (navy + SAS red), no external CDN. */

.smd {
  --navy: #07162e;
  --navy-2: #1d2b44;
  --accent: #bb0013;
  --accent-line: #ed1c24;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-alt: #f3f4f5;
  --line: #c5c6ce;
  --ink: #191c1d;
  --muted: #44474d;
  --on-navy: #ffffff;
  --maxw: 1200px;
  --gap: 24px;
  font-family: "Open Sans", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  line-height: 1.5;  /* sas-theme body is 1.8 — too airy for the directory UI; tighten */
}
/* keep body copy readable-tight, not the theme's 1.8 */
.smd p, .smd li, .smd .smd-hero__sub, .smd-side-card__desc, .smd-grid-card__desc,
.smd-hero-card__desc, .smd-section__lead, .smd-cat__count { line-height: 1.5; }
.smd *,
.smd *::before,
.smd *::after { box-sizing: border-box; }

.smd h1, .smd h2, .smd h3, .smd h4 {
  font-family: "Montserrat", system-ui, sans-serif;
  margin: 0;
  line-height: 1.25;
}
/* Reset the theme's default <p> margin, but at ZERO specificity (:where) so every
   element-specific margin below (card desc/tagline, hero sub, CTA lead…) still wins.
   A plain `.smd p {margin:0}` (0,1,1) was silently clobbering all of them. */
:where(.smd) p { margin: 0; }
.smd a { color: inherit; text-decoration: none; }

.smd-wrap { max-width: var(--maxw); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Buttons */
.smd-btn {
  display: inline-block; padding: 12px 24px; border-radius: 3px;
  font-weight: 600; font-size: 14px; letter-spacing: .03em; cursor: pointer;
  border: 2px solid transparent; transition: opacity .2s, background .2s; line-height: 1;
}
.smd-btn--accent { background: var(--accent); color: #fff; }
.smd-btn--accent:hover { opacity: .92; }
.smd-btn--light { background: #fff; color: var(--navy); }
.smd-btn--outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.smd-btn--light, .smd-hero-card .smd-btn--outline { color: var(--navy); }
.smd-hero-card .smd-btn--outline { color: #fff; border-color: #fff; }
.smd-btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }

.smd-link { color: var(--navy); font-weight: 600; font-size: 14px; }
.smd-link:hover { color: var(--accent); }

/* Tags */
.smd-tag {
  display: inline-block; padding: 3px 8px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; border-radius: 2px;
  background: var(--navy-2); color: #fff;
}
.smd-tag--accent { background: var(--accent); }
.smd-tag--muted { background: var(--surface-alt); color: var(--muted); }
.smd-tag--verified { background: #0f7b3f; color: #fff; }

/* Hero + search */
.smd-hero {
  position: relative; overflow: hidden;
  background: var(--navy) url("../img/hero-skyline.png") center/cover no-repeat;
  color: var(--on-navy); text-align: center;
  min-height: 460px; display: flex; align-items: center; padding: 64px 0;
}
.smd-hero__overlay {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(7,22,46,.80) 0%, rgba(7,22,46,.55) 45%, rgba(7,22,46,.85) 100%);
}
.smd-hero__inner { position: relative; z-index: 1; width: 100%; }
.smd-hero__title { font-size: clamp(32px, 5vw, 48px); font-weight: 700; margin-bottom: 16px; }
.smd-hero__sub { font-size: 18px; opacity: .9; max-width: 640px; margin: 0 auto 32px; }
/* Hero without the search form (client change 2026-07-28, Jourdan). The
   sub-heading's 32px bottom margin existed to space it off the form; with no
   form it leaves a dangling gap above the hero's own padding, so drop it. The
   min-height was also sized for title + sub + form, so trim it. Restoring the
   form = remove the smd-hero--nosearch class in render.php; these rules then
   simply stop applying. The .smd-search rules below are deliberately KEPT —
   the search-results page still uses them. */
.smd-hero--nosearch { min-height: 360px; }
.smd-hero--nosearch .smd-hero__sub { margin-bottom: 0; }

.smd-search {
  display: flex; flex-wrap: wrap; gap: 8px; background: #fff; padding: 8px;
  border-radius: 4px; max-width: 820px; margin: 0 auto; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.smd-search__field { flex: 1 1 220px; display: flex; align-items: center; padding: 0 12px; min-height: 48px; }
.smd-search__field + .smd-search__field { border-left: 1px solid var(--line); }
.smd-search__icon { margin-right: 8px; }
.smd-search input, .smd-search select {
  width: 100%; border: 0; outline: none; font-size: 16px; color: var(--ink);
  background: transparent; font-family: inherit;
}
.smd-search button { flex: 0 0 auto; }

/* Sections */
.smd-section { padding: 64px 0; }
.smd-section--alt { background: var(--surface-alt); }
.smd-section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.smd-section__head--center { display: block; text-align: center; margin-bottom: 40px; }
.smd-section__lead { color: var(--muted); margin-top: 8px; }
.smd-eyebrow { display: block; color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 6px; }
.smd-h2 { font-size: clamp(24px, 3vw, 32px); color: var(--navy); font-weight: 700; }
.smd-underline::after { content: ""; display: block; width: 40px; height: 3px; background: var(--accent-line); margin-top: 8px; }
.smd-section__head--center .smd-underline::after { margin-left: auto; margin-right: auto; }

/* Main Spotlight (bento) */
.smd-spotlight { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); align-items: stretch; }
.smd-spotlight__side { display: flex; flex-direction: column; gap: var(--gap); }

.smd-hero-card {
  position: relative; overflow: hidden; border-radius: 4px; background: var(--navy);
  min-height: 440px; display: flex; align-items: flex-end; border: 1px solid var(--line);
}
.smd-hero-card__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; z-index: 0; }
.smd-hero-card::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7,22,46,.20) 0%, rgba(7,22,46,.72) 62%, rgba(7,22,46,.95) 100%);
}
.smd-hero-card.smd-card-empty::after { display: none; }
.smd-hero-card__body { position: relative; z-index: 1; padding: 32px; color: #fff; }
.smd-hero-card__body .smd-tag { margin: 0 6px 12px 0; }
.smd-hero-card__name { font-size: 28px; margin: 4px 0 12px; }
.smd-hero-card__name a { color: #fff; }
.smd-hero-card__tagline { font-size: 16px; font-weight: 600; opacity: .95; margin-bottom: 8px; }
.smd-hero-card__desc { font-size: 15px; opacity: .85; max-width: 36rem; margin-bottom: 20px; }
.smd-hero-card__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.smd-hero-card--empty { align-items: center; justify-content: center; }
.smd-hero-card--empty p { color: #fff; padding: 32px; text-align: center; }
.smd-hero-card--empty a { color: #fff; text-decoration: underline; }

.smd-side-card {
  flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  padding: 20px; transition: border-color .2s; display: flex; flex-direction: column;
}
.smd-side-card:hover { border-color: var(--accent); }
.smd-side-card__top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.smd-side-card__logo { width: 48px; height: 48px; background: var(--navy-2); color: #fff; display: flex; align-items: center; justify-content: center; border-radius: 4px; overflow: hidden; }
.smd-side-card__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.smd-side-card__name { font-size: 18px; color: var(--navy); margin-bottom: 8px; }
.smd-side-card__name a:hover { color: var(--accent); }
.smd-side-card__desc { font-size: 14px; color: var(--muted); margin-bottom: 16px; flex: 1; }
.smd-side-card--empty { border-style: dashed; justify-content: center; text-align: center; }

/* Featured Leaders grid */
.smd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.smd-grid-card {
  display: flex; gap: 16px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px; padding: 16px; transition: box-shadow .2s, border-color .2s;
}
.smd-grid-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: var(--accent); }
.smd-grid-card__logo { width: 72px; height: 72px; flex: 0 0 72px; background: var(--surface-alt); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 28px; overflow: hidden; }
.smd-grid-card__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.smd-grid-card__name { font-size: 18px; color: var(--navy); margin: 6px 0 4px; }
.smd-grid-card:hover .smd-grid-card__name { color: var(--accent); }
.smd-grid-card__desc { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Industry Categories */
.smd-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.smd-cat { background: var(--surface); border: 1px solid var(--line); padding: 40px 24px; text-align: center; transition: transform .2s, box-shadow .2s; }
.smd-cat:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.smd-cat__icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin: 0 auto 18px; color: var(--accent); }
.smd-cat__icon svg { width: 48px; height: 48px; }
.smd-cat:hover .smd-cat__icon { color: var(--accent-line); }
.smd-cat__name { font-size: 19px; color: var(--navy); margin-bottom: 10px; }
.smd-cat__count { font-size: 14px; font-weight: 700; color: var(--accent); }

/* Search results empty state */
.smd-empty { background: var(--surface); border: 1px dashed var(--line); padding: 48px 24px; text-align: center; color: var(--muted); }
.smd-empty p { margin-bottom: 8px; }

/* Advertise CTA */
.smd-cta { background: var(--navy); color: #fff; padding: 64px 0; text-align: center; }
.smd-cta__title { font-size: clamp(24px, 3vw, 32px); margin-bottom: 16px; }
.smd-cta__lead { max-width: 640px; margin: 0 auto 32px; opacity: .85; font-size: 17px; }
.smd-cta__btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Profile page — Stitch "Enhanced Company Profile" aesthetic */
.smd-profile { }
/* hero banner */
.smd-profile__hero {
  position: relative; overflow: hidden;
  background: var(--navy) url("../img/hero-skyline.png") center/cover no-repeat;
  color: #fff;
}
.smd-profile__hero-overlay { position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(7,22,46,.72) 0%, rgba(7,22,46,.90) 100%); }
.smd-profile__hero-inner { position: relative; z-index: 1; padding-top: 28px; padding-bottom: 40px; }
.smd-profile__back { margin-bottom: 28px; }
.smd-profile__back a { color: rgba(255,255,255,.9); font-weight: 600; }
.smd-profile__back a:hover { color: #fff; }
.smd-profile__id { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.smd-profile__logo {
  width: 120px; height: 120px; flex: 0 0 120px; background: #fff; border: 4px solid #fff;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.smd-profile__logo img { width: 100%; height: 100%; object-fit: cover; }
.smd-profile__logo span { font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 34px; color: var(--navy); }
.smd-profile__idtext { min-width: 260px; flex: 1; }
.smd-profile__tags { display: flex; gap: 8px; margin-bottom: 12px; }
.smd-profile__name { font-size: clamp(28px, 4vw, 42px); color: #fff; margin-bottom: 8px; }
.smd-profile__tagline { font-size: 18px; color: rgba(255,255,255,.9); max-width: 640px; }

/* two-column body */
.smd-profile__layout { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 40px;
  padding-top: 48px; padding-bottom: 64px; align-items: start; }
.smd-profile__main { min-width: 0; }
.smd-profile__body { font-size: 16px; line-height: 1.7; }
.smd-profile__body p { margin-bottom: 16px; }
.smd-profile__body h2, .smd-profile__body h3 { color: var(--navy); margin: 28px 0 12px; }
.smd-profile__subhead { font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700; margin: 32px 0 12px; }
.smd-profile__specs { display: flex; gap: 8px; flex-wrap: wrap; }
.smd-chip { display: inline-block; padding: 5px 14px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); }
.smd-chip:hover { border-color: var(--accent); color: var(--accent); }

/* sidebar cards */
.smd-profile__aside { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 24px; }
.smd-aside-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.smd-aside-card h3 { font-size: 18px; color: var(--navy); margin-bottom: 10px; }
.smd-aside-card p { font-size: 14px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.smd-aside-card--cta { background: var(--navy); color: #fff; border-color: var(--navy); }
.smd-aside-card--cta h3 { color: #fff; }
.smd-aside-card--cta p { color: rgba(255,255,255,.82); }

/* enquiry form, when in the sidebar → navy "Direct Inquiry" card */
.smd-profile__aside .smd-enquiry { background: var(--navy); border: 0; border-radius: 8px; padding: 24px; margin: 0; }
.smd-profile__aside .smd-enquiry__title { color: #fff; font-size: 18px; }
.smd-profile__aside .smd-enquiry__lead { color: rgba(255,255,255,.8); font-size: 14px; }
.smd-profile__aside .smd-enquiry__row { display: block; }
.smd-profile__aside .smd-enquiry__field span { color: rgba(255,255,255,.85); }
.smd-profile__aside .smd-enquiry__consent { color: rgba(255,255,255,.6); }
.smd-profile__aside .smd-enquiry__field input,
.smd-profile__aside .smd-enquiry__field textarea {
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.25); color: #fff;
}
.smd-profile__aside .smd-enquiry__field input::placeholder,
.smd-profile__aside .smd-enquiry__field textarea::placeholder { color: rgba(255,255,255,.5); }
.smd-profile__aside .smd-enquiry .smd-btn--accent { width: 100%; text-align: center; }

/* Responsive */
@media (max-width: 900px) {
  .smd-spotlight { grid-template-columns: 1fr; }
  .smd-grid { grid-template-columns: repeat(2, 1fr); }
  .smd-cats { grid-template-columns: repeat(2, 1fr); }
  .smd-profile__layout { grid-template-columns: 1fr; }
  .smd-profile__aside { position: static; }
}
@media (max-width: 560px) {
  .smd-section { padding: 48px 0; }
  .smd-grid, .smd-cats { grid-template-columns: 1fr; }
  .smd-search__field + .smd-search__field { border-left: 0; border-top: 1px solid var(--line); }
  .smd-search button { width: 100%; }
  .smd-hero-card__body { padding: 24px; }
  .smd-grid-card { flex-direction: row; }
}

/* ── House "advertise here" placeholders for unsold slots (ADR-0001 D8) ────── */
.smd-card-empty {
  border: 2px dashed var(--line) !important;
  background: var(--surface-alt) !important;
  color: var(--muted);
  display: flex; flex-direction: column; justify-content: center;
}
.smd-card-empty .smd-card-empty__hd {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700; color: var(--navy-2); margin: 6px 0 4px; font-size: 1.05rem;
}
.smd-card-empty .smd-grid-card__logo span,
.smd-hero-card.smd-card-empty .smd-tag { opacity: .85; }
.smd-card-empty .smd-grid-card__logo { font-size: 1.6rem; color: var(--line); }

/* ── Visitor enquiry form (no-URL ads) ─────────────────────────────────────── */
.smd-enquiry {
  margin: 32px 0; padding: 28px; background: var(--surface-alt);
  border: 1px solid var(--line); border-radius: 12px;
}
.smd-enquiry__title { font-size: 1.4rem; color: var(--navy); margin-bottom: 6px; }
.smd-enquiry__lead { color: var(--muted); margin-bottom: 18px; }
.smd-enquiry__row { display: flex; gap: 16px; flex-wrap: wrap; }
.smd-enquiry__field { display: block; flex: 1 1 220px; margin-bottom: 14px; }
.smd-enquiry__field span { display: block; font-weight: 600; margin-bottom: 5px; font-size: .9rem; }
.smd-enquiry__field input,
.smd-enquiry__field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: var(--surface);
}
.smd-enquiry__field input:focus,
.smd-enquiry__field textarea:focus { outline: 2px solid var(--accent-line); border-color: var(--accent-line); }
.smd-enquiry__consent { font-size: .8rem; color: var(--muted); margin: 8px 0 16px; }
.smd-hp { position: absolute !important; left: -9999px !important; height: 0; overflow: hidden; }
.smd-notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.smd-notice--ok { background: #e6f4ea; color: #1a7f37; border: 1px solid #abe0bd; }
.smd-notice--err { background: #fce8e6; color: #b32d2e; border: 1px solid #f3b7b4; }

/* Theme-cascade hardening — real-theme deploy revealed sas-theme sets an h1
   colour and an .entry-content a colour that override the directory's own
   white text (hero H1 went dark-on-navy; anchor-styled CTAs went dark-on-red).
   .smd h1 (above) sets font/margin but no colour, so it doesn't shield these.
   Scope tight (hero title + button text only — section H2s stay dark on white). */
.smd .smd-hero__title, .smd .smd-cta__title { color: var(--on-navy) !important; }
.smd .smd-hero-card__name a { color: #fff !important; }
.smd a.smd-btn--accent, .smd .smd-btn--accent { color: #fff !important; }
.smd a.smd-btn--outline-light { color: #fff !important; }
.smd-hero a.smd-btn--outline, .smd-hero-card a.smd-btn--outline { color: #fff !important; }
.smd a.smd-btn--light { color: var(--navy) !important; }
/* Re-centre the hero subtitle + CTA lead — the broad `.smd p { margin:0 }` reset
   (specificity 0,1,1) was clobbering their `margin:0 auto` centring (0,1,0), so the
   max-width blocks dropped to the left. These (0,2,1) win it back. */
.smd p.smd-hero__sub { margin: 0 auto 32px; }
.smd p.smd-cta__lead { margin: 0 auto 32px; }

/* ── v1.2.0 Tier 1 carousel ───────────────────────────────────────────────── */
.smd-carousel { position: relative; }
.smd-carousel__track { position: relative; }
/* Slides stack; only the active one shows. min-height keeps the band stable
   while slides differ in text length so nav/dots don't jump. */
.smd-carousel__slide { display: none; }
.smd-carousel__slide.is-active { display: block; }
/* No-JS / single-slide fallback: show the first (or only) slide as a static card. */
.smd-carousel.is-single .smd-carousel__slide,
.smd-carousel:not([data-inited]) .smd-carousel__slide:first-child { display: block; }
.smd-carousel .smd-hero-card { width: 100%; }

/* Arrows sit in the TOP-RIGHT corner, side by side — clear of the ad copy,
   which is left-aligned (badges, name, tagline, description, CTAs). Previously
   they were vertically centred at the left/right edges and covered the text. */
.smd-carousel__nav {
  position: absolute; top: 16px;
  width: 42px; height: 42px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.4); background: rgba(7,22,46,.65); color: #fff;
  font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 3; backdrop-filter: blur(2px);
}
.smd-carousel__nav:hover { background: var(--accent); border-color: var(--accent); }
.smd-carousel__nav:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }
.smd-carousel__nav--next { right: 14px; }
.smd-carousel__nav--prev { right: 64px; }

.smd-carousel__dots { display: flex; gap: 9px; justify-content: center; margin-top: 16px; }
.smd-carousel__dot {
  width: 11px; height: 11px; border-radius: 999px; padding: 0; cursor: pointer;
  border: 0; background: var(--line); transition: background .2s, transform .2s;
}
.smd-carousel__dot.is-active { background: var(--accent); transform: scale(1.15); }
.smd-carousel__dot:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

/* ── v1.2.0 Tier 2 row (3 across, own section below Tier 1) ────────────────── */
.smd-tier2-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); align-items: stretch;
}
.smd-tier2-row .smd-side-card { height: 100%; }

@media (max-width: 860px) {
  .smd-tier2-row { grid-template-columns: 1fr; }
  .smd-carousel__nav { width: 38px; height: 38px; font-size: 20px; top: 12px; }
  .smd-carousel__nav--next { right: 10px; }
  .smd-carousel__nav--prev { right: 56px; }
}
