/* CoParently News CPT - Call To Action Box & Layout Styling */

.news-cta-container {
    margin: 40px 0 20px;
    padding: 0;
    clear: both;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
}

.news-cta-container * {
    box-sizing: border-box;
}

/* Grid Layout when both boxes are present */
.news-cta-container.has-two-cards {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
}

.news-cta-container.has-single-card {
    display: block;
}

/* Base Card Style */
.news-cta-card {
    display: flex;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 247, 250, 0.9) 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(148, 163, 184, 0.12), 0 2px 8px -1px rgba(148, 163, 184, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Adjust card layouts depending on layout type */
.has-two-cards .news-cta-card {
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 28px;
}

.has-single-card .news-cta-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 32px;
}

.news-cta-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -4px rgba(148, 163, 184, 0.2), 0 4px 12px -2px rgba(148, 163, 184, 0.15);
    border-color: rgba(203, 213, 225, 1);
}

.news-cta-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Tags */
.news-cta-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e0f2fe;
    color: #0369a1;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    margin-bottom: 12px;
}

.news-share-tag {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* Text elements */
.news-cta-title {
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.3 !important;
}

.news-cta-description {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.925rem !important;
    color: #64748b !important;
    line-height: 1.5 !important;
}

/* Action Container */
.news-cta-action {
    flex-shrink: 0;
}

.has-two-cards .news-cta-action {
    width: 100%;
}

/* Buttons */
.news-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px -2px rgba(3, 105, 161, 0.3);
}

.has-two-cards .news-cta-button,
.has-two-cards .news-cta-share-whatsapp {
    width: 100%;
}

.news-cta-button:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 6px 14px -2px rgba(3, 105, 161, 0.4);
    transform: scale(1.02);
}

.news-cta-button:active {
    transform: scale(0.98);
}

.news-cta-icon {
    display: block;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.news-cta-button:hover .news-cta-icon {
    transform: translateX(3px);
}

/* WhatsApp Button */
.news-cta-share-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #25D366;
    color: #ffffff !important;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px -2px rgba(37, 211, 102, 0.3);
}

.news-cta-share-whatsapp:hover {
    background: #20ba5a;
    box-shadow: 0 6px 14px -2px rgba(37, 211, 102, 0.4);
    transform: scale(1.02);
}

.news-cta-share-whatsapp:active {
    transform: scale(0.98);
}

.news-whatsapp-icon {
    display: block;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.news-cta-share-whatsapp:hover .news-whatsapp-icon {
    transform: scale(1.1);
}

/* Sidebar & 2-Column Layout Grid */
.news-layout-wrapper {
    display: grid;
    grid-template-columns: 2.2fr 0.8fr; /* 73% content, 27% sidebar */
    gap: 40px;
    margin: 30px 0;
    align-items: start;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.news-main-content-column {
    min-width: 0; /* prevent layout overflow */
}

.news-sidebar-column {
    background: transparent;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-radius: 0;
    padding: 0 0 0 40px; /* Space from the separator line */
    box-shadow: none;
}

/* Sidebar Widget Styling */
.news-sidebar-column .widget {
    margin-bottom: 35px;
}

.news-sidebar-column .widget:last-child {
    margin-bottom: 0;
}

.news-sidebar-column .widget-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 0 0 15px 0 !important;
    padding: 0 0 10px 0 !important;
    border-bottom: 2px solid #e2e8f0 !important;
    letter-spacing: -0.02em !important;
    text-transform: none !important;
}

/* Breadcrumbs Styling */
.news-breadcrumbs {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.news-breadcrumbs a {
    color: #0284c7;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-breadcrumbs a:hover {
    color: #0369a1;
    text-decoration: underline;
}

.news-breadcrumb-separator {
    margin: 0 8px;
    color: #cbd5e1;
    user-select: none;
}

.news-breadcrumb-current {
    color: #64748b;
    font-weight: 500;
}

/* Publish Date Styling */
.news-meta-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 28px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 14px;
    width: 100%;
}

.news-date-icon {
    color: #94a3b8;
    display: block;
    flex-shrink: 0;
}

/* Responsive Layout wrapping */
@media (max-width: 992px) {
    .news-cta-container.has-two-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .news-layout-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .news-sidebar-column {
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding: 30px 0 0 0;
    }
}

@media (max-width: 768px) {
    .has-single-card .news-cta-card {
        flex-direction: column;
        align-items: stretch;
        padding: 24px;
        gap: 20px;
    }
    
    .has-single-card .news-cta-content {
        align-items: center;
        text-align: center;
    }
    
    .has-single-card .news-cta-tag {
        align-self: center;
    }
    
    .has-single-card .news-cta-action {
        display: flex;
        justify-content: center;
    }
    
    .has-single-card .news-cta-button,
    .has-single-card .news-cta-share-whatsapp {
        width: 100%;
        max-width: 320px;
    }
}

/* Dark Mode Compatibility */
@media (prefers-color-scheme: dark) {
    .news-cta-card {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.8) 100%);
        border-color: rgba(51, 65, 85, 0.5);
        box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
    }
    
    .news-cta-card:hover {
        border-color: rgba(71, 85, 105, 0.8);
    }
    
    .news-cta-title {
        color: #f1f5f9 !important;
    }
    
    .news-cta-description {
        color: #94a3b8 !important;
    }
    
    .news-cta-tag {
        background-color: rgba(3, 105, 161, 0.2);
        color: #38bdf8;
    }
    
    .news-share-tag {
        background-color: rgba(46, 125, 50, 0.2);
        color: #4caf50;
    }
    
    /* Layout Dark Mode */
    .news-sidebar-column {
        background: transparent;
        border-color: rgba(51, 65, 85, 0.5);
        box-shadow: none;
    }
    .news-sidebar-column {
        border-top-color: rgba(51, 65, 85, 0.5);
    }
    
    .news-sidebar-column .widget-title {
        color: #f1f5f9 !important;
        border-bottom-color: rgba(51, 65, 85, 0.5) !important;
    }
    
    .news-meta-date {
        border-bottom-color: rgba(51, 65, 85, 0.5);
        color: #94a3b8;
    }
    
    .news-breadcrumbs {
        color: #94a3b8;
    }
    
    .news-breadcrumb-separator {
        color: rgba(71, 85, 105, 0.8);
    }
    
    .news-breadcrumb-current {
        color: #f1f5f9;
    }
}

