/* ==========================================================================
   News Feature Styles
   School of Storytelling Theme
   ========================================================================== */

/* CSS Custom Properties */
:root {
    --font-malayalam: 'Noto Sans Malayalam', 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --news-card-radius: 24px;
    --news-card-bg: #1a1a1a;
    --news-card-border: rgba(255, 255, 255, 0.08);
    --news-section-padding: 56px 0;
    --news-transition: 0.3s ease;
}

/* ==========================================================================
   Override Global Section Margin
   The theme's style.css applies `section { margin-bottom: 60px }` globally.
   News sections manage their own spacing entirely via padding, so we
   reset that margin here to prevent double-spacing between sections.
   ========================================================================== */

.news-marquee-section,
.news-featured-section,
.news-latest-section,
.news-popular-section,
.news-highlights-section,
.news-newsletter-banner-section,
.news-search-results-section,
.news-category-hero,
.news-category-listing-section {
    margin-bottom: 0;
}

/* ==========================================================================
   Noto Sans Malayalam Font Scoping
   Applied ONLY within news templates via WordPress body classes
   ========================================================================== */

body.post-type-archive-sos_news .news-content-text,
body.single-sos_news .news-detail-title,
body.single-sos_news .news-detail-content,
body.single-sos_news .news-detail-content p,
body.single-sos_news .news-detail-content h1,
body.single-sos_news .news-detail-content h2,
body.single-sos_news .news-detail-content h3,
body.single-sos_news .news-detail-content h4,
body.single-sos_news .news-detail-content h5,
body.single-sos_news .news-detail-content h6,
body.single-sos_news .news-detail-content li,
body.single-sos_news .news-detail-content td,
body.single-sos_news .news-detail-content th,
body.single-sos_news .news-detail-content blockquote,
body.single-sos_news .news-detail-content figcaption,
body.search-results .news-content-text {
    font-family: var(--font-malayalam);
}

/* Compensate for fixed navbar offset (no hero section) */
.news-archive-page > *:first-child {
    padding-top: 200px;
}

@media (max-width: 991px) {
    .news-archive-page > *:first-child {
        padding-top: 170px;
    }
}

@media (max-width: 767px) {
    .news-archive-page > *:first-child {
        padding-top: 150px;
    }
}

/* Top padding for featured section on news archive page */
body.post-type-archive-sos_news .news-featured-section {
    padding-top: 115px;
}

/* ==========================================================================
   News Archive Page - Featured News Section
   ========================================================================== */

.news-featured-section {
    background-color: var(--bg-black);
    padding: var(--news-section-padding);
}

.news-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.news-section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.news-featured-grid {
    display: flex;
    gap: 24px;
    min-height: 500px;
}

.news-featured-large {
    flex: 0 0 58%;
    max-width: 58%;
}

.news-featured-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   Reusable News Card Component
   ========================================================================== */

.news-card {
    position: relative;
    border-radius: var(--news-card-radius);
    overflow: hidden;
    transition: transform var(--news-transition), box-shadow var(--news-transition);
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.news-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Dark card variant */
.news-card--dark {
    background: var(--news-card-bg);
    border: 1px solid var(--news-card-border);
}

/* Light card variant */
.news-card--light {
    background: #ffffff;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.news-card--light:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.news-card--light .news-card-title {
    color: #1a1a1a;
}

.news-card--light .news-card-excerpt {
    color: #555;
}

.news-card--light .news-author-name {
    color: #666;
}

/* Large card - used for featured hero */
.news-card--large {
    height: 100%;
}

.news-card--large .news-card-link {
    position: relative;
    display: flex;
    flex-direction: column;
}

.news-card--large .news-card-image {
    position: absolute;
    inset: 0;
    border-radius: var(--news-card-radius);
}

.news-card--large .news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card--large .news-card-arrow {
    z-index: 4;
    bottom: 0;
    right: 0;
    width: 52px;
    height: 52px;
    border-radius: 0;
}

/* Rounded plate behind large-card arrow — border appears outside the image */
.news-card--large::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 68px;
    height: 68px;
    background: var(--bg-black);
    border-radius: 20px 0 0 0;
    z-index: 3;
}

