/*
Theme Name: Bright New
Theme URI: https://brightcentre2.lovable.app
Author: Bright
Description: A custom WordPress block theme for Bright — a clear voice for responsible innovation in health and care. Pixel-converted from the original TanStack Start site. Sage archetype, Forest / Sand / Orange palette, Outfit typography.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bright
Tags: block-templates, full-site-editing, custom-colors, custom-logo, editor-style, one-column, two-columns, three-columns, block-styles, wide-blocks, accessibility-ready
*/

/* ------------------------------------------------------------------
   Bright — base styles
   Most styling is driven by theme.json (colours, fonts, spacing).
   This stylesheet adds the pieces theme.json cannot express:
   utility classes for the radial accents, alternating section bands,
   rounded-2xl cards, overline labels, and the personality slider.
------------------------------------------------------------------ */

:root {
  --bright-radius-2xl: 1rem;
  --bright-radius-pill: 9999px;
  --bright-tracking-overline: 0.18em;
  --bright-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Smooth anchored navigation (#contact link from header) */
html { scroll-behavior: smooth; }

body {
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.wp-block-heading {
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ---------- Overline label (small uppercase eyebrow) ---------- */
.bright-overline {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: var(--bright-tracking-overline);
  text-transform: uppercase;
  color: var(--wp--preset--color--burn);
}
.bright-overline--mint    { color: var(--wp--preset--color--mint); }
.bright-overline--orange  { color: var(--wp--preset--color--orange-brand); }
.bright-overline--sand    { color: var(--wp--preset--color--sand); opacity: 0.8; }

/* ---------- Cards (rounded-2xl with subtle border) ---------- */
.bright-card {
  border-radius: var(--bright-radius-2xl);
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--card);
  padding: 2rem;
}
@media (min-width: 768px) { .bright-card { padding: 2.5rem; } }

/* ---------- Forest band (dark section) ---------- */
.bright-band-forest {
  background-color: var(--wp--preset--color--forest);
  color: var(--wp--preset--color--sand);
}
.bright-band-forest h1, .bright-band-forest h2, .bright-band-forest h3 {
  color: var(--wp--preset--color--sand);
}

/* ---------- Radial accent images (decorative) ---------- */
.bright-radial-warm,
.bright-radial-parent {
  position: absolute;
  pointer-events: none;
  user-select: none;
  object-fit: cover;
}
.bright-radial-warm {
  right: -10rem; top: -5rem;
  height: 120%; width: 70%;
  opacity: 0.8;
}
.bright-radial-parent {
  right: -10rem; top: 0;
  height: 100%; width: 60%;
  opacity: 0.25;
}

/* ---------- Site header — full width, all pages ---------- */
.bright-header {
  position: relative;
  inset-inline: 0;
  top: 0;
  z-index: 20;
  padding-block: 1rem;
}

/* Homepage: float header over the hero image */
.home .bright-header,
body.page-template-front-page .bright-header,
body[class*="front-page"] .bright-header {
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  background-color: transparent !important;
}

/* Ensure hero sits flush to top on homepage */
.home .wp-site-blocks,
body.page-template-front-page .wp-site-blocks,
body[class*="front-page"] .wp-site-blocks {
  padding-top: 0 !important;
}
.home .wp-site-blocks > *,
body.page-template-front-page .wp-site-blocks > *,
body[class*="front-page"] .wp-site-blocks > * {
  margin-block-start: 0 !important;
}
.bright-header__inner {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
}
@media (min-width: 768px) {
  .bright-header { padding-block: 1.25rem; }
  .bright-header__inner { padding-inline: 2.5rem; flex-wrap: nowrap; }
}

/* Default (all pages): sand background, black logo */
.bright-header {
  background-color: var(--wp--preset--color--sand);
}
.bright-brand__logo--dark { display: none !important; }
.bright-brand__logo--light { display: block !important; }

/* Homepage: forest green background, white logo.
   Covers classic .home class, FSE front-page template,
   and WPEngine which sometimes adds neither. */
.home .bright-header,
body.page-template-front-page .bright-header,
body[class*="front-page"] .bright-header {
  background-color: var(--wp--preset--color--forest);
}
.home .bright-brand__logo--dark,
body.page-template-front-page .bright-brand__logo--dark,
body[class*="front-page"] .bright-brand__logo--dark { display: block !important; }
.home .bright-brand__logo--light,
body.page-template-front-page .bright-brand__logo--light,
body[class*="front-page"] .bright-brand__logo--light { display: none !important; }

/* Brand — logo image */
.bright-brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}
.bright-brand img {
  height: 44px;
  width: auto;
  display: block;
}
@media (min-width: 768px) {
  .bright-brand img { height: 52px; }
}

/* Home: kill the WP root top padding strip above the forest hero.
   WPE doesn't always add the .home body class (FSE templates), so also
   target via :has(.bright-home) and zero out the WP root padding var. */
.home .wp-site-blocks,
body:has(.bright-home) .wp-site-blocks {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
body:has(.bright-home) {
  --wp--style--root--padding-top: 0px;
}
.home,
body:has(.bright-home) {
  margin-top: 0 !important;
}
.home .bright-hero,
body:has(.bright-home) .bright-hero {
  margin-top: 0 !important;
  margin-left: calc(-1 * var(--wp--style--root--padding-left, 0px)) !important;
  margin-right: calc(-1 * var(--wp--style--root--padding-right, 0px)) !important;
}
/* Home page header is now the same shared header — no hiding needed */

/* Default (all pages): dark forest links */
.bright-header nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  margin-inline: 0.5rem;
  transition: color 200ms var(--bright-ease);
  color: color-mix(in oklab, var(--wp--preset--color--forest) 75%, transparent);
}
@media (min-width: 768px) {
  .bright-header nav a { font-size: 0.875rem; margin-inline: 0.75rem; }
}
.bright-header nav a:hover { color: var(--wp--preset--color--forest); }

/* Homepage nav: sand/white links */
.home .bright-header nav a {
  color: color-mix(in oklab, var(--wp--preset--color--sand) 85%, transparent);
}
.home .bright-header nav a:hover { color: var(--wp--preset--color--sand); }

/* Active page underline — same on all pages */
.bright-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--wp--preset--color--orange-brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

/* ---------- Personality slider (Sage archetype) ---------- */
.bright-slider {
  display: grid;
  gap: 0.5rem;
}
.bright-slider__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}
.bright-slider__track {
  position: relative;
  height: 4px;
  border-radius: var(--bright-radius-pill);
  background: color-mix(in oklab, currentColor 12%, transparent);
}
.bright-slider__fill {
  position: absolute;
  inset: 0;
  border-radius: var(--bright-radius-pill);
  background: var(--wp--preset--color--orange-brand);
  width: var(--bright-slider-value, 50%);
}
.bright-slider__thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: var(--wp--preset--color--forest);
  border: 2px solid var(--wp--preset--color--sand);
  transform: translate(-50%, -50%);
  left: var(--bright-slider-value, 50%);
}

