/**
 * Site header — owned styling, no iCreate coupling.
 *
 * Layout (≥992 px): single horizontal row over the slider/banner.
 *
 *   [crest + diocese text]        [nav items]   [social] [DONATE] [search]
 *
 * Mobile: collapses to a dark band with logo + hamburger.
 */

/* WordPress accessibility helper — visually hidden but accessible to screen
 * readers. iCreate doesn't ship this so we add it ourselves. */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}
/* Skip-to-content link — hidden until tab-focused. iCreate's CSS made the
 * wrapper position:fixed and visible; we override that. */
body #skipContentWrapper {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    z-index: 10000;
}
body #skipContentWrapper:focus-within {
    position: fixed !important;
    left: 1rem !important;
    top: 1rem !important;
}
.skipContent {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #b80c09;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
}

/* Reset iCreate's default-state hides for elements we use. */
#donateButton,
#socialNav,
#mainNav {
    display: revert;
}

/* Header overlays the slider/banner area. Total height ~139 px to match mirror. */
header.nocontent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    padding: 0.6rem 2rem;
    background: transparent;
    /* note: NOT pointer-events:none — the dropdown div needs to receive
     * mouse events so :hover stays active on its <li> ancestor. */
}

/* Drop iCreate's container behaviour — own width/centering. */
header.nocontent > .ic-container-fluid {
    all: unset;
}

#headerInner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

/* Left: crest + diocese text in one piece (image already contains both) */
#headerLeft {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}
#headerLeft .mobileNav { display: none; }
#logo {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
}
#logo img {
    width: 450px;
    height: auto;
    max-width: 100%;
    display: block;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
}

/* Right column: 2 rows (top = social+donate, bottom = nav) */
#headerRight {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.4rem;
    min-width: 0;
}

#topNavContainer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

/* Nav comes first in visual order (after logo, before social/donate) */
#mainNav {
    display: block !important;
    position: static !important;
    margin: 0 !important;
    width: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    flex: 0 1 auto;
}
#mainNav > #nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}
#mainNav > #nav > li {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}
#mainNav > #nav > li > a.mainNavItem {
    display: block;
    padding: 0.4rem 0.9rem;
    font-family: 'Open Sans Condensed', 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.15;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}
#mainNav > #nav > li:hover > a.mainNavItem,
#mainNav > #nav > li > a.mainNavItem:focus {
    border-bottom-color: #edb614;
    color: #fff;
}

/* Social icons */
#socialNav {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
}
#socialNav a {
    display: inline-flex;
    line-height: 0;
}
#socialNav img {
    width: 32px;
    height: 32px;
    display: block;
    border-radius: 4px;
}

/* DONATE pill — gold background, black text. Sized to mirror (~150×50, 18 px) */
#donateButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    height: 50px;
    padding: 0 1.5rem;
    background: #edb614;
    color: #1a1a1a;
    font-family: 'Open Sans Condensed', 'Open Sans', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 1.125rem;       /* 18 px */
    line-height: 1;
    text-decoration: none;
    border-radius: 0;
    clip-path: polygon(0 0, 100% 0, 100% 65%, 88% 100%, 0 100%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: filter 0.15s;
}
#donateButton:hover,
#donateButton:focus {
    filter: brightness(0.92);
    color: #1a1a1a;
    text-decoration: none;
}

/* Search button — minimal pill */
#mainNav .searchBtn,
#nav #navTab05 .searchBtn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    padding: 0.35rem 0.55rem;
    margin-left: 0.35rem;
    cursor: pointer;
    color: #fff;
    line-height: 1;
}
#mainNav .searchBtn::before,
#nav #navTab05 .searchBtn::before {
    content: "🔍";
    font-size: 0.95rem;
}
#mainNav .searchBtn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Dropdowns appear on hover */
body #mainNav > #nav > li > .dropDownContainer.sf-mega {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    z-index: 50;
    min-width: 720px;
    margin-top: 0.5rem;
    background: #fff;
    border: 1px solid #d7d7d7;
    border-top: 3px solid #edb614;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    padding: 1.25rem 1.5rem;
}
body #mainNav > #nav > li:hover > .dropDownContainer.sf-mega,
body #mainNav > #nav > li:focus-within > .dropDownContainer.sf-mega {
    display: block !important;
}
body #mainNav > #nav > li#navTab03 > .dropDownContainer.sf-mega,
body #mainNav > #nav > li#navTab04 > .dropDownContainer.sf-mega {
    left: auto;
    right: 0;
}
.dropDownContainerInner {
    display: flex;
    gap: 1.75rem;
    align-items: flex-start;
}
#mainNav .dropdown {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 33%;
}
#mainNav .dropdown li {
    margin: 0;
    padding: 0.3rem 0;
}
#mainNav .dropdown a {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.35;
    display: block;
}
#mainNav .dropdown a:hover,
#mainNav .dropdown a:focus {
    color: #b80c09;
    text-decoration: underline;
}
#mainNav .viewMore {
    display: inline-block;
    margin-top: 0.6rem;
    font-weight: 700;
    color: #b80c09;
    text-decoration: none;
}

/* Mobile (< 992 px) */
@media (max-width: 991px) {
    header.nocontent {
        position: relative;
        background: #1a1a1a;
        padding: 0.85rem 1rem;
    }
    #headerInner { gap: 1rem; }
    #logo img { width: 240px; }
    #headerLeft .mobileNav {
        display: inline-flex;
        gap: 0.5rem;
        margin-left: auto;
    }
    #headerLeft .mobileNav img { width: 28px; height: 28px; }
    #headerRight { display: none !important; }
}