.news-card--large .news-card-arrow svg {
    width: 22px;
    height: 22px;
}

.news-card--large .news-card-content {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 32px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.news-card--large .news-card-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600;
    margin-bottom: 8px;
}

.news-card--large .news-card-excerpt {
    font-size: 0.95rem;
    margin-bottom: 16px;
    opacity: 0.85;
}

/* Medium card - horizontal layout */
.news-card--medium .news-card-link {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.news-card--medium .news-card-image {
    flex: 0 0 140px;
    max-width: 140px;
    overflow: hidden;
    border-radius: var(--news-card-radius);
}

.news-card--medium .news-card-arrow {
    width: 28px;
    height: 28px;
    bottom: 6px;
    right: 6px;
}

.news-card--medium .news-card-arrow svg {
    width: 14px;
    height: 14px;
}

.news-card--medium .news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card--medium .news-card-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-card--medium .news-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.news-card--medium .news-card-excerpt {
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.7;
}

/* Small card - vertical layout */
.news-card--small .news-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: var(--news-card-radius) var(--news-card-radius) 0 0;
}

.news-card--small .news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--news-transition);
}

.news-card--small:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card--small .news-card-content {
    padding: 16px;
}

.news-card--small .news-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.news-card--small .news-card-excerpt {
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.7;
}

/* Card shared elements */
.news-card-title {
    color: var(--color-white);
    line-height: 1.4;
    margin: 0;
}

.news-card-excerpt {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin: 0;
}

.news-card-image {
    position: relative;
    background: #141414;
    border-radius: var(--news-card-radius);
    overflow: hidden;
}

.news-card-placeholder {
    width: 100%;
    height: 100%;
    min-height: 150px;
    background: linear-gradient(135deg, #1e1e1e 0%, #161616 100%);
}

/* Green arrow overlay on card image */
.news-card-arrow {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--primary-green);
    border-radius: 12px 0 0 0;
    color: var(--color-white);
    flex-shrink: 0;
    transition: background var(--news-transition);
    z-index: 4;
}

.news-card-arrow svg {
    width: 18px;
    height: 18px;
}

.news-card:hover .news-card-arrow {
    background: var(--color-green-dark);
}

.news-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.news-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.news-author-name {
    font-family: var(--font-base);
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
}

/* Default avatar SVG icon (when no Gravatar exists) */
.news-author-avatar--default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.news-author-avatar--default svg {
    width: 60%;
    height: 60%;
}

/* Light card variant default avatar */
.news-card--light .news-author-avatar--default {
    background: #f0f0f0;
    color: #999;
}

/* Detail page default avatar */
.news-detail-author .news-author-avatar--default {
    background: #f0f0f0;
    color: #999;
}

/* Popular story section default avatar */
.news-popular-section .news-author-avatar--default {
    background: #f0f0f0;
    color: #999;
}

.news-card-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--primary-green);
    border-radius: 12px 0 0 0;
    color: var(--color-white);
    flex-shrink: 0;
    transition: background var(--news-transition);
}

.news-card:hover .news-card-arrow {
    background: var(--color-green-dark);
}

.news-card-arrow svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   News Archive Page - "In the Loop" Marquee Section
   ========================================================================== */

.news-marquee-section {
    padding: 12px 0;
}

.news-marquee-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
    background: #161616;
    border: 1px solid rgba(0, 188, 22, 0.25);
    border-radius: 6px;
}

.news-marquee-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-green);
    color: var(--color-white);
    font-family: var(--font-base);
    font-size: 13px;
    font-weight: 600;
    height: 50px;
    padding: 0 32px 0 18px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

.news-marquee-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--color-white);
    border-radius: 50%;
    flex-shrink: 0;
}

.news-marquee-track {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    background: none;
    padding-left: 16px;
    -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
    mask-image: linear-gradient(to right, black 80%, transparent 100%);
}

.news-marquee-track:hover .news-marquee-text-inner {
    animation-play-state: paused;
}

.news-marquee-text-inner {
    display: inline-flex;
    animation: news-marquee-scroll 60s linear infinite;
    white-space: nowrap;
}

