/* Green City Index - Cities Directory, Country Rankings and City Pages */

:root {
    --color-green-dark: #1a3a17;
    --color-green: #2d5a27;
    --color-green-light: #4a8c3f;
    --color-bg: #fafafa;
    --color-text: #333;
    --color-text-light: #666;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

/* Override flex layout from style.css for content pages (same pattern as about.css) */
main.container {
    display: block;
    overflow: auto;
    font-family: var(--font-main);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* Typography - same rules the About and Stories pages get from about.css */
main h1 {
    font-size: 2.5rem;
    color: var(--color-green-dark);
    margin-bottom: 2rem;
    font-weight: 400;
}

.section {
    margin-bottom: 3rem;
}

main h2 {
    font-size: 1.5rem;
    color: var(--color-green-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-green-light);
}

main h3 {
    font-size: 1.1rem;
    color: var(--color-green);
    margin: 1.5rem 0 0.75rem;
}

.directory-intro {
    font-size: 1.2rem;
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

.breadcrumbs {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.breadcrumbs a {
    color: var(--color-green-dark);
}

/* Country cards - story-card language */
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.country-card {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 1.5rem 1rem 1rem;
}

.country-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--color-green-light) 0%, var(--color-green) 100%);
}

.country-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.country-card h2 {
    font-size: 1.15rem;
    color: var(--color-green-dark);
    margin: 0 0 0.35rem;
    padding: 0;
    border-bottom: none;
}

.country-card .city-count {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* Ranking table */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 1.5rem;
}

.ranking-table th,
.ranking-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ranking-table th {
    background: var(--color-green-dark);
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

.ranking-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ranking-table th.num {
    text-align: right;
}

.ranking-table tr:hover {
    background: #fafafa;
}

.ranking-table a {
    color: var(--color-green);
}

/* City cards */
.city-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.city-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.city-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.city-card h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--color-green-dark);
}

.city-card .headline {
    color: var(--color-text-light);
    font-size: 0.85rem;
}

/* Quiet text: coverage, method, caveats */
.quiet {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-top: 1rem;
}

.method-formula {
    display: block;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-left: 3px solid var(--color-green-light);
    border-radius: 4px;
    color: var(--color-text);
    font-size: 0.85rem;
}

/* City page */
.city-stats p {
    font-size: 1.1rem;
    line-height: 1.7;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.25rem 1rem;
    text-align: center;
}

.stat .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-green-dark);
}

.stat .label {
    color: var(--color-text-light);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Buttons - same language as the homepage */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--color-green);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--color-green);
    border: 2px solid var(--color-green);
}

.btn-secondary:hover {
    background: var(--color-green);
    color: white;
}

.btn-primary:hover {
    background: var(--color-green-dark);
}

/* Compare links */
.compare-row {
    margin-top: 2rem;
}

.compare-row a {
    display: inline-block;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    margin: 0 0.5rem 0.5rem 0;
    text-decoration: none;
    color: var(--color-green);
    transition: transform 0.2s, box-shadow 0.2s;
}

.compare-row a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.ranking-table tr.is-current td {
    background: #eef3e6;
    font-weight: 600;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.map-card {
    display: block;
    background: white;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.map-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.map-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.map-card-label {
    display: block;
    font-weight: 600;
    padding: 0.5rem 0.75rem 0.15rem;
}

.map-card-legend {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.75rem 0.6rem;
    font-size: 0.72rem;
    color: var(--color-text-light);
}

.map-card-legend-word {
    white-space: nowrap;
}

.legend-swatch {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 2px;
}

.legend-swatch-green {
    background: #4dd64d;
}

.legend-bar {
    display: block;
    flex: 1;
    height: 0.5rem;
    border-radius: 3px;
}

.legend-bar-heat {
    background: linear-gradient(to right, #2166ac, #f7f7f7, #b2182b);
}

.legend-bar-aq {
    background: linear-gradient(to right, rgb(0, 104, 55), rgb(102, 189, 99), rgb(254, 224, 139), rgb(253, 174, 97), rgb(215, 48, 39));
}

/* Homepage directory teaser */
.teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.teaser-col h3 {
    margin-bottom: 0.75rem;
}

.teaser-cta {
    margin-top: 2rem;
    text-align: center;
}

.teaser-col .ranking-table {
    width: auto;
    min-width: 320px;
}

.teaser-col .ranking-table td {
    padding: 0.6rem 1rem 0.6rem 0;
}

.teaser-rank {
    width: 2.5rem;
    color: #666;
}

.teaser-col .ranking-table td:first-child {
    padding-left: 0.75rem;
}

.teaser-country {
    color: #666;
}
