/* ==========================================================================
   Celtech Compliance Solutions — main stylesheet
   Shared by every page. Sections:
   1. Fonts  2. Brand tokens  3. Base  4. Layout helpers  5. Header & nav
   6. Hero  7. Sections & cards  8. Services page  9. Contact  10. Footer
   ========================================================================== */

/* 1. Fonts — stored in /fonts so no visitor data goes to a third party */
@font-face { font-family: "Jost"; src: url("/fonts/jost-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/fonts/jost-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/fonts/jost-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("/fonts/spectral-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("/fonts/spectral-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* 2. Brand tokens — change a colour here and it updates everywhere */
:root {
  --navy: #082a3b;        /* from the logo */
  --navy-deep: #051c28;
  --navy-soft: #1d4257;
  --parchment: #f8f3ed;   /* from the logo background */
  --parchment-dark: #ece4d9;
  --white: #ffffff;
  --text: #13232d;
  --text-muted: #4f5e67;
  --accent: #2f7d8c;      /* teal, used sparingly for links and highlights */
  --border: #d9cfc2;

  --font-heading: "Spectral", Georgia, serif;
  --font-body: "Jost", system-ui, sans-serif;

  --max-width: 1120px;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(8 42 59 / 0.06), 0 6px 20px rgb(8 42 59 / 0.06);
}

/* 3. Base */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 500; }

p { margin: 0 0 1em; }

a { color: var(--accent); }
a:hover { color: var(--navy); }

img { max-width: 100%; height: auto; display: block; }

/* Visible outline for keyboard users */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* 4. Layout helpers */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.lead { font-size: 1.2rem; color: var(--text-muted); max-width: 42rem; }

.button {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--parchment);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.button:hover { background: var(--navy-soft); color: var(--parchment); }

.button--light { background: var(--parchment); color: var(--navy); }
.button--light:hover { background: var(--white); color: var(--navy); }

.button--outline { background: transparent; border: 1.5px solid currentColor; color: var(--parchment); }
.button--outline:hover { background: rgb(248 243 237 / 0.1); color: var(--parchment); }

/* 5. Header & navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--navy);
  color: var(--parchment);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--parchment);
  text-decoration: none;
}
.brand img { width: 40px; }
.brand span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}
.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
}
.brand:hover { color: var(--white); }

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--parchment);
  border-radius: 6px;
  color: var(--parchment);
  font: inherit;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.site-nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--parchment);
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { border-bottom-color: var(--parchment); }

/* Phones: collapse the menu behind a button */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    border-top: 1px solid var(--navy-soft);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 0.5rem 1.25rem 1rem; }
  .site-nav a { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--navy-soft); }
}

