/* newsletter.css — GIA Semanal — Editorial Intelligence Briefing */

/* === Animations === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes countUp {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes revealLine {
    from { width: 0; }
    to { width: 100%; }
}

/* === Masthead / Hero === */
.newsletter-hero {
    background: var(--color-primary);
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    color: white;
    margin: -20px -20px 0 -20px;
    position: relative;
    overflow: hidden;
}

.newsletter-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(171, 24, 43, 0.15) 100%);
    pointer-events: none;
}

.newsletter-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-secondary);
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 50px 40px 45px;
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    font-size: 0.7em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--color-accent);
    margin-bottom: 8px;
    display: block;
    animation: fadeInUp 0.6s ease both;
}

.newsletter-hero h2 {
    font-size: 3em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0;
    line-height: 1;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.newsletter-hero h2 i { display: none; }

.hero-rule {
    width: 60px;
    height: 3px;
    background: var(--color-secondary);
    border: none;
    margin: 16px 0;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.newsletter-hero p {
    font-size: 0.95em;
    font-weight: 300;
    opacity: 0.75;
    max-width: 500px;
    line-height: 1.5;
    animation: fadeInUp 0.6s ease 0.3s both;
}

/* === Newsletter Content Area === */
.newsletter-latest {
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.loading-indicator {
    text-align: center;
    color: var(--color-muted);
    padding: 60px 40px;
    font-size: 0.95em;
}

/* === Newsletter Card === */
.newsletter-card {
    background: white;
    border: none;
    border-radius: 0;
    overflow: visible;
    max-width: 900px;
    margin: 40px auto 0;
}

/* Card header — edition bar */
.newsletter-card-header {
    background: none;
    color: var(--color-primary);
    padding: 0 0 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 3px solid var(--color-primary);
    position: relative;
}

.newsletter-card-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 120px;
    height: 3px;
    background: var(--color-secondary);
}

.newsletter-card-header h3 {
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-secondary);
}

.newsletter-date {
    font-size: 0.85em;
    font-weight: 400;
    color: var(--color-muted);
    opacity: 1;
}

.newsletter-card-body {
    padding: 0;
    margin-top: 30px;
}

/* === Section Headers === */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
}

.section-number {
    width: 32px;
    height: 32px;
    background: var(--color-secondary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: 600;
    flex-shrink: 0;
}

.section-header h4 {
    color: var(--color-primary);
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    border: none;
    padding: 0;
    display: inline;
    margin: 0;
}

.section-header h4 i {
    display: none;
}

/* === Editorial Section === */
.newsletter-editorial {
    margin-bottom: 40px;
    position: relative;
    animation: fadeInUp 0.5s ease both;
}

.newsletter-editorial h4 {
    border: none;
    display: block;
    padding: 0;
    margin: 0;
}

.newsletter-editorial p {
    color: var(--color-text);
    line-height: 1.85;
    font-size: 0.95em;
    font-weight: 300;
    margin-bottom: 16px;
}

.newsletter-editorial p:first-of-type::first-letter {
    font-size: 3.2em;
    float: left;
    line-height: 0.85;
    margin-right: 8px;
    margin-top: 4px;
    color: var(--color-secondary);
    font-weight: 700;
}

.newsletter-editorial p {
    text-align: justify;
}

.newsletter-editorial strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* Divider between sections */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, var(--color-secondary), var(--color-border), transparent);
    margin: 35px 0;
}

/* === Top Tags Section === */
.newsletter-tags {
    margin-bottom: 40px;
    animation: fadeInUp 0.5s ease 0.1s both;
}

.newsletter-tags h4 {
    border: none;
    display: block;
    padding: 0;
    margin: 0;
}

.tag-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    gap: 0 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border-light);
    align-items: start;
    animation: slideInLeft 0.4s ease both;
}

.tag-item:nth-child(1) { animation-delay: 0.15s; }
.tag-item:nth-child(2) { animation-delay: 0.2s; }
.tag-item:nth-child(3) { animation-delay: 0.25s; }
.tag-item:nth-child(4) { animation-delay: 0.3s; }
.tag-item:nth-child(5) { animation-delay: 0.35s; }

.tag-item:last-child {
    border-bottom: none;
}

