/* Public tenant website. Every colour, radius and font comes from the
   theme custom properties set on <html> — nothing here is hardcoded, so
   the same stylesheet re-skins for any institute. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0; line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(28px, 3.4vw, 56px); }
h2 { font-size: clamp(22px, 2.2vw, 36px); }
h3 { font-size: 18px; }
p { margin: 0 0 14px; }

a { color: var(--c-primary); }
a:hover { color: var(--c-accent-text); }

img { max-width: 100%; display: block; }

:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

/* The page fills the screen with a 10% gutter each side, instead of a
   fixed centred column that leaves a large monitor mostly empty.
   Phones get a fixed gutter: 10% of 360px would eat usable width. */
.wrap {
  width: 100%;
  margin: 0 auto;
  padding-inline: 10%;
}

@media (max-width: 640px) {
  .wrap { padding-inline: 20px; }
}

/* Running text still needs a readable measure. A paragraph stretched across
   2000px is physically hard to read - the eye loses the line on the way back.
   So prose is capped while grids and panels use the full width. */
.measure { max-width: 72ch; }
.measure-wide { max-width: 92ch; }

/* ----------------------------------------------------------- top strip */

.topbar {
  background: var(--c-primary);
  color: var(--c-primary-fg);
  font-size: 13px;
}
.topbar .wrap {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  align-items: center; justify-content: space-between;
  padding-top: 8px; padding-bottom: 8px;
}
.topbar-creds { display: flex; flex-wrap: wrap; gap: 6px 16px; opacity: 0.92; }
.topbar a { color: var(--c-primary-fg); text-decoration: none; font-weight: 600; }

/* -------------------------------------------------------------- header */

.masthead { background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.masthead .wrap {
  display: flex; align-items: center; gap: 16px;
  padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap;
}
.crest {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: var(--c-primary); color: var(--c-primary-fg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 20px;
  flex-shrink: 0;
}
.crest img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius); }
.wordmark { line-height: 1.15; }
.wordmark .n1 {
  font-family: var(--font-heading); font-size: 22px; font-weight: 700;
  letter-spacing: 0.06em; display: block;
}
.wordmark .n2 {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--c-text-muted); display: block;
}

.nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a {
  padding: 9px 13px; border-radius: var(--radius);
  color: var(--c-text); text-decoration: none; font-size: 15px; font-weight: 500;
}
.nav a:hover { background: var(--c-bg); }
.nav a[aria-current="page"] { color: var(--c-primary); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 15px; font-weight: 700;
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--c-primary); color: var(--c-primary-fg); }
.btn-primary:hover { background: var(--c-text); color: var(--c-primary-fg); }
.btn-accent { background: var(--c-accent); color: var(--c-primary); }
.btn-accent:hover { filter: brightness(0.94); color: var(--c-primary); }
.btn-outline { background: transparent; color: var(--c-primary); border-color: var(--c-primary); }
.btn-outline:hover { background: var(--c-primary); color: var(--c-primary-fg); }

/* -------------------------------------------------------------- blocks */

.section { padding: clamp(44px, 4.5vw, 86px) 0; }
.section-alt { background: var(--c-surface); }
.section-head { max-width: 72ch; margin-bottom: 30px; }
.section-head p { color: var(--c-text-muted); margin: 10px 0 0; }

/* The hero is a full-bleed band in the institute's primary colour, as in
   the approved design - not a white panel. It stays readable because
   primary-fg is chosen by contrast, never assumed to be white. */
