/*
Theme Name: Cerebra
Theme URI: https://cerebra-ai.on-forge.com
Description: Theme for the CEREBRA-AI project site. Implements the design in the
  CEREBRA-AI content package v1.1 (preview/preview.css and wordpress/cerebra-brand.css).
  Page content supplies its own H1 and its own EU funding section, so neither the
  page template nor the site footer repeats them.
Author: Atomium
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
License: Proprietary
Text Domain: cerebra
Tags: project, research, accessibility-ready
*/

:root {
  --cerebra-blue: #066BB6;
  --cerebra-cyan: #10A4DE;
  --cerebra-navy: #0E2A4F;
  --cerebra-ink: #111B33;
  --cerebra-slate: #3F4650;
  --cerebra-muted: #8FA6C4;
  --cerebra-border: #C7CDD4;
  --cerebra-wash: #F1F6FA;
  --cerebra-font: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
}

*{ box-sizing: border-box }
html { scroll-behavior: smooth }

body {
  margin: 0;
  background: #fff;
  color: var(--cerebra-ink);
  font-family: var(--cerebra-font);
  font-size: 18px;
  line-height: 1.65;
}

img { max-width: 100%; height: auto }
a { color: var(--cerebra-blue); text-underline-offset: 4px }
a:hover { color: var(--cerebra-navy) }

a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--cerebra-blue);
  outline-offset: 5px;
}

h1, h2, h3 { line-height: 1.12; letter-spacing: -.025em }

/* ---------------------------------------------------------------- skip link */

.skip {
  position: absolute;
  left: 20px;
  top: -100px;
  padding: 12px;
  background: #fff;
  z-index: 20;
}

.skip:focus { top: 10px }

/* ------------------------------------------------------------------- header */

.site-header {
  max-width: 1320px;
  margin: auto;
  min-height: 108px;
  padding: 22px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 38px;
}

.brand { display: block; flex: 0 0 190px; line-height: 0 }
.brand img { width: 190px }

.site-header nav ul {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header nav a {
  text-decoration: none;
  color: var(--cerebra-ink);
  font-size: 16px;
  font-weight: 600;
}

.site-header nav a:hover,
.site-header nav .current-menu-item > a,
.site-header nav .current_page_item > a {
  color: var(--cerebra-blue);
  text-decoration: underline;
}

/* --------------------------------------------------------------------- hero */
/* Built by cerebra_hero_split() from the leading eyebrow / H1 / lead / buttons
   that every page in the content package starts with. */

.hero {
  background: var(--cerebra-navy);
  color: #fff;
  display: flex;
  align-items: center;
  /* A floor, not a fixed height: the band stays the same depth whether the
     title wraps to one line or two, and still grows if it wraps to three. */
  min-height: 35rem;
  padding-block: 74px;
}

/* Same max-width and gutter as .cerebra-content, so hero text and body text
   share one left edge. */
.hero-inner {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 24px;
}

.hero h1 {
  font-size: clamp(40px, 5.1vw, 72px);
  font-weight: 700;
  margin: 18px 0 28px;
  max-width: 930px;
  color: #fff;
  letter-spacing: -.025em;
}

.hero .cerebra-eyebrow {
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: #8FD8F7;
  margin: 0 0 14px;
}

.hero .cerebra-lead {
  font-size: clamp(21px, 2vw, 25px);
  line-height: 1.5;
  max-width: 830px;
  color: #e0eaf4;
  margin: 0;
}

.hero .wp-block-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 32px 0 0;
}

.hero .wp-block-button__link {
  padding: 12px 19px;
  color: var(--cerebra-navy);
  background: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  border: 1px solid #fff;
  border-radius: 0;
}

.hero .wp-block-button:nth-child(n+2) .wp-block-button__link {
  background: transparent;
  color: #fff;
  border-color: var(--cerebra-muted);
}

.hero .wp-block-button__link:hover { background: #E6F3FA; color: var(--cerebra-navy) }
.hero .wp-block-button__link:focus-visible { outline-color: #8FD8F7 }

/* ------------------------------------------------------------------ content */
/* Mirrors wordpress/cerebra-brand.css — the classes the imported blocks use. */

.cerebra-content {
  color: var(--cerebra-ink);
  font-size: 18px;
  line-height: 1.65;
  max-width: 1180px;
  margin-inline: auto;
  padding: 50px 24px 70px;
  text-align: left;
}

.cerebra-content h1 {
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.08;
  color: var(--cerebra-navy);
  margin-block: 16px 28px;
}

.cerebra-content h2 {
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.18;
  color: var(--cerebra-blue);
  margin-block: 48px 22px;
}

.cerebra-content h3 { font-size: 24px; margin-block: 32px 14px }
.cerebra-content p, .cerebra-content ul, .cerebra-content ol { max-width: 850px }
.cerebra-content p { margin-block: 0 20px }
.cerebra-content ul, .cerebra-content ol { padding-left: 1.35em }
.cerebra-content li { margin-block: 0 14px; padding-left: 4px }
.cerebra-content li::marker { color: var(--cerebra-blue) }

.cerebra-content .cerebra-eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cerebra-blue);
}

