/* ==========================================================================
   Site header (frontend/layouts/felayout.blade.php)  — "Option A", 2026-11-28
   - One white row: logo | main menu | account buttons. It sticks to the top and
     shrinks (body.pfh-scrolled, set by frontend/js/header.js) once the page scrolls.
   - Menus open as cards (.pfh-dd): icon + title + one-line description.
   - Phones/tablets (< 992px): the menu moves into a slide-in drawer (.pfh-drawer),
     built by header.js from the same desktop menu, so links live in one place.
   - Class prefix pfh- on purpose: the old .navbar / .dropdown rules and the hover
     scripts in custom.js don't touch it.
   ========================================================================== */
:root {
    --pfh-green: #17a43b;
    --pfh-green-d: #11873a;
    --pfh-blue: #015caa;
    --pfh-grad: linear-gradient(90deg, #17a43b 0%, #0f9468 45%, #015caa 100%);
    --pfh-ink: #16263a;
    --pfh-muted: #66768a;
    --pfh-line: #e5eaf0;
    --pfh-tint: #eaf7ee;
    --pfh-btint: #e8f1fa;
    --pfh-shadow: 0 18px 50px -12px rgba(16, 38, 64, .28), 0 4px 14px -4px rgba(16, 38, 64, .10);
    --pfh-sticky: 70px;          /* header height once stuck; page sticky bars sit below it */
}
@media (max-width: 991px) { :root { --pfh-sticky: 66px; } }

/* ---------- email / phone chips (used in the phone drawer) ---------- */
.pfh-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: #334155; text-decoration: none; transition: color .2s; }
.pfh-chip:hover, .pfh-chip:focus { color: var(--pfh-blue); text-decoration: none; }
.pfh-chip i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--pfh-tint); color: var(--pfh-green); font-size: 12px; }
.pfh-chip.is-phone { color: var(--pfh-blue); font-weight: 700; }
.pfh-chip.is-phone i { background: var(--pfh-btint); color: var(--pfh-blue); }

/* ---------- main row ---------- */
.pfh {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--pfh-line);
    transition: box-shadow .3s, background-color .3s;
}
.pfh::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--pfh-grad); }
.pfh-row { display: flex; align-items: center; gap: 18px; height: 100px; transition: height .3s ease; }
.pfh .pf-logo-home img { height: 84px; width: auto; max-width: none; transition: height .3s ease, transform .35s ease; }
body.pfh-scrolled .pfh {
    background: rgba(255, 255, 255, .85);
    -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
    box-shadow: 0 8px 30px -12px rgba(16, 38, 64, .25);
}
body.pfh-scrolled .pfh-row { height: 68px; }
body.pfh-scrolled .pfh .pf-logo-home img { height: 54px; }
body.pfh-scrolled .pfh .pf-logo-home::after { display: none; }   /* "Home" tip would hang below the slim bar */

/* ---------- menu ---------- */
.pfh-navwrap { display: flex; align-self: stretch; margin: 0 0 0 auto; }   /* menu + search icon sit together in the middle */
.pfh-nav { display: flex; align-items: stretch; margin: 0; padding: 0; list-style: none; }
.pfh-nav > li { position: relative; display: flex; }
.pfh-nav > li.pfh-mega-li { position: relative; }   /* the Students card opens under "Students" and is only as wide as its columns */
.pfh-nav > li > a {
    display: flex; align-items: center; gap: 7px; padding: 0 17px; position: relative;
    font-family: 'texgyreadventorbold', sans-serif; font-size: 16px; text-transform: uppercase; letter-spacing: .2px;
    color: var(--pfh-ink); text-decoration: none; transition: color .2s;
}
.pfh-nav > li > a .fa { font-size: 15px; transition: transform .25s; }
.pfh-nav > li > a::after {   /* sliding underline */
    content: ""; position: absolute; left: 17px; right: 17px; bottom: 26px; height: 3px; border-radius: 3px;
    background: var(--pfh-grad); transform: scaleX(0); transform-origin: left; transition: transform .28s ease, bottom .3s ease;
}
body.pfh-scrolled .pfh-nav > li > a::after { bottom: 14px; }
.pfh-nav > li:hover > a, .pfh-nav > li.is-open > a, .pfh-nav > li.is-active > a, .pfh-nav > li > a:focus { color: var(--pfh-blue); text-decoration: none; }
.pfh-nav > li:hover > a::after, .pfh-nav > li.is-open > a::after, .pfh-nav > li.is-active > a::after { transform: scaleX(1); }
.pfh-nav > li.is-open > a .fa { transform: rotate(180deg); }

