/* PDF Newsletter Module Styles (Modern Creative) */

/* Hero Section */
.newsletter-hero-section {
    padding: 60px 0 40px;
    /* Reduced height further per request */
    background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

/* Category Wrapper Spacing */
.category-scroll-wrapper {
    margin-top: 50px;
    /* Increased separation */
    margin-bottom: 40px !important;
}

.hero-subtitle {
    display: inline-block;
    color: #2dd4bf;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero-desc {
    color: #64748b;
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Search Form - Unified Pill Design */
.hero-search-form {
    max-width: 500px;
    position: relative;
    z-index: 5;
}

.hero-search-form .input-group {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.hero-search-form .input-group:focus-within {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #2dd4bf;
}

.hero-search-form .input-group-text {
    background: transparent;
    border: none !important;
    color: #94a3b8;
    padding-left: 20px;
}

.hero-search-form .form-control {
    background: transparent;
    border: none !important;
    box-shadow: none !important;
    padding: 12px;
    font-size: 1rem;
    color: #334155;
}

.hero-search-form .btn-primary {
    background-color: var(--ip-teal) !important;
    border-color: var(--ip-teal) !important;
    font-weight: 600;
    border-radius: 50px !important;
    padding: 10px 30px;
    transition: all 0.2s;
}

.hero-search-form .btn-primary:hover {
    background-color: var(--ip-teal-dark) !important;
    border-color: var(--ip-teal-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(58, 101, 101, 0.25);
}

/* Category Pills */
.cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 50px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.cat-pill:hover,
.cat-pill.active {
    background: #1e293b;
    color: #fff;
    border-color: #1e293b;
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2);
}

.cat-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
    font-size: 0.75rem;
}

.cat-pill.active .cat-count {
    background: rgba(255, 255, 255, 0.2);
}

.cat-pill:not(.active) .cat-count {
    background: #f1f5f9;
    color: #475569;
}


/* List View Grid */
.newsletter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

.news-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    /* Clean initial state */
    border: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    top: 0;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.news-thumb {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-thumb img {
    transform: scale(1.05);
}

.news-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Badges */
.news-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-time-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    z-index: 2;
}

/* Reader View & Minified Classes */
.content-block {
    position: relative;
    margin: 0 auto 20px auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.content-layer {
    display: block;
    width: 100%;
    height: auto;
}

.text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.01;
    /* Effectively invisible but selectable */
    line-height: 1.0;
    transform-origin: 0 0;
}

.text-overlay span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

.text-overlay ::selection {
    background: rgba(45, 212, 191, 0.3);
}

/* Sticky Sidebar Logic */

/* 1. Ensure all parents allow overflow (Crucial) */
body,
html,
.site-wrapper,
.container,
.main-content {
    overflow: visible !important;
}

/* 2. Grid Layout - Items Stretch */
.reader-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    margin-top: 0;
    align-items: stretch;
    /* Both cols full height */
}

/* 3. Sidebar Column - No Sticky, just a container */
.reader-sidebar {
    height: 100%;
    position: relative;
    /* Not sticky */
    z-index: 10;
}

/* 4. Inner Sticky Wrapper - The Actual Sticky Element */
.sidebar-inner-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 110px;
    /* Offset for header */
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Widgets - remove margins as wrapper handles gaps now */
.sidebar-widget {
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 0px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

@media (max-width: 991px) {
    .reader-layout {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .newsletter-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .sidebar-inner-sticky {
        position: static;
    }
}

/* Global Reset/Utility */
a {
    text-decoration: none !important;
}

.cat-list a {
    display: block;
    padding: 8px 3px;
    color: #64748b;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.cat-list a:hover {
    color: #2dd4bf;
    transform: translateX(5px);
}

/* Download PDF Button */
.btn-download-pdf {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FF7F4D;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 127, 77, 0.3);
}

.btn-download-pdf:hover {
    background: #FF6B35;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 127, 77, 0.4);
}