.cerebra-content .cerebra-lead {
  font-size: 24px;
  line-height: 1.5;
  color: var(--cerebra-slate);
}

.cerebra-content a { color: var(--cerebra-blue) }

.cerebra-content .wp-block-buttons { gap: 12px; margin-block: 28px 42px }

.cerebra-content .wp-block-button__link {
  background: var(--cerebra-blue);
  color: #fff;
  border-radius: 0;
  padding: 13px 22px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}

.cerebra-content .wp-block-button__link:hover { background: var(--cerebra-navy) }

.cerebra-content .wp-block-table { overflow-x: auto; margin-block: 26px }

.cerebra-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

.cerebra-content th {
  background: var(--cerebra-blue);
  color: #fff;
  text-align: left;
  font-weight: 700;
}

.cerebra-content td, .cerebra-content th {
  padding: 13px 15px;
  border: 1px solid var(--cerebra-border);
  vertical-align: top;
}

.cerebra-content td:first-child { font-weight: 600; color: var(--cerebra-ink) }

/* The EU funding block that closes every page in the content package. */
.cerebra-content .cerebra-funding {
  border-top: 1px solid var(--cerebra-border);
  margin-top: 54px;
  padding-top: 24px;
  color: var(--cerebra-slate);
  font-size: 14px;
}

.cerebra-content .cerebra-funding h2 { font-size: 21px; margin-top: 0; color: var(--cerebra-blue) }

/* ------------------------------------------------------------------- footer */
/* The funding paragraphs live in page content, so the footer carries only the
   emblem, the secondary navigation and the project line. */

.site-footer {
  background: var(--cerebra-wash);
  border-top: 1px solid var(--cerebra-border);
  padding: 50px max(48px, calc((100vw - 1184px) / 2)) 25px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--cerebra-slate);
}

.footer-top { display: grid; grid-template-columns: 2fr 1fr; gap: 100px }
.footer-top p { max-width: 730px }

.eu-emblem { width: 340px; max-width: 100%; display: block; margin-bottom: 24px }

.footer-top nav ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  align-content: start;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-top nav a { font-size: 15px }

.footer-base {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--cerebra-border);
  padding-top: 22px;
  margin-top: 30px;
  font-size: 13px;
}

/* ------------------------------------------------------------ posts / misc. */

.post-list { max-width: 1180px; margin-inline: auto; padding: 50px 24px 70px }
.post-list article { padding-block: 28px; border-bottom: 1px solid var(--cerebra-border) }
.post-list h2 { font-size: 27px; color: var(--cerebra-blue); margin: 0 0 8px }
.post-list h2 a { text-decoration: none }
.post-list time { font-size: 14px; color: var(--cerebra-slate) }

.pagination { display: flex; gap: 14px; margin-top: 34px }

/* ------------------------------------------------------------- media / print */

@media (max-width: 1100px) {
  .site-header { padding: 22px 30px }
  .site-header nav ul { gap: 18px }
  .footer-top { gap: 50px }
  .site-footer { padding-left: 40px; padding-right: 40px }
}

@media (max-width: 740px) {
  body { font-size: 17px }
  .site-header { display: block; padding: 20px 24px }
  .brand { width: 160px; margin-bottom: 20px }
  .brand img { width: 160px }
  .site-header nav ul { gap: 8px 20px }
  .site-header nav a { font-size: 14px }
  .hero { min-height: 20rem; padding-block: 46px }
  .hero h1 { font-size: 45px }
  .cerebra-content { font-size: 17px; padding: 32px 24px 40px }
  .cerebra-content .cerebra-lead { font-size: 21px }
  .cerebra-content table { min-width: 480px }
  .site-footer { padding: 32px 24px 20px }
  .footer-top { display: block }
  .footer-top nav { margin-top: 30px }
  .footer-base { display: block }
  .footer-base span { display: block; margin: 5px 0 }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto } }

@media print {
  .site-header, .site-footer nav, .hero .wp-block-buttons { display: none }
  .hero { background: #fff; color: #111; padding: 20px }
  .hero h1 { color: #111 }
  .hero .cerebra-lead, .hero .cerebra-eyebrow { color: #333 }
  .cerebra-content { padding: 0 }
  .cerebra-content table { min-width: 0 }
  h1, h2, h3 { break-after: avoid }
}
