/* =========================================================================
   Adventure Tours Manager — shared card styles
   One card design, reused by Grid, Slider, Tabs and Showcase.
   Images ALWAYS fill their area (object-fit: cover) so any uploaded photo —
   portrait, landscape or square — fits the card with no manual resizing.
   ========================================================================= */

.atm-card,
.atm-card * {
    box-sizing: border-box;
}

.atm-empty {
    padding: 26px 20px;
    border: 1px dashed #d7dbe0;
    border-radius: 12px;
    background: #fafbfc;
    color: #6b7280;
    font-size: 15px;
    text-align: center;
}

.atm-hidden {
    display: none !important;
}

/* ---------------- Card shell ---------------- */
.atm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e7eaee;
    background: #fff;
    border-radius: 16px;
    transition: box-shadow .24s ease, transform .24s ease;
}

.atm-shadow-yes .atm-card {
    box-shadow: 0 9px 28px rgba(17, 24, 39, .08);
}

.atm-card:hover {
    transform: translateY(-4px);
}

.atm-shadow-yes .atm-card:hover {
    box-shadow: 0 15px 34px rgba(17, 24, 39, .13);
}

/* Whole-card clickable overlay — sits above the image and media copy so a
   click anywhere on the card (image or text) follows the link. */
.atm-card-link {
    position: absolute;
    inset: 0;
    z-index: 20;
    overflow: hidden;
    text-indent: -9999px;
    white-space: nowrap;
    background: transparent;
}

.atm-card-linked {
    cursor: pointer;
}

/* Only the CTA button needs to sit above the overlay (it goes to the same
   place, but keeps its own hover/focus behaviour). Everything else on the card
   stays below the overlay so the whole surface is one big link. */
.atm-card-linked .atm-button {
    position: relative;
    z-index: 21;
    pointer-events: auto;
}

/* ---------------- Media / image ---------------- */
.atm-media {
    position: relative;
    width: 100%;
    height: 270px;           /* overridden by widget control */
    overflow: hidden;
    background: #dfe6ea;
}

.atm-image,
.atm-image-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;       /* <-- image fits the card automatically */
    object-position: center;
}

.atm-image-placeholder {
    background: linear-gradient(135deg, #dfe7ec, #bccbd3);
}

.atm-media-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, .02) 20%, rgba(0, 0, 0, .58) 100%);
}

.atm-badge {
    position: absolute;
    z-index: 2;
    top: 18px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 14px;
    border-radius: 999px;
    color: #fff;
    background: #149447;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .14);
}

.atm-media-copy {
    position: absolute;
    z-index: 2;
    left: 20px;
    right: 20px;
    bottom: 22px;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .34);
}

.atm-image-title {
    margin: 0;
    font-size: clamp(23px, 2vw, 29px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.4px;
    color: #fff;
}

.atm-image-air {
    display: block;
    margin-top: 3px;
    font-size: .62em;
    font-weight: 500;
    opacity: .92;
    line-height: 1.2;
}

.atm-image-subtitle {
    margin-top: 7px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
}

/* ---------------- Body ---------------- */
.atm-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 23px 22px 22px;
}

.atm-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #149447;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 800;
}

.atm-ic {
    flex: 0 0 auto;
}

.atm-title {
    margin: 10px 0 0;
    color: #171717;
    font-size: 21px;
    line-height: 1.36;
    font-weight: 800;
    letter-spacing: -.25px;
}

.atm-duration {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 8px 12px;
    border: 1px solid #e7eaee;
    border-radius: 999px;
    background: #f7f8fa;
    color: #777d86;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
}

.atm-description {
    margin: 14px 0 0;
    color: #727987;
    font-size: 14px;
    line-height: 1.72;
}

.atm-divider {
    width: 100%;
    height: 1px;
    margin: 18px 0 15px;
    background: #e9ecef;
}

.atm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
}

.atm-price-block {
    min-width: 0;
}

