/* ==========================================================================
   Header Style 8 — Travel Journal
   Pairs with Footer Style 14. Loaded only when this header is active.
   Shares the footer's hand-drawn squiggle, script wordmark and serif menu.
   ========================================================================== */
@font-face {
    font-family: 'Caveat';
    src: url('../../fonts/Caveat-Bold-latin.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Playfair Display';
    src: url('../../fonts/PlayfairDisplay-Variable-latin.woff2') format('woff2-variations'),
         url('../../fonts/PlayfairDisplay-Variable-latin.woff2') format('woff2');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

header.site-header.header-style-8 {
    --eph-accent: var(--accent-fill, var(--accent));
    --eph-on-accent: #111111;
    --eph-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --eph-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='15' viewBox='0 0 60 15'%3E%3Cpath d='M0,7.5 Q15,0 30,7.5 T60,7.5' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E");
    flex-direction: column;
    align-items: stretch;
    border-bottom: 0;
}

/* Main row fills the header; the squiggle sits underneath as its own row */
.header-style-8 .header-inner { flex: 1; height: auto; min-height: 0; justify-content: space-between; }
.header-style-8 .logo { flex: 1; justify-content: flex-start; }
.header-style-8 .nav-menu { flex: 2; justify-content: center; }
.header-style-8 .header-actions { flex: 1; justify-content: flex-end; }

.eph-wave {
    flex: 0 0 auto;
    height: 14px;
    margin-top: -4px;
    background: var(--eph-accent);
    -webkit-mask: var(--eph-wave) repeat-x 0 50% / 60px 15px;
            mask: var(--eph-wave) repeat-x 0 50% / 60px 15px;
    pointer-events: none;
}

/* --- Wordmark (used when no logo image is set) --- */
.header-style-8 .eph-wordmark { display: inline-flex; flex-direction: column; line-height: 1; color: var(--text-main); }
.header-style-8 .eph-wordmark span { color: inherit; }
.header-style-8 .eph-script { font-family: 'Caveat', 'Segoe Script', cursive; font-size: 34px; font-weight: 700; line-height: .85; letter-spacing: 0; }
.header-style-8 .eph-sub {
    position: relative; padding-left: 13px; margin-top: 3px;
    font-family: 'Montserrat', var(--font-body, sans-serif); font-size: 12px; font-weight: 700;
    letter-spacing: 4px; text-transform: uppercase;
}
.header-style-8 .eph-sub::before {
    content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -4px;
    border-radius: 50%; background: var(--eph-accent);
}

/* --- Serif menu with a squiggle under the hovered / current item --- */
.header-style-8 .ep-main-menu { gap: 30px; }
.header-style-8 .ep-main-menu > li > a { font-family: var(--eph-serif) !important; letter-spacing: .2px; }
.header-style-8 .ep-main-menu > li > a .ep-menu-title { position: relative; }
.header-style-8 .ep-main-menu > li > a .ep-menu-title::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 6px;
    width: auto; border-radius: 0;
    background: var(--eph-accent);
    -webkit-mask: var(--eph-wave) repeat-x 0 50% / 20px 6px;
            mask: var(--eph-wave) repeat-x 0 50% / 20px 6px;
    opacity: 0; transform: translateY(3px);
    transition: opacity .25s ease, transform .25s ease;
}
.header-style-8 .ep-main-menu > li:hover > a .ep-menu-title::after,
.header-style-8 .ep-main-menu > li.current-menu-item > a .ep-menu-title::after,
.header-style-8 .ep-main-menu > li.current-menu-ancestor > a .ep-menu-title::after {
    opacity: 1; transform: none;
}
.header-style-8 .ep-main-menu > li > a::before { display: none; } /* neutralise the pill hover style */

/* --- Call-to-action button (matches the footer's "Start Your Journey") --- */
.header-style-8 .eph-cta {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    margin-left: 6px; padding: 10px 18px; border-radius: 4px;
    background: var(--eph-accent); color: var(--on-accent-fill, var(--eph-on-accent)) !important;
    font-family: 'Montserrat', var(--font-body, sans-serif); font-size: 14px; font-weight: 700; line-height: 1;
    white-space: nowrap; transition: filter .2s, transform .2s;
}
.header-style-8 .eph-cta:hover { filter: brightness(.94); transform: translateY(-1px); }
.header-style-8 .eph-cta i { font-size: 16px; }

@media (max-width: 1200px) {
    .header-style-8 .ep-main-menu { gap: 22px; }
}
@media (max-width: 992px) {
    .header-style-8 .eph-cta { display: none; }
    .header-style-8 .logo { flex: 0 1 auto; }
    .header-style-8 .eph-script { font-size: 30px; }
    .header-style-8 .eph-sub { font-size: 11px; letter-spacing: 3px; }
}

@media (prefers-reduced-motion: reduce) {
    .header-style-8 .ep-main-menu > li > a .ep-menu-title::after { transition: none; }
}

/* Submenu — Travel Journal: paper card with a pointer, serif links and a sliding arrow */
[data-submenu="match"] .header-style-8 .ep-main-menu .sub-menu { min-width: 240px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); border-radius: 14px; background: var(--submenu-bg, color-mix(in srgb, var(--accent) 5%, var(--bg-card, #fff))); box-shadow: 0 24px 50px rgba(31, 41, 55, .12); }
[data-submenu="match"] .header-style-8 .ep-main-menu > li > .sub-menu { margin-top: 10px; }
[data-submenu="match"] .header-style-8 .ep-main-menu > li > .sub-menu::before { content: ''; position: absolute; top: -7px; left: 26px; width: 12px; height: 12px; border-top: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); border-left: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); background: inherit; transform: rotate(45deg); }
[data-submenu="match"] .header-style-8 .ep-main-menu > li > .sub-menu::after { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
[data-submenu="match"] .header-style-8 .ep-main-menu .sub-menu a { position: relative; padding: 10px 12px 10px 14px; border-radius: 8px; font-family: var(--eph-serif); font-size: 16px; font-weight: 600; letter-spacing: .1px; }
[data-submenu="match"] .header-style-8 .ep-main-menu .sub-menu a::before { content: '\2192'; position: absolute; left: 10px; opacity: 0; color: var(--accent-text, var(--accent)); font-family: var(--font-body, sans-serif); transform: translateX(-6px); transition: opacity .25s, transform .25s; }
[data-submenu="match"] .header-style-8 .ep-main-menu .sub-menu a:hover { padding-left: 34px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--submenu-hover-text, var(--text-main)); }
[data-submenu="match"] .header-style-8 .ep-main-menu .sub-menu a:hover::before { opacity: 1; transform: none; }
