/* Tenant Site theme — structure & typography, styled to match the live pasifikcloud.com
 * (uSkinned "Source" / Bootstrap-3 look): fixed white header + thin utility bar, full-bleed
 * dark-overlay hero with white left-aligned copy, alternating white/#f4f4f4 bands punctuated by
 * full-width cyan CTA strips, square compact buttons, 3-column grey footer.
 *
 * Brand values arrive as CSS custom properties from the per-tenant /site-theme.css
 * (365.Core.TenantSite): --site-primary (cyan #37C4F5 — button/CTA-strip fill, brand accents),
 * --site-interactive (teal #0C7A9E — text links on white, WCAG 4.89:1), --site-font.
 * Neutral fallbacks keep an unbranded tenant presentable; E2E treats fallback-rendered as UNTHEMED.
 * House classes for rich-text: .ts-checklist, .ts-tiers, .ts-note. */

:root {
  --site-primary: #334155;      /* fallback; P1 seeds #37C4F5 */
  --site-interactive: #1d4ed8;  /* fallback; P1 seeds #0C7A9E */
  --site-font: system-ui, sans-serif;

  --ts-primary-hover: #26a9d6;  /* real-site button hover (darker cyan) */
  --ts-fg: #555555;             /* body */
  --ts-heading: #333333;        /* headings */
  --ts-bg: #ffffff;
  --ts-bg-alt: #f4f4f4;         /* off-white alternating band + footer */
  --ts-border: #e3e3e3;
  --ts-hero-overlay: rgba(24, 24, 24, 0.62);
  --ts-hero-bg: #1b2b34;        /* dark base behind the hero (photo optional via --ts-hero-image) */
  --ts-max-width: 1170px;       /* Bootstrap 3 container */
}

* { box-sizing: border-box; }
html { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--site-font);
  font-size: 14px;               /* original: body 14px/1.4 #555 */
  line-height: 1.5;
  color: var(--ts-fg);
  background: var(--ts-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--ts-heading);
  font-weight: 600;
  letter-spacing: -0.02em;       /* original heading tracking */
  margin: 0 0 0.5em;
  line-height: 1.15;
}
/* Original scale: 30/25/22 mobile → 35/30/26 ≥992 → 45/35/30 ≥1200 */
h1 { font-size: 30px; }
h2 { font-size: 25px; }
h3 { font-size: 20px; }
@media (min-width: 992px) {
  h1 { font-size: 35px; }
  h2 { font-size: 30px; }
  h3 { font-size: 24px; }
}
@media (min-width: 1200px) {
  h1 { font-size: 45px; }
  h2 { font-size: 35px; }
  h3 { font-size: 26px; }
}
p { margin: 0 0 1em; }

a { color: var(--site-interactive); text-decoration: none; }
a:hover, a:focus { color: #c4570f; text-decoration: none; } /* real-site orange link hover */

:focus-visible { outline: 3px solid var(--site-interactive); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

.ts-container {
  max-width: var(--ts-max-width);
  margin: 0 auto;
  padding: 0 15px;
}

/* ── Utility bar (thin top strip) ─────────────────────────── */
.ts-utilitybar {
  background: var(--ts-bg-alt);
  border-bottom: 1px solid var(--ts-border);
  font-size: 13px;
}
.ts-utilitybar .ts-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.25rem;
  min-height: 34px;
}
.ts-utilitybar a { color: var(--ts-heading); }
.ts-utilitybar a:hover { color: var(--site-interactive); }
.ts-login-link::before { content: "\1F464"; margin-right: 0.35rem; } /* user glyph */

/* ── Header (sticky white bar) ───────────────────────────── */
.ts-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--ts-bg);
  border-bottom: 1px solid var(--ts-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.ts-header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 74px;
  flex-wrap: wrap;
}
.ts-logo { display: inline-flex; align-items: center; }
.ts-logo img { max-height: 46px; width: auto; display: block; }
.ts-logo-text { font-size: 1.3rem; font-weight: 700; color: var(--ts-heading); }
.ts-nav { flex: 1; }
.ts-nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; flex-wrap: wrap; }
.ts-nav a { color: var(--ts-heading); font-size: 15px; font-weight: 500; }
.ts-nav a:hover, .ts-nav a:focus { color: var(--site-primary); }
.ts-header-actions { display: flex; align-items: center; gap: 1rem; }
.ts-header .ts-login-link { color: var(--ts-heading); font-size: 14px; font-weight: 500; }
.ts-header .ts-login-link:hover { color: var(--site-primary); }