.news-marquee-text-inner span {
    display: inline-block;
    padding-right: 80px;
    font-family: var(--font-malayalam);
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}

@keyframes news-marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ==========================================================================
   News Archive Page - Latest News Carousel Section
   ========================================================================== */

.news-latest-section {
    background-color: var(--bg-black);
    padding: var(--news-section-padding);
}

.news-nav-arrows {
    display: flex;
    gap: 8px;
}

.news-nav-prev,
.news-nav-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
    transition: all var(--news-transition);
    padding: 0;
}

.news-nav-prev:hover,
.news-nav-next:hover {
    border-color: var(--primary-green);
    background: var(--primary-green);
}

.news-nav-prev.swiper-button-disabled,
.news-nav-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: default;
}

.news-nav-prev.swiper-button-disabled:hover,
.news-nav-next.swiper-button-disabled:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: transparent;
}

.news-nav-prev svg,
.news-nav-next svg {
    width: 18px;
    height: 18px;
}

.news-latest-swiper {
    overflow: hidden;
    padding-bottom: 4px;
}

.news-latest-swiper .swiper-wrapper {
    align-items: stretch;
}

.news-latest-swiper .swiper-slide {
    height: auto;
    display: flex;
}

.news-latest-swiper .swiper-slide .news-card {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.news-latest-swiper .swiper-slide .news-card .news-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-latest-swiper .swiper-slide .news-card .news-card-content {
    flex: 1;
}

/* ==========================================================================
   News Archive Page - Popular Story Section (White Background)
   ========================================================================== */

.news-popular-section {
    background: #ffffff;
    padding: var(--news-section-padding);
}

.news-popular-section .news-section-title {
    color: #1a1a1a;
}

.news-popular-featured {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    align-items: stretch;
}

.news-popular-image {
    flex: 0 0 58%;
    max-width: 58%;
    border-radius: var(--news-card-radius);
    overflow: hidden;
    position: relative;
    transition: transform var(--news-transition), box-shadow var(--news-transition);
}

.news-popular-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.news-popular-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-popular-image-link {
    display: block;
    height: 100%;
    position: relative;
}

/* Rounded plate behind popular story arrow — border appears outside the image */
.news-popular-image-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 64px;
    height: 64px;
    background: #ffffff;
    border-radius: 20px 0 0 0;
    z-index: 2;
}

.news-popular-image-arrow {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-green);
    border-radius: 0;
    color: var(--color-white);
    transition: background var(--news-transition);
    z-index: 3;
}

.news-popular-image-link:hover .news-popular-image-arrow {
    background: var(--color-green-dark);
}

.news-popular-image-arrow svg {
    width: 20px;
    height: 20px;
}

.news-popular-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-popular-content .news-popular-title {
    font-family: var(--font-malayalam);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 16px;
}

.news-popular-content .news-popular-title a {
    color: inherit;
    text-decoration: none;
}

.news-popular-content .news-popular-title a:hover {
    color: var(--primary-green);
}

.news-popular-content .news-popular-excerpt {
    font-family: var(--font-malayalam);
    font-size: 1rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
}

.news-popular-content .news-card-author .news-author-name {
    color: #666;
}

.news-popular-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ==========================================================================
   News Archive Page - Highlights Section
   ========================================================================== */

.news-highlights-section {
    background-color: var(--bg-black);
    padding: var(--news-section-padding);
}

/* Highlight hero card */
.news-highlight-hero {
    position: relative;
    border-radius: var(--news-card-radius);
    overflow: hidden;
    margin-bottom: 32px;
    min-height: 560px;
    transition: transform var(--news-transition), box-shadow var(--news-transition);
}

.news-highlight-hero:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.news-highlight-hero-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.news-highlight-hero-image {
    position: absolute;
    inset: 0;
}

.news-highlight-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-highlight-hero-content {
    position: relative;
    z-index: 2;
    padding: 48px;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
}

.news-highlight-hero-title {
    font-family: var(--font-malayalam);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    color: var(--color-white);
    line-height: 1.3;
    margin-bottom: 12px;
    max-width: 700px;
}

