/**
 * Modern News Item Styles for UMMSE
 * Contemporary design with U-M branding
 */

/* ==========================================================================
   CSS Variables for Easy Customization
   ========================================================================== */

:root {
    --um-blue: #00274C;
    --um-maize: #FFCB05;
    --um-maize-light: #FFD75F;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-light: #999;
    --border-color: #e5e5e5;
    --bg-light: #f8f9fa;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Single News Item
   ========================================================================== */

.single-news_item .news-item-single,
.single-news-item .news-item-single {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Meta Information Bar */
.documentActions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, var(--bg-light) 0%, #fff 100%);
    border-left: 4px solid var(--um-maize);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.documentByLine {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    font-size: 0.95rem;
}

.documentPublished {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--um-blue);
    gap: 0.5rem;
}

.documentPublished::before {
    content: "📅";
    font-size: 1.1em;
}

.documentLocation {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    gap: 0.5rem;
}

.documentLocation::before {
    content: "📍";
    font-size: 1.1em;
}

/* Title */
.documentFirstHeading {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--um-blue);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Description/Lead Paragraph */
.documentDescription {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 3rem;
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--um-maize);
    font-weight: 400;
}

/* Featured Image Container */
.newsImageContainer {
    margin: 3rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.newsImageContainer:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.newsImage {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.imageCaption {
    padding: 1.25rem 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    font-style: normal;
    margin: 0;
}

.imageCaption::before {
    content: "ℹ️ ";
    margin-right: 0.5rem;
}

/* Content */
.news-item-content .entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.news-item-content .entry-content p {
    margin-bottom: 1.75rem;
}

.news-item-content .entry-content h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    color: var(--um-blue);
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
    padding-bottom: 0.75rem;
}

.news-item-content .entry-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--um-maize);
    border-radius: 2px;
}

.news-item-content .entry-content h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--um-blue);
    font-weight: 600;
}

.news-item-content .entry-content a {
    color: var(--um-blue);
    text-decoration: underline;
    text-decoration-color: var(--um-maize);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: var(--transition);
}

.news-item-content .entry-content a:hover {
    color: var(--um-maize);
    text-decoration-color: var(--um-blue);
}

.news-item-content .entry-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-left: 4px solid var(--um-maize);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-style: italic;
    color: var(--text-secondary);
}

.news-item-content .entry-content ul,
.news-item-content .entry-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.news-item-content .entry-content li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

/* Footer */
.news-item-content .entry-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    font-size: 0.95rem;
}

.documentAuthor {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.documentAuthor::before {
    content: "✍️";
    font-size: 1.1em;
}

.author-name {
    font-weight: 600;
    color: var(--um-blue);
}

.documentTags {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.documentTags a {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--bg-light);
    color: var(--um-blue);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.documentTags a:hover {
    background: var(--um-blue);
    color: white;
    border-color: var(--um-blue);
    transform: translateY(-1px);
}

/* ==========================================================================
   News Archive/Listing
   ========================================================================== */

.news-archive-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.news-archive-header {
    margin: 0 0 2rem;
    padding: 0;
    text-align: left;
}

.news-archive-header .page-title {
    font-size: clamp(2.25rem, 5vw, 3rem);
    color: var(--um-blue);
    margin: 0 0 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.archive-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* News Listing Grid */
.news-listing {
    display: grid;
    gap: 3rem;
}

.news-listing-item {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.news-listing-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--um-maize);
}

.news-item-wrapper {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
}

.news-item-thumbnail {
    position: relative;
    overflow: hidden;
    background: var(--bg-light);
}

.news-item-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 39, 76, 0.7));
    opacity: 0;
    transition: var(--transition);
}

.news-listing-item:hover .news-item-thumbnail::after {
    opacity: 1;
}

.news-item-thumbnail img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: var(--transition);
}

.news-listing-item:hover .news-item-thumbnail img {
    transform: scale(1.05);
}

.news-item-text {
    display: flex;
    flex-direction: column;
    padding: 2rem 2rem 2rem 0;
}

.news-item-title {
    font-size: 1.75rem;
    margin: 0 0 1rem 0;
    line-height: 1.3;
    font-weight: 700;
}

