/* =========================================================
   regulation-ai.eu — Main CSS
   Design: Institutional Precision (EU AI Act palette)
   Colors:
     --blue-900:  #0c1e40   (deep authority navy)
     --blue-700:  #1e3a5f
     --blue-500:  #2563eb   (EU blue — links, CTAs)
     --sky-400:   #38bdf8   (AI/tech accent)
     --amber-500: #f59e0b   (deadlines, urgent)
     --red-600:   #dc2626   (prohibited, error)
     --green-600: #16a34a   (active/compliant)
     --slate-50:  #f8fafc
     --slate-100: #f1f5f9
     --slate-200: #e2e8f0
     --slate-700: #334155
     --slate-900: #0f172a
   ========================================================= */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-900:  #0c1e40;
  --blue-700:  #1e3a5f;
  --blue-500:  #2563eb;
  --sky-400:   #38bdf8;
  --amber-500: #f59e0b;
  --red-600:   #dc2626;
  --green-600: #16a34a;
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --radius:    6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--slate-900);
  background: var(--slate-50);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-500); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--blue-900);
  margin-top: 2rem;
  margin-bottom: .75rem;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-top: 0; }
h2 { font-size: clamp(1.35rem, 3vw, 1.875rem); border-bottom: 2px solid var(--slate-200); padding-bottom: .4rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p  { margin-bottom: 1.2rem; }
ul, ol { margin: 0 0 1.2rem 1.4rem; }
li { margin-bottom: .35rem; }

blockquote {
  border-left: 4px solid var(--blue-500);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--slate-100);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--slate-700);
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--slate-100);
  padding: .15em .4em;
  border-radius: 3px;
  color: var(--blue-700);
}

pre {
  background: var(--slate-900);
  color: var(--slate-50);
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: .875rem;
}
pre code { background: none; padding: 0; color: inherit; }

strong { font-weight: 700; }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: 800px; }

/* ---- Navigation ---- */
.nav {
  background: var(--blue-900);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
}
.nav__logo-badge {
  background: var(--blue-500);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .15em .5em;
  border-radius: 3px;
}
.nav__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav__links a {
  color: rgba(255,255,255,.82);
  font-size: .875rem;
  font-weight: 500;
  transition: color .15s;
}
.nav__links a:hover { color: #fff; text-decoration: none; }
.nav__links a.active { color: var(--sky-400); }
.nav__cta {
  background: var(--blue-500);
  color: #fff !important;
  padding: .4rem .9rem;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 600;
  transition: background .15s;
}
.nav__cta:hover { background: #1d4ed8 !important; }
.nav__menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  color: #fff;
  font-size: 1.4rem;
}

/* ---- Hero / Page header ---- */
.page-hero {
  background: linear-gradient(135deg, var(--blue-900) 0%, #1a3a6e 100%);
  color: #fff;
  padding: 3rem 1.25rem 3.5rem;
}
.page-hero__inner { max-width: 900px; margin: 0 auto; }
.page-hero__breadcrumbs {
  font-size: .8125rem;
  color: rgba(255,255,255,.65);
  margin-bottom: 1rem;
}
.page-hero__breadcrumbs a { color: rgba(255,255,255,.75); }
.page-hero__breadcrumbs span { margin: 0 .4rem; }
.page-hero__badge {
  display: inline-block;
  background: rgba(56,189,248,.18);
  color: var(--sky-400);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .25em .75em;
  border-radius: 99px;
  border: 1px solid rgba(56,189,248,.35);
  margin-bottom: 1rem;
}
.page-hero h1 { color: #fff; margin-top: .5rem; }
.page-hero__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: .8125rem;
  color: rgba(255,255,255,.65);
}
.page-hero__meta time { color: rgba(255,255,255,.85); }

/* ---- Content layout (pillar: 2-col) ---- */
.content-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}
@media (min-width: 900px) {
  .content-layout--sidebar {
    grid-template-columns: 220px 1fr;
    align-items: start;
  }
}

/* ---- Sidebar TOC ---- */
.toc {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 76px;
  font-size: .875rem;
}
.toc__title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--slate-600);
  margin-bottom: .75rem;
  margin-top: 0;
  border: none;
  padding: 0;
}
.toc__list { list-style: none; margin: 0; padding: 0; }
.toc__list li { margin-bottom: .4rem; }
.toc__list a {
  color: var(--slate-700);
  line-height: 1.4;
  display: block;
}
.toc__list a:hover { color: var(--blue-500); }
.toc__list a.active { color: var(--blue-500); font-weight: 600; }

/* ---- Article body ---- */
.article-body { min-width: 0; }
.article-body h2 { scroll-margin-top: 80px; }
.article-body h3 { scroll-margin-top: 80px; }

/* ---- Deadline table ---- */
.deadline-section { margin: 2.5rem 0; }
.deadline-section h2 { margin-top: 0; }

.deadline-table-wrap { overflow-x: auto; }

