/**
 * Aircrafts module styles.
 *
 * Card declarations are ported from the flynext theme's
 * assets/scss/elements/_deals_single_item.scss under our own class names,
 * rather than reusing .single-deals-box directly. That theme is a purchased
 * dependency: piggybacking on its classes would give free styling today and
 * unexplained breakage on its next update.
 *
 * @package Hamad Aviation Core
 */

:root {
    --hamad-aircraft-sold: #c1272d;
    --hamad-aircraft-border: #d4d4d4;
    --hamad-aircraft-heading: #19232d;
}

/* ---------- grid ---------- */

.hamad-aircraft-col {
    margin-bottom: 30px;
}

/* ---------- card ---------- */

.hamad-aircraft-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #fff;
    border: 1px solid var(--hamad-aircraft-border);
    border-radius: 8px;
    overflow: hidden;
}

.hamad-aircraft-thumb {
    position: relative;
    overflow: hidden; /* clips the ribbon ends against the image edge */
    border-radius: 8px 8px 0 0;
}

.hamad-aircraft-thumb a {
    display: block;
}

.hamad-aircraft-thumb img,
.hamad-aircraft-thumb-placeholder {
    display: block;
    width: 100%;
    height: auto;
    /*
     * Source images range from 580x387 to 1200 wide. Without normalising the
     * ratio, a fixed ribbon offset lands somewhere different on every card.
     */
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.hamad-aircraft-thumb-placeholder {
    background: linear-gradient(135deg, #eef1f4 0%, #dfe4ea 100%);
}

.hamad-aircraft-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 18px 20px 20px;
}

.hamad-aircraft-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--hamad-aircraft-heading);
}

.hamad-aircraft-title a {
    color: inherit;
    transition: color 300ms;
}

.hamad-aircraft-title a:hover {
    color: var(--main-color-one, #dcbb87);
}

/* ---------- specs ---------- */

.hamad-aircraft-specs {
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.hamad-aircraft-specs li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px dashed #c9c9c9;
    font-size: 14px;
}

.hamad-aircraft-specs li:last-child {
    margin-bottom: 0;
}

.hamad-aircraft-specs .spec-label {
    color: #6b7480;
    font-weight: 500;
}

.hamad-aircraft-specs .spec-value {
    color: var(--hamad-aircraft-heading);
    font-weight: 600;
    text-align: right;
}

.hamad-aircraft-badge {
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 12px;
    padding: 4px 12px;
    border-radius: 3px;
    background-color: #f2f4f6;
    color: #6b7480;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hamad-aircraft-note {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7480;
}

/* ---------- contact ---------- */

.hamad-aircraft-contact {
    margin-top: auto;
    padding-top: 14px;
}

.hamad-aircraft-contact-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--hamad-aircraft-heading);
}

.hamad-aircraft-contact ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hamad-aircraft-contact li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.hamad-aircraft-contact li:last-child {
    margin-bottom: 0;
}

