/**
 * Featured News Component
 * Version: 1.5.0
 *
 * A 30/70 split layout component displaying a featured article
 * alongside a list of secondary articles from an RSS feed.
 *
 * Layout: 30% featured article | 70% secondary article list
 * Themes: default, hccc-primary, hccc-secondary, hccc-accent
 *
 * Responsive Breakpoints:
 * - Mobile: < 768px (single column)
 * - Tablet Portrait: 768px - 899px (single column, enhanced)
 * - Tablet Landscape: 900px - 1023px (40/60 split)
 * - Desktop: 1024px+ (30/70 split)
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    /* Layout */
    --fn-gap: 0;
    --fn-grid-gap: 2rem;
    --fn-padding: 0;
    --fn-border-radius: 0;

    /* Featured Article */
    --fn-featured-bg: #f8f9fa;
    --fn-featured-color: #333333;
    --fn-featured-title-color: #1a1a1a;
    --fn-featured-image-height: 280px;
    --fn-featured-padding: 1.5rem;

    /* Secondary Articles */
    --fn-secondary-bg: #f8f9fa;
    --fn-secondary-color: #333333;
    --fn-secondary-title-color: #1a1a1a;
    --fn-secondary-border: #e9ecef;
    --fn-secondary-padding: 1.5rem;
    --fn-thumbnail-size: 120px;

    /* Category Badge */
    --fn-category-bg: #006366;
    --fn-category-color: #ffffff;

    /* Typography */
    --fn-font-family: "Montserrat", Arial, Helvetica, sans-serif;
    --fn-title-size: 1.5rem;
    --fn-title-weight: 800;
    --fn-secondary-title-size: 1rem;
    --fn-secondary-title-weight: 700;
    --fn-date-size: 0.875rem;
    --fn-date-color: #6c757d;
    --fn-description-size: 1rem;
    --fn-description-color: #555555;

    /* Interactive States */
    --fn-hover-transform: translateY(-2px);
    --fn-hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    --fn-transition: all 0.3s ease;

    /* Button */
    --fn-button-bg: #006366;
    --fn-button-color: #ffffff;
    --fn-button-hover-bg: #2a2a86;
    --fn-button-padding: 0.875rem 1.75rem;
    --fn-button-radius: 0;

    /* Focus */
    --fn-focus-color: #006366;
    --fn-focus-offset: 2px;
}

/* ==========================================================================
   Base Component Styles
   ========================================================================== */

.featured-news {
    font-family: var(--fn-font-family);
    padding: var(--fn-padding);
    margin: 0 auto;
    max-width: 1400px;
}

/* ==========================================================================
   Full Width / Full Bleed Layout
   ========================================================================== */

.featured-news--full-width {
    max-width: none;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 3rem 0;
    background: var(--fn-section-bg, #f8f9fa);
}

.featured-news--full-width .featured-news__grid {
    max-width: min(1600px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 0 1.5rem;
}

.featured-news--full-width .featured-news__header {
    max-width: min(1600px, calc(100% - 3rem));
    margin: 0 auto 1.5rem;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .featured-news--full-width .featured-news__grid,
    .featured-news--full-width .featured-news__header {
        max-width: min(1600px, calc(100% - 4rem));
        padding: 0 2rem;
    }
}

@media (min-width: 1200px) {
    .featured-news--full-width .featured-news__grid,
    .featured-news--full-width .featured-news__header {
        max-width: min(1600px, 92%);
        padding: 0 2rem;
    }
}

@media (min-width: 1800px) {
    .featured-news--full-width .featured-news__grid,
    .featured-news--full-width .featured-news__header {
        max-width: 1600px;
        padding: 0;
    }
}

/* Header */
.featured-news__header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.featured-news__title {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .featured-news__title {
        font-size: 2.25rem;
    }
}

/* ==========================================================================
   Grid Layout
   ========================================================================== */

.featured-news__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--fn-grid-gap);
}

@media (min-width: 1024px) {
    .featured-news__grid {
        grid-template-columns: 3fr 7fr;
    }
}

/* ==========================================================================
   Featured Article (Left Column)
   ========================================================================== */