.news-highlight-hero-excerpt {
    font-family: var(--font-malayalam);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-width: 600px;
    margin-bottom: 16px;
}

.news-highlight-hero-arrow {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--primary-green);
    border-radius: 0;
    color: var(--color-white);
    z-index: 4;
    transition: background var(--news-transition);
}

/* Rounded plate behind highlights hero arrow — border appears outside the image */
.news-highlight-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 68px;
    height: 68px;
    background: var(--bg-black);
    border-radius: 20px 0 0 0;
    z-index: 3;
}

.news-highlight-hero-link:hover .news-highlight-hero-arrow {
    background: var(--color-green-dark);
}

.news-highlight-hero-arrow svg {
    width: 22px;
    height: 22px;
}

.news-highlights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* ==========================================================================
   News Detail Page
   ========================================================================== */

.news-detail-wrapper {
    background: #ffffff;
    color: #1a1a1a;
    padding-top: 110px;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* Back to News navigation bar */
.news-detail-back-bar {
    padding: 16px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 32px;
}

.news-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--news-transition);
}

.news-back-link:hover {
    color: #1a1a1a;
}

.news-back-link svg {
    flex-shrink: 0;
    transition: transform var(--news-transition);
}

.news-back-link:hover svg {
    transform: translateX(-3px);
}

.news-detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.news-detail-header {
    margin-bottom: 40px;
}

.news-detail-title {
    font-family: var(--font-malayalam);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 24px;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.news-detail-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.news-detail-author .news-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.news-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.news-detail-author .news-author-name {
    font-family: var(--font-base);
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
}

.news-detail-date {
    font-family: var(--font-base);
    font-size: 0.85rem;
    color: #888;
}

/* Share Buttons */
.news-share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.news-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: transparent;
    color: #555;
    cursor: pointer;
    transition: all var(--news-transition);
    padding: 0;
}

.news-share-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: rgba(0, 188, 22, 0.05);
}

.news-share-btn.copied {
    border-color: var(--primary-green);
    background: var(--primary-green);
    color: #fff;
}

.news-share-btn svg {
    width: 18px;
    height: 18px;
}

/* Featured image */
.news-detail-featured-image {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
}

.news-detail-featured-image .news-hero-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   News Detail Page - Gutenberg Content Styling (White BG)
   ========================================================================== */

.news-detail-content {
    font-family: var(--font-malayalam);
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.news-detail-content p {
    margin-bottom: 1.5em;
}

.news-detail-content h1,
.news-detail-content h2,
.news-detail-content h3,
.news-detail-content h4,
.news-detail-content h5,
.news-detail-content h6 {
    color: #1a1a1a;
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.75em;
}

.news-detail-content h1 { font-size: 2rem; }
.news-detail-content h2 { font-size: 1.75rem; }
.news-detail-content h3 { font-size: 1.5rem; }
.news-detail-content h4 { font-size: 1.25rem; }
.news-detail-content h5 { font-size: 1.1rem; }
.news-detail-content h6 { font-size: 1rem; }

.news-detail-content a {
    color: var(--primary-green);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.news-detail-content a:hover {
    color: var(--color-green-dark);
}

.news-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.news-detail-content .wp-block-image {
    margin: 2rem 0;
}

.news-detail-content .wp-block-image figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-top: 8px;
}

.news-detail-content .wp-block-gallery {
    margin: 2rem 0;
}

.news-detail-content blockquote,
.news-detail-content .wp-block-quote {
    border-left: 4px solid var(--primary-green);
    margin: 2rem 0;
    padding: 16px 24px;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
}

.news-detail-content blockquote p {
    font-style: italic;
    color: #444;
    margin-bottom: 0.5em;
}

.news-detail-content blockquote cite {
    font-size: 0.85rem;
    color: #888;
    font-style: normal;
}

.news-detail-content ul,
.news-detail-content ol {
    margin: 1.5em 0;
    padding-left: 1.5em;
}

.news-detail-content li {
    margin-bottom: 0.5em;
}

.news-detail-content table,
.news-detail-content .wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.news-detail-content table th,
.news-detail-content table td {
    padding: 12px 16px;
    border: 1px solid #ddd;
    text-align: left;
}

.news-detail-content table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1a1a1a;
}