/* Hide Theme Default Titles on Single News Pages */
.single-news .entry-header,
.single-news .entry-title,
.single-news .post-title,
.single-news .page-header,
.single-news h1.page-title,
.single-news .hero-title-container,
.single-news .heading-title {
    display: none !important;
}

/* Remove line/divider above the hero boxes and pull content up */
.single-news hr,
.single-news .separator,
.single-news .divider,
.single-news .ast-theme-header-line,
.single-news .main-header-bar,
.single-news .site-header,
.single-news header.site-header {
    border-bottom: none !important;
    border-bottom-width: 0 !important;
    box-shadow: none !important;
}

.single-news .site-content,
.single-news .content-area,
.single-news .entry-content,
.single-news #content,
.single-news main,
.single-news article,
.single-news .post,
.single-news .type-news,
.single-news #primary,
.single-news #main,
.single-news .site-main {
    border-top: none !important;
    border-top-width: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.news-single-hero {
    margin-top: 30px !important; /* Nice breathing space below the desktop header */
    margin-bottom: 45px !important; /* Breathing space before the content / breadcrumbs below */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.news-single-hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 35px;
    align-items: stretch; /* Stretch title box and image to identical height */
}

.news-single-title-box {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center the title vertically */
    height: 100%;
}

.news-single-title {
    font-size: 3.7rem !important; /* Increased by another 30% */
    font-weight: 800 !important;
    color: #0f172a !important;
    line-height: 1.15 !important;
    margin: 0 0 20px 0 !important;
    letter-spacing: -0.03em !important;
}

.news-single-title-box .news-meta-date {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.news-single-image-box {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
    background: #f1f5f9;
    height: 100%; /* Stretch height to match title box */
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
}

.single-news .news-single-image-box img.news-single-hero-img,
.news-single-hero-img {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.5s ease !important;
}

.news-single-hero-inner:hover .news-single-hero-img {
    transform: scale(1.02) !important;
}

.news-single-hero.no-featured-image .news-single-hero-inner {
    display: block;
}

.news-single-hero.no-featured-image .news-single-title-box {
    max-width: 100%;
}

/* News Archive Container & Layout */
.news-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.news-archive-header {
    margin-bottom: 40px;
}

.news-archive-title {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 0 25px 0 !important;
    letter-spacing: -0.04em !important;
}

/* Category Filters (Premium Pill Buttons) */
.news-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 5px;
}

.news-filter-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.news-filter-btn:hover {
    border-color: #94a3b8;
    color: #1e293b;
    background: #f8fafc;
}

.news-filter-btn.is-active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

/* Premium Horizontal Cards (1:1 Ratio Stack) */
.news-archive-items {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.news-archive-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px -2px rgba(148, 163, 184, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
}

.news-archive-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px -4px rgba(148, 163, 184, 0.15);
    border-color: rgba(203, 213, 225, 0.8);
}

/* Image wrapper forced 1:1 aspect-ratio */
.news-archive-card-image-column {
    min-width: 0;
}

.news-archive-card-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.news-archive-card-image-wrapper img,
.news-archive-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-archive-card-image-wrapper.news-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    aspect-ratio: 1 / 1;
}

.news-archive-card-image-wrapper.news-no-image span.dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

