/**
 * Market Intelligence Newspaper - Financial Times Style
 * Premium newspaper layout for market data display
 */

/* Container Structure */
.sffc-market-intelligence-wrapper {
    position: relative;
    margin: 20px 0;
    font-family: 'Noto Serif', 'Georgia', serif;
    background: #FFF1E5; /* FT signature cream */
    border: 1px solid #D9CCBC;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Default maximized state */
.sffc-market-intelligence-wrapper.sffc-default-maximized .sffc-newspaper-content {
    grid-template-columns: repeat(3, 1fr);
    padding: 30px;
}

/* Header Section */
.sffc-newspaper-header {
    background: linear-gradient(to bottom, #FFF1E5 0%, #FFF8F3 100%);
    border-bottom: 3px double #990F3D; /* FT pink accent */
    padding: 16px 20px;
    position: relative;
}

.sffc-newspaper-masthead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sffc-newspaper-title {
    font-family: 'Financier Display', 'Playfair Display', 'Georgia', serif;
    font-size: 24px;
    font-weight: 700;
    color: #0D0D0D;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.sffc-newspaper-date {
    font-size: 11px;
    color: #585857;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.sffc-market-indicators {
    display: flex;
    gap: 20px;
    padding: 8px 0;
    border-top: 1px solid #E5DDD3;
    font-size: 11px;
}

.sffc-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sffc-indicator-label {
    color: #585857;
    font-weight: 500;
}

.sffc-indicator-value {
    font-weight: 700;
    color: #0D0D0D;
}

.sffc-indicator-value.positive {
    color: #0D7F3F;
}

.sffc-indicator-value.negative {
    color: #CC0000;
}

.sffc-indicator-arrow {
    width: 0;
    height: 0;
    border-style: solid;
}

.sffc-indicator-arrow.up {
    border-width: 0 4px 6px 4px;
    border-color: transparent transparent #0D7F3F transparent;
}

.sffc-indicator-arrow.down {
    border-width: 6px 4px 0 4px;
    border-color: #CC0000 transparent transparent transparent;
}

/* Window Controls */
.sffc-newspaper-controls {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.sffc-newspaper-control {
    width: 24px;
    height: 24px;
    border: 1px solid #D9CCBC;
    background: #FFF8F3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.sffc-newspaper-control:hover {
    background: #FFF1E5;
    border-color: #990F3D;
}

.sffc-newspaper-control svg {
    width: 12px;
    height: 12px;
    stroke: #585857;
    stroke-width: 2;
    fill: none;
}

/* Preloader Section */
.sffc-market-preloader {
    padding: 40px;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sffc-preloader-spinner {
    width: 48px;
    height: 48px;
    border: 2px solid #E5DDD3;
    border-top: 2px solid #990F3D;
    border-radius: 50%;
    animation: sffc-spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes sffc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sffc-preloader-message {
    font-size: 14px;
    color: #585857;
    font-style: italic;
    animation: sffc-fade 2s ease-in-out infinite;
}

@keyframes sffc-fade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Main Content Grid */
.sffc-newspaper-content {
    padding: 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    min-height: 300px;
}

.sffc-newspaper-content.maximized {
    grid-template-columns: repeat(3, 1fr);
    padding: 30px;
}

/* Lead Story Section */
.sffc-lead-story {
    grid-column: span 2;
    border-right: 1px solid #E5DDD3;
    padding-right: 20px;
}

.sffc-newspaper-content.maximized .sffc-lead-story {
    grid-column: span 2;
}

.sffc-story-category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #990F3D;
    margin-bottom: 8px;
}

.sffc-story-headline {
    font-family: 'Financier Display', 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: #0D0D0D;
    margin-bottom: 8px;
}

.sffc-newspaper-content.maximized .sffc-story-headline {
    font-size: 28px;
    margin-bottom: 12px;
}

.sffc-story-subheadline {
    font-size: 14px;
    line-height: 1.4;
    color: #585857;
    margin-bottom: 12px;
    font-weight: 400;
}

.sffc-newspaper-content.maximized .sffc-story-subheadline {
    font-size: 16px;
}

.sffc-story-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #807973;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E5DDD3;
}

.sffc-story-time,
.sffc-story-source {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sffc-story-body {
    font-size: 13px;
    line-height: 1.6;
    color: #333333;
    column-count: 2;
    column-gap: 20px;
    text-align: justify;
    hyphens: auto;
}

.sffc-newspaper-content.maximized .sffc-story-body {
    font-size: 14px;
    line-height: 1.7;
}

.sffc-story-body p {
    margin-bottom: 12px;
    text-indent: 12px;
}

.sffc-story-body p:first-child {
    text-indent: 0;
}

.sffc-story-body p:first-child::first-letter {
    float: left;
    font-size: 48px;
    line-height: 40px;
    padding-right: 6px;
    padding-top: 4px;
    font-weight: 700;
    color: #990F3D;
}

/* Side Stories */
.sffc-side-stories {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sffc-side-story {
    padding-bottom: 20px;
    border-bottom: 1px solid #E5DDD3;
}

.sffc-side-story:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sffc-side-story-headline {
    font-family: 'Financier Display', 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #0D0D0D;
    margin-bottom: 8px;
}

.sffc-newspaper-content.maximized .sffc-side-story-headline {
    font-size: 18px;
}

.sffc-side-story-summary {
    font-size: 12px;
    line-height: 1.5;
    color: #585857;
    margin-bottom: 8px;
}

.sffc-newspaper-content.maximized .sffc-side-story-summary {
    font-size: 13px;
}

.sffc-story-impact {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    background: #990F3D;
    color: #FFF1E5;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.sffc-story-impact.medium {
    background: #B07C0C;
}

.sffc-story-impact.low {
    background: #585857;
}

/* Market Data Visualization */
.sffc-market-chart {
    margin: 16px 0;
    padding: 12px;
    background: #FFF8F3;
    border: 1px solid #E5DDD3;
}

.sffc-chart-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #585857;
    margin-bottom: 8px;
}

.sffc-chart-bars {
    display: flex;
    align-items: flex-end;
    height: 60px;
    gap: 4px;
}

.sffc-chart-bar {
    flex: 1;
    background: linear-gradient(to top, #990F3D, #CC5177);
    position: relative;
}

.sffc-chart-bar-label {
    position: absolute;
    bottom: -16px;
    font-size: 9px;
    color: #807973;
    white-space: nowrap;
}

/* Bottom Section */
.sffc-newspaper-footer {
    padding: 16px 20px;
    background: #FFF8F3;
    border-top: 1px solid #E5DDD3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.sffc-footer-links {
    display: flex;
    gap: 16px;
}

.sffc-footer-link {
    color: #990F3D;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.sffc-footer-link:hover {
    color: #CC0000;
    text-decoration: underline;
}

.sffc-last-updated {
    color: #807973;
    font-style: italic;
}

/* Minimized State */
.sffc-market-intelligence-wrapper.minimized .sffc-newspaper-content,
.sffc-market-intelligence-wrapper.minimized .sffc-newspaper-footer {
    display: none;
}

.sffc-market-intelligence-wrapper.minimized {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sffc-market-intelligence-wrapper.minimized .sffc-newspaper-header {
    border-bottom-width: 1px;
}

/* Summary View for Minimized State */
.sffc-minimized-summary {
    padding: 12px 20px;
    font-size: 13px;
    color: #585857;
    display: none;
}

.sffc-market-intelligence-wrapper.minimized .sffc-minimized-summary {
    display: block;
}

.sffc-summary-items {
    display: flex;
    gap: 20px;
}

.sffc-summary-item {
    position: relative;
    padding-left: 12px;
}

.sffc-summary-item::before {
    content: "▪";
    position: absolute;
    left: 0;
    color: #990F3D;
}

/* Professional Icons */
.sffc-icon-clock::before {
    content: "◷";
    margin-right: 4px;
}

.sffc-icon-source::before {
    content: "◉";
    margin-right: 4px;
    font-size: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sffc-newspaper-content {
        grid-template-columns: 1fr;
    }
    
    .sffc-lead-story {
        border-right: none;
        border-bottom: 1px solid #E5DDD3;
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    
    .sffc-story-body {
        column-count: 1;
    }
    
    .sffc-market-indicators {
        flex-wrap: wrap;
    }
}

/* Print-like Typography */
@media screen and (min-width: 1200px) {
    .sffc-newspaper-content.maximized .sffc-story-body {
        column-count: 3;
        column-rule: 1px solid #E5DDD3;
    }
}

/* Loading States */
.sffc-story-skeleton {
    background: linear-gradient(90deg, #FFF8F3 25%, #FFF1E5 50%, #FFF8F3 75%);
    background-size: 200% 100%;
    animation: sffc-skeleton 1.5s infinite;
    height: 12px;
    margin-bottom: 8px;
    border-radius: 2px;
}

@keyframes sffc-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.sffc-story-skeleton.headline {
    height: 24px;
    width: 80%;
}

.sffc-story-skeleton.text {
    height: 12px;
    width: 100%;
}

.sffc-story-skeleton.text:nth-child(3) {
    width: 95%;
}

.sffc-story-skeleton.text:nth-child(4) {
    width: 88%;
}