/* ==========================================================================
   CertyHub — 2026
   ========================================================================== */

:root {
  --green-950: #0b2416;
  --green-900: #12321f;
  --green-800: #1a4a2c;
  --green-700: #215c37;
  --green-500: #3a9a4d;
  --green-300: #9fd3a8;
  --green-100: #e6f2e7;
  --cream: #f6f5f0;
  --ink: #141a16;
  --ink-soft: #4a544d;
  --line: #e2e4df;
  --white: #ffffff;

  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px -20px rgba(11, 36, 22, .25);
  --container: 1200px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .95rem;
  padding: .9em 1.6em;
  border-radius: 999px;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: .6em 1.2em; font-size: .88rem; }
.btn-primary { background: var(--green-700); color: var(--white); }
.btn-primary:hover { background: var(--green-800); }
.btn-light { background: var(--white); color: var(--green-900); }
.btn-light:hover { background: var(--green-100); }
.btn-ghost { border-color: rgba(255,255,255,.4); color: var(--white); }
.btn-ghost:hover { border-color: var(--white); }

.card-link {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .92rem;
  color: var(--green-700);
  text-decoration: none;
}
.card-link::after { content: " →"; transition: margin .2s; }
.card-link:hover::after { margin-left: .25em; }

.eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green-500);
  margin-bottom: .9em;
}
.eyebrow-light { color: var(--green-300); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px -12px rgba(0,0,0,.15); }

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand img { height: 30px; width: auto; }

.main-nav { display: flex; gap: 26px; margin-left: auto; }
.main-nav a {
  font-size: .93rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
}
.main-nav a:hover, .main-nav a.active { color: var(--ink); }
.main-nav a.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--green-500); border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 16px; }
.lang { display: flex; gap: 2px; font-size: .78rem; font-weight: 600; }
.lang a {
  text-decoration: none; color: var(--ink-soft);
  padding: 4px 6px; border-radius: 6px;
}
.lang a[aria-current="true"] { color: var(--green-700); background: var(--green-100); }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 0; background: transparent; cursor: pointer;
  padding: 10px; flex-direction: column; justify-content: space-between;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--white);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(58,154,77,.35), transparent 60%),
    linear-gradient(160deg, var(--green-900), var(--green-950));
  padding: 88px 0 120px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: .35em;
}
.hero h1 span { color: var(--green-300); }
.lead { font-size: 1.15rem; color: rgba(255,255,255,.8); max-width: 34em; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 48px; }

.hero-stats { display: flex; gap: 40px; margin: 0; }
.hero-stats div { border-left: 2px solid rgba(159,211,168,.4); padding-left: 14px; }
.hero-stats dt { font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; line-height: 1.1; }
.hero-stats dd { margin: 0; font-size: .88rem; color: rgba(255,255,255,.65); }

.hero-media { position: relative; }
.hero-img-main {
  width: 100%;
  aspect-ratio: 4 / 3.3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-img-card {
  position: absolute;
  left: -48px; bottom: -56px;
  width: 52%;
  margin: 0;
  background: var(--white);
  padding: 8px 8px 0;
  border-radius: 14px;
  box-shadow: 0 24px 50px -20px rgba(0,0,0,.5);
  transform: rotate(-2deg);
}
.hero-img-card img { border-radius: 8px; aspect-ratio: 4/3; object-fit: cover; }
.hero-img-card figcaption { color: var(--ink); font-size: .8rem; font-weight: 600; padding: 8px 4px 10px; }

/* ---------- Partners ---------- */
.partners { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.partners-label {
  text-align: center;
  font-size: .82rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.logo-row {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 28px 56px;
}
.logo-row img {
  height: 34px; width: auto; max-width: 140px; object-fit: contain;
  filter: grayscale(1); opacity: .65;
  transition: filter .25s, opacity .25s;
}
.logo-row img:hover { filter: none; opacity: 1; }
.logo-row img[alt="Red Hat"] { height: 52px; }

/* ---------- Sections ---------- */
.section { padding: 112px 0; }
.section-tint { background: var(--cream); }
.section-dark { background: var(--green-900); color: var(--white); }
.section-dark p { color: rgba(255,255,255,.78); }

.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head p:last-child { color: var(--ink-soft); font-size: 1.05rem; }
.section-head-row {
  max-width: none;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
}
.section-head-row h2 { margin: 0; }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.service-card {
  display: flex; flex-direction: column;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.service-card:hover { border-color: var(--green-300); box-shadow: var(--shadow); transform: translateY(-3px); }
.service-card p { color: var(--ink-soft); font-size: .96rem; flex: 1; }
.icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--green-100);
  display: grid; place-items: center;
  margin-bottom: 22px;
}
.icon svg, .social svg {
  width: 26px; height: 26px;
  fill: none; stroke: var(--green-700);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.service-card-feature {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--white);
  background: var(--green-800);
  justify-content: flex-end;
  min-height: 300px;
}
.service-card-feature img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: .45;
}
.service-card-feature > div { position: relative; padding: 32px; }
.service-card-feature p { color: rgba(255,255,255,.85); }

/* ---------- Test centers ---------- */
.centers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.center-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 0 var(--line);
  display: flex; flex-direction: column;
}
.center-card > img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.center-body { padding: 32px; display: flex; flex-direction: column; flex: 1; }
.center-title { display: flex; align-items: baseline; gap: 12px; }
.center-title h3 { font-size: 1.6rem; margin: 0 0 .3em; }
.flag {
  font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--green-500);
}
.address { color: var(--ink); }
.address span { color: var(--ink-soft); font-size: .92rem; }
.tags { list-style: none; padding: 0; margin: 4px 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: .82rem; font-weight: 500;
  background: var(--green-100); color: var(--green-800);
  padding: 5px 12px; border-radius: 999px;
}
.center-contact {
  margin-top: auto;
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  padding-top: 20px; border-top: 1px solid var(--line);
  font-size: .93rem; font-weight: 500;
}
.center-contact a { text-decoration: none; color: var(--green-700); }
.center-contact a:hover { text-decoration: underline; }

