/**
 * TYPO3 v14 News Site Package Theme Base Styles
 * Built on Bootstrap Package classes (No fluid_styled_content markup dependencies)
 */

/* ==========================================================================
   1. Design Tokens & CSS Custom Properties (Theming)
   ========================================================================== */
:root {
    --news-primary: #101820;      /* Deep obsidian headline text */
    --news-accent: #d9381e;       /* Editorial red alert/breaking flag */
    --news-muted: #5a626a;        /* Readable meta-text gray */
    --news-bg-light: #f9f9fb;     /* Card background */
    --news-border: #e2e8f0;       /* Thin layout divider borders */
    --news-font-editorial: 'Georgia', serif;
    --news-font-sans: system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   2. Core Typography (News Overrides)
   ========================================================================== */
body {
    font-family: var(--news-font-sans);
    color: var(--news-primary);
    -webkit-font-smoothing: antialiased;
}

/* News Article Typo Layout */
.frame-type-header h1,
.news-article-title {
    font-family: var(--news-font-editorial);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* Bootstrap package frame headings */
.frame h2, .frame h3 {
    font-family: var(--news-font-editorial);
    font-weight: 700;
    color: var(--news-primary);
}

/* ==========================================================================
   3. Frontpage Layout Architecture (Bootstrap Package Grids)
   ========================================================================== */
/* Lead/Hero Article Layout Wrapper */
.news-hero-wrapper {
    border-bottom: 2px solid var(--news-primary);
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
}

.news-hero-wrapper .card-title {
    font-size: calc(1.5rem + 1.5vw);
    font-family: var(--news-font-editorial);
    margin-top: 1rem;
}

/* 3-Column Breaking/Latest News Grid overrides */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ==========================================================================
   4. Component Blocks (Cards, Text-Pic, Lists)
   ========================================================================== */
/* Style adaptation for Bootstrap Package "Card Group" or "TextPic" */
.frame-type-textpic, 
.frame-type-card_group .card {
    border: none !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    transition: opacity 0.2s ease-in-out;
}

.frame-type-card_group .card:hover {
    opacity: 0.9;
}

.frame-type-card_group .card-img-top,
.news-image-wrapper img {
    border-radius: 0 !important;
    object-fit: cover;
    aspect-ratio: 16 / 10;
}

.frame-type-card_group .card-body {
    padding: 1rem 0 0 0 !important; /* Elegant flat news design padding */
}

/* ==========================================================================
   5. News Editorial Meta Elements
   ========================================================================== */
/* Category Badges */
.badge-news-category {
    background-color: var(--news-accent) !important;
    color: #ffffff !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.4em 0.8em;
    border-radius: 0;
}

/* Timestamp / Author meta row */
.news-meta-data {
    font-family: var(--news-font-sans);
    font-size: 0.85rem;
    color: var(--news-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.news-meta-data span:not(:last-child)::after {
    content: "•";
    margin: 0 0.5rem;
    color: var(--news-border);
}

/* ==========================================================================
   6. Custom UI & Typo3 Native Enhancements
   ========================================================================== */
/* Modern Editorial Border Divider Block instead of generic <hr> */
.news-divider {
    height: 4px;
    background-color: var(--news-primary);
    width: 60px;
    margin: 1.5rem 0;
}

/* Frontpage sticky sidebar lists */
.news-sidebar-sticky {
    position: sticky;
    top: 2rem;
}

.news-sidebar-list .list-group-item {
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--news-border);
    background: transparent;
}

.news-sidebar-list .list-group-item:last-child {
    border-bottom: none;
}

/* ==========================================================================
   7. Dark Mode Integration (Leveraging Bootstrap 5 Utility)
   ========================================================================== */
[data-bs-theme="dark"] {
    --news-primary: #f8f9fa;
    --news-bg-light: #1e252b;
    --news-border: #343a40;
    --news-muted: #adb5bd;
}
/* Core Structural Wrap for Hero Container */
.news-hero-item {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-bottom: 2rem;
}

/* Forces image consistency and prevents it from being squished */
.news-hero-media img {
    object-fit: cover;
    display: block;
    width: 100%;
    height: auto;
    min-height: 400px;
    max-height: 550px; /* Adjust this to change the overall image banner height */
}

/* 
   WHITE STRIP OVERLAY AT THE BOTTOM SIDE
   This strictly limits the strip to the bottom edge 
*/
.news-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto; /* Ensures it only grows as large as the text inside it */
    background-color: rgba(255, 255, 255, 0.95); /* Crisp, solid white background */
    padding: 15px 25px; /* Vertical and horizontal padding inside the strip */
    box-shadow: 0 -5px 15px rgba(0,0,0,0.15); /* Soft drop shadow on the image */
    z-index: 10;
}

/* Headline Styling inside the white strip */
h1.news-hero-title {
    color: #000000 !important; /* Strict black font color */
    font-size: 1.6rem; /* Adjust font size if headline feels too bulky */
    font-weight: 700;
    line-height: 1.2;
}

/* Small Read More Box */
.news-hero-more-btn {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 6px 14px !important; /* Compact button padding */
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.news-hero-more-btn:hover {
    background-color: #333333 !important;
    color: #ffffff !important;
}












/* Core container constraining the image aspect ratio */
.hero-news-container {
    position: relative;
    width: 100%;
    margin-bottom: 2.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Forces the featured image to be noticeably massive */
.hero-news-image {
    width: 100%;
    height: auto;
    min-height: 520px;
    max-height: 650px;
    object-fit: cover;
    display: block;
}

/* Fallback structural block */
.hero-news-placeholder {
    width: 100%;
    height: 520px;
    background-color: #f5f5f5;
}

/* White layout strip running straight across the bottom */
.hero-news-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff; /* Strict solid white strip */
    padding: 24px 40px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    z-index: 10;
}

/* Hard black title typography without text decorators */
.hero-news-title {
    font-family: inherit;
    font-size: 2.25rem;
    font-weight: 800;
    color: #000000; /* Strict black font color */
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
    flex: 1;
}

/* Compact box button shape */
.hero-read-more {
    display: inline-block;
    background-color: #000000;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: background-color 0.15s ease-in-out;
}

/* Interactive focus feedback */
.hero-read-more:hover {
    background-color: #222222;
}

/* Responsive breakpoint drop-down rules for handheld screens */
@media (max-width: 992px) {
    .hero-news-overlay {
        position: relative; /* Un-pins the overlay to preserve space on small screen heights */
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 15px;
    }
    .hero-news-title {
        font-size: 1.65rem;
    }
    .hero-news-image,
    .hero-news-placeholder {
        min-height: 320px;
    }
}
