/* Shared site header: identical on every page */

/* The menu always stays on one line. Between phone and laptop widths it becomes the ☰ menu instead of wrapping. */
@media (min-width: 600px) and (max-width: 1023px) {
    header.wp-block-template-part .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
    header.wp-block-template-part .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
header.wp-block-template-part .superbthemes-navigation-004-columns-nav .wp-block-navigation { justify-content: flex-end; }
header.wp-block-template-part .wp-block-navigation__responsive-container-open { margin-left: auto; }

/* On Elementor pages, the header sits edge to edge like everywhere else */
.elementor-widget-shortcode header.wp-block-template-part { width: 100%; }

/* v1.0.1: Superb Addons page template adds <hr> lines around Elementor content; they push the header down */
body[class*="page-template-superbaddons"] hr:has(+ .elementor),
body[class*="page-template-superbaddons"] .elementor + hr,
body.page-template-elementor_header_footer hr:has(+ .elementor),
body.page-template-elementor_header_footer .elementor + hr { display: none; }

/* v1.0.3: clear "you are here" marker in the menu, on every page (Elementor pages included) */
header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item.current-menu-item > a.wp-block-navigation-item__content,
header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item.current-menu-item > a.wp-block-navigation-item__content:hover {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 9px !important;
}
header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item:not(.current-menu-item) > a.wp-block-navigation-item__content { opacity: 0.72; transition: opacity 0.2s ease; }
header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item:not(.current-menu-item) > a.wp-block-navigation-item__content:hover { opacity: 1; }

/* v1.0.5: small page title under the menu */
header.wp-block-template-part .atw-page-label {
    max-width: none;
    margin: 0 !important;
    padding: 0 calc(2 * clamp(30px, 6vw, 60px)) 10px;
    box-sizing: border-box;
}
header.wp-block-template-part .atw-page-label span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #1C1917;
}
header.wp-block-template-part .atw-page-label span::before {
    content: "";
    width: 28px;
    height: 2px;
    background: currentColor;
}

/* v1.0.7: phones use a 20px side margin everywhere (header, page title, content) */
@media (max-width: 600px) {
    header.wp-block-template-part .wp-block-group.alignfull { padding-left: 0 !important; padding-right: 0 !important; }
    header.wp-block-template-part .wp-block-columns.alignwide { padding-left: 20px !important; padding-right: 20px !important; }
    header.wp-block-template-part .atw-page-label { padding-left: 20px; padding-right: 20px; }
}

/* v1.0.8: on Elementor pages the box holding the header measured itself too short, so content slid up under it */
.e-con:has(> .elementor-widget-shortcode header.wp-block-template-part),
.e-con:has(> .e-con-inner > .elementor-widget-shortcode header.wp-block-template-part) { display: block !important; }

/* v1.1.0: account button (Log in / Hi, name) */
header.wp-block-template-part .wp-block-column:has(> .atw-account) { display: flex !important; align-items: center; justify-content: flex-end; gap: clamp(12px, 2vw, 28px); }
header.wp-block-template-part .wp-block-column:has(> .atw-account) > nav { flex: 0 1 auto; }
.atw-account { position: relative; flex: 0 0 auto; font-family: "DM Sans", sans-serif; }
.atw-account > summary { list-style: none; }
.atw-account > summary::-webkit-details-marker { display: none; }
.atw-account-btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
    padding: 8px 16px; border: 1px solid #1C1917; border-radius: 999px;
    font-size: 14px; font-weight: 600; line-height: 1; color: #1C1917; background: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}
.atw-account-btn:hover, .atw-account[open] > .atw-account-btn { background: #1C1917; color: #F2EDE5; }
.atw-account-label { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atw-account-menu {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 100050; width: 270px;
    padding: 10px; background: #fff; border: 1px solid rgba(28, 25, 23, 0.1); border-radius: 16px;
    box-shadow: 0 16px 40px rgba(28, 25, 23, 0.14); text-align: left;
}
.atw-account-head { margin: 4px 8px 8px !important; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #71717A; }
.atw-account-opt { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; text-decoration: none !important; color: #1C1917 !important; }
.atw-account-opt:hover { background: #F6F1EA; }
.atw-account-opt strong { font-size: 15px; font-weight: 600; }
.atw-account-opt span { font-size: 12.5px; color: #71717A; }
.atw-account-foot { margin: 6px 12px 4px !important; padding-top: 10px; border-top: 1px solid rgba(28, 25, 23, 0.08); font-size: 13.5px; color: #52525B; }
.atw-account-foot a { color: #1C1917 !important; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 600px) {
    .atw-account-btn { padding: 8px; border-radius: 50%; }
    .atw-account-label { display: none; }
    .atw-account-menu { position: fixed; left: 12px; right: 12px; top: auto; width: auto; margin-top: 10px; }
}

/* v1.2.0: slimmer header on every page (smaller logo, less padding) */
header.wp-block-template-part .superbthemes-navigation-004 { padding-top: 10px !important; padding-bottom: 10px !important; }
header.wp-block-template-part .wp-block-site-logo img.custom-logo { height: 56px !important; width: auto !important; max-width: none; }
header.wp-block-template-part .wp-block-site-logo { width: auto !important; }
header.wp-block-template-part .superbthemes-navigation-004-columns-nav .wp-block-navigation { min-height: 0 !important; }
header.wp-block-template-part .atw-page-label { padding-bottom: 8px; }
@media (max-width: 600px) {
    header.wp-block-template-part .superbthemes-navigation-004 { padding-top: 8px !important; padding-bottom: 8px !important; }
    header.wp-block-template-part .wp-block-site-logo img.custom-logo { height: 46px !important; }
}
/* v1.2.1: logo column only as wide as the logo, so the menu gets the room; menu words never break */
@media (min-width: 601px) {
    header.wp-block-template-part .superbthemes-navigation-004-columns-logo { flex: 0 0 auto !important; width: auto !important; }
    header.wp-block-template-part .superbthemes-navigation-004-columns-nav { flex: 1 1 auto !important; min-width: 0; }
}
header.wp-block-template-part .wp-block-navigation a.wp-block-navigation-item__content { white-space: nowrap; word-break: normal !important; overflow-wrap: normal !important; }
@media (min-width: 1024px) and (max-width: 1180px) {
    header.wp-block-template-part .superbthemes-navigation-004-columns-nav .wp-block-navigation__container { gap: 16px !important; }
}

/* v1.3.0: shared footer inside Elementor pages sits edge to edge */
.elementor-widget-shortcode footer.wp-block-template-part { width: 100%; }
.e-con:has(> .elementor-widget-shortcode footer.wp-block-template-part),
.e-con:has(> .e-con-inner > .elementor-widget-shortcode footer.wp-block-template-part) { display: block !important; padding: 0 !important; }
