/* Climate card on travel guide pages (scripts/lib/guideClimate.js). */
.gc {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.gc-best {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.9375rem;
    color: var(--guide-text-muted);
}

.gc-best i {
    color: var(--guide-primary);
}

.gc-best strong {
    color: var(--guide-text);
}

.gc-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 720px) {
    .gc-facts {
        grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    }
}

.gc-fact {
    display: grid;
    gap: 0.125rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--guide-border);
    border-radius: var(--guide-radius-sm, 8px);
    background: var(--guide-surface-elevated, #f8fafc);
}

.gc-fact-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--guide-text-muted);
}

.gc-fact-month {
    font-size: 1.125rem;
    line-height: 1.3;
    color: var(--guide-text);
}

.gc-fact-detail {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--guide-text);
}

.gc-fact-detail span {
    font-weight: 400;
    color: var(--guide-text-muted);
}

/* Chart: a row per month on narrow cards, a column per month on wide ones. */
.gc-figure {
    margin: 0;
    min-width: 0;
    container-type: inline-size;
}

.gc-caption {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--guide-text-muted);
}

.gc-legend-rain {
    white-space: nowrap;
}

.gc-legend-rain::before {
    content: "";
    display: inline-block;
    width: 0.625rem;
    height: 0.625rem;
    margin-right: 0.3rem;
    border-radius: 2px;
    background: #60a5fa;
    vertical-align: -1px;
}

.gc-chart {
    --gc-dir: to right;
    display: grid;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gc-col {
    display: grid;
    grid-template-columns: 2.25rem 2.25rem minmax(0, 1fr) 2.25rem 2.75rem;
    grid-template-areas: "month lo track hi rain";
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}

.gc-month { grid-area: month; }
.gc-lo { grid-area: lo; }
.gc-track { grid-area: track; }
.gc-hi { grid-area: hi; }
.gc-rain { grid-area: rain; }

.gc-hi,
.gc-lo {
    font-size: 0.8125rem;
    line-height: 1.1;
    white-space: nowrap;
}

.gc-hi {
    font-weight: 700;
    color: var(--guide-text);
}

.gc-lo {
    text-align: right;
    color: var(--guide-text-muted);
}

.gc-month {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--guide-text-muted);
}

.gc-track {
    position: relative;
    height: 0.625rem;
    border-radius: 999px;
    background: var(--guide-bg-darker, #f1f5f9);
}

.gc-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--lo);
    right: calc(100% - var(--hi));
    min-width: 0.375rem;
    border-radius: 999px;
}

.gc-rain {
    position: relative;
    height: 0.5rem;
    border-radius: 2px;
    background: #dbeafe;
}

.gc-rain span {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--rain);
    border-radius: 2px;
    background: #60a5fa;
}

@container (min-width: 34rem) {
    .gc-chart {
        --gc-dir: to top;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 0.25rem;
    }

    .gc-col {
        grid-template-columns: none;
        grid-template-rows: auto 8rem auto 1.75rem auto;
        grid-template-areas: "hi" "track" "lo" "rain" "month";
        justify-items: center;
        gap: 0.25rem;
    }

    .gc-hi,
    .gc-lo {
        font-size: 0.75rem;
        text-align: center;
    }

    .gc-month {
        font-size: 0.75rem;
    }

    .gc-track {
        width: 0.625rem;
        height: 100%;
    }

    .gc-bar {
        left: 0;
        right: 0;
        top: calc(100% - var(--hi));
        bottom: var(--lo);
        min-width: 0;
        min-height: 0.375rem;
    }

    .gc-rain {
        width: 0.625rem;
        height: 100%;
        background: none;
    }

    .gc-rain span {
        top: auto;
        bottom: 0;
        right: 0;
        width: auto;
        height: var(--rain);
        border-radius: 2px 2px 0 0;
    }
}

.gc-details {
    border: 1px solid var(--guide-border);
    border-radius: var(--guide-radius-sm, 8px);
}

.gc-details summary {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--guide-text);
    cursor: pointer;
}

.gc-details summary:focus-visible {
    outline: 2px solid var(--guide-primary);
    outline-offset: 2px;
}

.gc-table-wrap {
    overflow-x: auto;
    padding: 0 0.875rem 0.75rem;
}

.gc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.gc-table th,
.gc-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--guide-border);
    text-align: right;
    white-space: nowrap;
}

.gc-table th:first-child {
    text-align: left;
}

.gc-table thead th {
    font-weight: 600;
    color: var(--guide-text-muted);
}

.gc-table tbody th {
    font-weight: 600;
    color: var(--guide-text);
}

.gc-table td {
    color: var(--guide-text);
}

.gc-source {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--guide-text-subtle, #64748b);
}

.gc-source a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