/* ---------- Split layouts ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.split-media img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 4 / 4.4;
  object-fit: cover;
}
.split-copy > p:not(.eyebrow) { color: var(--ink-soft); font-size: 1.05rem; }
.section-dark .split-copy > p:not(.eyebrow) { color: rgba(255,255,255,.78); }

.benefits {
  list-style: none; padding: 0; margin: 32px 0 36px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px;
}
.benefits li { padding-left: 18px; border-left: 3px solid var(--green-500); }
.benefits h3 { font-size: 1rem; margin-bottom: .3em; }
.benefits p { font-size: .92rem; color: var(--ink-soft); margin: 0; }

.about-media img {
  background: var(--white);
  aspect-ratio: 1;
  object-fit: contain;
  padding: 24px;
}

/* ---------- Quotes ---------- */
.quotes {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}
.quote {
  margin: 0;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--cream);
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 24px;
}
.quote blockquote { margin: 0; font-size: 1.05rem; line-height: 1.5; font-weight: 500; }
.quote figcaption {
  font-family: var(--font-head);
  font-weight: 700; font-size: .85rem;
  color: var(--green-700);
}
.quote figcaption::before { content: "— "; }
.quote-lg {
  grid-row: span 2;
  background: var(--green-700);
  color: var(--white);
}
.quote-lg blockquote { font-family: var(--font-head); font-size: clamp(1.35rem, 2.2vw, 1.8rem); font-weight: 600; line-height: 1.35; }
.quote-lg blockquote::before {
  content: "“"; display: block;
  font-size: 5rem; line-height: .7; color: var(--green-300);
  margin-bottom: 8px;
}
.quote-lg figcaption { color: var(--green-300); }
.quote:nth-child(4) { grid-column: 2 / span 2; }

