/*
Theme Name: Raydiant
Author: Forcefield Web Development
Author URI: https://forcefieldnc.com
Version: 1.0
Description: Custom theme for Raydiant Oximetry. Built on Forcefield Stratum.
*/

/* ── Fonts ── */
@font-face { font-family: 'Poppins'; src: url('fonts/poppins-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/poppins-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/poppins-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/poppins-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/poppins-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }

/* ── Tokens (see _handoff/design-tokens.md) ── */
:root {
    --navy: #252A4C;
    --teal: #1FCCBE;
    --violet: #AC81F2;
    --violet-deep: #6F4FE8;
    --paper: #FAFCFD;
    --ice: #EDF5F8;
    --lavender: #EDE9FF;
    --white: #FFFFFF;

    --text-strong: rgba(37, 42, 76, 0.82);
    --text: rgba(37, 42, 76, 0.72);
    --text-muted: rgba(37, 42, 76, 0.68);
    --text-quiet: rgba(37, 42, 76, 0.56);
    --line: rgba(37, 42, 76, 0.11);
    --line-strong: rgba(37, 42, 76, 0.18);

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Poppins', Helvetica, Arial, sans-serif;

    --page-gutter: clamp(1.5rem, 8vw, 9rem);
    --section-y: clamp(4.5rem, 7vw, 7rem);
    /* Exact fixed-header height: vertical padding plus the CTA pill.
       Sections add their own top padding on top of this. */
    --nav-height: 5.4rem;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; }

/* ── Base ── */
html {
    /* No elastic overscroll bounce above the fixed header. Also disables
       Chrome-Android pull-to-refresh, which is fine for a marketing site. */
    overscroll-behavior-y: none;
    background: var(--paper);
    scroll-behavior: smooth;
}
html.nav-locked { overflow: hidden; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.65;
    color: var(--navy);
    background: var(--paper);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 300;
    line-height: 1.15;
}

h1 { font-size: clamp(2.3rem, 3vw, 3.6rem); }
h2 { font-size: clamp(2rem, 2.6vw, 3rem); }
h3 { font-size: clamp(1.45rem, 2vw, 2rem); }
h4 { font-size: 1.25rem; }

p + p { margin-top: 1em; }

:focus-visible {
    outline: 2px solid var(--violet-deep);
    outline-offset: 4px;
}

/* Small violet label above a hero headline. */
.eyebrow {
    margin-bottom: 1.4rem;
    color: var(--violet);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Teal accent word inside headlines (ff_headline turns <strong> into this). */
.accent { color: var(--teal); }

/* Scroll-in. main.js adds .is-visible; reduced motion shows everything. */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 700ms ease, transform 700ms ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* Anchored sections (/#technology from the nav) land below the fixed header. */
[id] { scroll-margin-top: var(--nav-height); }

/* The header is fixed, so page content starts below it. The homepage is
   exempt: its hero sits under the glass and handles its own offset. */
#main { padding-top: var(--nav-height); }
.home #main { padding-top: 0; }

/* ── Container ── */
.ff-container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 var(--page-gutter);
}

/* ── Buttons ── */
.ff-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0 1.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.11em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.ff-btn-primary {
    background: var(--navy);
    color: var(--white);
}
.ff-btn-primary:hover { background: var(--violet-deep); }

.ff-btn-outline {
    border-color: var(--line-strong);
    color: var(--navy);
}
.ff-btn-outline:hover {
    border-color: var(--navy);
    background: var(--navy);
    color: var(--white);
}

/* ── Skip Link ── */
.ff-skip-link {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal;
}
.ff-skip-link:focus {
    clip: auto;
    display: block;
    height: auto;
    width: auto;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100000;
    padding: 15px 23px;
    background: var(--white);
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 0 2px 2px rgba(37, 42, 76, .3);
}

/* ── Accessibility ── */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal;
}

/* ── Header ── */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.55rem var(--page-gutter) 1.35rem;
}

/* The glass lives on a pseudo-element: backdrop-filter on the header itself
   would make it the containing block for the fixed mobile drawer and overlay. */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(37, 42, 76, 0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 280ms ease, border-color 280ms ease;
}

/* On the home page the nav floats over the hero. */
.home .site-header::before {
    background: rgba(255, 255, 255, 0.18);
    border-bottom-color: rgba(37, 42, 76, 0.04);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}
.home .site-header.is-scrolled::before {
    background: rgba(255, 255, 255, 0.28);
    border-bottom-color: rgba(37, 42, 76, 0.045);
}

.brand { flex-shrink: 0; }
.brand img {
    width: clamp(176px, 14vw, 285px);
    height: auto;
}

.site-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0 auto;
}

.primary-menu a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 180ms ease;
}
.primary-menu a:hover { color: var(--navy); }
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-ancestor > a { color: var(--violet); }

.nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.45rem;
    padding: 0 1rem;
    border: 1px solid rgba(37, 42, 76, 0.14);
    border-radius: 999px;
    color: var(--navy);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.12);
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.nav-cta:hover {
    border-color: var(--navy);
    background: var(--navy);
    color: var(--white);
}

/* Dropdowns: hover on pointer devices, focus-within for keyboards. */
.menu-item-has-children { position: relative; }

.menu-item-has-children > a::after {
    content: '';
    width: 0.38rem;
    height: 0.38rem;
    margin-top: -0.18rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 180ms ease;
}

.sub-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 50%;
    z-index: 200;
    min-width: 14.5rem;
    padding: 0.55rem;
    border: 1px solid rgba(37, 42, 76, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 48px rgba(37, 42, 76, 0.13);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -0.35rem);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}