/* ---------- Pill (e.g. "Now recruiting collaborators") ---------- */
.bright-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid color-mix(in oklab, currentColor 25%, transparent);
  background: color-mix(in oklab, currentColor 5%, transparent);
  border-radius: var(--bright-radius-pill);
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.bright-pill__dot {
  width: 6px; height: 6px;
  border-radius: 9999px;
  background: var(--wp--preset--color--orange-brand);
}

/* ---------- Tabs (Work page Programmes / Press / Output) ---------- */
.bright-tabs__list {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  background: var(--wp--preset--color--secondary);
  border-radius: var(--bright-radius-2xl);
  padding: 0.25rem;
}
.bright-tabs__trigger {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 500;
  border-radius: calc(var(--bright-radius-2xl) - 4px);
  cursor: pointer;
  color: var(--wp--preset--color--foreground);
}
.bright-tabs__trigger[aria-selected="true"] {
  background: var(--wp--preset--color--card);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}
.bright-tabs__panel { display: none; }
.bright-tabs__panel[data-active="true"] { display: block; }

/* ---------- Accordion (Work page collapsibles) ---------- */
.bright-accordion__item { border-bottom: 1px solid var(--wp--preset--color--border); }
.bright-accordion__trigger {
  width: 100%;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 1rem 0;
  font: inherit;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  color: inherit;
}
.bright-accordion__trigger::after {
  content: "+";
  font-size: 1.25rem;
  line-height: 1;
}
.bright-accordion__trigger[aria-expanded="true"]::after { content: "−"; }
.bright-accordion__panel {
  display: none;
  padding-bottom: 1rem;
  color: var(--wp--preset--color--muted-foreground);
  line-height: 1.6;
}
.bright-accordion__trigger[aria-expanded="true"] + .bright-accordion__panel {
  display: block;
}