.hamad-aircraft-contact li::before {
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    text-align: center;
    color: var(--main-color-one, #dcbb87);
}

.hamad-aircraft-contact-email::before {
    content: "\2709"; /* envelope */
}

.hamad-aircraft-contact-phone::before {
    content: "\260E"; /* telephone */
}

.hamad-aircraft-contact a {
    color: #6b7480;
    word-break: break-word;
    transition: color 300ms;
}

.hamad-aircraft-contact a:hover {
    color: var(--main-color-one, #dcbb87);
}

/* ---------- SOLD ribbon ---------- */

/*
 * Reproduces the treatment already on the live page, which comes from
 * .sold-list / .sold-overlayer in this plugin's custom_popup.css combined with
 * markup that core_custom.js injects into Elementor columns carrying the
 * "sold-list" class: a 40% black wash, centred SOLD text, and two 5px white
 * bars rotated -139deg meeting behind the text.
 *
 * Rebuilt here in pure CSS on a single element so the cards need no injected
 * markup and no JS - and so removing the hand-built Elementor cards does not
 * take the ribbon with them.
 */

.hamad-aircraft-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 4px;
    text-align: center;
    text-transform: uppercase;
}

/* The two white bars, matching custom_popup.css geometry. */
.hamad-aircraft-ribbon::before,
.hamad-aircraft-ribbon::after {
    content: "";
    position: absolute;
    width: 60%;
    height: 5px;
    background-color: #fff;
    transform: rotate(-139deg);
}

.hamad-aircraft-ribbon::before {
    top: 40px;
    right: -60px;
}

.hamad-aircraft-ribbon::after {
    bottom: 40px;
    left: -60px;
}

/*
 * Alternative corner flash, available via ribbon_style="corner". Uses the
 * dedicated sold colour rather than var(--main-color-one), which resolves to
 * #DCBB87 - a light gold that fails contrast against white text and does not
 * read as "sold".
 */
.hamad-aircraft-ribbon--corner {
    top: 20px;
    right: -60px;
    bottom: auto;
    left: auto;
    display: block;
    width: 200px;
    padding: 8px 0;
    background-color: var(--hamad-aircraft-sold);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    transform: rotate(45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.hamad-aircraft-ribbon--corner::before,
.hamad-aircraft-ribbon--corner::after {
    content: none;
}

/* ---------- single aircraft ---------- */

/*
 * Grid rather than Bootstrap columns so the summary card can sit between the
 * photos and the spec sheet on phones, yet span both rows on desktop.
 */
.hamad-aircraft-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "gallery"
        "aside"
        "body";
}

.hamad-aircraft-gallery-area { grid-area: gallery; }
.hamad-aircraft-aside        { grid-area: aside; }
.hamad-aircraft-body         { grid-area: body; }

@media (min-width: 992px) {
    .hamad-aircraft-layout {
        grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
        grid-template-areas:
            "gallery aside"
            "body    aside";
        grid-template-rows: auto 1fr;
        column-gap: 40px;
    }

    .hamad-aircraft-summary {
        position: sticky;
        top: 110px; /* clears the theme's sticky header */
    }

    /*
     * The theme sets overflow-x: hidden on body, which makes body a scroll
     * container that never scrolls - and a sticky element sticks to its
     * nearest scroll container, so the card would never stick. clip trims the
     * same horizontal overflow without creating a scroll container. Browsers
     * without clip keep the theme's hidden and the card simply does not stick.
     */
    body.single-aircraft {
        overflow-x: clip;
        overflow-y: visible;
    }
}

/* photos */
.hamad-aircraft-media {
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
    border-radius: 8px;
    background-color: #eef0f2;
}

.hamad-media-main {
    display: block;
    cursor: zoom-in;
}

/*
 * contain, not cover: listing photos are often very wide (the GIV-SP side
 * shot is 2.5:1) and cover would crop off the nose and tail. The fixed frame
 * stops the page jumping when a thumbnail swaps in a different shape.
 */
.hamad-aircraft-media .hamad-media-main img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: contain;
}

.hamad-media-count {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.hamad-media-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 10px;
    margin: 0 0 36px;
    padding: 0;
    list-style: none;
}

.hamad-media-thumbs li {
    margin: 0;
}

.hamad-media-thumb {
    display: block;
    border-radius: 6px;
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: outline-color 200ms;
}

.hamad-media-thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    opacity: 0.6;
    transition: opacity 200ms;
}

.hamad-media-thumb:hover img,
.hamad-media-thumb:focus-visible img,
.hamad-media-thumb.is-active img {
    opacity: 1;
}

.hamad-media-thumb.is-active {
    outline-color: var(--main-color-one, #dcbb87);
}

/* summary card */
.hamad-aircraft-summary {
    margin-bottom: 36px;
    padding: 28px;
    border: 1px solid #e6e8eb;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 12px 32px rgba(25, 35, 45, 0.08);
}

.hamad-aircraft-summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.hamad-aircraft-summary-badges .hamad-aircraft-badge {
    margin-bottom: 0;
}

.hamad-aircraft-type,
.hamad-aircraft-status {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 3px;
    background-color: var(--main-color-one, #dcbb87);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hamad-aircraft-status {
    background-color: #e7f5ec;
    color: #1e7a45;
}

.hamad-aircraft-status--sold {
    background-color: #fbe9ea;
    color: var(--hamad-aircraft-sold);
}

.hamad-aircraft-summary-title {
    margin: 0 0 6px;
    font-size: 26px;
    line-height: 1.25;
    color: var(--hamad-aircraft-heading);
}

.hamad-aircraft-summary-note {
    margin: 0 0 18px;
    font-size: 15px;
    color: #4f5965;
}

.hamad-aircraft-figures {
    margin: 0 0 18px;
    padding: 0;
}

.hamad-aircraft-figures > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid #eceef1;
}

.hamad-aircraft-figures dt {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #5b6572;
}

.hamad-aircraft-figures dd {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    text-align: right;
    color: var(--hamad-aircraft-heading);
}

.hamad-aircraft-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 6px;
    background-color: #f6f7f9;
}

.hamad-aircraft-price-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #5b6572;
}

.hamad-aircraft-price-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--hamad-aircraft-heading);
}

.hamad-aircraft-actions {
    display: grid;
    gap: 10px;
}

.hamad-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color 200ms, color 200ms, border-color 200ms;
}

.hamad-btn:hover,
.hamad-btn:focus {
    text-decoration: none;
}

.hamad-btn--primary {
    background-color: var(--hamad-aircraft-heading);
    color: #fff;
}