.news-item-title a {
    color: var(--um-blue);
    text-decoration: none;
    transition: var(--transition);
}

.news-item-title a:hover {
    color: var(--um-maize);
}

.news-item-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.news-date {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--um-blue);
}

.news-date::before {
    content: "📅";
}

.news-location {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.news-location::before {
    content: "📍";
}

.news-item-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-size: 1.05rem;
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--um-blue);
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    transition: var(--transition);
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--um-blue);
    border-radius: var(--radius-sm);
    width: fit-content;
}

.news-read-more::after {
    content: '→';
    transition: var(--transition);
}

.news-read-more:hover {
    background: var(--um-blue);
    color: white;
    transform: translateX(4px);
}

.news-read-more:hover::after {
    transform: translateX(4px);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
}

.pagination .nav-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 1rem;
    background: white;
    color: var(--um-blue);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--um-blue);
    color: white;
    border-color: var(--um-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.pagination .current {
    background: var(--um-blue);
    color: white;
    border-color: var(--um-blue);
}

.pagination .prev,
.pagination .next {
    padding: 0 1.5rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 992px) {
    .news-item-wrapper {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
    }
    
    .news-item-text {
        padding: 1.5rem 1.5rem 1.5rem 0;
    }
}

@media (max-width: 768px) {
    .documentFirstHeading {
        font-size: 2rem;
    }
    
    .documentDescription {
        font-size: 1.125rem;
        padding: 1.25rem 1.5rem;
    }
    
    .news-item-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .news-item-thumbnail img {
        height: 240px;
    }
    
    .news-item-text {
        padding: 1.5rem;
    }
    
    .news-item-title {
        font-size: 1.5rem;
    }
    
    .documentActions {
        padding: 1rem;
    }
    
    .documentByLine {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .news-item-single {
        padding: 2rem 1rem;
    }
    
    .documentFirstHeading {
        font-size: 1.75rem;
    }
    
    .documentDescription {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .news-item-title {
        font-size: 1.25rem;
    }
    
    .news-item-content .entry-content {
        font-size: 1rem;
    }
    
    .news-read-more {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .plone-style-news:not(.force-light-mode) {
        --text-primary: #e5e5e5;
        --text-secondary: #b0b0b0;
        --text-light: #888;
        --border-color: #333;
        --bg-light: #1a1a1a;
    }
    
    .plone-style-news:not(.force-light-mode) .news-listing-item,
    .plone-style-news:not(.force-light-mode) .documentActions {
        background: #222;
    }
    
    .plone-style-news:not(.force-light-mode) .imageCaption {
        background: #1a1a1a;
    }
}

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

@media print {
    .documentActions,
    .news-read-more,
    .pagination {
        display: none;
    }
    
    .newsImageContainer {
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .news-item-content .entry-content a {
        text-decoration: underline;
        color: black;
    }
    
    .news-item-content .entry-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

.news-listing-shortcode .news-item-wrapper-no-image {
    display: block;
}

.news-listing-shortcode .news-item-wrapper-no-image .news-item-text {
    padding: 2rem;
}





/* News/Event About-section layout */

.about-section-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.about-section-sidebar,
.about-section-main {
    min-width: 0;
}

.about-section-sidebar .section-nav {
    margin-top: 0;
}

/*
 * Override the old .news-item-single rule, which previously constrained
 * the entire single-news template and added 3rem of padding.
 */
.single-news_item .about-section-main.news-item-single,
.single-news-item .about-section-main.news-item-single {
    max-width: none;
    width: auto;
    margin: 0;
    padding: 0;
}

/* Allow the outer template to use the available Astra container width. */
.single-news_item .news-single-main,
.single-news-item .news-single-main {
    max-width: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 900px) {
    .about-section-layout {
        grid-template-columns: 1fr;
    }

    .about-section-sidebar {
        margin-bottom: 1.5rem;
    }
}

.about-section-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.about-section-sidebar,
.about-section-main {
    min-width: 0;
}

.about-section-sidebar .section-nav {
    margin-top: 0;
}

@media (max-width: 900px) {
    .about-section-layout {
        grid-template-columns: 1fr;
    }

    .about-section-sidebar {
        margin-bottom: 1.5rem;
    }
}
