:root {
    --economist-red: #E3120B;
    --light-gray: #f0f0f0;
    --dark-gray: #333333;
    --off-white: #f8f8f8;
}

body {
    background-color: var(--off-white);
    color: var(--dark-gray);
}

.navbar {
    background-color: white !important;
    border-bottom: 1px solid var(--light-gray);
}

.navbar-brand {
    font-weight: bold;
    color: var(--economist-red) !important;
}

.navbar-brand__logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.navbar-collapsible {
    width: 100%;
}

.navbar-analysis-menu {
    width: 100%;
}

.navbar-analysis-menu .dropdown-toggle,
.navbar-analysis-menu .dropdown,
.navbar-analysis-menu .dropdown-menu {
    width: 100%;
}

.dropdown-item-primary {
    font-weight: 600;
    color: var(--bs-primary);
}

.dropdown-item-primary:hover,
.dropdown-item-primary:focus {
    color: var(--bs-primary);
}

.navbar-actions {
    width: 100%;
}

.navbar-actions .btn,
.navbar-actions .dropdown,
.navbar-actions .dropdown-toggle {
    width: 100%;
}

.navbar-actions .dropdown-menu {
    width: 100%;
}

.btn-primary {
    background-color: var(--economist-red);
    border-color: var(--economist-red);
}

.btn-primary:hover {
    background-color: #c00;
    border-color: #c00;
}

.btn-outline-primary {
    color: var(--economist-red);
    border-color: var(--economist-red);
}

.btn-outline-primary:hover {
    color: white;
    background-color: var(--economist-red);
    border-color: var(--economist-red);
}

.card-header {
    background-color: var(--light-gray);
    font-weight: bold;
    color: var(--dark-gray);
}

.dropdown-item:active {
    background-color: var(--economist-red);
}

.analysis-visuals img {
    max-height: 280px;
    object-fit: contain;
}

.map-container {
    min-height: 280px;
}

.analysis-action-buttons {
    gap: 1rem;
    row-gap: 1rem;
}

.analysis-action-buttons__form {
    margin: 0;
    flex: 0 1 auto;
    display: flex;
}

.analysis-action-buttons__form .btn {
    flex: 0 1 auto;
    min-width: 140px;
    padding: 0.65rem 1.25rem;
}

.analysis-action-buttons__link.btn {
    margin: 0;
    flex: 0 1 auto;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
}

.insights-controls {
    row-gap: 0.75rem;
}

.insights-selector {
    width: 100%;
}

.insights-selector .btn {
    flex: 1 1 auto;
    min-width: 140px;
}

.analysis-results-sections .list-group-item {
    gap: 0.5rem;
}

.analysis-results-sections .list-group-item > span {
    text-align: right;
}

@media (max-width: 576px) {
    .analysis-action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .analysis-action-buttons__form,
    .analysis-action-buttons__link.btn {
        width: 100%;
        min-width: 0;
    }

    .analysis-action-buttons__form .btn,
    .analysis-action-buttons__link.btn {
        padding: 0.55rem 1rem;
    }

    .analysis-results-sections .list-group-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .analysis-results-sections .list-group-item > span {
        width: 100%;
        text-align: left;
    }

    .navbar-brand__logo {
        width: 20px;
        height: 20px;
    }

    .insights-controls {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .insights-selector {
        gap: 0.5rem;
    }

    .insights-selector .btn {
        flex: 1 1 100%;
        min-width: 0;
    }

}

.back-to-top {
    position: fixed;
    top: 4.5rem;
    left: 0.75rem;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 999px;
    background-color: var(--economist-red);
    color: #fff;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-top:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.back-to-top--visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top__icon {
    font-size: 1.1rem;
    line-height: 1;
}

@media (min-width: 768px) {
    .back-to-top {
        display: none;
    }
}

@media (min-width: 992px) {
    .navbar-analysis-menu,
    .navbar-actions {
        width: auto;
    }

    .navbar-analysis-menu .dropdown-toggle,
    .navbar-analysis-menu .dropdown,
    .navbar-analysis-menu .dropdown-menu,
    .navbar-actions .btn,
    .navbar-actions .dropdown,
    .navbar-actions .dropdown-toggle {
        width: auto;
    }

    .navbar-actions .dropdown-menu {
        width: auto;
    }
}

.blog-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.blog-card .card-body {
    padding: 2.25rem;
}

.blog-card__meta {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blog-card__excerpt p {
    margin-bottom: 1.1rem;
    line-height: 1.7;
}

.post-excerpt__more {
    margin-bottom: 0;
    color: #6c757d;
    font-style: italic;
}

.post-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 1.5rem;
    margin-bottom: .75rem;
}

.post-content ul,
.post-content ol {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.post-content blockquote {
    padding-left: 1rem;
    border-left: 3px solid #e5e7eb;
    color: #555;
    margin: 1rem 0;
}

.post-content hr {
    margin: 2rem 0;
}