/* ---------- Blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post {
  text-decoration: none;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.post:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.post-body { padding: 24px 26px 28px; }
.post-tag {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--green-500); margin-bottom: 10px;
}
.post h3 { font-size: 1.12rem; }
.post p { color: var(--ink-soft); font-size: .93rem; margin: 0; }

/* ---------- Contact ---------- */
.contact-cta {
  display: flex; justify-content: space-between; align-items: center; gap: 32px;
  padding: 56px;
  border-radius: 24px;
  color: var(--white);
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(58,154,77,.45), transparent 70%),
    var(--green-900);
  margin-bottom: 72px;
}
.contact-cta h2 { margin-bottom: .25em; }
.contact-cta p { color: rgba(255,255,255,.78); margin: 0; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr 1.5fr; gap: 40px; }
.contact-col h3 {
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green-500); margin-bottom: 1em;
}
.contact-col p { color: var(--ink-soft); font-size: .95rem; }
.contact-col a { color: var(--ink); text-decoration: none; font-weight: 500; }
.contact-col a:hover { color: var(--green-700); text-decoration: underline; }
.emails { margin: 0; font-size: .92rem; }
.emails dt { font-size: .78rem; color: var(--ink-soft); }
.emails dd { margin: 0 0 12px; }
.break { overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; gap: 24px; }
.footer-logo { height: 24px; width: auto; }
.footer-inner p { margin: 0; color: var(--ink-soft); font-size: .88rem; }
.social { margin-left: auto; display: flex; gap: 8px; }
.social a {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green-100);
  transition: background .2s;
}
.social a:hover { background: var(--green-300); }
.social svg { width: 20px; height: 20px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .main-nav { gap: 18px; }
  .header-actions .btn { display: none; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 920px) {
  :root { --header-h: 68px; }
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column; gap: 0;
    background: var(--white);
    padding: 8px 24px 24px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 30px -20px rgba(0,0,0,.2);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
  }
  .main-nav a { padding: 14px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .main-nav a.active::after { display: none; }
  .nav-open .main-nav { transform: none; opacity: 1; pointer-events: auto; }
  .header-actions { margin-left: auto; }

  .hero { padding: 56px 0 96px; }
  .hero-grid, .split, .centers-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-img-card { left: 16px; bottom: -40px; width: 46%; }
  .split-reverse .split-media { order: -1; }
  .split-media img { aspect-ratio: 16 / 10; }
  .about-media img { aspect-ratio: 16 / 10; }

  .services-grid, .blog-grid { grid-template-columns: 1fr 1fr; }
  .quotes { grid-template-columns: 1fr 1fr; }
  .quote-lg { grid-row: auto; grid-column: span 2; }
  .quote:nth-child(4) { grid-column: span 2; }

  .section { padding: 80px 0; }
  .contact-cta { flex-direction: column; align-items: flex-start; padding: 40px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .hero-stats { gap: 22px; }
  .hero-stats dt { font-size: 1.3rem; }
  .hero-img-card { display: none; }
  .services-grid, .blog-grid, .quotes, .benefits, .contact-grid { grid-template-columns: 1fr; }
  .quote-lg, .quote:nth-child(4) { grid-column: auto; }
  .logo-row { gap: 24px 36px; }
  .logo-row img { height: 26px; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }
  .section-head-row { flex-direction: column; align-items: flex-start; }
  .service-card, .center-body, .quote { padding: 24px; }
  .contact-cta { padding: 32px 24px; }
  .contact-cta .btn { white-space: normal; }
  .footer-inner { flex-wrap: wrap; }
}

/* ==========================================================================
   Blog
   ========================================================================== */
.page-hero {
  color: var(--white);
  background:
    radial-gradient(900px 400px at 90% -20%, rgba(58,154,77,.35), transparent 60%),
    linear-gradient(160deg, var(--green-900), var(--green-950));
  padding: 80px 0 72px;
}
.page-hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; margin-bottom: .25em; }
.page-hero .lead { margin: 0; }
.page-note {
  display: inline-block;
  margin: 20px 0 0;
  font-size: .88rem;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
}

.blog-page { padding-top: 48px; }
.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chip {
  font: 600 .88rem var(--font-head);
  padding: .55em 1.1em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--green-300); color: var(--ink); }
.chip.is-active { background: var(--green-700); border-color: var(--green-700); color: var(--white); }

.post[hidden] { display: none; }
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  margin: 0 0 10px;
  font-size: .82rem; color: var(--ink-soft);
}
.post-meta .post-tag { margin: 0; }
.post-noimg { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--green-700), var(--green-900)); }

.post-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr; }
.post-featured img { aspect-ratio: auto; height: 100%; min-height: 320px; }
.post-featured .post-body { padding: 40px; align-self: center; }
.post-featured h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.post-featured p { font-size: 1rem; }

/* Article */
.article-container { max-width: 800px; }
.article-header { padding: 56px 0 32px; }
.article-header h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 800; letter-spacing: -.02em; margin: 0; }
.back-link {
  display: inline-block; margin-bottom: 28px;
  font: 600 .9rem var(--font-head); color: var(--green-700); text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
.article-image { width: 100%; border-radius: var(--radius); margin-bottom: 40px; }

.prose { font-size: 1.08rem; line-height: 1.75; padding-bottom: 88px; overflow-wrap: break-word; }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.6rem; margin: 1.8em 0 0; }
.prose h3 { font-size: 1.25rem; margin: 1.6em 0 0; }
.prose h4 { font-size: 1.05rem; margin: 1.4em 0 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 0; }
.prose li + li { margin-top: .4em; }
.prose a { color: var(--green-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--green-500); }
.prose img { border-radius: var(--radius-sm); margin: 1.6em auto; height: auto; }
.prose p > img { margin: 0 auto; }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 24px;
  border-left: 3px solid var(--green-500);
  font-size: 1.15rem; font-weight: 500; color: var(--ink);
}
.embed { position: relative; aspect-ratio: 16 / 9; margin: 1.6em 0; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm); }

@media (max-width: 920px) {
  .post-featured { grid-template-columns: 1fr; }
  .post-featured img { min-height: 0; aspect-ratio: 16 / 10; }
  .post-featured .post-body { padding: 26px 26px 28px; }
}
@media (max-width: 600px) {
  .page-hero { padding: 56px 0 48px; }
  .article-header { padding: 36px 0 24px; }
  .prose { font-size: 1.02rem; padding-bottom: 64px; }
}