/* Invisible bridge so the pointer can cross the gap without closing it. */
.sub-menu::before {
    content: '';
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    height: 0.8rem;
}

.sub-menu a {
    display: block;
    padding: 0.72rem 0.8rem;
    border-radius: 7px;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.35;
    text-transform: none;
}
.sub-menu a:hover,
.sub-menu a:focus-visible {
    background: rgba(237, 233, 255, 0.72);
    color: var(--violet-deep);
    outline: none;
}

.menu-item-has-children:hover > .sub-menu,
.menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
.menu-item-has-children:hover > a::after,
.menu-item-has-children:focus-within > a::after {
    transform: translateY(0.18rem) rotate(225deg);
}

/* ── Footer ── */
.site-footer {
    padding: 2rem clamp(1.5rem, 6vw, 7rem) 1.15rem;
    background: var(--navy);
    color: rgba(255, 255, 255, 0.78);
}
.site-footer a { transition: color 180ms ease; }
.site-footer a:hover,
.site-footer a:focus-visible { color: var(--teal); }
.site-footer :focus-visible { outline-color: var(--teal); }

.footer-grid {
    display: grid;
    grid-template-columns: minmax(13rem, 1.5fr) repeat(3, minmax(8rem, 0.7fr));
    gap: clamp(1.25rem, 3vw, 3.5rem);
    align-items: start;
}

.footer-brand { width: fit-content; }
.footer-brand img {
    width: min(100%, 13.25rem);
    height: auto;
}

.footer-heading {
    margin-bottom: 0.55rem;
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.footer-links {
    display: grid;
    gap: 0.28rem;
}
.footer-links a,
.footer-location {
    font-size: 0.76rem;
    line-height: 1.55;
}
/* WordPress menus: the legal row is bare anchors, columns are lists. */
.footer-links li { margin: 0; }

.footer-disclosure {
    max-width: 16rem;
    margin-top: 2.4rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.56rem;
    line-height: 1.55;
}

.footer-bottom {
    display: grid;
    grid-template-columns: minmax(20rem, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-caution {
    font-size: 0.75rem;
    line-height: 1.55;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem 1rem;
    font-size: 0.65rem;
    white-space: nowrap;
}

/* Logged in: sit below the WordPress admin bar (32px, 46px under 783px). WP adds
   matching scroll-padding, so anchors line up with the header's visible edge. */
.admin-bar .site-header { top: 32px; }
.admin-bar .site-nav { top: 32px; }
@media (max-width: 782px) {
    .admin-bar .site-header,
    .admin-bar .site-nav { top: 46px; }
}

/* Hamburger, close, overlay: desktop hides all three. */
.nav-toggle,
.nav-close,
.nav-overlay { display: none; }

/* ── Responsive ── */
@media (max-width: 1200px) {
    :root { --nav-height: 4.75rem; }

    .site-header { padding: 1rem 1.5rem; }
    .brand img { width: 152px; }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        margin-right: -10px;
        padding: 0;
        border: 0;
        background: none;
        cursor: pointer;
    }
    .nav-toggle span {
        display: block;
        width: 22px;
        height: 1.5px;
        margin: 0 auto;
        background: var(--navy);
    }

    .site-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 300;
        width: min(22rem, 100%);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 5rem 2rem 2.5rem;
        background: var(--white);
        box-shadow: -26px 0 70px rgba(37, 42, 76, 0.12);
        overflow-y: auto;
        visibility: hidden;
        transform: translateX(100%);
        transition: transform 280ms ease, visibility 280ms;
    }
    .nav-open .site-nav {
        visibility: visible;
        transform: none;
        /* Visible at once so the close button can take focus mid-slide. */
        transition: transform 280ms ease, visibility 0s;
    }

    .nav-close {
        display: block;
        position: absolute;
        top: 1.25rem;
        right: 1.25rem;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        background: none;
        color: var(--navy);
        font-size: 1.1rem;
        cursor: pointer;
    }

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 250;
        background: rgba(37, 42, 76, 0.32);
        opacity: 0;
        visibility: hidden;
        transition: opacity 280ms ease, visibility 280ms;
    }
    .nav-open .nav-overlay {
        opacity: 1;
        visibility: visible;
    }

    .primary-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
    }
    .primary-menu > li { border-bottom: 1px solid var(--line); }
    .primary-menu > li > a {
        padding: 1.1rem 0;
        font-size: 0.8rem;
    }
    .menu-item-has-children > a::after { display: none; }

    /* Sub-items stay open and indented inside the drawer. */
    .sub-menu {
        position: static;
        min-width: 0;
        padding: 0 0 0.9rem 1rem;
        border: 0;
        border-radius: 0;
        background: none;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }
    /* The desktop hover rule is more specific than the reset above. */
    .menu-item-has-children:hover > .sub-menu,
    .menu-item-has-children:focus-within > .sub-menu { transform: none; }
    .sub-menu::before { display: none; }
    .sub-menu a {
        padding: 0.45rem 0;
        border-radius: 0;
        color: var(--text);
        font-size: 0.8rem;
    }
    .sub-menu a:hover { background: none; }

    .nav-cta {
        margin-top: 2rem;
        min-height: 3rem;
        background: var(--navy);
        border-color: var(--navy);
        color: var(--white);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }

    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
    .footer-bottom { grid-template-columns: 1fr; }
    .footer-legal { justify-content: flex-start; }
}

@media (max-width: 480px) {
    :root { --nav-height: 4.45rem; }
    .site-header { padding: 0.85rem 1.25rem; }

    .site-footer { padding: 1.6rem 1.5rem 1rem; }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }
    .footer-brand { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .site-nav, .nav-overlay, .sub-menu { transition: none; }
}