.tag-rank {
    grid-row: 1 / 3;
    color: white;
    background: var(--color-primary);
    font-weight: 600;
    font-size: 0.85em;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
}

.tag-name {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tag-count {
    color: var(--color-secondary);
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 6px;
}

.tag-context {
    grid-column: 2;
    color: var(--color-text-light);
    font-size: 0.88em;
    font-weight: 300;
    line-height: 1.5;
    margin-left: 0;
    margin-top: 3px;
}

/* === Pulse Section === */
.newsletter-pulse {
    background: var(--color-primary);
    border-radius: 8px;
    padding: 20px 24px;
    color: white;
    animation: fadeInUp 0.5s ease 0.2s both;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.newsletter-pulse .section-header {
    margin-bottom: 0;
    flex-shrink: 0;
}

.newsletter-pulse .section-number {
    background: var(--color-accent);
    color: var(--color-primary);
}

.newsletter-pulse .section-header h4 {
    color: white;
}

.pulse-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    flex: 1;
}

.pulse-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.pulse-stat-value {
    font-size: 1.4em;
    font-weight: 700;
    color: white;
}

.pulse-stat-label {
    font-size: 0.8em;
    color: rgba(255,255,255,0.6);
    font-weight: 300;
}

.pulse-stat-delta {
    font-size: 0.75em;
    font-weight: 400;
    color: rgba(255,255,255,0.5);
}

.pulse-stat-delta.up { color: #68d391; }
.pulse-stat-delta.down { color: #fc8181; }

.pulse-separator {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.pulse-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-pill {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.72em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.08);
}

.category-pill span {
    font-weight: 700;
    color: var(--color-accent);
    margin-left: 3px;
}

/* === Footer === */
.newsletter-footer {
    text-align: center;
    padding: 30px 0 10px;
    margin-top: 30px;
    color: var(--color-muted);
    font-size: 0.8em;
    font-weight: 300;
    border-top: 1px solid var(--color-border-light);
}

.newsletter-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.newsletter-footer a:hover {
    color: var(--color-secondary);
}

/* === Archive Section === */
.newsletter-archive {
    max-width: 900px;
    margin: 50px auto 0;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
}

.archive-title {
    color: var(--color-primary);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-weight: 600;
}

.archive-title i {
    color: var(--color-secondary);
    margin-right: 10px;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.archive-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: white;
    border: 1px solid var(--color-border-light);
    border-left: 3px solid transparent;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.archive-item:hover {
    border-left-color: var(--color-primary);
    background: #fafbfc;
    padding-left: 24px;
}

.archive-item.active {
    border-left-color: var(--color-secondary);
    border-left-width: 3px;
    background: #fdf2f4;
}

.archive-item-date {
    font-weight: 500;
    color: var(--color-primary);
    font-size: 0.9em;
}

.archive-item-stats {
    color: var(--color-muted);
    font-size: 0.8em;
    font-weight: 300;
}

.archive-empty {
    text-align: center;
    color: var(--color-muted);
    padding: 30px;
    font-size: 0.9em;
}

/* === Mobile === */
@media (max-width: 768px) {
    .newsletter-hero {
        margin: -12px -12px 0 -12px;
    }

    .hero-content {
        padding: 35px 20px 30px;
    }

    .newsletter-hero h2 {
        font-size: 2em;
    }

    .hero-eyebrow {
        font-size: 0.6em;
        letter-spacing: 2px;
    }

    .newsletter-card {
        margin-top: 25px;
    }

    .newsletter-card-header {
        flex-direction: column;
        gap: 4px;
    }

    .newsletter-card-body {
        margin-top: 20px;
    }

    .newsletter-editorial p:first-of-type::first-letter {
        font-size: 2.5em;
    }

    .tag-item {
        grid-template-columns: 32px 1fr;
    }

    .newsletter-pulse {
        padding: 20px 16px;
        border-radius: 8px;
    }

    .pulse-value {
        font-size: 2.2em;
    }

    .pulse-categories {
        gap: 6px;
    }

    .category-pill {
        padding: 5px 10px;
        font-size: 0.7em;
    }

    .newsletter-archive {
        margin-top: 30px;
        padding-top: 25px;
    }

    .section-header h4 {
        font-size: 0.95em;
    }
}
