.trip-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 12rem;
    height: 18rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    background-color: white;
    cursor: pointer;
    transition: box-shadow 0.15s;
    color: inherit;
    text-decoration: none;
}

.card-action-btns {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    z-index: 1;
    display: flex;
    gap: 0.25rem;
}

.card-remove-btn,
.card-edit-btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.card-remove-btn:hover {
    background: #c0392b;
}

.card-edit-btn:hover {
    background: #2471a3;
}

.trip-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

.trip-card-image {
    width: 100%;
    height: 8rem;
    object-fit: cover;
}

.trip-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    color: #adb5bd;
}

.trip-card-image-placeholder svg {
    width: 2.5rem;
    height: 2.5rem;
}

.trip-card-image-collapsed {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    border: none;
    padding: 0;
    background-color: #e9ecef;
    color: #6c7580;
    cursor: pointer;
}

.trip-card-image-collapsed svg {
    width: 2.5rem;
    height: 2.5rem;
}

.trip-card-image-collapsed span {
    font-size: 0.75rem;
}

.trip-card-image-collapsed:hover {
    background-color: #dde1e5;
    color: rgb(5, 39, 103);
}

.trip-card-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trip-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.trip-card-text {
    font-size: 0.875rem;
    color: #555;
    margin: 0;
}

@media (max-width: 640.98px) {
    .trip-card {
        width: 100%;
        height: auto;
        flex-direction: row;
    }

    .trip-card-image {
        width: 7rem;
        height: auto;
        flex-shrink: 0;
    }

    .trip-card-body {
        flex: 1;
        min-width: 0;
    }
}

/* Sight cards carry a rating block (issue #49) under the text, so they can't share the trip card's
   fixed 18rem height — grow instead, keeping 18rem as the floor so a row of cards still lines up. */
.sight-card {
    height: auto;
    min-height: 18rem;
    cursor: default;
}

.sight-rating {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: auto;
}

.sight-rating-summary {
    align-self: flex-start;
    border: none;
    background: none;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(5, 39, 103);
    cursor: pointer;
}

.sight-rating-summary-empty {
    font-weight: 400;
    color: #6c7580;
    cursor: default;
}

.sight-rating-summary-toggle {
    font-size: 0.75rem;
    margin-left: 0.15rem;
}

.sight-rating-raters {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background-color: #f1f3f5;
    font-size: 0.8125rem;
}

.sight-rating-raters li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.sight-rating-rater-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sight-rating-rater-score {
    font-weight: 600;
    flex-shrink: 0;
}

.sight-rating-label {
    font-size: 0.75rem;
    color: #6c7580;
}

.sight-rating-scale {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.sight-rating-btn {
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.25rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    color: #343a40;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
}

.sight-rating-btn:hover {
    border-color: #2471a3;
    color: #2471a3;
}

.sight-rating-btn-selected,
.sight-rating-btn-selected:hover {
    border-color: #2471a3;
    background: #2471a3;
    color: white;
}

/* Lets .sight-rating's margin-top:auto pin the rating block to the card's bottom edge. */
.sight-card .trip-card-body {
    flex: 1;
}

/* On phones the cards are full-width rows rather than a grid, so there's no row to line up with —
   drop the 18rem floor that would otherwise leave a tall empty gap above the rating block. */
@media (max-width: 640.98px) {
    .sight-card {
        min-height: 0;
    }
}

/* Issue #59: "Open in Google Maps" + pin button on a sight card. */
.sight-location {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.sight-map-link {
    color: rgb(5, 39, 103);
    font-weight: 600;
}

.sight-pin-btn {
    border: 1px solid #ccd3dc;
    background: white;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.8rem;
    color: rgb(5, 39, 103);
    cursor: pointer;
}

.sight-pin-btn:hover {
    background: #f1f4f8;
}
