/* ==========================================================
   CARDS — the two card styles used across the site
   (loaded on every page)

   .trip-card  every tour / trek / day-trip card
               photo tile, title on the photo; on hover a panel
               slides up with the price and a "Read More" button
   .tile-card  destinations + East Africa tours
               photo with the title and subtitle underneath

   Both sit in a .card-grid: 4 per row on desktop, 3 on tablets,
   2 on large phones, 1 on phones; a short last row is left-aligned. The whole card is clickable (assets/js/site.js).
   ========================================================== */

.card-grid {
    width: 100%;                 /* also inside the old flex wrappers */
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* an unfinished last row starts on the left */
    gap: 20px;
    margin-top: 20px;
    text-align: center;
}
.card-grid > * { flex: 0 1 calc((100% - 60px) / 4); }          /* 4 per row */
@media (max-width: 1024px) { .card-grid > * { flex-basis: calc((100% - 40px) / 3); } }
@media (max-width: 768px)  { .card-grid > * { flex-basis: calc((100% - 20px) / 2); } }
@media (max-width: 520px)  { .card-grid > * { flex-basis: 100%; } }

/* .card-grid--fill: cards stretch to share the full width (East Africa Tours) */
.card-grid--fill > * { flex: 1 1 0; }
@media (max-width: 768px) { .card-grid--fill > * { flex: 1 1 100%; } }

/* ---- shared ---- */
.trip-card,
.tile-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: #fff;
    transition: transform 0.3s;
}
.trip-card:hover,
.tile-card:hover { transform: scale(1.05); }

.trip-card img,
.tile-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* gold tag, top right */
.card-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    padding: 5px 10px;
    border-radius: 20px;
    background-color: var(--brand);
    color: #000;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
}

/* ---- .trip-card (Kilimanjaro style) ---- */
.trip-card__title {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s;
}
.trip-card__title h5 {
    margin: 0;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
}

.trip-card__details {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 100%;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    transform: translateY(100%);
    transition: transform 0.3s;
}
.trip-card__details h5 {
    margin: 0;
    padding: 8px 15px;
    color: #fff;
    font-weight: 600;
}
.trip-card__details p {
    margin: 5px 0 0;
    font-size: 14px;
    color: #fff;
}
.trip-card__details .read-more {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    border-radius: 5px;
    background-color: var(--brand);
    color: #000;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}
.trip-card__details .read-more:hover {
    background-color: #000;
    color: var(--brand);
}

.trip-card:hover .trip-card__title { opacity: 0; }
.trip-card:hover .trip-card__details { transform: translateY(0); }

/* Phones/tablets have no hover: show the price panel straight away */
@media (hover: none) {
    .trip-card__title { opacity: 0; }
    .trip-card__details {
        transform: none;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.35));
    }
    .trip-card:hover { transform: none; }
}

/* ---- .tile-card (day-trips style) ---- */
.tile-card__body {
    padding: 10px;
    text-align: center;
    text-transform: uppercase;
}
.tile-card__body h5 {
    margin: 0 0 6px;
    font-weight: 600;
}
.tile-card__body h5 a {
    color: #000;
    text-decoration: none;
}
.tile-card__body h5 a:hover { color: var(--brand); }
.tile-card__body p {
    margin: 0;
    font-size: 12px;
}