.news-detail-content table tr:nth-child(even) {
    background: #fafafa;
}

.news-detail-content .wp-block-columns {
    margin: 2rem 0;
}

.news-detail-content .wp-block-separator {
    border: none;
    border-top: 2px solid #eee;
    margin: 2.5rem 0;
}

.news-detail-content .wp-block-code,
.news-detail-content pre {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 2rem 0;
}

.news-detail-content .wp-block-code code {
    background: transparent;
    color: inherit;
}

.news-detail-content .wp-block-pullquote {
    border-top: 4px solid var(--primary-green);
    border-bottom: 4px solid var(--primary-green);
    padding: 2rem 0;
    margin: 2.5rem 0;
    text-align: center;
}

.news-detail-content .wp-block-pullquote blockquote {
    border-left: none;
    background: transparent;
    padding: 0;
}

.news-detail-content .wp-block-pullquote p {
    font-size: 1.25rem;
    font-style: italic;
}

.news-detail-content .wp-block-cover {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.news-detail-content .wp-block-embed {
    margin: 2rem 0;
}

.news-detail-content .wp-block-embed iframe {
    max-width: 100%;
    border-radius: 8px;
}

/* Alignments in detail page content */
.news-detail-content .alignwide {
    max-width: 1000px;
    margin-left: calc(50% - 500px);
    margin-right: calc(50% - 500px);
    width: auto;
}

.news-detail-content .alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
}

/* Tags */
.news-detail-tags {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.news-tag {
    display: inline-block;
    padding: 6px 16px;
    background: #f0f0f0;
    color: #555;
    font-family: var(--font-base);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 20px;
    text-decoration: none;
    transition: all var(--news-transition);
}

.news-tag:hover {
    background: var(--primary-green);
    color: #fff;
}

/* ==========================================================================
   News Detail — Previous / Next Navigation
   ========================================================================== */

.news-adjacent-nav {
    background: #ffffff;
    border-top: 2px solid #f0f0f0;
    padding: 0 0 56px;
}

.news-adjacent-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #f0f0f0; /* acts as a divider line between the two halves */
}

/* Each side */
.news-adjacent-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 32px 24px;
    background: #ffffff;
    text-decoration: none;
    color: #1a1a1a;
    transition: background var(--news-transition);
    min-height: 140px;
}

.news-adjacent-item:hover {
    background: #f8f9fa;
}

.news-adjacent-empty {
    pointer-events: none;
    background: #fdfdfd;
}

/* Direction label (← Previous / Next →) */
.news-adjacent-direction {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-base);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-green);
}

.news-adjacent-direction svg {
    flex-shrink: 0;
    transition: transform var(--news-transition);
}

.news-adjacent-prev:hover .news-adjacent-direction svg {
    transform: translateX(-4px);
}

.news-adjacent-next:hover .news-adjacent-direction svg {
    transform: translateX(4px);
}

.news-adjacent-direction--right {
    justify-content: flex-end;
}

/* Card body — thumbnail + text */
.news-adjacent-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.news-adjacent-body--right {
    flex-direction: row-reverse;
}

/* Thumbnail */
.news-adjacent-thumb {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.news-adjacent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Text block */
.news-adjacent-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.news-adjacent-text--right {
    text-align: right;
}

.news-adjacent-category {
    font-family: var(--font-base);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary-green);
}

.news-adjacent-title {
    font-family: var(--font-malayalam);
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--news-transition);
}

.news-adjacent-item:hover .news-adjacent-title {
    color: var(--primary-green);
}

.news-adjacent-date {
    font-family: var(--font-base);
    font-size: 0.78rem;
    color: #aaa;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 767px) {
    .news-adjacent-inner {
        grid-template-columns: 1fr;
    }

    .news-adjacent-item {
        padding: 24px 16px;
    }

    .news-adjacent-direction--right {
        justify-content: flex-start;
    }

    .news-adjacent-body--right {
        flex-direction: row;
    }

    .news-adjacent-text--right {
        text-align: left;
    }

    .news-adjacent-thumb {
        flex: 0 0 64px;
        width: 64px;
        height: 64px;
    }
}

