/**
 * MarinePhD design tokens — single ocean gradient system.
 * Source of truth = homepage hero (assistant-hero.css).
 * Perf: variables + CSS only; no webfont network requests.
 */

:root {
    --mphd-navy-950: #061a2c;
    --mphd-navy-900: #0a3352;
    --mphd-navy-800: #0f4668;
    --mphd-cyan-700: #0e7490;
    --mphd-cyan-600: #0891b2;
    --mphd-foam-400: #5eead4;
    --mphd-foam-200: #e0f2fe;
    --mphd-mist-50: #f0f7fa;
    --mphd-mist-100: #e8f2f6;
    --mphd-ink: #143047;
    --mphd-coral: #e85d4c;
    --mphd-coral-dark: #c94839;
    --mphd-surface: #ffffff;
    --mphd-shadow: 0 10px 28px rgba(10, 51, 82, 0.12);

    --mphd-font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
    --mphd-font-body: Tahoma, "Segoe UI", Candara, "Trebuchet MS", sans-serif;

    /* Canonical ocean fill — same as hero */
    --mphd-ocean-gradient:
        radial-gradient(ellipse 70% 55% at 50% 0%, rgba(94, 234, 212, 0.18), transparent 55%),
        linear-gradient(165deg, #061a2c 0%, #0a3352 38%, #0e7490 78%, #0f4668 100%);
    --mphd-ocean-gradient-simple: linear-gradient(165deg, #061a2c 0%, #0a3352 38%, #0e7490 78%, #0f4668 100%);
    --mphd-ocean-gradient-btn: linear-gradient(135deg, #0a3352 0%, #0e7490 55%, #0891b2 100%);
    --mphd-ocean-gradient-btn-hover: linear-gradient(135deg, #061a2c 0%, #0a3352 45%, #0e7490 100%);

    /* White wave that cuts a dark fill (hero ::after pattern) */
    --mphd-wave-cut-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' d='M0 24c120 16 240-16 360 0s240 24 360 8 240-24 360-8 240 24 360 8v16H0z'/%3E%3C/svg%3E");
    --mphd-wave-cut-mist: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath fill='%23f0f7fa' d='M0 24c120 16 240-16 360 0s240 24 360 8 240-24 360-8 240 24 360 8v16H0z'/%3E%3C/svg%3E");

    --mphd-brand: var(--mphd-cyan-700);
    --mphd-brand-deep: var(--mphd-navy-900);
    --mphd-brand-hover: var(--mphd-navy-800);

    /* Remap legacy agri / teal tokens used across ssr-common + cards */
    --primary-dark-green: #0a3352;
    --secondary-dark-green: #061a2c;
    --accent-green: #0e7490;
    --gradient-bg: var(--mphd-ocean-gradient-simple);
    --gradient-hero: var(--mphd-ocean-gradient-btn);
}

html {
    color-scheme: light;
}

body {
    font-family: var(--mphd-font-body);
    color: var(--mphd-ink);
    background: #ffffff;
}

h1, h2, h3,
.hero-title,
.home-country-carousel__title,
.home-field-carousel__title,
.ai-nav-panel__title {
    font-family: var(--mphd-font-display);
    letter-spacing: -0.01em;
    color: var(--mphd-navy-900);
}

a {
    color: var(--mphd-cyan-700);
}

a:hover,
a:focus-visible {
    color: var(--mphd-navy-800);
}

/* ── Primary buttons (same ocean gradient everywhere) ─────────── */

.button,
.btn,
button.button,
.wp-block-button__link,
.read-more-btn,
.ai-nav-panel__submit,
.assistant-hero-form__submit,
.ssr-scholarship-filter__submit,
.ssr-scholarship-filter button[type="submit"],
.filter-section button[type="submit"],
.header-search-corner .search-box__submit-button,
.aff-category-banner__cta.button,
.aff-category-banner .button.aff-category-banner__cta,
.aff-inline-card__cta.button:not(.aff-inline-card__cta--secondary),
.home-country-carousel__all,
.home-field-carousel__all,
.op-card-cta,
.op-overview-panel__btn--primary,
.summary-cta-modern .cta-button,
.cta-section .button,
a.read-more-btn {
    background: var(--mphd-ocean-gradient-btn) !important;
    background-color: #0e7490 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 14px rgba(10, 51, 82, 0.22) !important;
    text-decoration: none !important;
}

.button:hover,
.btn:hover,
button.button:hover,
.wp-block-button__link:hover,
.read-more-btn:hover,
.ai-nav-panel__submit:hover,
.ai-nav-panel__submit:focus-visible,
.assistant-hero-form__submit:hover,
.ssr-scholarship-filter__submit:hover,
.filter-section button[type="submit"]:hover,
.header-search-corner .search-box__submit-button:hover,
.aff-category-banner__cta.button:hover,
.aff-inline-card__cta.button:not(.aff-inline-card__cta--secondary):hover,
.home-country-carousel__all:hover,
.home-field-carousel__all:hover,
.op-overview-panel__btn--primary:hover,
.summary-cta-modern .cta-button:hover,
.cta-section .button:hover,
a.read-more-btn:hover {
    background: var(--mphd-ocean-gradient-btn-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(6, 26, 44, 0.28) !important;
}

/* Outline “All countries” style stays light but ocean-bordered */
.home-country-carousel__all,
.home-field-carousel__all,
.aff-inline-card__cta--secondary.button {
    background: #ffffff !important;
    color: var(--mphd-navy-900) !important;
    border: 1px solid rgba(14, 116, 144, 0.35) !important;
    box-shadow: none !important;
}

.aff-inline-card__cta--secondary.button:hover,
.aff-inline-card__cta--secondary.button:focus-visible {
    background: #f0f9ff !important;
    color: var(--mphd-navy-900) !important;
    border-color: rgba(14, 116, 144, 0.55) !important;
    box-shadow: none !important;
}

.home-country-carousel__all:hover,
.home-field-carousel__all:hover {
    background: var(--mphd-ocean-gradient-btn) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

/* ── Internal AI strip + page title hero (must match homepage ocean) ─ */

.ai-nav-strip {
    background: var(--mphd-ocean-gradient-simple) !important;
    border-bottom-color: rgba(94, 234, 212, 0.22) !important;
    box-shadow: 0 8px 24px rgba(10, 51, 82, 0.18) !important;
}

.hero-section:not(.hero-section--ai),
.category-page .hero-section,
.tag-page .hero-section,
.search-page .hero-section,
.single .hero-section,
.sch-seo-page .hero-section,
.sch-seo-landing .hero-section,
.aff-country .hero-section,
.aff-city .hero-section,
.aff-hub .hero-section,
.sch-about-page .hero-section,
.sch-guides-page .hero-section,
body.vacancy-catalog-shell .hero-section,
body.open-phd-positions-archive .hero-section {
    background: var(--mphd-ocean-gradient) !important;
    overflow: hidden;
}

.hero-section:not(.hero-section--ai)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 36px;
    z-index: 2;
    pointer-events: none;
    background: var(--mphd-wave-cut-white) center bottom / 100% 100% no-repeat;
}

/*
 * Inner title heroes: optically center H1 in the dark band.
 * Extra bottom padding equals the 36px wave so the glyphs sit higher.
 */
.hero-section:not(.hero-section--ai) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 1.15rem !important;
    padding-bottom: calc(1.15rem + 36px) !important;
}

.hero-section:not(.hero-section--ai) .container {
    padding-top: 0;
    padding-bottom: 0;
    width: 100%;
}

.hero-section:not(.hero-section--ai) .hero-title,
.hero-section:not(.hero-section--ai) h1.hero-title,
.hero-section:not(.hero-section--ai) .hero-subtitle,
.sch-seo-page .hero-section .hero-title,
.sch-seo-page .hero-section h1.hero-title,
.sch-seo-page .hero-section .hero-subtitle,
.sch-contacts-page .hero-section .hero-title,
.sch-contacts-page .hero-section .hero-subtitle {
    margin: 0 !important;
    color: #ffffff !important;
}

.hero-section:not(.hero-section--ai) .hero-subtitle {
    margin-top: 0.65rem !important;
    opacity: 0.95;
}

/* ── Header (all pages) — white bar above AI strip / hero, like homepage ─ */

.site-header,
.header-main,
#header-grid,
.header--row,
.header-main-inner,
body.has-ai-nav-strip .site-header,
body.has-ai-nav-strip .header-main,
body.has-ai-nav-strip #header-grid {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(14, 116, 144, 0.12) !important;
    color: var(--mphd-ink) !important;
}

.site-header a,
#header-grid a,
.nav-ul > li > a,
.header--row a {
    color: var(--mphd-navy-900) !important;
}

.site-header a:hover,
#header-grid a:hover {
    color: var(--mphd-cyan-700) !important;
}

/* Logo is dark SVG — never invert on white header */
.marinephd-logo-lockup,
.custom-logo.marinephd-logo-lockup,
.site-header .custom-logo,
#header-grid .custom-logo {
    filter: none !important;
    opacity: 1 !important;
}

/* Neve duplicate title/tagline (Funded PhD…) must never sit on brand stack */
.nv-title-tagline-wrap,
#header-grid .nv-title-tagline-wrap,
.site-header .nv-title-tagline-wrap,
.site-header .site-branding,
#header-grid .site-branding {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ── Footer — same ocean gradient ─────────────────────────────── */

.site-footer,
footer#site-footer,
.footer,
.custom-react-footer,
.footer-bottom {
    background: var(--mphd-ocean-gradient-simple) !important;
    color: var(--mphd-foam-200) !important;
}

.site-footer a,
footer#site-footer a,
.footer a,
.custom-react-footer a,
.footer-bottom a {
    color: var(--mphd-foam-400) !important;
}

.site-footer a:hover,
footer#site-footer a:hover,
.footer a:hover {
    color: #ffffff !important;
}

/* Footer top edge = white wave cutting dark ocean fill (hero pattern, flipped) */
.site-footer,
footer#site-footer,
.custom-react-footer {
    position: relative;
    margin-top: 2.5rem;
    padding-top: 2.75rem !important;
    overflow: hidden;
}

.site-footer::before,
footer#site-footer::before,
.custom-react-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 40px;
    pointer-events: none;
    background: var(--mphd-wave-cut-white) center top / 100% 100% no-repeat;
    transform: scaleY(-1);
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