/* Overlay hover effect on image */
.news-archive-image-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 132, 199, 0.15);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-archive-image-hover-cta {
    background: #ffffff;
    color: #0369a1;
    font-weight: 700;
    font-size: 0.875rem;
    padding: 10px 18px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.news-archive-card:hover .news-archive-card-image-wrapper img {
    transform: scale(1.06);
}

.news-archive-card:hover .news-archive-image-hover-overlay {
    opacity: 1;
}

.news-archive-card:hover .news-archive-image-hover-cta {
    transform: translateY(0);
}

/* Content details (Right Column) */
.news-archive-card-content-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.news-archive-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.news-archive-card-category {
    display: inline-block;
    padding: 7px 14px;
    background-color: #d0dbf0;
    color: #2b4c7e;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    margin-bottom: 0 !important;
    line-height: 1;
}

.news-archive-card-date {
    display: inline-block;
    padding: 6px 13px; /* 7px minus 1px border for top/bottom, 14px minus 1px border for left/right */
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 0.725rem;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1;
}

.news-archive-card-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.3 !important;
    margin: 0 0 10px 0 !important;
    letter-spacing: -0.02em !important;
}

.news-archive-card-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-archive-card-title a:hover {
    color: #0284c7;
}

.news-archive-card-excerpt {
    font-size: 0.95rem !important;
    color: #475569 !important;
    line-height: 1.6 !important;
    margin: 0 0 18px 0 !important;
}

.news-archive-card-excerpt p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Readmore Link and Arrow translation */
.news-archive-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0284c7 !important;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.news-archive-card-readmore:hover {
    color: #0369a1 !important;
}

.news-readmore-arrow {
    transition: transform 0.2s ease;
}

.news-archive-card-readmore:hover .news-readmore-arrow {
    transform: translateX(4px);
}

/* News Archive Pagination */
.news-archive-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.news-archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.news-archive-pagination .page-numbers:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.news-archive-pagination .page-numbers.current {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    /* Single Article Hero Mobile Overlay */
    .news-single-hero {
        margin-top: 30px !important; /* Give it space below the mobile header navigation */
        margin-bottom: 20px !important;
    }

    .news-single-hero-inner {
        position: relative;
        display: flex;
        flex-direction: column;
    }
    
    .news-single-title-box {
        position: relative !important;
        margin-top: 0 !important;
        margin-bottom: -50px !important; /* Overlaps down onto the image card */
        margin-left: 15px !important;
        margin-right: 15px !important;
        background: rgba(255, 255, 255, 0.96) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        padding: 24px !important;
        border-radius: 16px !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
        height: auto !important;
        z-index: 10 !important;
    }
    
    .news-single-image-box {
        width: 100% !important;
        height: 280px !important;
        border-radius: 12px !important;
        position: relative !important;
        z-index: 5 !important;
        margin-top: 0 !important;
        margin-bottom: 25px !important; /* Add space below the image on mobile */
        display: block !important; /* Override desktop flex in mobile */
    }
    
    .news-single-title {
        font-size: 2.2rem !important; /* Enlarged mobile headline */
    }
    
    /* Archive Cards Mobile stacking */
    .news-archive-card {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .news-archive-card-image-wrapper {
        aspect-ratio: 16 / 9; /* Widescreen on mobile for card images */
    }
}

/* Dark Mode Extensions for Archive & Hero */
@media (prefers-color-scheme: dark) {
    .news-single-title-box {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(51, 65, 85, 0.5);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    
    .news-single-title {
        color: #f1f5f9 !important;
    }
    
    .news-filter-btn {
        background: #1e293b;
        border-color: #475569;
        color: #94a3b8;
    }
    
    .news-filter-btn:hover {
        background: #334155;
        color: #f1f5f9;
    }
    
    .news-filter-btn.is-active {
        background: #0284c7;
        border-color: #0284c7;
        color: #ffffff;
        box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    }
    
    .news-archive-title {
        color: #f1f5f9 !important;
    }
    
    .news-archive-card {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(51, 65, 85, 0.5);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }
    
    .news-archive-card:hover {
        border-color: rgba(71, 85, 105, 0.8);
    }
    
    .news-archive-card-title a {
        color: #f1f5f9;
    }
    
    .news-archive-card-title a:hover {
        color: #38bdf8;
    }
    
    .news-archive-card-excerpt {
        color: #94a3b8 !important;
    }
    
    .news-archive-card-category {
        background-color: rgba(208, 219, 240, 0.15);
        color: #93c5fd;
    }
    
    .news-archive-card-date {
        border-color: rgba(71, 85, 105, 0.6);
        color: #94a3b8;
    }
    
    .news-archive-image-hover-cta {
        background: #1e293b;
        color: #38bdf8;
    }
    
    .news-archive-pagination .page-numbers {
        background: #1e293b;
        border-color: #475569;
        color: #94a3b8;
    }
    
    .news-archive-pagination .page-numbers:hover {
        background: #334155;
        color: #f1f5f9;
    }
    
    .news-archive-pagination .page-numbers.current {
        background: #0284c7;
        border-color: #0284c7;
        color: #ffffff;
    }
    
    @media (max-width: 768px) {
        .news-single-title-box {
            background: rgba(30, 41, 59, 0.95);
        }
    }
}