/* ==========================================================================
   News Search Results
   ========================================================================== */

.news-search-results-section {
    background-color: var(--bg-black);
    padding: var(--news-section-padding);
}

.news-search-results-heading {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: 32px;
}

.news-search-results-heading span {
    color: var(--primary-green);
}

.news-search-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.news-no-results {
    text-align: center;
    padding: 80px 0;
}

.news-no-results p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}

/* Pagination */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
}

.news-pagination a,
.news-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-family: var(--font-base);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all var(--news-transition);
}

.news-pagination a {
    background: #1a1a1a;
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.news-pagination a:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.news-pagination span.current {
    background: var(--primary-green);
    color: var(--color-white);
    border: 1px solid var(--primary-green);
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1199px) {
    .news-featured-grid {
        min-height: 420px;
    }

    .news-highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .news-featured-grid {
        flex-direction: column;
        min-height: auto;
    }

    .news-featured-large {
        flex: none;
        max-width: 100%;
        min-height: 350px;
    }

    .news-featured-stack {
        flex-direction: row;
    }

    .news-popular-featured {
        flex-direction: column;
        gap: 24px;
    }

    .news-popular-image {
        flex: none;
        max-width: 100%;
        aspect-ratio: 16/9;
    }

    .news-popular-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-search-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-detail-wrapper {
        padding-top: 90px;
    }

    .news-detail-content .alignwide {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 767px) {
    :root {
        --news-section-padding: 48px 0;
    }

    .news-detail-container {
        padding: 20px 0 0px 20px;
    }

    /* Hide marquee on mobile */
    .news-marquee-section {
        display: none;
    }

    /* Hide author info on cards in archive/listing pages on mobile */
    body.post-type-archive-sos_news .news-card-meta,
    body.search-results .news-card-meta {
        display: none;
    }

    /* Reduce header height on mobile for news detail page */
    body.single-sos_news .site-header {
        padding-top: 0.75rem;
        padding-bottom: 0.25rem;
    }

    .news-featured-large {
        min-height: 280px;
    }

    .news-featured-stack {
        flex-direction: column;
    }

    .news-popular-cards {
        grid-template-columns: 1fr;
    }

    .news-highlights-grid {
        grid-template-columns: 1fr;
    }

    .news-highlight-hero {
        min-height: 380px;
    }

    .news-highlight-hero-content {
        padding: 24px;
        min-height: 380px;
    }

    .news-search-grid {
        grid-template-columns: 1fr;
    }

    /* Smaller marquee badge on mobile */
    .news-marquee-badge {
        font-size: 11px;
        height: 32px;
        padding: 0 20px 0 12px;
        clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%);
    }

    /* Hide excerpt on cards in archive, show full title */
    body.post-type-archive-sos_news .news-card-excerpt {
        display: none;
    }
    body.post-type-archive-sos_news .news-card--medium .news-card-title,
    body.post-type-archive-sos_news .news-card--small .news-card-title {
        -webkit-line-clamp: unset;
        overflow: visible;
        display: block;
    }

    .news-detail-wrapper {
        padding-top: 80px;
        padding-bottom: 48px;
    }

    .news-detail-title {
        font-size: 1.5rem;
    }

    .news-detail-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-detail-content {
        font-size: 1rem;
    }

    .news-detail-content .alignwide,
    .news-detail-content .alignfull {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .news-card--medium .news-card-image {
        flex: 0 0 110px;
        max-width: 110px;
    }
}

/* ==========================================================================
   Section Header - "Read more" / View all link
   ========================================================================== */

.news-view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-base);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-green);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--news-transition), gap var(--news-transition);
    white-space: nowrap;
}

.news-view-all-link:hover {
    color: var(--color-white);
    gap: 10px;
}

.news-view-all-link svg {
    flex-shrink: 0;
    transition: transform var(--news-transition);
}

.news-view-all-link:hover svg {
    transform: translateX(3px);
}

/* Popular section: the title is dark so the link should also adapt */
.news-popular-section .news-view-all-link {
    color: var(--primary-green);
}