.atm-price-label {
    margin-bottom: 4px;
    color: #9ba1aa;
    font-size: 9px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 1.9px;
}

.atm-price {
    color: #149447;
    font-size: 23px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.25px;
}

.atm-price-note {
    margin-top: 2px;
    color: #7f858e;
    font-size: 12px;
    line-height: 1.25;
}

.atm-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 49px;
    padding: 0 19px;
    border-radius: 999px;
    background: #dfa400;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
    transition: transform .2s ease, filter .2s ease;
}

.atm-button:hover,
.atm-button:focus {
    color: #fff !important;
    transform: translateY(-1px);
    filter: brightness(.96);
}

.atm-button-static {
    cursor: default;
}

.atm-arrow {
    flex: 0 0 auto;
}

/* ---------------- Grid widget ---------------- */
.atm-grid {
    width: 100%;
    font-family: inherit;
}

.atm-pos-left { margin-left: 0; margin-right: auto; }
.atm-pos-center { margin-left: auto; margin-right: auto; }
.atm-pos-right { margin-left: auto; margin-right: 0; }

.atm-grid-track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

/* ---------------- Showcase widget ---------------- */
.atm-showcase {
    width: 100%;
    font-family: inherit;
}

.atm-showcase-track {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: stretch;
}

.atm-showcase.atm-pos-left   .atm-showcase-track { justify-content: flex-start; }
.atm-showcase.atm-pos-center .atm-showcase-track { justify-content: center; }
.atm-showcase.atm-pos-right  .atm-showcase-track { justify-content: flex-end; }

/* Single card: centred, natural width (width set by control) */
.atm-showcase.atm-count-1 .atm-showcase-track {
    display: flex;
}

/* Two cards: side by side, each takes an equal share up to a cap */
.atm-showcase.atm-count-2 .atm-showcase-track > .atm-card {
    flex: 0 1 380px;
}

/* 3+ cards: switch to a grid */
.atm-showcase.atm-multi .atm-showcase-track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
    .atm-grid-track,
    .atm-showcase.atm-multi .atm-showcase-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .atm-grid-track,
    .atm-showcase.atm-multi .atm-showcase-track {
        grid-template-columns: 1fr;
    }
    .atm-showcase.atm-count-2 .atm-showcase-track > .atm-card {
        flex: 1 1 100%;
    }
    .atm-body { padding: 21px 18px 21px; }
    .atm-title { font-size: 20px; }
    .atm-footer { gap: 9px; }
    .atm-price { font-size: 21px; }
    .atm-button { min-height: 46px; padding: 0 15px; }
}

/* 1.0.4: keep image coverage stronger than Elementor's generic img height:auto. */
.atm-card .atm-media { flex-shrink:0; }
.atm-card .atm-image,
.atm-card .atm-image-placeholder { position:absolute;inset:0;display:block;width:100%;height:100%;min-width:100%;min-height:100%;max-width:none;max-height:none;object-fit:cover;object-position:center;border-radius:0;margin:0;padding:0; }
/* Flex positioning avoids percentage-translation conflicts in the editor. */
.atm-card .atm-media-position { position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;padding:22px 20px;pointer-events:none; }
.atm-card .atm-media-copy { position:relative;inset:auto;left:0;top:0;bottom:auto;right:auto;width:100%;min-width:0;max-width:100%;flex:0 0 auto;transform:none; }
.atm-card .atm-image-title { position:static; }
.atm-image-title-text { display:block;max-width:100%; }
.atm-image-title-text,.atm-image-air,.atm-image-subtitle { position:relative;left:0;top:0;overflow-wrap:anywhere; }
.atm-card .atm-body { min-width:0; }
.atm-card .atm-footer { flex-wrap:wrap; }
.atm-card .atm-button { max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:center; }
.atm-card .atm-title,.atm-card .atm-description,.atm-card .atm-price,.atm-card .atm-location,.atm-card .atm-badge { overflow-wrap:anywhere; }
.atm-card .atm-badge { max-width:calc(100% - 24px); }
