/**
 * Umrah Group Packages — front-end card.
 * Design reference: docs/images/umrah-group.jpg
 *
 * Loaded by Elementor only on pages that use the Umrah Group Packages widget
 * (declared via the widget's get_style_depends()).
 *
 * SIZING: every text size, gap and padding inside the card is expressed in `em`
 * against `.gp-card`'s own font-size. That single value is what the widget's
 * "Text Size" control overrides, so the whole card — logo included — scales
 * together. Don't reintroduce px font sizes here; they'd ignore the control.
 *
 * WIDTH is deliberately not set. The card fills whatever Elementor container it
 * is placed in — set that container to Boxed to constrain it.
 */

.gp-list {
    /*
     * Accent palette. These four are overridden at runtime by an inline block
     * from homey_gp_palette_css(), which resolves them from the Homey theme
     * options — so editing the palette under Theme Options updates the card.
     * The values here are only the fallback for when that block is absent.
     */
    --gp-primary: #1b458a;
    --gp-primary-hover: #163a75;
    --gp-secondary: #ef882a;
    --gp-secondary-hover: #d97620;

    /* Not part of the theme palette: flight rows and body text keep their own
       colours so they stay readable against any brand colour. */
    --gp-blue: #2255cc;
    --gp-ink: #1d2327;

    display: flex;
    flex-direction: column;
    gap: 26px;

    /* The card reflows on its OWN width, not the viewport's — because the width
       is set by whichever Elementor container it lands in. A viewport media query
       gets this wrong: a boxed 900px container on a 1512px screen would keep the
       wide desktop layout and overflow by ~240px. See the fallback at the bottom
       of this file for browsers without container query support. */
    container-type: inline-size;
    container-name: gp;
}

/* --- Card shell --- */

.gp-card {
    /* The scaling anchor. Matches the theme's 14px base; the Elementor
       "Text Size" control overrides this one declaration. */
    font-size: 14px;

    position: relative;
    background: #fff;
    border-radius: 25px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.13);
    /* Also what clips the banner's top-left corner to follow the card's curve. */
    overflow: hidden;
}

/* Flush into the card's top-left corner — no margin. */
.gp-card__banner {
    display: inline-block;
    max-width: 42%;
    padding: 0.7em 1.6em;
}

.gp-card__title {
    margin: 0;
    color: #fff;
    font-size: 1.05em;
    line-height: 1.25;
    font-weight: 700;
}

/* --- Body grid --- */

.gp-card__body {
    display: grid;
    /*
     * Logo, flights, prices and CTA size to their content; hotels takes whatever
     * is left. Giving hotels a floor instead (minmax(17em, 1.5fr)) pinned it at
     * that floor and let the prices column claim the surplus — hotels ended up on
     * 238px against prices' 454px, which is what forced the hotel names to wrap.
     *
     * The first track is `auto` rather than a fixed width so it collapses to zero
     * for an airline with no logo instead of leaving a blank block.
     */
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    gap: 0.7em 1.6em;
    /*
     * Top, not centre. Centring aligns each column independently, so the moment
     * one column is taller than another their headings stop lining up — the
     * design has ISB-JED-ISB / Hotels / Sharing all sitting on one line.
     * The logo and CTA opt back into centring below.
     */
    align-items: start;
    padding: 1em 2.4em 1.6em 1.9em;
}

.gp-card__airline {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

/*
 * Scoped to `.gp-card` on purpose. Elementor ships `.elementor img { max-width:
 * 100% }` — specificity (0,1,1) — which out-specifies a bare `.gp-card__logo`
 * (0,1,0) and stretches the logo to fill its grid cell. `.gp-card .gp-card__logo`
 * is (0,2,0) and wins without needing !important. Any future img/a rule in this
 * file has the same trap.
 */
.gp-card .gp-card__logo {
    max-width: 5.5em;
    height: auto;
}

.gp-card__heading {
    margin: 0 0 0.5em;
    color: var(--gp-secondary);
    font-size: 1.15em;
    font-weight: 700;
    line-height: 1.2;
}

.gp-card__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gp-card__list > li {
    margin-bottom: 0.45em;
    font-size: 0.95em;
    line-height: 1.4;
}

.gp-card__list > li:last-child {
    margin-bottom: 0;
}

/* --- Flights --- */

.gp-card__flight {
    display: flex;
    align-items: center;
    gap: 0.7em;
    color: var(--gp-blue);
    white-space: nowrap;
}

/*
 * Inline SVG from homey_gp_flight_icon(), not an icon font — see the comment on
 * that function for why Font Awesome is deliberately avoided here.
 *
 * `color` rather than `fill`: the SVG paints with fill="currentColor", and the
 * row itself is blue, so the icon has to set its own colour to stay dark like
 * the design. Height in em means it tracks the Text Size control.
 */
.gp-card__flight-icon {
    flex: 0 0 auto;
    height: 0.8em;
    width: auto; /* follows the 640:512 viewBox */
    color: var(--gp-ink);
}

/* --- Hotels --- */

.gp-card__hotel {
    color: var(--gp-ink);
}

/* --- Prices --- */

.gp-card__prices {
    display: flex;
    gap: 1.6em;
    justify-content: flex-end;
    /* Wrap to a second row rather than pushing the card into overflow at the
       top of the Text Size control's range. */
    flex-wrap: wrap;
}

.gp-card__price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7em;
    min-width: 5em;
}