/* ── Buttons (original .btn: square, 12px 15px, 14px/600) ── */
.ts-btn {
  display: inline-block;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.ts-btn:active { transform: translateY(1px); }
.ts-btn-primary { background: var(--site-primary); color: #ffffff; }
.ts-btn-primary:hover, .ts-btn-primary:focus { background: var(--ts-primary-hover); color: #ffffff; }
.ts-btn-onfill { background: #ffffff; color: var(--ts-heading); }
.ts-btn-onfill:hover { background: #f0f0f0; color: var(--ts-heading); }

/* ── Hero (full-bleed photo banner, dark overlay, white left copy — original .apc.banner) ── */
.ts-main { min-height: 55vh; }
.ts-hero {
  position: relative;
  overflow: hidden;
  background: var(--ts-hero-bg);
  color: #ffffff;
  padding: 5rem 0;
}
.ts-hero-photo { padding: 7rem 0; }
/* CMS banner photo as a real <img> (CSP img-src 'self'); overlay + copy stack above it. */
.ts-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}
.ts-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ts-hero-overlay);
  z-index: 1;
}
/* Photo heroes get a left-weighted gradient so the white copy stays legible over bright
   imagery (the flat wash isn't enough on busy photos). */
.ts-hero-photo::before {
  background: linear-gradient(90deg, rgba(18, 18, 18, 0.88) 0%, rgba(18, 18, 18, 0.6) 55%, rgba(18, 18, 18, 0.35) 100%);
}
.ts-hero .ts-note { color: rgba(255, 255, 255, 0.88); font-style: normal; }
.ts-hero .ts-container { position: relative; z-index: 2; max-width: var(--ts-max-width); }
.ts-hero-inner { max-width: 62%; animation: ts-rise 0.55s ease-out both; }
.ts-hero h1 { color: #ffffff; max-width: 20ch; }
@keyframes ts-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ts-hero-inner { animation: none; }
}
.ts-kicker {
  color: var(--site-primary);
  letter-spacing: 0.02em;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.ts-hero-sub { color: rgba(255, 255, 255, 0.92); font-size: 1.15rem; max-width: 60ch; }
.ts-hero-footnote { color: rgba(255, 255, 255, 0.8); font-size: 0.95rem; margin-top: 1rem; }
@media (max-width: 860px) {
  .ts-hero { padding: 3rem 0; }
  .ts-hero-inner { max-width: 100%; }
}

/* ── Section bands ───────────────────────────────────────── */
/* Hero-less pages (About / Contact / legal): a light title band aligned to the same 820px
   column as the rich-text body, so the H1 sits directly above the content instead of adrift
   full-width. */
.ts-pagehead {
  background: var(--ts-bg-alt);
  border-bottom: 1px solid var(--ts-border);
  padding: 3rem 0;
}
.ts-pagehead .ts-container { max-width: 820px; }
.ts-pagehead h1 { margin: 0; }
/* Text-lead pages want a tighter section rhythm than the marketing bands. */
.ts-page-textlead .ts-richtext { padding: 1.25rem 0; }
.ts-page-textlead .ts-richtext:first-of-type { padding-top: 2rem; }

.ts-stats { background: var(--ts-bg-alt); padding: 2.5rem 0; }
.ts-stats-row { display: flex; gap: 2rem; flex-wrap: wrap; }
.ts-stat { flex: 1 1 220px; }
.ts-stat-value { font-size: 2.1rem; font-weight: 700; color: var(--site-primary); margin: 0; letter-spacing: -0.02em; }
.ts-stat-label { font-weight: 600; color: var(--ts-heading); margin: 0 0 0.25em; }
.ts-stat-caption { font-size: 0.9rem; margin: 0; color: var(--ts-fg); }

.ts-cardband { padding: 3.5rem 0; }
.ts-cardband:nth-of-type(even) { background: var(--ts-bg-alt); }
.ts-cardband-intro { max-width: 62ch; }
.ts-cards { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.5rem; }
.ts-card {
  /* Cap at an even third so a trailing partial row (e.g. 5 cards = 3 + 2) keeps the same
     column width and left-aligns, instead of stretching wider than the row above. */
  flex: 1 1 300px;
  max-width: calc((100% - 3rem) / 3);
  background: var(--ts-bg);
  border: 1px solid var(--ts-border);
  border-top: 3px solid var(--site-primary);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
@media (max-width: 980px) { .ts-card { max-width: calc((100% - 1.5rem) / 2); } }
@media (max-width: 640px) { .ts-card { max-width: 100%; } }
/* A band with EXACTLY four cards balances as 2x2 instead of orphaning the 4th card alone on
   row two (e.g. Who we serve, the portal band). flex-BASIS must change too — max-width only
   caps growth; the 300px basis is what packs three per line. :has() ships in all evergreen
   engines; older engines keep the 3+1 wrap — degraded, not broken. */
@media (min-width: 981px) {
  .ts-cards:has(> .ts-card:nth-child(4):last-child) > .ts-card {
    flex-basis: calc((100% - 1.5rem) / 2);
    max-width: calc((100% - 1.5rem) / 2);
  }
}
.ts-card:hover {
  box-shadow: 0 10px 24px rgba(24, 24, 24, 0.1);
  transform: translateY(-3px);
}
@media (prefers-reduced-motion: reduce) {
  .ts-card, .ts-card:hover { transform: none; transition: none; }
}
.ts-card h3 { margin-bottom: 0.4em; }
.ts-card-link { font-weight: 600; }

.ts-richtext { padding: 2.5rem 0; }
.ts-richtext .ts-container { max-width: 820px; }
.ts-richtext h2 { margin-top: 1.2em; }
.ts-richtext h2:first-child { margin-top: 0; }

/* Full-width cyan CTA strip (real-site .cta-strip.c1-bg) */
.ts-ctaband {
  padding: 3rem 0;
  background: var(--site-primary);
  color: #ffffff;
  text-align: center;
}
.ts-ctaband h2 { color: #ffffff; }
.ts-ctaband-sub { color: rgba(255, 255, 255, 0.95); max-width: 60ch; margin: 0 auto 1.25rem; }
.ts-ctaband .ts-btn-primary { background: #ffffff; color: var(--ts-heading); }
.ts-ctaband .ts-btn-primary:hover { background: #f0f0f0; color: var(--ts-heading); }

/* ── Forms (themes any module form in the content zone — e.g. the Licence Health Check
      request at {tenant}/healthcheck; markup is label+input siblings, no wrappers) ── */
.ts-main form {
  max-width: 640px;
  margin: 2rem auto 3rem;
  padding: 2rem;
  background: var(--ts-bg);
  border: 1px solid var(--ts-border);
  border-top: 3px solid var(--site-primary);
}
.ts-main form label {
  display: block;
  margin: 1.1rem 0 0.35rem;
  font-weight: 600;
  color: var(--ts-heading);
}
.ts-main form label:first-of-type { margin-top: 0; }
.ts-main form input[type="text"],
.ts-main form input[type="email"],
.ts-main form input[type="tel"],
.ts-main form input:not([type]),
.ts-main form select,
.ts-main form textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-family: var(--site-font);
  font-size: 14px;
  color: var(--ts-heading);
  background: var(--ts-bg);
  border: 1px solid #c0cad6;
  border-radius: 0;
}
.ts-main form textarea { min-height: 110px; resize: vertical; }
.ts-main form input:focus,
.ts-main form select:focus,
.ts-main form textarea:focus {
  outline: 3px solid var(--site-interactive);
  outline-offset: 0;
  border-color: var(--site-interactive);
}
.ts-main form button[type="submit"],
.ts-main form input[type="submit"],
.ts-main form button:not([type]) {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 12px 24px;
  font-family: var(--site-font);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: var(--site-primary);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.ts-main form button[type="submit"]:hover,
.ts-main form input[type="submit"]:hover,
.ts-main form button:not([type]):hover { background: var(--ts-primary-hover); }
.ts-main form .field-validation-error,
.ts-main form .validation-summary-errors {
  color: #a94442;                /* original validation red */
  font-size: 13px;
  display: block;
  margin-top: 0.25rem;
}
.ts-main form h1 { font-size: 30px; }
/* Module pages (e.g. /healthcheck, thank-you) render their H1/intro as direct children of the
   content zone, outside any container. Constrain to the form column and center for a finished
   look. A form on the page anchors it left-aligned via the .ts-main form rules above; a bare
   confirmation page (h1 + p, no form) reads centered. */
.ts-main > h1 {
  max-width: 640px;
  margin: 2.5rem auto 0.5rem;
  padding: 0 15px;
  font-size: 30px;
  text-align: center;
}
.ts-main > p {
  max-width: 640px;
  margin: 0 auto 1rem;
  padding: 0 15px;
  text-align: center;
  color: var(--ts-fg);
}
.ts-main:has(form) > h1 { text-align: left; }
.ts-main:has(form) { padding-bottom: 3rem; }

/* ── Rich-text house classes ─────────────────────────────── */
.ts-checklist { list-style: none; padding: 0; }
.ts-checklist li { padding-left: 1.9rem; position: relative; margin-bottom: 0.6em; }
.ts-checklist li::before { content: "\2713"; position: absolute; left: 0; color: var(--site-primary); font-weight: 700; }

.ts-tiers { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0; padding: 0; list-style: none; }
.ts-tiers > li { flex: 1 1 280px; border: 1px solid var(--ts-border); padding: 1.25rem; background: var(--ts-bg); }

.ts-note { font-size: 0.92rem; color: var(--ts-fg); font-style: italic; }

/* ── Footer (3-col grey) ─────────────────────────────────── */
.ts-footer {
  margin-top: 0;
  background: var(--ts-bg-alt);
  border-top: 1px solid var(--ts-border);
  padding: 2.5rem 0 1.5rem;
}
.ts-footer-cols { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.ts-footer-col { flex: 1 1 240px; }
.ts-footer-col h4 { font-size: 16px; color: var(--ts-heading); margin-bottom: 0.6em; }
.ts-footer-col p, .ts-footer-col li { font-size: 14px; margin: 0 0 0.35em; }
.ts-footer-nav ul { list-style: none; margin: 0; padding: 0; }
.ts-footer-nav li { margin-bottom: 0.35em; }
.ts-footer-nav a { color: var(--ts-fg); font-size: 14px; }
.ts-footer-nav a:hover { color: var(--site-interactive); }
.ts-footer .ts-social a { font-weight: 600; color: var(--site-interactive); }
.ts-footer .ts-social a:hover { color: #c4570f; }
.ts-footer-legal {
  border-top: 1px solid var(--ts-border);
  margin-top: 1.5rem;
  padding-top: 1rem;
  font-size: 13px;
  color: var(--ts-fg);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 720px) {
  /* Stacked mobile header: logo row → horizontal wrap nav → full-width CTA. */
  .ts-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    min-height: 0;
  }
  .ts-nav { width: 100%; }
  .ts-nav ul { gap: 0.4rem 1.1rem; }
  .ts-header-actions { width: 100%; }
  .ts-header-cta { display: block; width: 100%; text-align: center; }
  .ts-cards, .ts-stats-row, .ts-footer-cols { gap: 1.25rem; }
}
