/*
 * Search Overlay + Social Links — Hello Elementor Child v2.7.6
 */

/* ========================================================================
   HEADER ACTIONS GROUP (search + hamburger)
   ======================================================================== */
.hec-site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

html body .hec-site-header__search-trigger,
html body .hec-site-header__search-trigger:hover,
html body .hec-site-header__search-trigger:focus,
html body .hec-site-header__search-trigger:active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--hec-text) !important;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.25s ease, color 0.25s ease, transform 0.25s ease;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

html body .hec-site-header__search-trigger:hover {
    opacity: 1;
    color: var(--hec-accent) !important;
    transform: scale(1.05);
}

html body .hec-site-header__search-trigger:focus-visible {
    outline: 2px solid var(--hec-accent) !important;
    outline-offset: 2px;
}

/* ========================================================================
   SEARCH OVERLAY — full screen, fades in
   ======================================================================== */
.hec-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 15, 15, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.hec-search-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.hec-search-overlay.is-open .hec-search-form {
    transform: translateY(0);
    opacity: 1;
}

html body .hec-search-overlay__close,
html body .hec-search-overlay__close:hover,
html body .hec-search-overlay__close:focus,
html body .hec-search-overlay__close:active {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.7) !important;
    cursor: pointer;
    transition: color 0.25s ease, transform 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

html body .hec-search-overlay__close:hover {
    color: #ffffff !important;
    transform: rotate(90deg);
}

.hec-search-overlay__inner {
    width: 100%;
    max-width: 720px;
}