.gp-card__price-label {
    color: var(--gp-primary);
    font-size: 1.05em;
    font-weight: 700;
    line-height: 1.1;
}

.gp-card__price-value {
    color: var(--gp-ink);
    font-size: 1.05em;
    line-height: 1.1;
}

/* --- CTA --- */

.gp-card__cta {
    display: flex;
    justify-content: flex-end;
    align-self: center;
}

.gp-card__cta-btn {
    display: inline-block;
    padding: 1.05em 2.4em;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 0.95em;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

/* Each variant sets its own hover background below, from the theme's hover
   colours — no blanket opacity dim, which would compound with them. */
.gp-card__cta-btn:hover,
.gp-card__cta-btn:focus {
    text-decoration: none;
}

.gp-card__cta-btn--primary {
    background: var(--gp-primary);
    color: #fff;
}

.gp-card__cta-btn--secondary {
    background: var(--gp-secondary);
    color: #fff;
}

.gp-card__cta-btn--outline {
    background: transparent;
    border-color: var(--gp-primary);
    color: var(--gp-primary);
}

.gp-card__cta-btn--primary:hover,
.gp-card__cta-btn--primary:focus {
    background: var(--gp-primary-hover);
    color: #fff;
}

.gp-card__cta-btn--secondary:hover,
.gp-card__cta-btn--secondary:focus {
    background: var(--gp-secondary-hover);
    color: #fff;
}

.gp-card__cta-btn--outline:hover,
.gp-card__cta-btn--outline:focus {
    background: var(--gp-primary);
    color: #fff;
}

/* --- Pagination / empty --- */

.gp-list__pagination {
    margin-top: 10px;
}

.gp-list--empty p {
    margin: 0;
    padding: 24px;
    background: #f6f7f7;
    border-radius: 8px;
    text-align: center;
}

/* --- Responsive -----------------------------------------------------------
 *
 * Keyed on the CARD's width via container queries, so the layout is correct at
 * any Elementor container width. Tightens tracks, gaps and padding only — font
 * sizes stay under the Text Size control's authority.
 *
 * The three breakpoints are repeated as viewport media queries inside the
 * `@supports not` block at the end of this file, for browsers predating
 * container query support. Keep the two sets in sync.
 * ------------------------------------------------------------------------ */

@container gp (max-width: 1180px) {
    /* The base template is already fluid, so only the spacing tightens here. */
    .gp-card__body {
        gap: 0.7em 1.2em;
    }

    .gp-card__prices {
        gap: 1.2em;
    }

    .gp-card__price {
        min-width: 4.6em;
    }

    .gp-card__cta-btn {
        padding: 1.05em 1.8em;
    }
}

@container gp (max-width: 1000px) {
    .gp-card__banner {
        max-width: 100%;
        margin-left: 0;
        width: 100%;
    }

    .gp-card__body {
        grid-template-columns: auto 1fr;
        align-items: start;
        padding: 1.4em;
    }

    .gp-card__flights {
        grid-column: 2;
    }

    .gp-card__hotels,
    .gp-card__prices,
    .gp-card__cta {
        grid-column: 1 / -1;
    }

    .gp-card__prices {
        justify-content: flex-start;
        flex-wrap: wrap;
        padding-top: 0.45em;
        border-top: 1px solid #e6e6e6;
    }

    .gp-card__cta {
        justify-content: flex-start;
    }
}

@container gp (max-width: 560px) {
    .gp-card__body {
        grid-template-columns: 1fr;
    }

    .gp-card__airline {
        justify-content: flex-start;
    }

    .gp-card__flights {
        grid-column: 1;
    }

    .gp-card__flight {
        white-space: normal;
    }

    .gp-card__price {
        min-width: 4.8em;
    }
}

/* --- Fallback: browsers without container queries (pre-2022) ---------------
 * Mirrors the three blocks above, keyed on the viewport instead. Only applies
 * where @container is unsupported, so the two can never both take effect.
 * ------------------------------------------------------------------------ */

@supports not (container-type: inline-size) {

@media screen and (max-width: 1400px) {
    /* The base template is already fluid, so only the spacing tightens here. */
    .gp-card__body {
        gap: 0.7em 1.2em;
    }

    .gp-card__prices {
        gap: 1.2em;
    }

    .gp-card__price {
        min-width: 4.6em;
    }

    .gp-card__cta-btn {
        padding: 1.05em 1.8em;
    }
}

@media screen and (max-width: 1199px) {
    .gp-card__banner {
        max-width: 100%;
        margin-left: 0;
        width: 100%;
    }

    .gp-card__body {
        grid-template-columns: auto 1fr;
        align-items: start;
        padding: 1.4em;
    }

    .gp-card__flights {
        grid-column: 2;
    }

    .gp-card__hotels,
    .gp-card__prices,
    .gp-card__cta {
        grid-column: 1 / -1;
    }

    .gp-card__prices {
        justify-content: flex-start;
        flex-wrap: wrap;
        padding-top: 0.45em;
        border-top: 1px solid #e6e6e6;
    }

    .gp-card__cta {
        justify-content: flex-start;
    }
}

@media screen and (max-width: 600px) {
    .gp-card__body {
        grid-template-columns: 1fr;
    }

    .gp-card__airline {
        justify-content: flex-start;
    }

    .gp-card__flights {
        grid-column: 1;
    }

    .gp-card__flight {
        white-space: normal;
    }

    .gp-card__price {
        min-width: 4.8em;
    }
}

} /* end @supports not (container-type: inline-size) */