.featured-news__featured {
    background: var(--fn-featured-bg);
    border-radius: var(--fn-border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: var(--fn-transition);
}

.featured-news__featured:hover {
    transform: var(--fn-hover-transform);
    box-shadow: var(--fn-hover-shadow);
}

.featured-news__featured-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.featured-news__featured-link:focus {
    outline: 2px solid var(--fn-focus-color);
    outline-offset: var(--fn-focus-offset);
}

/* Featured Image */
.featured-news__featured-image-wrapper {
    position: relative;
    width: 100%;
    height: var(--fn-featured-image-height);
    overflow: hidden;
    background: #e9ecef;
}

.featured-news__featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.featured-news__featured:hover .featured-news__featured-image {
    transform: scale(1.05);
}

.featured-news__featured-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.featured-news__placeholder-icon {
    font-size: 3rem;
    color: #adb5bd;
}

/* Featured Content */
.featured-news__featured-content {
    padding: var(--fn-featured-padding);
}

/* Category Badge */
.featured-news__category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--fn-category-bg);
    color: var(--fn-category-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    margin-bottom: 0.75rem;
}

/* Featured Title */
.featured-news__featured-title {
    font-size: var(--fn-title-size);
    font-weight: var(--fn-title-weight);
    color: var(--fn-featured-title-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.featured-news__featured:hover .featured-news__featured-title {
    color: var(--fn-focus-color);
}

@media (min-width: 768px) {
    .featured-news__featured-title {
        font-size: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .featured-news__featured-title {
        font-size: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .featured-news__featured-title {
        font-size: 1.75rem;
    }
}

/* Date */
.featured-news__date {
    display: block;
    font-size: var(--fn-date-size);
    color: var(--fn-date-color);
    margin-bottom: 1rem;
}

/* Description */
.featured-news__description {
    font-size: var(--fn-description-size);
    color: var(--fn-description-color);
    line-height: 1.6;
    margin: 0 0 1.25rem 0;
}

/* Read More */
.featured-news__read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--fn-focus-color);
    transition: gap 0.3s ease;
}

.featured-news__featured:hover .featured-news__read-more {
    gap: 0.75rem;
}

.featured-news__read-more i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.featured-news__featured:hover .featured-news__read-more i {
    transform: translateX(3px);
}

/* ==========================================================================
   Secondary Articles (Right Column)
   ========================================================================== */

.featured-news__secondary {
    display: flex;
    flex-direction: column;
}

.featured-news__secondary-list {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Secondary Item */
.featured-news__secondary-item {
    background: var(--fn-secondary-bg);
    border-bottom: 1px solid var(--fn-secondary-border);
    transition: var(--fn-transition);
}

.featured-news__secondary-item:first-child {
    border-radius: var(--fn-border-radius) var(--fn-border-radius) 0 0;
}

.featured-news__secondary-item:last-child {
    border-bottom: none;
}

.featured-news__secondary-item:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.featured-news__secondary-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: var(--fn-secondary-padding);
    text-decoration: none;
    color: inherit;
}

.featured-news__secondary-link:focus {
    outline: 2px solid var(--fn-focus-color);
    outline-offset: -2px;
}

/* Thumbnail */
.featured-news__thumbnail-wrapper {
    flex-shrink: 0;
    width: var(--fn-thumbnail-width, 120px);
    height: var(--fn-thumbnail-height, 85px);
    border-radius: 0;
    overflow: hidden;
    background: #e9ecef;
}

.featured-news__thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-news__secondary-item:hover .featured-news__thumbnail {
    transform: scale(1.08);
}

.featured-news__thumbnail--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #adb5bd;
    font-size: 1.5rem;
}

/* Secondary Content */
.featured-news__secondary-content {
    flex: 1;
    min-width: 0;
}

.featured-news__secondary-title {
    font-size: var(--fn-secondary-title-size);
    font-weight: var(--fn-secondary-title-weight);
    color: var(--fn-secondary-title-color);
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.featured-news__secondary-item:hover .featured-news__secondary-title {
    color: var(--fn-focus-color);
}

.featured-news__secondary-date {
    display: block;
    font-size: 0.8125rem;
    color: var(--fn-date-color);
}

/* ==========================================================================
   View All Button
   ========================================================================== */

.featured-news__view-all-wrapper {
    padding: 1rem var(--fn-secondary-padding);
    background: var(--fn-secondary-bg);
    border-radius: 0 0 var(--fn-border-radius) var(--fn-border-radius);
    text-align: center;
}

.featured-news__view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: var(--fn-button-padding);
    background: var(--fn-button-bg);
    color: var(--fn-button-color);
    font-family: var(--fn-font-family);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03125rem;
    border: none;
    border-radius: var(--fn-button-radius);
    cursor: pointer;
    transition: var(--fn-transition);
}

.featured-news__view-all:hover,
.featured-news__view-all:focus {
    background: var(--fn-button-hover-bg);
    color: var(--fn-button-color);
}

.featured-news__view-all:focus {
    outline: 2px solid var(--fn-button-bg);
    outline-offset: 2px;
}

.featured-news__view-all i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.featured-news__view-all:hover i {
    transform: translateX(3px);
}

/* ==========================================================================
   Theme: HCCC Primary (Teal)
   ========================================================================== */

.featured-news--hccc-primary {
    --fn-category-bg: #006366;
    --fn-focus-color: #006366;
    --fn-button-bg: #006366;
    --fn-button-hover-bg: #006d64;
    --fn-section-bg: #ffffff;
}

.featured-news--hccc-primary .featured-news__title {
    color: #006366;
}

.featured-news--hccc-primary .featured-news__featured {
    border-top: 4px solid #006366;
}

.featured-news--hccc-primary .featured-news__secondary-list {
    border-top: 4px solid #006366;
}

/* ==========================================================================
   Theme: HCCC Secondary (Blue)
   ========================================================================== */

.featured-news--hccc-secondary {
    --fn-category-bg: #2a2a86;
    --fn-focus-color: #2a2a86;
    --fn-button-bg: #2a2a86;
    --fn-button-hover-bg: #080A39;
    --fn-section-bg: #ffffff;
}

.featured-news--hccc-secondary .featured-news__title {
    color: #2a2a86;
}

.featured-news--hccc-secondary .featured-news__featured {
    border-top: 4px solid #2a2a86;
}

.featured-news--hccc-secondary .featured-news__secondary-list {
    border-top: 4px solid #2a2a86;
}

/* ==========================================================================
   Theme: HCCC Accent (Yellow/Gold)
   ========================================================================== */

.featured-news--hccc-accent {
    --fn-category-bg: #1a1a1a;
    --fn-category-color: #ffe14f;
    --fn-focus-color: #006366;
    --fn-button-bg: #1a1a1a;
    --fn-button-hover-bg: #333333;
    --fn-button-color: #ffe14f;
    --fn-section-bg: #fffef0;
}

.featured-news--hccc-accent .featured-news__title {
    color: #1a1a1a;
}

.featured-news--hccc-accent .featured-news__featured {
    border-top: 4px solid #ffe14f;
}

.featured-news--hccc-accent .featured-news__secondary-list {
    border-top: 4px solid #ffe14f;
}

.featured-news--hccc-accent .featured-news__category {
    background: #ffe14f;
    color: #1a1a1a;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

/*
 * Responsive Breakpoint Strategy:
 * - Mobile: < 768px (single column, compact)
 * - Tablet Portrait: 768px - 899px (single column, enhanced)
 * - Tablet Landscape: 900px - 1023px (40/60 split, intermediate)
 * - Desktop: 1024px - 1199px (30/70 split)
 * - Large Desktop: 1200px - 1399px (30/70 split, enhanced)
 * - Extra Large: 1400px+ (30/70 split, maximum sizing)
 */

/* Mobile: Stack layout */
@media (max-width: 767px) {
    .featured-news__featured-image-wrapper {
        height: 200px;
    }

    .featured-news__thumbnail-wrapper {
        width: 120px;
        height: 85px;
    }

    .featured-news__secondary-link {
        padding: 1rem;
    }

    .featured-news__view-all-wrapper {
        padding: 1rem;
    }
}

/* Tablet Portrait: Enhanced single column */
@media (min-width: 768px) and (max-width: 899px) {
    .featured-news__grid {
        gap: 2rem;
    }

    .featured-news__featured-image-wrapper {
        height: 260px; /* Reduced from 320px for better proportion */
    }

    .featured-news__thumbnail-wrapper {
        width: 150px;
        height: 100px;
    }

    .featured-news__secondary-link {
        padding: 1rem 1.25rem;
    }
}

/* Tablet Landscape: Intermediate 40/60 split */
@media (min-width: 900px) and (max-width: 1023px) {
    .featured-news__grid {
        grid-template-columns: 2fr 3fr; /* 40/60 split for tablet-landscape */
        gap: 2rem;
    }

    .featured-news__featured-image-wrapper {
        height: 240px; /* Smoother transition to desktop */
    }

    .featured-news__featured-content {
        padding: 1.25rem;
    }

    .featured-news__featured-title {
        font-size: 1.375rem;
    }

    .featured-news__thumbnail-wrapper {
        width: 140px;
        height: 95px;
    }

    .featured-news__secondary-link {
        padding: 1rem 1.25rem;
    }

    .featured-news__secondary-title {
        font-size: 0.9375rem;
    }
}

/* Desktop: Full 30/70 layout */
@media (min-width: 1024px) {
    .featured-news__featured-image-wrapper {
        height: 280px; /* Smooth progression: 200 → 260 → 240 → 280 */
    }

    .featured-news__featured-content {
        padding: 1.25rem;
    }

    .featured-news__thumbnail-wrapper {
        width: 160px;
        height: 100px;
    }

    .featured-news__secondary-link {
        padding: 1rem 1.25rem;
    }

    /* Constrain View All button width on larger screens */
    .featured-news__view-all {
        width: auto;
        min-width: 200px;
        max-width: 300px;
    }
}

/* Large Desktop: Enhanced sizing */
@media (min-width: 1200px) {
    .featured-news__featured-image-wrapper {
        height: 300px;
    }

    .featured-news__featured-content {
        padding: 1.5rem;
    }

    .featured-news__featured-title {
        font-size: 1.5rem;
    }

    .featured-news__thumbnail-wrapper {
        width: 200px;
        height: 115px;
    }

    .featured-news__secondary-link {
        padding: 1.25rem 1.5rem;
    }

    .featured-news__secondary-title {
        font-size: 1.125rem;
    }
}

/* Extra Large Desktop */
@media (min-width: 1400px) {
    .featured-news__featured-image-wrapper {
        height: 320px;
    }

    .featured-news__featured-title {
        font-size: 1.625rem;
    }

    .featured-news__thumbnail-wrapper {
        width: 240px;
        height: 140px;
    }

    .featured-news__secondary-link {
        padding: 1.5rem 1.75rem;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .featured-news__featured,
    .featured-news__secondary-item {
        border: 2px solid currentColor;
    }

    .featured-news__featured-link:focus,
    .featured-news__secondary-link:focus,
    .featured-news__view-all:focus {
        outline-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .featured-news__featured,
    .featured-news__secondary-item,
    .featured-news__featured-image,
    .featured-news__thumbnail,
    .featured-news__featured-title,
    .featured-news__secondary-title,
    .featured-news__read-more,
    .featured-news__view-all {
        transition: none;
    }

    .featured-news__featured:hover {
        transform: none;
    }

    .featured-news__featured:hover .featured-news__featured-image,
    .featured-news__secondary-item:hover .featured-news__thumbnail {
        transform: none;
    }
}

/* Screen Reader Only */
.featured-news__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Visible (keyboard only focus) */
.featured-news__featured-link:focus-visible,
.featured-news__secondary-link:focus-visible,
.featured-news__view-all:focus-visible {
    outline: 3px solid var(--fn-focus-color);
    outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .featured-news {
        break-inside: avoid;
    }

    .featured-news__grid {
        display: block;
    }

    .featured-news__featured,
    .featured-news__secondary-item {
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }

    .featured-news__view-all-wrapper {
        display: none;
    }
}

/* ==========================================================================
   Loading/Empty States
   ========================================================================== */

.featured-news--loading .featured-news__grid {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-news__loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top-color: var(--fn-focus-color);
    border-radius: 50%;
    animation: fn-spin 0.8s linear infinite;
}

@keyframes fn-spin {
    to {
        transform: rotate(360deg);
    }
}

.featured-news--empty .featured-news__grid {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: var(--fn-border-radius);
}

.featured-news__empty-message {
    text-align: center;
    color: #6c757d;
}

.featured-news__empty-message i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}