.news-popular-section .news-view-all-link:hover {
    color: #111;
}

/* ==========================================================================
   News Category Listing Page (taxonomy-news_category.php)
   White background — horizontal list layout
   ========================================================================== */

.news-category-page {
    background-color: #ffffff;
    min-height: 100vh;
    padding-top: 110px;
}

/* Back bar */
.news-category-back-bar {
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    padding: 16px 0;
}

.news-category-back-bar .news-back-link {
    color: #555;
}

.news-category-back-bar .news-back-link:hover {
    color: #1a1a1a;
}

/* Hero header */
.news-category-hero {
    background-color: #ffffff;
    padding: 24px 0;
}

.news-category-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin: 0;
}

.news-category-hero-desc {
    font-size: 1rem;
    color: #666;
    max-width: 560px;
    line-height: 1.7;
    margin: 0;
}

/* Listing section */
.news-category-listing-section {
    background: #ffffff;
    padding: 12px 0 64px;
}

/* Vertical list of items */
.news-category-list {
    display: flex;
    flex-direction: column;
}

/* Each row: image left + content right */
.news-category-item {
    border-bottom: 1px solid #eee;
    transition: background var(--news-transition);
}

.news-category-item:first-child {
    border-top: 1px solid #eee;
}

.news-category-item:hover {
    background: #fafafa;
}

.news-category-item-link {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 24px 8px;
    text-decoration: none;
    color: inherit;
}

/* Image column */
.news-category-item-image {
    flex: 0 0 220px;
    width: 220px;
    aspect-ratio: 4/3;
    border-radius: var(--news-card-radius);
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    flex-shrink: 0;
}

.news-category-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--news-transition);
}

.news-category-item:hover .news-category-item-img {
    transform: scale(1.04);
}

.news-category-item-image .news-card-placeholder {
    width: 100%;
    height: 100%;
    min-height: 140px;
}

/* Reuse popular story green corner arrow */
.news-category-item-image .news-popular-image-arrow {
    width: 40px;
    height: 40px;
}

.news-category-item-image .news-popular-image-arrow svg {
    width: 18px;
    height: 18px;
}



/* Content column */
.news-category-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.news-category-item-title {
    font-family: var(--font-malayalam);
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0;
}

.news-category-item-excerpt {
    font-family: var(--font-malayalam);
    font-size: 0.95rem;
    color: #555;
    line-height: 1.65;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-category-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.news-category-item-meta .news-card-author {
    gap: 8px;
}

.news-category-item-meta .news-author-name {
    color: #666;
}

.news-category-item-meta .news-author-avatar--default {
    background: #f0f0f0;
    color: #999;
}

.news-category-item-date {
    font-family: var(--font-base);
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
}

/* Pagination — light variant */
.news-pagination--light {
    margin-top: 48px;
}

.news-pagination--light a {
    background: #f5f5f5;
    color: #1a1a1a;
    border: 1px solid #ddd;
}

.news-pagination--light a:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: #fff;
}

.news-pagination--light span.current {
    background: var(--primary-green);
    color: #fff;
    border-color: var(--primary-green);
}

/* Font scoping + body overrides for category listing */
body.tax-news_category {
    background-color: #ffffff;
    color: #1a1a1a;
}

body.tax-news_category .news-content-text {
    font-family: var(--font-malayalam);
}

/* Responsive */
@media (max-width: 991px) {
    .news-category-page {
        padding-top: 90px;
    }

    .news-category-item-image {
        flex: 0 0 180px;
        width: 180px;
    }
}

@media (max-width: 767px) {
    .news-category-page {
        padding-top: 80px;
    }

    .news-category-back-bar {
        padding: 40px 0 10px 0;
    }

    .news-category-hero {
        padding: 32px 0 24px;
    }

    .news-category-item-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 4px;
    }

    .news-category-item-image {
        flex: none;
        width: 100%;
        aspect-ratio: 16/9;
    }

    .news-category-item-date {
        display: none;
    }
}

/* ==========================================================================
   Latest News section — header right group (Read more + arrows)
   ========================================================================== */

