/**
 * Top Stories Block Styles
 * Mobile-First Responsive Design
 */

.crypto-news-top-stories-block {
    margin: var(--space-xl) 0;
    padding: 0 var(--container-padding);
}

.crypto-news-top-stories-block.alignwide {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
}

.crypto-news-top-stories-block.alignfull {
    max-width: 100%;
    padding: 0;
}

.crypto-news-top-stories-section-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--color-text);
    margin: 0 0 var(--space-lg) 0;
    font-family: var(--font-family-display);
}

.crypto-news-top-stories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

/* Hero Story Styles */
.crypto-news-top-stories-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.crypto-news-top-stories-hero:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.crypto-news-top-stories-hero-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.crypto-news-top-stories-hero-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background: var(--color-surface-alt);
}

.crypto-news-top-stories-hero-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.crypto-news-top-stories-hero:hover .crypto-news-top-stories-hero-image img {
    transform: scale(1.05);
}

.crypto-news-top-stories-hero-content {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.crypto-news-top-stories-hero-category {
    font-size: var(--font-size-xs);
    color: var(--color-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.crypto-news-top-stories-hero-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--color-text);
    margin: 0;
    font-family: var(--font-family-display);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crypto-news-top-stories-hero-link:hover .crypto-news-top-stories-hero-title,
.crypto-news-top-stories-hero-link:focus-visible .crypto-news-top-stories-hero-title {
    color: var(--color-accent);
}

.crypto-news-top-stories-hero-excerpt {
    font-size: var(--font-size-base);
    color: var(--color-muted);
    line-height: var(--line-height-base);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Secondary Stories Styles */
.crypto-news-top-stories-secondary {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.crypto-news-top-stories-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--color-accent);
}

.crypto-news-top-stories-secondary-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.crypto-news-top-stories-secondary-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background: var(--color-surface-alt);
}

.crypto-news-top-stories-secondary-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.crypto-news-top-stories-secondary:hover .crypto-news-top-stories-secondary-image img {
    transform: scale(1.05);
}

.crypto-news-top-stories-secondary-content {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}

.crypto-news-top-stories-secondary-category {
    font-size: var(--font-size-xs);
    color: var(--color-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.crypto-news-top-stories-secondary-title {
    font-size: var(--font-size-md);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--color-text);
    margin: 0;
    font-family: var(--font-family-display);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crypto-news-top-stories-secondary-link:hover .crypto-news-top-stories-secondary-title,
.crypto-news-top-stories-secondary-link:focus-visible .crypto-news-top-stories-secondary-title {
    color: var(--color-accent);
}

/* Tablet: Hero above, 2 secondary stories below in a row */
@media (min-width: 769px) and (max-width: 1024px) {
    .crypto-news-top-stories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }

    .crypto-news-top-stories-hero {
        grid-column: 1 / -1;
    }

    /* Secondary stories take one column each */
    .crypto-news-top-stories-secondary {
        grid-column: span 1;
    }
}

/* Desktop: Hero left (2/3), Secondary stories right (1/3) stacked vertically */
@media (min-width: 1025px) {
    .crypto-news-top-stories-grid {
        grid-template-columns: 2fr 1fr;
        gap: var(--space-xl);
        align-items: start;
    }

    .crypto-news-top-stories-hero {
        min-height: 500px;
        grid-column: 1;
        grid-row: 1 / -1;
    }

    /* All secondary stories go in column 2, stacked vertically */
    .crypto-news-top-stories-secondary {
        grid-column: 2;
    }

    .crypto-news-top-stories-grid > .crypto-news-top-stories-secondary:nth-child(2) {
        grid-row: 1;
    }

    .crypto-news-top-stories-grid > .crypto-news-top-stories-secondary:nth-child(3) {
        grid-row: 2;
    }

    .crypto-news-top-stories-grid > .crypto-news-top-stories-secondary:nth-child(4) {
        grid-row: 3;
    }

    .crypto-news-top-stories-grid > .crypto-news-top-stories-secondary:nth-child(5) {
        grid-row: 4;
    }
}

/* Large Desktop: Optimize spacing */
@media (min-width: 1400px) {
    .crypto-news-top-stories-grid {
        gap: var(--space-2xl);
    }

    .crypto-news-top-stories-hero-content {
        padding: var(--space-xl);
    }

    .crypto-news-top-stories-secondary-content {
        padding: var(--space-lg);
    }
}

/* Accessibility: Focus styles */
.crypto-news-top-stories-hero-link:focus-visible,
.crypto-news-top-stories-secondary-link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-lg);
}

/* Dark Mode Styles */
@media (prefers-color-scheme: dark) {
    :root:not(.light-mode) .crypto-news-top-stories-section-title {
        color: var(--color-text, #f8fafc);
    }

    :root:not(.light-mode) .crypto-news-top-stories-hero {
        background: var(--color-surface, #111827);
    }

    :root:not(.light-mode) .crypto-news-top-stories-hero-category {
        color: var(--color-accent, #f5a524);
    }

    :root:not(.light-mode) .crypto-news-top-stories-hero-title {
        color: var(--color-text, #f8fafc);
    }

    :root:not(.light-mode) .crypto-news-top-stories-hero-excerpt {
        color: var(--color-muted, #9ca3af);
    }

    :root:not(.light-mode) .crypto-news-top-stories-secondary {
        background: var(--color-surface, #111827);
        border-color: var(--color-border, #1f2937);
    }

    :root:not(.light-mode) .crypto-news-top-stories-secondary-category {
        color: var(--color-accent, #f5a524);
    }

    :root:not(.light-mode) .crypto-news-top-stories-secondary-title {
        color: var(--color-text, #f8fafc);
    }
}

body.is-dark .crypto-news-top-stories-section-title {
    color: var(--color-text, #f8fafc);
}

body.is-dark .crypto-news-top-stories-hero {
    background: var(--color-surface, #111827);
}

body.is-dark .crypto-news-top-stories-hero-category {
    color: var(--color-accent, #f5a524);
}

body.is-dark .crypto-news-top-stories-hero-title {
    color: var(--color-text, #f8fafc);
}

body.is-dark .crypto-news-top-stories-hero-excerpt {
    color: var(--color-muted, #9ca3af);
}

body.is-dark .crypto-news-top-stories-secondary {
    background: var(--color-surface, #111827);
    border-color: var(--color-border, #1f2937);
}

body.is-dark .crypto-news-top-stories-secondary-category {
    color: var(--color-accent, #f5a524);
}

body.is-dark .crypto-news-top-stories-secondary-title {
    color: var(--color-text, #f8fafc);
}

/* Print styles */
@media print {
    .crypto-news-top-stories-hero-image,
    .crypto-news-top-stories-secondary-image {
        display: none;
    }

    .crypto-news-top-stories-grid {
        grid-template-columns: 1fr;
    }
}

