/* site.css — shared rules on top of the page styles generated from the design. */

/* ---------- Mobile menu (button injected by js/site.js) ---------- */
.gy-menu-btn { display: none; }

@media (max-width: 900px) {
    header.gy-has-menu { flex-wrap: wrap !important; row-gap: 0 !important; }
    header.gy-has-menu > nav { display: none !important; }
    header.gy-has-menu.gy-menu-open > nav {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start !important;
        flex-basis: 100%;
        gap: 18px !important;
        padding: 20px 0 8px;
    }
    .gy-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid #663604;
        border-radius: 12px;
        background: transparent;
        color: #FFDBB6;
        cursor: pointer;
    }
    .gy-menu-btn svg { display: block; }
    .gy-menu-btn .gy-menu-close { display: none; }
    .gy-menu-open .gy-menu-btn .gy-menu-close { display: block; }
    .gy-menu-open .gy-menu-btn .gy-menu-bars { display: none; }
}

/* ---------- Button rows on phones (classes set by js/site.js) ---------- */
@media (max-width: 600px) {
    .gy-actions {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
    }
    /* call-to-action buttons: one per row, full width */
    /* (the element keeps its own display, so text + inline spans stay together) */
    .gy-actions > .gy-act-button {
        flex: 1 1 100% !important;
        width: auto !important;
        max-width: none !important;
        justify-content: center !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    /* two-option toggles: side by side, equal halves */
    .gy-actions > .gy-act-toggle {
        flex: 1 1 calc(50% - 5px) !important;
        min-width: 0 !important;
        justify-content: center !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    /* store badges: side by side, equal halves, badge centered in its half */
    .gy-actions > .gy-act-badge {
        flex: 1 1 calc(50% - 5px) !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    .gy-actions > .gy-act-badge img {
        height: 48px !important;
        width: auto !important;
        max-width: 100% !important;
    }
}

/* ---------- Home hero on phones (classes set by js/site.js) ---------- */
@media (max-width: 700px) {
    /* The hero is as tall as its content and starts right under the header (the design centers
       it in a screen-tall box, which leaves empty bands above and below on phones). */
    .gy-home-hero {
        min-height: 0 !important;
        align-items: flex-start !important;
    }
    .gy-hero-video video { inset: 0 !important; width: 100% !important; height: 100% !important; object-fit: cover !important; }
    .gy-hero-bar { top: auto !important; bottom: 16px !important; }
    /* Pause / Mute keep their own size (not the phone button-row halves), Skip sits beside them. */
    .gy-hero-bar .gy-actions { width: auto !important; flex: none !important; }
    .gy-hero-bar .gy-actions > * { flex: none !important; }
    /* Copy: headline, then the search, then the intro text and links. */
    .gy-hero-copy {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        padding-top: 16px !important;
        padding-bottom: 36px !important;
    }
    .gy-hero-copy > h1 {
        font-size: clamp(36px, 10.4vw, 52px) !important;
        margin: 18px 0 22px !important;
    }
    .gy-hero-search { order: 1; width: 100%; margin-top: 0 !important; }
    .gy-hero-intro { order: 2; margin-top: 28px; }
    .gy-hero-extra { order: 3; width: 100%; }
    .gy-hero-extra > span:empty { display: none; }
    /* Search box: the skill field gets its own row, the ZIP and the button share the next one. */
    .gy-hero-search label:first-of-type { flex-basis: 100% !important; border-bottom: 1px solid #E5E0D8; }
    .gy-hero-search span[style*="width:1px"] { display: none !important; }
    .gy-hero-search label:last-of-type { flex: 1 1 0 !important; }
    .gy-hero-search button[type="submit"] { padding: 0 18px !important; }
    .gy-hero-search .gy-act-toggle { white-space: nowrap; padding: 0 10px !important; }
}

/* While the video plays on a phone it covers the whole screen, header included. The layer's
   pointer-events turn to auto only in the video phase (js/pages/home.js), so the header comes
   back as soon as the video ends or is skipped. */
@media (max-width: 700px), (orientation: landscape) and (max-height: 500px) {
    .gy-hero-box { overflow: visible !important; }
    .gy-hero-video { --gy-vid-h: 100svh; }
    /* Outside the video phase the screen-sized picture would spill past the hero: hide it. */
    .gy-hero-video:not([style*="pointer-events: auto"]) video { visibility: hidden; }
    .gy-hero-video[style*="pointer-events: auto"] {
        --gy-vid-h: 100svh;
        top: calc(-1 * var(--gy-header-h, 84px)) !important;
        height: 100svh !important;
        z-index: 20 !important;
    }
}

/* Phone held upright: the 16:9 video is turned a quarter turn so it fills the screen uncropped,
   and the controls turn with it; the viewer turns the phone to watch. Once the screen itself turns
   to landscape this rule no longer applies and the video plays upright (block below). */
@media (max-width: 700px) and (orientation: portrait) {
    .gy-hero-video video {
        inset: auto !important;
        left: 50% !important;
        top: 50% !important;
        width: var(--gy-vid-h) !important;
        height: 100vw !important;
        transform: translate(-50%, -50%) rotate(90deg);
    }
    .gy-hero-bar {
        inset: auto !important;
        left: 50% !important;
        top: 50% !important;
        width: var(--gy-vid-h) !important;
        height: 100vw !important;
        padding: 16px;
        box-sizing: border-box;
        align-content: flex-end !important;
        align-items: flex-end !important;
        transform: translate(-50%, -50%) rotate(90deg);
        pointer-events: none;
    }
    .gy-hero-bar > * { pointer-events: auto; }
}

/* Phone turned sideways (short landscape screen): the video fits the screen, controls over it. */
@media (orientation: landscape) and (max-height: 500px) {
    .gy-hero-video video { inset: 0 !important; width: 100% !important; height: 100% !important; object-fit: contain !important; }
    .gy-hero-bar { top: auto !important; bottom: 12px !important; }
}

/* ---------- Section labels drawn as pills ("#1 Human logistics…"): one line on phones ---------- */
@media (max-width: 600px) {
    [style*="text-transform:uppercase;padding:9px 16px;border-radius:999px"] {
        font-size: 12px !important;
        letter-spacing: .1em !important;
        padding: 7px 14px !important;
    }
}

/* ---------- Home comparison table on phones: one card per row (js/site.js) ---------- */
@media (max-width: 700px) {
    .gy-compare { display: block !important; min-width: 0 !important; }
    /* Column heads: only the Gygler logo bar stays, as the table's title. */
    .gy-compare > :nth-child(-n+3) { display: none !important; }
    .gy-compare > :nth-child(4) { border-radius: 16px !important; justify-content: center; margin-bottom: 4px; }
    /* Rows (after the <template>, 4 cells each): the topic, the two others, Gygler's answer. */
    .gy-compare > :nth-child(4n+2):not(:nth-child(2)) { padding: 20px 0 6px !important; font-size: 16px; }
    .gy-compare > :nth-child(4n+3):not(:nth-child(3)),
    .gy-compare > :nth-child(4n+4):not(:nth-child(4)) { padding: 4px 0 !important; border-top: 0 !important; font-size: 14px; }
    .gy-compare > :nth-child(4n+3) > span:last-child::before { content: var(--gy-cmp-a); font-weight: 700; margin-right: 4px; }
    .gy-compare > :nth-child(4n+4) > span:last-child::before { content: var(--gy-cmp-b); font-weight: 700; margin-right: 4px; }
    .gy-compare > :nth-child(4n+5):not(:last-child) {
        margin-top: 8px;
        padding: 12px 14px !important;
        border: 2px solid #FF880B !important;
        border-radius: 12px;
    }
    .gy-compare > :nth-child(4n+5):not(:last-child) > span:last-child::before { content: var(--gy-cmp-g); margin-right: 4px; }
    /* Bottom row: the three empty cells go, the button keeps its frame. */
    .gy-compare > :nth-last-child(-n+4):not(:last-child) { display: none !important; }
    .gy-compare > :last-child { margin-top: 20px; border-radius: 16px !important; border-top: 2px solid #FF880B !important; }
}

/* ---------- Legal pages on phones: the text card keeps more of the screen width ---------- */
@media (max-width: 600px) {
    [data-legal-article] { padding: 22px 18px !important; }
    /* "On this page" uses the full width instead of a 190px column of wrapped links. */
    [data-legal-toc] { flex-basis: 100% !important; }
    /* Wide tables: one block per row, each value under its column name (js/site.js). */
    [data-legal-article] table, [data-legal-article] tbody, [data-legal-article] tr { display: block; min-width: 0 !important; }
    [data-legal-article] thead { display: none; }
    [data-legal-article] td { display: block; padding: 4px 16px !important; border-top: 0 !important; }
    [data-legal-article] td:first-child { padding-top: 14px !important; border-top: 1px solid #E5E0D8 !important; }
    [data-legal-article] tr:first-child td:first-child { border-top: 0 !important; }
    [data-legal-article] td:last-child { padding-bottom: 14px !important; }
    [data-legal-article] td[data-label]:not(:first-child)::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: #995207;
    }
}

/* ---------- Sticky side images ----------
   The About founder photo sticks beside the letter on wide screens. Once the two columns stack
   (narrow screens), a sticky photo stays on top and the letter scrolls underneath it. */
@media (max-width: 760px) {
    [style*="position:sticky"] { position: static !important; }
}

/* ---------- Bigger touch targets for small text links ---------- */
@media (pointer: coarse) {
    footer a, [data-legal-toc] a { position: relative; }
    footer a::after, [data-legal-toc] a::after {
        content: "";
        position: absolute;
        inset: -6px 0;
    }
    /* header EN / ES switch: ~30px tall as drawn, 44px to the finger */
    a[title="Gygler in English"], a[title="Gygler en español"] { position: relative; }
    a[title="Gygler in English"]::after, a[title="Gygler en español"]::after {
        content: "";
        position: absolute;
        inset: -7px 0;
    }
}

/* ---------- Accessibility over the design's inline styles ---------- */
/* Home search mode toggles (I need talent / I'm looking for Gygs): 44px touch target. */
button[data-attr*="aria-pressed"][style*="min-height:40px"] { min-height: 44px !important; }
/* Light grey hints ("(optional)", search tips): #8F8A84 is 3.4:1 on white; this tone is 5.6:1. */
[style*="color:#8F8A84"] { color: #6B665F !important; }
/* Fields drawn with outline:none and no focus style of their own get a visible keyboard focus. */
input[style*="outline:none"][style*="background:transparent"]:focus-visible {
    outline: 2px solid #FF880B !important;
    outline-offset: -2px;
    border-radius: 999px;
}
select[style*="outline:none"]:focus-visible { border-color: #FF880B !important; }

/* ---------- Legal pages: wide tables scroll without reserving scrollbar space ---------- */
[data-legal-article] > div[style*="overflow-x"] { scrollbar-width: none; }
[data-legal-article] > div[style*="overflow-x"]::-webkit-scrollbar { display: none; }

/* ---------- Home search validation message (js/search-map.js) ---------- */
.gy-search-hint {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #FFF3E7;
    color: #663604;
    font-size: 14px;
    font-weight: 700;
}
.gy-search-hint[hidden] { display: none; }

/* ---------- Search map open (js/search-map.js): lock the page behind it ----------
   Here rather than in css/search-map.css, which only arrives after the modal is already open. */
html.gy-map-open,
html.gy-map-open body { overflow: hidden; overscroll-behavior: none; }

/* ---------- Form result modal (markup injected by js/forms.js) ---------- */
.gy-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147483100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(51, 27, 2, .55);
}
.gy-modal {
    width: 100%;
    max-width: 440px;
    padding: 32px 28px 28px;
    border-radius: 24px;
    background: #FFFFFF;
    color: #331B02;
    text-align: center;
    font: 400 16px/1.55 'Quicksand', sans-serif;
    box-shadow: 0 24px 64px rgba(31, 31, 31, .3);
    box-sizing: border-box;
}
.gy-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
}
.gy-modal-icon--success { background: #FFE7CE; color: #FF880B; }
.gy-modal-icon--error { background: #FFE7CE; color: #663604; }
.gy-modal h2 { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
.gy-modal p { margin: 0 0 10px; color: #663604; }
.gy-modal button {
    margin-top: 12px;
    min-height: 48px;
    padding: 0 28px;
    border: 0;
    border-radius: 999px;
    background: #FF880B;
    color: #331B02;
    font: 700 15px 'Quicksand', sans-serif;
    cursor: pointer;
}
.gy-modal button:hover { background: #FFA03C; }
button[data-gy-send]:disabled { opacity: .7; cursor: progress; }

/* ---------- Cookie consent (markup injected by js/consent.js) ---------- */
.gy-consent {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2147483000;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 22px;
    border-radius: 20px;
    border: 1px solid #663604;
    background: #331B02;
    color: #FFF3E7;
    font: 400 15px/1.55 'Quicksand', sans-serif;
    box-shadow: 0 18px 48px rgba(31, 31, 31, .28);
    box-sizing: border-box;
}
.gy-consent h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: #FFFFFF; }
.gy-consent p { margin: 0 0 14px; color: #FFDBB6; }
.gy-consent a { color: #FF880B; font-weight: 700; }
.gy-consent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.gy-consent button {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid #663604;
    background: transparent;
    color: #FFF3E7;
    font: 700 14px 'Quicksand', sans-serif;
    cursor: pointer;
}
.gy-consent button:hover { background: #4D2903; }
.gy-consent button.gy-primary { background: #FF880B; border-color: #FF880B; color: #331B02; }
.gy-consent button.gy-primary:hover { background: #FFA03C; }
.gy-consent-options { display: grid; gap: 12px; margin: 4px 0 16px; }
.gy-consent-option {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 14px;
    background: #4D2903;
}
.gy-consent-option input { margin-top: 4px; width: 18px; height: 18px; accent-color: #FF880B; flex: none; }
.gy-consent-option strong { display: block; color: #FFFFFF; }
.gy-consent-option span { color: #FFDBB6; font-size: 14px; }
.gy-consent-note { font-size: 13px; color: #FFCF9D; margin: 0 0 12px; }

/* ---------- Language picker (js/translate.js) ---------- */
.gy-lang { position: relative; }
.gy-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #663604;
    border-radius: 999px;
    background: transparent;
    color: #FFDBB6;
    font: 700 13px 'Quicksand', sans-serif;
    letter-spacing: .02em;
    cursor: pointer;
    white-space: nowrap;
}
.gy-lang-btn:hover, .gy-lang-btn[aria-expanded="true"] { background: #4D2903; }
.gy-lang-btn:focus-visible { outline: 2px solid #FF880B; outline-offset: 2px; }
.gy-lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 2147483200;
    min-width: 220px;
    max-height: min(420px, 70vh);
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid #663604;
    border-radius: 16px;
    background: #331B02;
    box-shadow: 0 18px 40px rgba(31, 31, 31, .35);
    font: 600 14px 'Quicksand', sans-serif;
}
.gy-lang-menu[hidden] { display: none; }
.gy-lang-menu [role="option"] {
    padding: 10px 12px;
    border-radius: 10px;
    color: #FFF3E7;
    cursor: pointer;
}
.gy-lang-menu [role="option"]:hover, .gy-lang-menu [role="option"]:focus { background: #4D2903; outline: none; }
.gy-lang-menu [aria-selected="true"] { color: #FF880B; }
.gy-lang-divider {
    margin: 6px 6px 2px;
    padding-top: 8px;
    border-top: 1px solid #4D2903;
    color: #FFCF9D;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.gy-lang-notice {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 2147483300;
    max-width: min(520px, calc(100vw - 32px));
    padding: 14px 18px;
    border-radius: 14px;
    background: #331B02;
    color: #FFF3E7;
    font: 600 14px/1.5 'Quicksand', sans-serif;
    box-shadow: 0 18px 40px rgba(31, 31, 31, .35);
}
.gy-lang-notice[hidden] { display: none; }
@media (max-width: 900px) {
    .gy-lang-menu { right: auto; left: 0; }
}