.deadline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.deadline-table th {
  background: var(--blue-900);
  color: #fff;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.deadline-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--slate-200);
  vertical-align: top;
}
.deadline-table tr:last-child td { border-bottom: none; }
.deadline-table tr:hover td { background: var(--slate-50); }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .2em .6em;
  border-radius: 99px;
}
.status--active    { background: #dcfce7; color: var(--green-600); }
.status--deferred  { background: #fef3c7; color: #92400e; }
.status--prohibited{ background: #fee2e2; color: var(--red-600); }

/* Countdown */
.countdown-chip {
  display: inline-block;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 4px;
  padding: .15em .5em;
  font-size: .75rem;
  font-weight: 600;
  color: var(--slate-700);
  font-variant-numeric: tabular-nums;
}
.countdown-chip[data-urgent="true"] {
  background: #fef3c7;
  border-color: var(--amber-500);
  color: #92400e;
}

/* ---- FAQ Section ---- */
.faq-section { margin: 3rem 0; }
.faq-section h2 { margin-top: 0; }

.faq-item {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
}
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: .9375rem;
  gap: 1rem;
  user-select: none;
}
.faq-question:hover { background: var(--slate-50); }
.faq-chevron { flex-shrink: 0; transition: transform .2s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer {
  display: none;
  padding: 1rem 1.25rem 1.25rem;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-200);
  font-size: .9375rem;
}
.faq-item.open .faq-answer { display: block; }

/* ---- Cross-link DORA block ---- */
.crosslink-dora {
  background: linear-gradient(135deg, #0c1e40 0%, #1a3a6e 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin: 2.5rem 0;
}
.crosslink-dora__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(37,99,235,.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.crosslink-dora__title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 .4rem;
  border: none;
  padding: 0;
}
.crosslink-dora__text {
  font-size: .875rem;
  color: rgba(255,255,255,.8);
  margin: 0 0 .75rem;
}
.crosslink-dora__link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--blue-500);
  color: #fff;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  font-size: .825rem;
  font-weight: 600;
  transition: background .15s;
}
.crosslink-dora__link:hover { background: #1d4ed8; text-decoration: none; }

/* ---- Lead Capture CTA ---- */
.lead-cta {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin: 2.5rem 0;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.lead-cta h3 { margin-top: 0; }
.lead-cta__form {
  display: flex;
  gap: .5rem;
  max-width: 440px;
  margin: 1rem auto 0;
}
.lead-cta__input {
  flex: 1;
  padding: .6rem .9rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
}
.lead-cta__input:focus { outline: 2px solid var(--blue-500); border-color: var(--blue-500); }
.lead-cta__btn {
  background: var(--blue-500);
  color: #fff;
  border: none;
  padding: .6rem 1.2rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .15s;
}
.lead-cta__btn:hover { background: #1d4ed8; }
.lead-cta__note { font-size: .75rem; color: var(--slate-600); margin-top: .5rem; }

/* ---- Info callout boxes ---- */
.callout {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  gap: .75rem;
}
.callout--info    { background: #eff6ff; border-left: 4px solid var(--blue-500); }
.callout--warn    { background: #fffbeb; border-left: 4px solid var(--amber-500); }
.callout--danger  { background: #fef2f2; border-left: 4px solid var(--red-600); }
.callout--success { background: #f0fdf4; border-left: 4px solid var(--green-600); }
.callout__body p:last-child { margin-bottom: 0; }

/* ---- Homepage specific ---- */
.home-hero {
  background: linear-gradient(135deg, var(--blue-900) 0%, #1a3a6e 60%, #0c3566 100%);
  color: #fff;
  padding: 5rem 1.25rem 4rem;
  text-align: center;
}
.home-hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3rem); max-width: 800px; margin: 0 auto .75rem; }
.home-hero__sub { font-size: 1.125rem; color: rgba(255,255,255,.75); max-width: 620px; margin: 0 auto 2rem; }
.home-hero__ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .9375rem;
  transition: all .15s;
  text-decoration: none;
}
.btn--primary { background: var(--blue-500); color: #fff; }
.btn--primary:hover { background: #1d4ed8; text-decoration: none; }
.btn--outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); }
.btn--outline:hover { border-color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }

.section { padding: 3.5rem 1.25rem; }
.section--alt { background: #fff; }
.section__title { text-align: center; margin-bottom: 2.5rem; }
.section__title h2 { margin-top: 0; border: none; padding: 0; }
.section__title p { color: var(--slate-600); margin-top: .5rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}
.card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.card__icon { font-size: 1.75rem; margin-bottom: .75rem; }
.card__title { font-size: 1rem; font-weight: 700; color: var(--blue-900); margin-bottom: .4rem; }
.card__desc { font-size: .875rem; color: var(--slate-600); margin: 0; }

/* ---- Footer ---- */
.footer {
  background: var(--blue-900);
  color: rgba(255,255,255,.7);
  padding: 3rem 1.25rem 1.5rem;
}
.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 600px) { .footer__inner { grid-template-columns: 2fr 1fr 1fr; } }
.footer__brand { color: #fff; font-weight: 700; font-size: 1rem; margin-bottom: .5rem; }
.footer__tagline { font-size: .8125rem; margin-bottom: 1rem; }
.footer__col h4 {
  color: rgba(255,255,255,.9);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 0 0 .75rem;
  border: none;
  padding: 0;
}
.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col li { margin-bottom: .4rem; }
.footer__col a { color: rgba(255,255,255,.6); font-size: .85rem; }
.footer__col a:hover { color: rgba(255,255,255,.95); }
.footer__bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .8rem;
}
.footer__legal a { color: rgba(255,255,255,.5); margin-left: 1rem; }

/* ---- Utilities ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav__links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--blue-900); padding: 1rem; gap: .75rem; box-shadow: 0 8px 16px rgba(0,0,0,.3); }
  .nav__links.open { display: flex; }
  .nav__menu-toggle { display: flex; }
  .crosslink-dora { flex-direction: column; }
  .lead-cta__form { flex-direction: column; }
  .footer__inner { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .page-hero { padding: 2rem 1rem 2.5rem; }
  .content-layout { padding: 1.5rem 1rem; }
}
