/* thrdb stylesheet: styles for thrdb's own components
   (templates/thrdb/components/), loaded on every page by the GSTHR project
   next to its site.css.

   thrdb is built for GSTHR, so it follows the project's design system:
   - values come from the project's tokens (--text-secondary, --space-4,
     --radius-lg), never raw colours or sizes;
   - the simple elements are used by class: .btn, .gs-icon-btn, .gs-meta,
     .gs-tag, .gs-card;
   - new styles go here, not in a new file and not in a <link> inside a block.

   The older per-block files in this folder move here as their templates are
   rebuilt from components. */

/* ============================================================ Country card */

/* templates/thrdb/components/country_card.html
   A 4:1 strip of the country, then flag, name, meta line and the arrow. The
   photo and flag come from the sprites (flags.css, backgrounds.css). */
.gs-country {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
    color: var(--text-body);
    text-decoration: none;
}

.gs-country:hover {
    color: var(--text-body);
}

.gs-country__photo {
    position: relative;
    display: block;
    aspect-ratio: 4 / 1;
    overflow: hidden;
    background: var(--surface-soft);
}

.gs-country__photo > span {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.3s var(--ease-out);
}

.gs-country:hover .gs-country__photo > span {
    transform: scale(1.035);
}

.gs-country__body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3) var(--space-4);
}

/* The flag sprite is drawn at 90x60 and scaled to half. */
.gs-country__flag {
    display: block;
    width: 45px;
    height: 30px;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(34, 34, 34, 0.08);
}

.gs-country__flag > span {
    display: block;
    width: 90px;
    height: 60px;
    background-color: #fff;
    background-repeat: no-repeat;
    transform: scale(0.5);
    transform-origin: top left;
}

.gs-country__name {
    display: block;
    overflow: hidden;
    color: var(--text-heading);
    font-size: var(--fs-h4);
    font-weight: var(--fw-bold);
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gs-country__name a {
    color: inherit;
    text-decoration: none;
}

.gs-country .gs-meta {
    margin-top: 0.125rem;
}

/* Flag view: no photo. Either the card asks for it (variant="flag") or the
   grid does: countryFilter.js switches .country-grid--minimal on the grid. */
.gs-country--flag .gs-country__photo,
.country-grid--minimal .gs-country__photo {
    display: none;
}

.gs-country--flag .gs-country__body,
.country-grid--minimal .gs-country__body {
    padding: var(--space-4);
}

/* A grid column stretches its card. */
.country-wrapper > .gs-country {
    height: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .gs-country__photo > span {
        transition: none;
        transform: none;
    }
}