/* ---------- Form (Get involved) ---------- */
.bright-form input,
.bright-form select,
.bright-form textarea,
.bright-form .wpcf7-form-control {
  width: 100%;
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--wp--preset--color--sand) 30%, transparent);
  color: var(--wp--preset--color--sand);
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  font: inherit;
}
.bright-form input::placeholder,
.bright-form textarea::placeholder { color: color-mix(in oklab, var(--wp--preset--color--sand) 40%, transparent); }
.bright-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: color-mix(in oklab, var(--wp--preset--color--sand) 90%, transparent);
}

/* ---------- Anchor offset for #contact ---------- */
#contact { scroll-margin-top: 6rem; }

/* ---------- Home hero (forest band, flush to top, optional bg image) ----------
   Set --bright-hero-image on the <section> to add a background photo.
   Example: style="--bright-hero-image:url('/wp-content/uploads/hero.jpg')"
   The ::before layer renders the image at low opacity; the ::after layer
   keeps the headline legible with a forest gradient. */
.bright-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 5.5rem 1.25rem 3.5rem;
  min-height: auto;
}
@media (min-width: 640px) {
  .bright-hero { padding-inline: 2rem; }
}
@media (min-width: 768px) {
  .bright-hero {
    padding: 7rem 2.5rem 5rem;
    min-height: 88vh;
  }
}
.bright-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--bright-hero-image, none);
  background-size: cover;
  background-position: center;
  opacity: 0.4;
}
.bright-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    var(--wp--preset--color--forest) 0%,
    color-mix(in oklab, var(--wp--preset--color--forest) 85%, transparent) 60%,
    color-mix(in oklab, var(--wp--preset--color--forest) 40%, transparent) 100%
  );
}
.bright-hero__inner {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
}
.bright-hero__title {
  max-width: 48rem;
  font-size: clamp(1.875rem, 1.25rem + 4vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0;
}
.bright-hero__cta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .bright-hero__cta { margin-top: 2.5rem; }
}

/* Kill any blockGap or root padding above the hero introduced by the WP
   layout engine — applies whether or not the body has the .home class. */
.wp-site-blocks > .bright-hero,
.wp-site-blocks > main > .bright-hero:first-child,
.wp-site-blocks > main:first-child > .bright-hero:first-child,
.bright-home > .bright-hero:first-child {
  margin-top: 0 !important;
}
.wp-site-blocks:has(> .bright-hero:first-child),
.wp-site-blocks:has(> main:first-child > .bright-hero:first-child),
.wp-site-blocks:has(> main:first-child > .bright-home > .bright-hero:first-child) {
  padding-top: 0 !important;
}

/* ── Header Home (transparent over hero) ── */
.bright-header--home {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  background-color: transparent !important;
  color: #f0edd8;
}
.bright-header--home a { color: #f0edd8 !important; text-decoration: none; }
.bright-header--home .wp-block-navigation a { color: #f0edd8 !important; }

/* ── Header Pages (sand background) ── */
.bright-header--inner {
  position: relative;
  background-color: #f0edd8 !important;
  color: #0e4550;
}
.bright-header--inner a { color: #0e4550 !important; text-decoration: none; }
.bright-header--inner .wp-block-navigation a { color: #0e4550 !important; }

/* Ensure hero Cover block sits flush behind home header */
.wp-site-blocks { padding-top: 0 !important; }
.wp-site-blocks > *:first-child { margin-block-start: 0 !important; }