.hamad-btn--primary:hover,
.hamad-btn--primary:focus {
    background-color: var(--main-color-one, #dcbb87);
    color: #fff;
}

/*
 * Brand gold with dark text, matching the header's Book Now button. White on
 * #DCBB87 fails contrast.
 */
.hamad-btn--whatsapp {
    background-color: var(--main-color-one, #dcbb87);
    color: var(--hamad-aircraft-heading);
}

.hamad-btn--whatsapp:hover,
.hamad-btn--whatsapp:focus {
    background-color: #c9a46b;
    color: var(--hamad-aircraft-heading);
}

.hamad-btn--outline {
    border-color: #d5d9de;
    background-color: #fff;
    color: var(--hamad-aircraft-heading);
}

.hamad-btn--outline:hover,
.hamad-btn--outline:focus {
    border-color: var(--hamad-aircraft-heading);
    color: var(--hamad-aircraft-heading);
}

.hamad-aircraft-summary-email {
    margin: 14px 0 0;
    font-size: 14px;
    text-align: center;
}

.hamad-aircraft-summary-email a {
    color: #5b6572;
}

/* phones: contact buttons pinned to the bottom of the screen */
.hamad-aircraft-mobilebar {
    display: none;
}

@media (max-width: 991px) {
    .hamad-aircraft-mobilebar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 999;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        background-color: #fff;
        box-shadow: 0 -6px 20px rgba(25, 35, 45, 0.12);
    }

    .hamad-aircraft-mobilebar .hamad-btn {
        min-height: 44px;
        padding: 8px 6px;
        font-size: 14px;
    }

    /* keep the footer and the theme's back-to-top button clear of the bar */
    body.single-aircraft {
        padding-bottom: 72px;
    }

    body.single-aircraft .back-to-top {
        bottom: 86px;
    }
}

@media (max-width: 767px) {
    .hamad-media-thumbs {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        margin-bottom: 28px;
        padding-bottom: 4px;
        scroll-snap-type: x mandatory;
    }

    .hamad-media-thumbs li {
        flex: 0 0 72px;
        scroll-snap-align: start;
    }

    .hamad-aircraft-summary {
        padding: 22px;
    }

    .hamad-aircraft-summary-title {
        font-size: 22px;
    }
}

/* ---------- fallback, in case the theme drops the core class ---------- */

.hamad-aircraft-card .screen-reader-text,
.hamad-aircraft-single .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 767px) {
    .hamad-aircraft-title {
        font-size: 18px;
    }

    .hamad-aircraft-ribbon--band {
        letter-spacing: 4px;
    }
}

/* ---------- detail-page spec sheet ---------- */

.hamad-aircraft-lede {
    margin-bottom: 28px;
    font-size: 17px;
    line-height: 1.7;
    color: #46505c;
}

.hamad-aircraft-tagline {
    display: block;
    margin-bottom: 18px;
    color: var(--main-color-one, #dcbb87);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hamad-aircraft-single .entry-content h3 {
    margin: 40px 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hamad-aircraft-border);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--hamad-aircraft-heading);
}

.hamad-aircraft-single .entry-content > :first-child {
    margin-top: 0;
}

.hamad-aircraft-single .entry-content h4 {
    margin: 24px 0 10px;
    font-size: 17px;
    font-weight: 600;
    color: var(--hamad-aircraft-heading);
}

/* two-column label/value rows */
.hamad-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 40px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.hamad-spec-grid li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px dashed #d9dde2;
    font-size: 15px;
}

.hamad-spec-grid .spec-label {
    color: #5b6572;
}

.hamad-spec-grid .spec-value {
    font-weight: 600;
    text-align: right;
    color: var(--hamad-aircraft-heading);
}

/* checkmark feature lists */
.hamad-feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 32px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.hamad-feature-list li {
    position: relative;
    padding: 6px 0 6px 28px;
    font-size: 15px;
    color: #46505c;
}

.hamad-feature-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 6px;
    color: var(--main-color-one, #dcbb87);
    font-weight: 700;
}

/* plain bulleted lists inside the spec sheet */
.hamad-plain-list {
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    columns: 2;
    column-gap: 32px;
}

.hamad-plain-list li {
    padding: 5px 0;
    font-size: 15px;
    color: #46505c;
    break-inside: avoid;
}

/* gallery */
.hamad-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 10px;
}

.hamad-gallery figure {
    margin: 0;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--hamad-aircraft-border);
}

.hamad-gallery img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 400ms;
}

.hamad-gallery figure:hover img {
    transform: scale(1.04);
}

.hamad-gallery a {
    display: block;
    cursor: zoom-in;
}

.hamad-price {
    margin: 10px 0 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--hamad-aircraft-heading);
}

@media (max-width: 767px) {
    .hamad-spec-grid,
    .hamad-feature-list {
        grid-template-columns: 1fr;
    }

    .hamad-plain-list {
        columns: 1;
    }

    .hamad-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