/* 6. Hero (the big intro block at the top of a page) */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--parchment);
  padding: 5rem 0 5.5rem;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 3rem;
}
.hero h1 { color: var(--parchment); }
.hero .lead { color: rgb(248 243 237 / 0.8); }
.hero .eyebrow { color: #8cc4cf; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero-mark { opacity: 0.9; justify-self: center; width: min(320px, 100%); }

.hero--small { padding: 3.5rem 0; }
.hero--small .container { grid-template-columns: 1fr; }

@media (max-width: 760px) {
  .hero { padding: 3.5rem 0 4rem; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-mark { display: none; }
}

/* 7. Sections & cards */
.section { padding: 5rem 0; }
.section--alt { background: var(--parchment-dark); }
.section--dark { background: var(--navy); color: var(--parchment); }
.section--dark h2 { color: var(--parchment); }
.section--dark .lead { color: rgb(248 243 237 / 0.8); }

.section-header { margin-bottom: 2.5rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card p { color: var(--text-muted); }
.card ul { margin: 0 0 1.25rem; padding-left: 1.1rem; color: var(--text-muted); }
.card .card-link { margin-top: auto; font-weight: 500; text-decoration: none; }
.card .card-link:hover { text-decoration: underline; }

.card-number {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
}
.pillars h3 { padding-top: 1rem; border-top: 2px solid var(--navy); }

.cta-band { text-align: center; }
.cta-band .lead { margin: 0 auto 2rem; }

/* 8. Services page */
.service-group { padding: 4rem 0; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.service-group:last-of-type { border-bottom: none; }
.service-group-intro { max-width: 46rem; margin-bottom: 2rem; }

.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-top: 1.5rem;
}

/* 9. Contact */
.contact-methods {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}
.contact-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 260px;
  padding: 1.5rem 2rem;
  border: 1px solid var(--navy-soft);
  border-radius: var(--radius);
  color: var(--parchment);
  text-decoration: none;
}
.contact-method:hover { background: var(--navy-soft); color: var(--white); }
.contact-method .label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8cc4cf;
}
.contact-method .value { font-size: 1.15rem; font-weight: 500; }

/* 10. Footer */
.site-footer {
  background: var(--navy-deep);
  color: rgb(248 243 237 / 0.7);
  padding: 3rem 0 2rem;
  font-size: 0.95rem;
}
.site-footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.site-footer h3 { color: var(--parchment); font-size: 1rem; font-family: var(--font-body); font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: rgb(248 243 237 / 0.85); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-logo { width: 180px; margin-bottom: 1rem; }
.footer-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid var(--navy-soft);
  padding-top: 1.5rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  .section { padding: 3.5rem 0; }
  .site-footer .container { grid-template-columns: 1fr; }
}

/* 11. News page */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.news { padding: 3rem 0 4rem; }

/* Desktop: filters on the left, articles on the right */
.news-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.news-filters {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.news-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font: inherit;
  color: var(--text);
}
.news-search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgb(47 125 140 / 0.2); }

.filter-group { margin-top: 1.75rem; }
.filter-heading {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--parchment); }
.chip:disabled { opacity: 0.4; cursor: default; }
.chip:disabled:hover { border-color: var(--border); }
.chip-count { font-size: 0.75rem; color: var(--text-muted); }
.chip[aria-pressed="true"] .chip-count { color: rgb(248 243 237 / 0.7); }

.chip--cni { border-color: var(--accent); font-weight: 500; }
.chip--cni[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }

.news-filters-done,
.news-filters-toggle { display: none; }

/* Toolbar above the results */
.news-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.news-count { margin: 0; font-weight: 500; color: var(--navy); }
.news-clear {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Article list */
.article-list { list-style: none; margin: 0; padding: 0; }
.article { padding: 1.5rem 0; border-bottom: 1px solid var(--border); }

.article-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.article-tag {
  padding: 0.1rem 0.55rem;
  border: none;
  border-radius: 4px;
  background: var(--parchment-dark);
  color: var(--navy-soft);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.article-tag:hover { background: var(--navy); color: var(--parchment); }

.article-title { font-size: 1.3rem; margin-bottom: 0.4rem; }
.article-title a { color: var(--navy); text-decoration: none; }
.article-title a:hover { color: var(--accent); text-decoration: underline; }

.article-summary { color: var(--text-muted); margin-bottom: 0.5rem; }
.article-meta { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.news-empty { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
.news-empty h2 { font-size: 1.5rem; }

.news-more { display: block; margin: 2rem auto 0; }

.news-updated,
.news-disclaimer { font-size: 0.85rem; color: var(--text-muted); margin-top: 2rem; }
.news-disclaimer { margin-top: 0.5rem; }

/* Tablets and phones: filters move into a full-screen panel */
@media (max-width: 900px) {
  .news-layout { grid-template-columns: 1fr; }

  .news-filters {
    display: none;
    position: fixed;
    inset: 0;
    top: 0;
    z-index: 20;
    max-height: none;
    padding: 1.5rem 1.25rem 6rem;
    background: var(--parchment);
  }
  .news-filters.is-open { display: block; }

  .news-filters-done {
    display: block;
    position: fixed;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 1.25rem;
    border: none;
    font: inherit;
    cursor: pointer;
  }

  .news-filters-toggle {
    display: inline-block;
    padding: 0.45rem 1rem;
    border: 1.5px solid var(--navy);
    border-radius: 999px;
    background: var(--white);
    color: var(--navy);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
  }

  body.filters-open { overflow: hidden; }
}
