/* US Weekly Market Pulse - Optimized Styles - Version 1.2.0 */

/* ===== BASE STYLES ===== */
.us-weekly-section {
    margin: 2.5rem 0;
    padding: 1.75rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
}
.us-heading {
    color: #1a365d;
    margin-top: 0;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #2c5282;
    font-size: 1.6rem;
    font-weight: 700;
}
.us-commentary {
    line-height: 1.7;
    margin: 1.25rem 0 1.75rem;
    color: #2d3748;
    font-size: 1.05rem;
}

/* ===== COLOR CODING FOR VALUES ===== */
.us-positive-value {
    color: #198754;
    font-weight: 600;
}
.us-negative-value {
    color: #dc3545;
    font-weight: 600;
}
.us-neutral-value {
    color: #6c757d;
    font-weight: 500;
}

/* ===== TABLE STYLES ===== */
.us-table-container {
    overflow-x: auto;
    margin: 30px 0 35px 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.us-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    margin-bottom: 0;
}
.us-data-table th {
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 16px 14px;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.us-data-table td {
    border: 1px solid #edf2f7;
    padding: 14px;
    transition: background-color 0.2s ease;
    font-size: 0.95em;
}
.us-data-table tr:nth-child(even) {
    background-color: #f8fafc;
}
.us-data-table tr:hover td {
    background-color: #f0f7ff;
}

/* Color coding in tables */
.us-data-table .us-positive-value {
    color: #198754;
    font-weight: 600;
}
.us-data-table .us-negative-value {
    color: #dc3545;
    font-weight: 600;
}
.us-data-table .us-neutral-value {
    color: #6c757d;
    font-weight: 500;
}

/* ===== GRAPH SECTION - IMPROVED SPACING ===== */
.us-graph-section {
    margin: 3rem 0 3.5rem 0;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}
.us-graph-title {
    color: #1a365d;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.75rem 0;
    padding: 0;
}
.us-graph-description {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
}
.us-graph-container {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}
.us-graph-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* Aspect Ratio Wrapper for 1200×650 (54.1667%) */
.us-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 54.1667%;
    overflow: hidden;
    border-radius: 8px;
    background: #f1f5f9;
    margin-bottom: 1.5rem;
}
.us-graph-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}
.us-graph-caption {
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    margin: 0.5rem 0 0 0;
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}
.us-graph-caption span {
    display: inline-block;
}

/* ===== MARKET OVERVIEW ===== */
.us-market-overview {
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 12px;
    margin: 2.5rem 0;
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}
.us-overview-heading {
    color: white !important;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding-bottom: 1rem;
    font-weight: 700;
}
.us-overview-content {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.95;
}
.us-overview-content strong {
    color: #90cdf4;
    font-weight: 600;
}

/* Color coding in overview */
.us-market-overview .us-positive-value {
    color: #4ade80 !important;
}
.us-market-overview .us-negative-value {
    color: #f87171 !important;
}
.us-market-overview .us-neutral-value {
    color: #cbd5e1 !important;
}