.news-latest-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ==========================================================================
   PNG Arrow Image (replaces SVG in large-image arrow containers)
   ========================================================================== */

.news-arrow-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* PNG arrow containers — no border-radius; rounding handled by ::after plate outside the image */
.news-card--large .news-card-arrow,
.news-highlight-hero-arrow {
    background: var(--bg-black);
    border-radius: 0;
    padding: 0;
    overflow: hidden;
}

.news-popular-image-arrow {
    background: #ffffff;
    border-radius: 0;
    padding: 0;
    overflow: hidden;
}

/* Cancel hover background changes for PNG-image arrow containers */
.news-card:hover.news-card--large .news-card-arrow,
.news-highlight-hero-link:hover .news-highlight-hero-arrow {
    background: var(--bg-black);
}

.news-popular-image-link:hover .news-popular-image-arrow {
    background: #ffffff;
}

/* ==========================================================================
   News Archive Newsletter Banner Section
   Two-column: left green panel (heading) + right dark panel (form)
   ========================================================================== */

.news-newsletter-banner-section {
    width: 100%;
    overflow: hidden;
    margin-bottom: clamp(40px, 6vw, 80px);
}

.news-newsletter-banner-inner {
    display: flex;
    min-height: 180px;
}

/* Left panel — green background */
.news-newsletter-banner-left {
    flex: 0 0 40%;
    background: var(--primary-green);
    display: flex;
    align-items: center;
    padding: 40px 48px;
    border-radius: 16px 0 0 16px;
}

.news-newsletter-banner-heading {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    line-height: 1.1;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Right panel — dark background */
.news-newsletter-banner-right {
    flex: 1;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding: 40px 48px;
    border-radius: 0 16px 16px 0;
}

.news-newsletter-banner-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin: 0;
    max-width: 520px;
}

/* Override the default newsletter-input-wrapper border-radius for banner */
.news-newsletter-input-wrapper {
    max-width: 520px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: visible;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.news-newsletter-input-wrapper:focus-within {
    border-color: var(--primary-green);
    background: rgba(255, 255, 255, 0.08);
}

.news-newsletter-input-wrapper .newsletter-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 14px 20px;
    color: #ffffff;
    font-size: 0.95rem;
}

.news-newsletter-input-wrapper .newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

/* The subscribe button replaces the arrow-only footer button */
.news-newsletter-submit {
    flex: 0 0 auto;
    background: var(--primary-green);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease;
    border-radius: 0 6px 6px 0;
    white-space: nowrap;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.news-newsletter-submit:hover {
    background: var(--color-green-dark);
    transform: translateY(-1px);
}

.news-newsletter-submit:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.news-newsletter-submit.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Message below the form */
.news-newsletter-form .newsletter-message {
    font-size: 0.875rem;
    margin-top: 4px;
}

/* ── Responsive ── */

@media (max-width: 1024px) {
    .news-newsletter-banner-left {
        flex: 0 0 45%;
        padding: 36px 36px;
    }

    .news-newsletter-banner-right {
        padding: 36px 36px;
    }
}

@media (max-width: 768px) {
    .news-newsletter-banner-inner {
        flex-direction: column;
        min-height: auto;
    }

    .news-newsletter-banner-left {
        flex: none;
        border-radius: 16px 16px 0 0;
        padding: 36px 24px;
    }

    .news-newsletter-banner-heading {
        font-size: clamp(1.4rem, 5vw, 1.8rem);
    }

    .news-newsletter-banner-right {
        flex: none;
        border-radius: 0 0 16px 16px;
        padding: 32px 24px;
    }

    .news-newsletter-input-wrapper,
    .news-newsletter-banner-description {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .news-newsletter-banner-left {
        padding: 28px 20px;
    }

    .news-newsletter-banner-right {
        padding: 28px 20px;
        gap: 16px;
    }

    .news-newsletter-input-wrapper {
        flex-direction: column;
        border-radius: 8px;
    }

    .news-newsletter-submit {
        border-radius: 0 0 6px 6px;
        width: 100%;
        padding: 14px 20px;
    }

    .news-newsletter-input-wrapper .newsletter-input {
        border-radius: 6px 6px 0 0;
    }
}

