/* Shared pack-card styles. Consumed by packs.html and trips.html.
 * Uses --forest-*, --sand-*, --cream-*, --ochre-* tokens. */

.pack-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.pack-card-photo {
    position: relative;
    border-radius: 14px;
    aspect-ratio: 1 / 1;
    box-shadow: 0 2px 8px rgba(76, 54, 30, 0.1);
    background-color: #3c5a45;
    background-clip: padding-box;
}

.pack-card-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    z-index: 2;
    display: inline-flex;
    align-items: center;
}
.pack-card-badge-more {
    font-size: 10px;
    color: #6a7068;
    margin-left: 2px;
    letter-spacing: 0;
}

/* Wrap covers the whole photo so absolute children pin to the photo's
   edges (not a 22x22 anchor in the corner, which caused the popover to
   overflow past the card on narrow 2-up grids). Clicks fall through via
   pointer-events:none; the button and the open popover opt back in. */
.pack-card-info-wrap {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.pack-card-info-btn {
    position: absolute;
    bottom: 9px;
    right: 9px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.pack-card-info-popover {
    position: absolute;
    bottom: 42px;
    left: 8px;
    right: 8px;
    max-width: none;
    background: var(--forest-800, #1f3a2a);
    color: var(--cream-50, #f5ede0);
    font-size: 10.5px;
    padding: 9px 12px;
    border-radius: 10px;
    line-height: 1.4;
    font-weight: 500;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: none;
    white-space: normal;
}
.pack-card-info-head {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--lime-accent, #c9e265);
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.pack-card-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pack-card-info-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(245, 237, 224, 0.1);
}
.pack-card-info-item:last-child { border-bottom: none; }
.pack-card-info-who {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pack-card-info-lic {
    font-size: 9px;
    opacity: 0.75;
    font-variant: small-caps;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.pack-card-info-foot {
    margin-top: 6px;
    font-size: 9px;
    opacity: 0.65;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
}
.pack-card-info-popover::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 12px;  /* points at the info button (9px inset + 13px button center) */
    width: 8px;
    height: 8px;
    background: var(--forest-800, #1f3a2a);
    transform: rotate(45deg);
}
.pack-card-info-wrap.is-open .pack-card-info-popover {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.pack-card-meta {
    padding: 9px 2px 0;
}
.pack-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--forest-800, #1f3a2a);
    line-height: 1.25;
}
.pack-card-sub {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-muted, #7a6b55);
}

.pack-card.is-current .pack-card-photo {
    outline: 3px solid var(--ochre-600, #8c5a2b);
    outline-offset: 2px;
}

/* 2x2 photo mosaic (used when resolver returns 2-4 photos).
 * Tiles sit flush under the photo's border-radius; the photo container
 * clips via background-clip: padding-box + border-radius. Forest-green
 * "grout" between tiles gives the mosaic feel. */
.pack-card-mosaic {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    background: var(--forest-800, #1f3a2a);
    border-radius: 14px;
    overflow: hidden;
}
.pack-card-mosaic-tile {
    background-size: cover;
    background-position: center;
    background-color: #2d4a36;
    min-width: 0;
    min-height: 0;
}

/* Regional-version chip shown below a global pack card when the user has
 * a country filter active and a dedicated regional pack exists for it.
 * Lives inside a .pack-card-column so the chip hangs below the card. */
.pack-card-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0; /* allow the column to shrink inside a grid row */
}

.pack-card-regional-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--forest-800, #213A29);
    background: #E9F1EC;
    border: 1px solid #CADBCE;
    border-radius: 999px;
    text-decoration: none;
    max-width: 100%;
    min-width: 0;
}

.pack-card-regional-chip:hover,
.pack-card-regional-chip:focus-visible {
    background: #D6E5DB;
    outline: none;
}

.pack-card-regional-chip-flag {
    font-size: 14px;
    line-height: 1;
}

.pack-card-regional-chip-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pack-card-regional-chip-arrow {
    flex: 0 0 auto;
    opacity: 0.6;
}