/* ===== WEEKLY SUMMARY ===== */
.us-weekly-summary {
    background: #f8fafc;
    border-left: 5px solid #2c5282;
    padding: 2rem;
    margin: 3rem 0;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
}
.us-summary-heading {
    color: #1a365d;
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.8rem;
    font-weight: 700;
}
.us-summary-section {
    background: white;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.us-summary-section h3 {
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}
.us-performance-metrics {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.us-performance-metrics li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1.05rem;
}
.us-performance-metrics li:last-child {
    border-bottom: none;
}
.us-performance-metrics strong {
    color: #2c5282;
    font-weight: 600;
}

/* Color coding in performance metrics */
.us-performance-metrics .us-positive-value {
    color: #198754;
    font-weight: 600;
}
.us-performance-metrics .us-negative-value {
    color: #dc3545;
    font-weight: 600;
}
.us-performance-metrics .us-neutral-value {
    color: #6c757d;
    font-weight: 500;
}

.us-observations {
    margin: 0;
}
.us-observations p {
    margin: 0.75rem 0;
    line-height: 1.7;
    font-size: 1.05rem;
}
.us-observations strong {
    color: #2c5282;
}
.us-takeaways {
    padding-left: 1.5rem;
    margin: 0;
}
.us-takeaways li {
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 1.05rem;
}
.us-takeaways li:last-child {
    margin-bottom: 0;
}
.us-takeaways strong {
    color: #2c5282;
}

/* ===== DISCLAIMER ===== */
.us-disclaimer {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1.25rem;
    margin-top: 2rem;
    border-radius: 6px;
    font-size: 0.95rem;
}
.us-disclaimer em {
    color: #856404;
    font-style: normal;
}
.us-disclaimer strong {
    color: #856404;
}

/* ===== ERROR & MESSAGE STYLES ===== */
.us-error {
    padding: 1.25rem;
    background: #fed7d7;
    color: #742a2a;
    border-radius: 6px;
    border-left: 4px solid #e53e3e;
    font-size: 1rem;
}
.us-graph-missing {
    padding: 2.5rem;
    background: #f7fafc;
    text-align: center;
    color: #718096;
    border-radius: 8px;
    border: 1px dashed #cbd5e0;
    font-size: 1rem;
}

/* ===== FEDERAL RESERVE INDICATORS - CSS GRID ===== */
.us-fed-section {
    margin: 3rem 0;
    padding: 2.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.us-fed-heading {
    color: #1a365d;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
}

.us-fed-description {
    text-align: center;
    color: #4a5568;
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* CSS Grid for 3-column layout */
.us-fed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.us-fed-card {
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.us-fed-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #cbd5e0;
}

.us-fed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.us-fed-card-icon {
    font-size: 2rem;
    line-height: 1;
}

.us-fed-card-frequency {
    font-size: 0.75rem;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.8rem;
    background: #e2e8f0;
    border-radius: 15px;
}

.us-fed-card-body {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.us-fed-card-title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.4;
}

.us-fed-card-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #2c5282;
    margin: 0;
    line-height: 1.2;
}

.us-fed-card-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-top: auto;
}

.us-fed-card-date {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

.us-fed-footnote {
    text-align: center;
    font-size: 0.9rem;
    color: #718096;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    line-height: 1.6;
}

.us-fed-footnote em {
    font-style: normal;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablet */
@media (min-width: 768px) {
    .us-weekly-section {
        padding: 2rem;
        margin: 3rem 0;
    }
    .us-heading {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    .us-graph-section {
        margin: 3.5rem 0 4rem 0;
        padding-top: 2.5rem;
    }
    .us-graph-title {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    .us-graph-description {
        font-size: 1.05rem;
        margin-bottom: 2rem;
    }
    .us-graph-container {
        padding: 1.75rem;
        margin-bottom: 1.75rem;
    }
    .us-graph-caption {
        font-size: 0.9rem;
        gap: 1.25rem;
        padding-top: 1.25rem;
    }
    .us-market-overview {
        padding: 3rem;
        margin: 3rem 0;
    }
    .us-overview-heading {
        font-size: 2.2rem;
    }
    .us-overview-content {
        font-size: 1.15rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .us-graph-title {
        font-size: 1.7rem;
    }
    .us-graph-container {
        padding: 2rem;
    }
    .us-table-container {
        margin: 35px 0 40px 0;
    }
}

/* Federal Reserve Responsive */
@media (max-width: 1200px) {
    .us-fed-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .us-fed-section {
        padding: 2rem;
    }
    
    .us-fed-heading {
        font-size: 1.8rem;
    }
    
    .us-fed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .us-fed-card-title {
        font-size: 1.05rem;
    }
    
    .us-fed-card-value {
        font-size: 1.5rem;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .us-table-container {
        margin: 25px -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .us-data-table {
        min-width: 700px;
    }
    
    .us-weekly-section {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    .us-heading {
        font-size: 1.4rem;
    }
    .us-graph-section {
        margin: 2.5rem 0 3rem 0;
        padding-top: 1.5rem;
    }
    .us-graph-title {
        font-size: 1.3rem;
    }
    .us-graph-caption {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Federal Reserve Mobile */
    .us-fed-section {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .us-fed-heading {
        font-size: 1.6rem;
    }
    
    .us-fed-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .us-fed-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .us-fed-card {
        padding: 1.25rem;
    }
    
    .us-fed-card-title {
        font-size: 1.1rem;
    }
    
    .us-fed-card-value {
        font-size: 1.5rem;
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .us-fed-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print Styles */
@media print {
    .us-market-overview {
        background: white !important;
        color: black !important;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    .us-overview-heading {
        color: black !important;
    }
    .us-graph-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    .us-weekly-summary {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    /* Federal Reserve Print */
    .us-fed-section {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .us-fed-grid {
        break-inside: avoid;
    }
    
    .us-fed-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    /* Color coding for print */
    .us-positive-value {
        color: #000 !important;
        font-weight: bold;
    }
    .us-negative-value {
        color: #000 !important;
        font-weight: bold;
    }
}