.hec-search-form {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s 0.2s ease, transform 0.5s 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.hec-search-form__label {
    font-family: var(--hec-font-body);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: rgba(255, 255, 255, 0.5);
    display: block;
}

.hec-search-form__row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.hec-search-form__row svg {
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

html body .hec-search-form__input,
html body input[type="search"].hec-search-form__input,
html body input.hec-search-form__input {
    flex: 1;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: var(--hec-font-heading) !important;
    font-size: clamp(2rem, 5vw, 3.5rem) !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    padding: 0.5rem 0 !important;
    margin: 0 !important;
    letter-spacing: -0.01em;
    width: 100%;
    min-width: 0;
    height: auto !important;
    border-radius: 0 !important;
}

html body .hec-search-form__input:focus {
    outline: none !important;
    box-shadow: none !important;
}

html body .hec-search-form__input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

html body .hec-search-form__input::-webkit-search-cancel-button,
html body .hec-search-form__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

html body button.hec-search-form__submit,
html body .hec-search-form__submit {
    align-self: flex-start;
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-family: var(--hec-font-body) !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    padding: 0.9rem 2rem !important;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none !important;
    border-radius: 0 !important;
    line-height: 1 !important;
    height: auto !important;
}

html body button.hec-search-form__submit:hover,
html body .hec-search-form__submit:hover,
html body .hec-search-form__submit:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: #ffffff !important;
    outline: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Prevent body scroll when overlay is open */
body.hec-search-open {
    overflow: hidden;
}

/* ========================================================================
   SEARCH PAGE — inline refinement form under the hero title
   ======================================================================== */
.hec-search__label {
    display: block;
    font-family: var(--hec-font-body);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    opacity: 0.55;
    margin-bottom: 0.5rem;
}

.hec-search__query {
    display: block;
    font-style: italic;
    font-weight: 400;
}

.hec-search__inline-form {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    border: 1px solid var(--hec-border);
    border-radius: 100px;
    max-width: 500px;
    width: 100%;
    background: var(--hec-bg);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.hec-search__inline-form:focus-within {
    border-color: var(--hec-accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.hec-search__inline-form svg {
    color: var(--hec-text);
    opacity: 0.55;
    flex-shrink: 0;
}

html body .hec-search__inline-input,
html body input[type="search"].hec-search__inline-input,
html body input.hec-search__inline-input {
    flex: 1;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: var(--hec-font-body) !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    color: var(--hec-text) !important;
    -webkit-text-fill-color: var(--hec-text) !important;
    padding: 0.6rem 0 !important;
    margin: 0 !important;
    min-width: 0;
    width: 100%;
    height: auto !important;
    border-radius: 0 !important;
}

html body .hec-search__inline-input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

html body .hec-search__inline-input::placeholder {
    color: var(--hec-text);
    opacity: 0.4;
    font-style: italic;
}

/* Remove native search cancel button (the X in webkit) for a cleaner look */
html body .hec-search__inline-input::-webkit-search-cancel-button,
html body .hec-search__inline-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

html body button.hec-search__inline-submit,
html body .hec-search__inline-submit {
    flex-shrink: 0;
    background: var(--hec-text) !important;
    color: var(--hec-bg) !important;
    -webkit-text-fill-color: var(--hec-bg) !important;
    border: none !important;
    border-radius: 100px !important;
    font-family: var(--hec-font-body) !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    padding: 0.75rem 1.5rem !important;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none !important;
    line-height: 1 !important;
    height: auto !important;
    white-space: nowrap;
}

html body button.hec-search__inline-submit:hover,
html body .hec-search__inline-submit:hover,
html body .hec-search__inline-submit:focus {
    background: var(--hec-accent) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    outline: none !important;
    transform: none;
}

/* Image hero variant: invert inline form */
.hec-archive__hero--image .hec-search__inline-form {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
}

.hec-archive__hero--image .hec-search__inline-form svg,
.hec-archive__hero--image .hec-search__inline-input,
.hec-archive__hero--image .hec-search__inline-input::placeholder {
    color: #ffffff;
    opacity: 0.7;
}

.hec-archive__hero--image .hec-search__inline-submit {
    background: #ffffff;
    color: #111111;
}

/* Per-result "post" badge on search results */
.hec-search__post-type {
    display: inline-block;
    font-family: var(--hec-font-body);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--hec-text);
    opacity: 0.45;
    margin-bottom: 0.4rem;
}

/* ========================================================================
   SEARCH RESULTS PAGE — compact hero override
   Search isn't a destination, it's utility. Keep the hero slim.
   ======================================================================== */
.hec-archive.hec-search {
    min-height: auto !important;
}

.hec-archive.hec-search .hec-archive__hero {
    min-height: auto;
    padding: clamp(2.5rem, 6vw, 4rem) var(--hec-gutter) clamp(1rem, 3vw, 2rem);
}

.hec-archive.hec-search .hec-archive__hero-inner {
    min-height: auto;
    padding-bottom: 0;
    gap: 1.5rem;
}

/* Smaller title on search \u2014 quoted query doesn't need to be giant */
.hec-archive.hec-search .hec-archive__title {
    font-size: clamp(2rem, 5vw, 3.5rem) !important;
    line-height: 1.15;
}

.hec-archive.hec-search .hec-archive__title[data-length="medium"],
.hec-archive.hec-search .hec-archive__title[data-length="long"],
.hec-archive.hec-search .hec-archive__title[data-length="xlong"] {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem) !important;
}

.hec-archive.hec-search .hec-archive__headline {
    gap: 0.75rem;
    max-width: 720px;
    margin: 0 auto;
}

.hec-archive.hec-search .hec-archive__intro p {
    font-size: 0.95rem;
    opacity: 0.6;
}

/* Hide decorations on search \u2014 they're for editorial archives, not utility pages */
.hec-archive.hec-search .hec-archive__signature,
.hec-archive.hec-search .hec-archive__arrow,
.hec-archive.hec-search .hec-archive__tagline {
    display: none;
}

/* Inline refinement form tightens up under the title */
.hec-archive.hec-search .hec-search__inline-form {
    margin: 1rem auto 0;
}

/* Force a compact list on search, regardless of site-wide list_style setting */
.hec-archive.hec-search .hec-archive__list {
    max-width: 900px;
    gap: 0 !important;
    padding: 1.5rem var(--hec-gutter) 1.5rem !important;
}

.hec-archive.hec-search .hec-row,
.hec-archive.hec-search .hec-row--flip {
    display: grid !important;
    grid-template-columns: 180px 1fr !important;
    gap: 1.75rem !important;
    align-items: center;
    padding: 1.25rem 0 !important;
    border-bottom: 1px solid var(--hec-border);
}

.hec-archive.hec-search .hec-row:first-child {
    border-top: 1px solid var(--hec-border);
}

.hec-archive.hec-search .hec-row--flip .hec-row__media,
.hec-archive.hec-search .hec-row--flip .hec-row__body {
    order: initial;
}

.hec-archive.hec-search .hec-row__media {
    aspect-ratio: 4 / 3;
    border-radius: 2px;
}

.hec-archive.hec-search .hec-row__body {
    gap: 0.4rem !important;
}

.hec-archive.hec-search .hec-row__title {
    font-size: 1.2rem !important;
    line-height: 1.25;
    margin: 0;
}

.hec-archive.hec-search .hec-row__excerpt {
    font-size: 0.88rem !important;
    line-height: 1.5;
    max-width: none !important;
    opacity: 0.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hec-archive.hec-search .hec-row__link {
    font-size: 0.65rem !important;
    padding: 0.2rem 0;
    border-bottom-width: 0 !important;
    align-self: flex-start;
}

.hec-archive.hec-search .hec-row__index {
    font-size: 0.6rem;
    top: 0.5rem;
    left: 0.5rem;
}

@media (max-width: 560px) {
    .hec-archive.hec-search .hec-row {
        grid-template-columns: 90px 1fr !important;
        gap: 1rem !important;
        padding: 1rem 0 !important;
    }

    .hec-archive.hec-search .hec-row__title {
        font-size: 1rem !important;
    }

    .hec-archive.hec-search .hec-row__link {
        display: none;
    }

    .hec-archive.hec-search .hec-archive__hero {
        padding: 2rem var(--hec-gutter) 1rem;
    }
}

.hec-archive__empty {
    max-width: 600px;
    margin: 2rem auto 3rem;
    text-align: center;
    padding: 0 var(--hec-gutter);
}

.hec-archive__empty p {
    font-family: var(--hec-font-heading);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--hec-text);
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

/* ========================================================================
   FOOTER SOCIAL LINKS
   ======================================================================== */
.hec-site-footer__social-row {
    border-bottom: 1px solid var(--hec-border);
}

.hec-site-footer__social-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 1.25rem var(--hec-gutter);
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

html body .hec-site-footer__social-link,
html body .hec-site-footer__social-link:link,
html body .hec-site-footer__social-link:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--hec-text) !important;
    opacity: 0.7;
    text-decoration: none !important;
    border: 1px solid var(--hec-border);
    border-radius: 50%;
    background: transparent !important;
    transition: color 0.25s ease, opacity 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

html body .hec-site-footer__social-link:hover,
html body .hec-site-footer__social-link:focus {
    color: var(--hec-accent) !important;
    border-color: var(--hec-accent);
    opacity: 1;
    transform: translateY(-2px);
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */
@media (max-width: 768px) {
    html body .hec-search-overlay__close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }

    .hec-search-overlay__inner {
        padding: 0 1rem;
    }

    .hec-search__inline-form {
        padding-left: 1rem;
        gap: 0.5rem;
        max-width: 100%;
    }

    html body .hec-search__inline-input {
        font-size: 0.9rem !important;
        padding: 0.5rem 0 !important;
    }

    html body button.hec-search__inline-submit,
    html body .hec-search__inline-submit {
        padding: 0.6rem 1rem !important;
        font-size: 0.65rem !important;
        letter-spacing: 0.15em;
    }

    html body .hec-site-footer__social-link {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 480px) {
    /* Make the inline form scale down, keep it a pill but with tighter internals */
    .hec-search__inline-form {
        padding: 0.4rem 0.4rem 0.4rem 0.9rem;
        gap: 0.4rem;
    }

    html body .hec-search__inline-input {
        font-size: 0.85rem !important;
    }

    html body button.hec-search__inline-submit,
    html body .hec-search__inline-submit {
        padding: 0.55rem 0.9rem !important;
        letter-spacing: 0.1em;
    }

    .hec-search__inline-form svg {
        width: 16px;
        height: 16px;
    }
}