.hero { background: var(--c-primary); color: var(--c-primary-fg); }
.hero .wrap { padding-top: clamp(52px, 6vw, 110px); padding-bottom: clamp(52px, 6vw, 110px); }
.hero h1 { color: var(--c-primary-fg); max-width: 19ch; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--c-accent); margin-bottom: 16px;
}
.hero-hi { font-size: clamp(17px, 1.5vw, 21px); margin: 14px 0 0; opacity: .86; }
.hero-lede { max-width: 58ch; margin: 18px 0 0; opacity: .88; font-size: 16.5px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-note {
  margin-top: 26px; padding-top: 18px; font-size: 14px; opacity: .8;
  border-top: 1px solid rgba(255, 255, 255, .18); max-width: 58ch;
}
.hero-rule { width: 72px; height: 4px; background: var(--c-accent); border-radius: 2px; margin-bottom: 20px; }
/* On the hero band the outline button sits on primary, so it borrows the
   foreground colour rather than the primary colour it would vanish into. */
.hero .btn-outline { color: var(--c-primary-fg); border-color: rgba(255, 255, 255, .55); }
.hero .btn-outline:hover { background: var(--c-primary-fg); color: var(--c-primary); }

/* Trust strip - the four claims under the hero in the design. */
.trust { background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.trust-grid {
  display: grid; gap: 22px 28px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  padding: clamp(26px, 2.6vw, 42px) 0;
}
@media (min-width: 1040px) { .trust-grid { grid-template-columns: repeat(4, 1fr); } }
.trust-item strong { display: block; font-size: 15px; margin-bottom: 3px; }
.trust-item span { font-size: 14px; color: var(--c-text-muted); }

.cards { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 620px)  { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(3, 1fr); } }
/* Beyond 4 across, course cards stop reading as a list and start looking
   like a spreadsheet, so the count is capped rather than left to auto-fit. */
@media (min-width: 1560px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column;
}
.card h3 { margin-bottom: 6px; }
.card p { color: var(--c-text-muted); font-size: 15px; flex: 1; }
.card-meta {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--c-accent-text); margin-bottom: 8px;
}
.card-code {
  font-family: var(--font-heading); font-size: 13px; font-weight: 700;
  color: var(--c-primary);
}

.stats { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat-box { text-align: center; padding: 20px; background: var(--c-surface); border-radius: var(--radius); border: 1px solid var(--c-border); }
.stat-n { font-family: var(--font-heading); font-size: 32px; font-weight: 700; color: var(--c-primary); }
.stat-l { font-size: 14px; color: var(--c-text-muted); }

.gallery-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (min-width: 1560px) { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
@media (min-width: 1560px) { .gallery-grid img { height: 210px; } }
.gallery-grid img { width: 100%; height: 170px; object-fit: cover; border-radius: var(--radius); }

.verify-panel {
  background: var(--c-primary); color: var(--c-primary-fg);
  border-radius: var(--radius); padding: 32px;
}
.verify-panel h2 { color: var(--c-primary-fg); }
.verify-panel p { color: var(--c-primary-fg); opacity: 0.88; }
.verify-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.verify-form input {
  flex: 1; min-width: 220px; min-height: 46px; padding: 0 14px;
  border-radius: var(--radius); border: 2px solid transparent;
  font-size: 15px; font-family: inherit;
}

.notice {
  background: var(--c-surface); border-left: 4px solid var(--c-accent);
  border-radius: var(--radius); padding: 18px 20px;
}

.result-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 24px; margin-top: 24px;
}
.result-flag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-weight: 700; font-size: 14px;
}
.flag-unknown { background: #fef6e7; color: #713f12; }
.flag-valid { background: #eaf6ee; color: #14532d; }
.flag-revoked { background: #fdecec; color: #7f1d1d; }

/* -------------------------------------------------------------- footer */

.footer { background: var(--c-primary); color: var(--c-primary-fg); margin-top: 20px; }
.footer .wrap { padding-top: 44px; padding-bottom: 32px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer h4 {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 12px; opacity: 0.75; font-family: var(--font-body);
}
.footer a { color: var(--c-primary-fg); text-decoration: none; opacity: 0.92; }
.footer a:hover { text-decoration: underline; color: var(--c-primary-fg); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 15px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin-top: 28px; padding-top: 18px;
  font-size: 13px; opacity: 0.8;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

.errpage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.errpage-inner { max-width: 520px; }

@media (max-width: 760px) {
  .nav { width: 100%; margin-left: 0; }
  .section { padding: 40px 0; }
}