/* ---------- dropdown card ---------- */
.pfh-dd {
    position: absolute; top: 100%; left: 50%; z-index: 60;
    background: #fff; border-radius: 16px; border: 1px solid rgba(16, 38, 64, .06); box-shadow: var(--pfh-shadow);
    padding: 14px; text-align: left;
    opacity: 0; visibility: hidden; transform: translate(-50%, 10px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.pfh-dd::before {   /* caret */
    content: ""; position: absolute; top: -7px; left: var(--pfh-ax, 50%); width: 14px; height: 14px; background: #fff;
    transform: translateX(-50%) rotate(45deg); border-left: 1px solid rgba(16, 38, 64, .06); border-top: 1px solid rgba(16, 38, 64, .06);
}
.pfh-dd::after { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }   /* hover bridge */
.pfh-nav > li.is-open > .pfh-dd { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.pfh-mega-li > .pfh-dd { left: -8px; right: auto; width: max-content; transform: translateY(10px); }
.pfh-nav > li.pfh-mega-li.is-open > .pfh-dd { transform: translateY(0); }
.pfh-dd-right { left: auto; right: 0; transform: translateY(10px); }   /* account menu, at the right edge */
.pfh-acct.is-open > .pfh-dd-right { opacity: 1; visibility: visible; transform: translateY(0); }

.pfh-item {
    display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; position: relative;
    color: var(--pfh-ink); text-decoration: none; transition: background-color .18s;
}
.pfh-item::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--pfh-grad); opacity: 0; transition: opacity .18s; }
.pfh-item:hover, .pfh-item:focus, .pfh-item.is-current { background: #f2f9f4; color: var(--pfh-ink); text-decoration: none; outline: 0; }
.pfh-item:hover::before, .pfh-item:focus::before, .pfh-item.is-current::before { opacity: 1; }
.pfh-ic {
    flex: 0 0 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
    background: var(--pfh-tint); color: var(--pfh-green); font-size: 16px; transition: transform .2s, background .2s, color .2s;
}
.pfh-ic.is-blue { background: var(--pfh-btint); color: var(--pfh-blue); }
.pfh-item:hover .pfh-ic, .pfh-item:focus .pfh-ic { background: var(--pfh-grad); color: #fff; transform: scale(1.06); }
.pfh-t { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.pfh-d { display: block; font-size: 12.5px; color: var(--pfh-muted); line-height: 1.35; margin-top: 2px; font-weight: 400; }
.pfh-item:hover .pfh-t, .pfh-item:focus .pfh-t { color: var(--pfh-blue); }
.pfh-item.is-current .pfh-t { color: var(--pfh-green-d); }

/* plain list (Parents, Institutes, Updates): only as wide as its links */
.pfh-dd-list { display: grid; grid-template-columns: max-content; gap: 12px; }

/* tiles (Explore More) */
.pfh-dd-tiles { display: grid; grid-template-columns: repeat(2, 230px); gap: 8px; }
.pfh-tile { flex-direction: column; gap: 8px; border: 1px solid var(--pfh-line); padding: 14px; transition: box-shadow .2s, transform .2s, border-color .2s, background-color .2s; }
.pfh-tile::before { display: none; }
.pfh-tile .pfh-ic { flex: none; width: 38px; }
.pfh-tile:hover, .pfh-tile:focus { border-color: transparent; background: #fff; box-shadow: 0 10px 24px -10px rgba(1, 92, 170, .35); transform: translateY(-2px); }

/* two-column grid (About) */
.pfh-dd-grid { display: grid; grid-template-columns: repeat(2, 250px); gap: 2px; }
/* About: "Who we are" | "Get in touch", each column as wide as its links */
.pfh-dd-groups { display: grid; grid-template-columns: repeat(2, max-content); gap: 18px; padding: 20px; }
/* last menu item: the card lines up with the item's right edge and opens leftwards (header.js points the caret at "About") */
.pfh-nav > li > .pfh-dd--end { left: auto; right: -8px; transform: translateY(10px); }
.pfh-nav > li.is-open > .pfh-dd--end { transform: translateY(0); }

/* mega menu (Students) */
.pfh-mega { display: grid; grid-template-columns: repeat(3, max-content); gap: 18px; padding: 20px; }
.pfh-mcol + .pfh-mcol { border-left: 1px solid var(--pfh-line); padding-left: 18px; }
.pfh-mcol h6 {
    margin: 0 0 8px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--pfh-muted); font-weight: 700;
}
.pfh-mcol h6 a { color: var(--pfh-blue); font-size: 13px; letter-spacing: .2px; text-transform: none; }
.pfh-mcol h6 a:hover, .pfh-mcol h6 a:focus { text-decoration: underline; }
/* "All Assessments" under the three main ones: a lighter row with a dashed line above it */
.pfh-item--all { margin-top: 6px; border-top: 1px dashed var(--pfh-line); border-radius: 0 0 12px 12px; padding-top: 12px; }
.pfh-item--all .pfh-ic { background: transparent; border: 1.5px dashed #b9c6d3; color: var(--pfh-blue); }
.pfh-item--all .pfh-t { color: var(--pfh-blue); }
.pfh-item--all .pfh-t .fa { font-size: 13px; margin-left: 4px; transition: transform .2s; }
.pfh-item--all:hover .pfh-t .fa { transform: translateX(4px); }
.pfh-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.pfh-mini .pfh-item { align-items: center; padding: 8px 10px; }
.pfh-mini .pfh-ic { flex-basis: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
.pfh-mini .pfh-t { font-size: 14px; font-weight: 600; }

/* ---------- search: magnifier icon + panel under the header ---------- */
.pfh-search-btn {
    flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--pfh-line); background: #fff; padding: 0;
    position: relative; margin: 0 auto 0 -10px;   /* right beside About */
    display: grid; place-items: center; color: var(--pfh-ink); font-size: 17px; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, transform .2s;
}
/* hovered: above the header's coloured bottom line (.pfh::after), which otherwise ran through the tip */
.pfh-search-btn:hover, .pfh-search-btn:focus-visible { border-color: var(--pfh-blue); color: var(--pfh-blue); outline: 0; transform: scale(1.05); z-index: 5; }
/* "Search site" tip on hover, right under the button with its point touching it. Where it reaches the
   header's bottom line it sits on top of it (the button is raised above the line while hovered, see above). */
.pfh-search-btn { --pfh-tip-y: 12px; }
.pfh-search-btn::after {
    content: attr(data-tip); position: absolute; left: 50%; top: 100%; z-index: 80; pointer-events: none; white-space: nowrap;
    padding: 7px 11px; border-radius: 8px; background: var(--pfh-ink); color: #fff; font-size: 12px; font-weight: 600; line-height: 1;
    box-shadow: 0 8px 18px -8px rgba(16, 38, 64, .5);
    opacity: 0; transform: translate(-50%, calc(var(--pfh-tip-y) - 6px)); transition: opacity .18s, transform .18s;
}
.pfh-search-btn::before {
    content: ""; position: absolute; left: 50%; top: 100%; z-index: 80; pointer-events: none;
    border: 5px solid transparent; border-bottom-color: var(--pfh-ink); transform: translate(-50%, calc(var(--pfh-tip-y) - 16px)); opacity: 0; transition: opacity .18s, transform .18s;
}
.pfh-search-btn:hover::after, .pfh-search-btn:focus-visible::after { opacity: 1; transform: translate(-50%, var(--pfh-tip-y)); }
.pfh-search-btn:hover::before, .pfh-search-btn:focus-visible::before { opacity: 1; transform: translate(-50%, calc(var(--pfh-tip-y) - 10px)); }
.pfh-search-btn[aria-expanded="true"]::after, .pfh-search-btn[aria-expanded="true"]::before { display: none; }   /* search is open: no tip */
.pfh-search-btn[aria-expanded="true"] { background: var(--pfh-blue); border-color: var(--pfh-blue); color: #fff; }
.pfh-search-btn[aria-expanded="true"] .fa-search::before { content: "\f00d"; }   /* turns into a close (x) icon */
.pfh-search { position: absolute; left: 0; right: 0; top: 100%; z-index: 70; pointer-events: none; }
.pfh-search .container { position: relative; }
.pfh-search-card {
    margin: 10px 0 0 auto; width: 480px; max-width: 100%; padding: 12px; pointer-events: auto;
    background: #fff; border-radius: 16px; border: 1px solid rgba(16, 38, 64, .06); box-shadow: var(--pfh-shadow);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.pfh-search.is-open .pfh-search-card { opacity: 1; visibility: visible; transform: none; }
.pfh-search .top-search-wrapper { width: 100%; }
.pfh-search .top-search-input-box { padding: 10px 16px; border-radius: 999px; }
.pfh-search .top-search-icon { font-size: 15px; margin-right: 10px; }
.pfh-search .top-search-input { font-size: 15px; }
.pfh-search .top-search-input::placeholder { font-size: 14px; }
.pfh-search .top-search-dropdown { top: calc(100% + 10px); }

/* ---------- account buttons ---------- */
.pfh-acts { display: flex; align-items: center; gap: 10px; flex: none; }
.pfh-btn-ghost, .pfh-btn-grad {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px;
    font-weight: 700; font-size: 14px; white-space: nowrap; text-decoration: none; cursor: pointer; line-height: 1;
    transition: background .3s, color .2s, transform .2s, box-shadow .3s;
}
.pfh-btn-ghost { border: 1.5px solid var(--pfh-blue); color: var(--pfh-blue); background: #fff; }
.pfh-btn-ghost:hover, .pfh-btn-ghost:focus { background: var(--pfh-blue); color: #fff; text-decoration: none; }
.pfh-btn-grad { border: 0; color: #fff; background: var(--pfh-grad); background-size: 160% 100%; box-shadow: 0 8px 20px -8px rgba(1, 92, 170, .6); }
.pfh-btn-grad:hover, .pfh-btn-grad:focus { color: #fff; background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(1, 92, 170, .7); text-decoration: none; }
.pfh-acct { position: relative; }
.pfh-acct-btn { max-width: 220px; }
.pfh-acct-btn .pfh-name { overflow: hidden; text-overflow: ellipsis; }
.pfh-acct-btn .fa-angle-down { transition: transform .25s; }
.pfh-acct.is-open .pfh-acct-btn .fa-angle-down { transform: rotate(180deg); }
.pfh-acct .pfh-dd { width: 260px; padding: 10px; }
.pfh-acct .pfh-dd::before { left: auto; right: 34px; }
.pfh-acct form { margin: 0; }
.pfh-acct button.pfh-item { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; }
.pfh-acct button.pfh-item:hover, .pfh-acct button.pfh-item:focus { background: #fdf1f1; }
.pfh-acct button.pfh-item:hover .pfh-t, .pfh-acct button.pfh-item:focus .pfh-t { color: #dc2626; }
.pfh-acct button.pfh-item:hover .pfh-ic, .pfh-acct button.pfh-item:focus .pfh-ic { background: #dc2626; }
.pfh-acct-hello { padding: 6px 12px 10px; border-bottom: 1px solid var(--pfh-line); margin-bottom: 6px; font-size: 12px; color: var(--pfh-muted); }
.pfh-acct-hello b { display: block; color: var(--pfh-ink); font-size: 15px; }

/* ---------- burger + drawer (phones and tablets) ---------- */
.pfh-burger, .pfh-acct-mobile {
    display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--pfh-line); background: #fff;
    color: var(--pfh-ink); font-size: 20px; cursor: pointer; place-items: center; padding: 0; text-decoration: none;
}
.pfh-acct-mobile { color: var(--pfh-blue); font-size: 18px; }
.pfh-drawer-bg { position: fixed; inset: 0; background: rgba(10, 24, 40, .45); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; z-index: 1090; }
.pfh-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 88vw); background: #fff; z-index: 1091;
    transform: translateX(100%); visibility: hidden; transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility .32s;
    display: flex; flex-direction: column; box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .35);
}
body.pfh-drawer-open { overflow: hidden; }
body.pfh-drawer-open .pfh-drawer { transform: none; visibility: visible; }
body.pfh-drawer-open .pfh-drawer-bg { opacity: 1; visibility: visible; }
.pfh-dr-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--pfh-line); }
.pfh-dr-head img { height: 46px; width: auto; }
.pfh-dr-x { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--pfh-line); background: #fff; font-size: 18px; cursor: pointer; color: var(--pfh-ink); }
.pfh-dr-body { overflow-y: auto; flex: 1; padding: 8px 10px; -webkit-overflow-scrolling: touch; }
.pfh-dr-home { display: flex; align-items: center; gap: 10px; padding: 14px 10px; border-radius: 10px; font-family: 'texgyreadventorbold', sans-serif; font-size: 16px; text-transform: uppercase; color: var(--pfh-ink); text-decoration: none; }
.pfh-dr-home:hover, .pfh-dr-home:focus { background: #f4f8fc; color: var(--pfh-blue); text-decoration: none; }
.pfh-acc > button {
    width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; border-radius: 10px;
    padding: 14px 10px; font-family: 'texgyreadventorbold', sans-serif; font-size: 16px; text-transform: uppercase; color: var(--pfh-ink); cursor: pointer;
}
.pfh-acc > button .fa { transition: transform .25s; }
.pfh-acc.is-open > button { color: var(--pfh-blue); background: #f4f8fc; }
.pfh-acc.is-open > button .fa { transform: rotate(180deg); }
.pfh-acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.pfh-acc.is-open .pfh-acc-panel { grid-template-rows: 1fr; }
.pfh-acc-panel > div { overflow: hidden; }
.pfh-acc .pfh-item { padding: 9px 10px; }
.pfh-dr-foot { padding: 14px 16px; border-top: 1px solid var(--pfh-line); display: grid; gap: 8px; }
.pfh-dr-foot form { margin: 0; display: grid; }
.pfh-dr-contact { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center; padding-top: 4px; }

/* ---------- smaller desktops ---------- */
@media (max-width: 1199px) {
    .pfh-row { gap: 12px; }
    .pfh-nav > li > a { padding: 0 11px; font-size: 14.5px; }
    .pfh-nav > li > a::after { left: 11px; right: 11px; }
    .pfh-btn-ghost, .pfh-btn-grad { padding: 0 14px; font-size: 13px; }
    .pfh-acts .pfh-btn-ghost .fa-user-o { display: none; }
    .pfh-mega { padding: 16px; gap: 12px; }
    .pfh-mcol + .pfh-mcol { padding-left: 12px; }
}

/* ---------- phones & tablets: drawer instead of the menu ---------- */
@media (max-width: 991px) {
    .pfh-navwrap, .pfh-acts { display: none; }
    .pfh-row { height: 76px; }
    .pfh .pf-logo-home img { height: 58px; }
    body.pfh-scrolled .pfh-row { height: 64px; }
    body.pfh-scrolled .pfh .pf-logo-home img { height: 48px; }
    .pfh-burger, .pfh-acct-mobile { display: grid; }
    .pfh-search-btn { margin: 0 0 0 auto; width: 44px; height: 44px; border-radius: 12px; }
    .pfh-search-btn::after, .pfh-search-btn::before { display: none; }   /* no hover tip on touch screens */
    .pfh-search-card { width: auto; }
}
@media (min-width: 992px) {
    .pfh-drawer, .pfh-drawer-bg { display: none; }
}

/* custom.css puts overflow-x: hidden on html AND body, which turns body into its own scroll box
   and stops position: sticky. clip hides sideways overflow the same way without that side effect. */
@supports (overflow-x: clip) {
    html, body { overflow-x: clip; }
}

/* page bars that stick to the top now sit below the sticky header */
.ctpf-sticky-nav, .board-nav-section, .ctpfstickymenu { top: var(--pfh-sticky) !important; }
.news-sticky-sidebar, .sticky-sidebar-container, .quick-facts-card { top: calc(var(--pfh-sticky) + 20px) !important; }
html { scroll-padding-top: calc(var(--pfh-sticky) + 10px); }

@media (prefers-reduced-motion: reduce) {
    .pfh, .pfh *, .pfh-drawer, .pfh-drawer * { transition: none !important; }
}
