/**
 * CSS para feed-item.php
 * Página de leitura de notícia agregada
 */

html, body {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

* {
    box-sizing: border-box;
}

.max-w-custom {
    max-width: 1450px;
}

:root {
    --font-heading: Sora, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: Outfit, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-code: 'Courier New', Courier, monospace;
}

.article-hero-v4,
.article-reading-shell,
.article-meta,
.article-lead,
.article-body {
    font-family: var(--font-body);
}

.article-hero-v4__title,
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6,
.article-card-title,
.article-sidebar-title {
    font-family: var(--font-heading);
    letter-spacing: -0.025em;
}

.article-body code,
.article-body pre,
.article-body kbd,
.article-body samp {
    font-family: var(--font-code);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   HERO EDITORIAL - full width, título sobre imagem
   ============================================ */
.article-hero-v4 {
    background: #ffffff;
}

.article-hero-v4__media {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f3f4f6;
    aspect-ratio: 21 / 9;
    max-height: 200px;
}

.article-hero-v4__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.article-hero-v4__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 50%, rgba(0, 0, 0, 0.15) 100%);
    display: flex;
    align-items: flex-end;
}

.article-hero-v4__overlay-inner {
    width: 100%;
}

.article-hero-v4__content {
    width: 100%;
}

.article-hero-v4__badge {
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.625rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.article-hero-v4__title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin: 0 0 0.5rem;
}

/* ============================================
   METADADOS
   ============================================ */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    font-size: 0.82rem;
    color: #6b7280;
    padding: 10px 0 14px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.article-meta--hero {
    padding: 0;
    margin: 0;
    border-bottom: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.article-meta--hero .article-meta__item i {
    color: rgba(255, 255, 255, 0.7);
}

.article-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.article-meta__sep {
    color: #d1d5db;
}

.article-meta__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
}

/* ============================================
   COLUNA DE LEITURA
   ============================================ */
.article-reading-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.75rem 0 2rem;
}

.article-lead {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 1.25rem;
}

.article-body {
    font-family: var(--font-body);
    color: #374151;
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: none;
    width: 100%;
    margin: 0 0 2rem;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body p:last-child {
    margin-bottom: 0;
}

.article-body strong {
    font-weight: 700;
    color: inherit;
}

.article-body a {
    color: #7c3aed;
    text-decoration: underline;
}

.article-body a:hover {
    color: #6d28d9;
}

.article-body .article-dropcap > p:first-of-type:first-letter,
.article-body > p:first-of-type:first-letter {
    float: left;
    font-size: 3.5rem;
    line-height: 1;
    margin: 4px 8px 0 0;
    color: #6d28d9;
    font-weight: 700;
}

/* ============================================
   IMAGEM INLINE
   ============================================ */
.article-inline-image {
    margin: 32px auto;
    max-width: 720px;
}

.article-inline-image img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.article-inline-image figcaption {
    font-size: 0.78rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 8px;
}

/* ============================================
   FINAL DO ARTIGO
   ============================================ */
.article-footer-v4 {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-top: 0.5rem;
}

.article-footer-v4 hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 0 0 1.5rem;
}

.article-reaction {
    text-align: center;
    margin-bottom: 2rem;
}

.article-reaction__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.article-reaction .feedback-simple {
    justify-content: center;
}

.feedback-like-btn,
.feedback-dislike-btn {
    border: 0 !important;
    background: #f3f4f6 !important;
    border-radius: 9999px !important;
    padding: 0.625rem 1rem !important;
}

.feedback-like-btn:hover,
.feedback-dislike-btn:hover {
    background: #e5e7eb !important;
}

.feedback-like-btn.active {
    border-color: transparent !important;
    background-color: #dcfce7 !important;
}

.feedback-dislike-btn.active {
    border-color: transparent !important;
    background-color: #fee2e2 !important;
}

.article-source-credits {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.article-source-credits__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: #ede9fe;
    color: #7c3aed;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.article-related-v4 {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 2.5rem;
}

.article-related-v4__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.article-related-card {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-related-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
}

.article-related-card__thumb {
    overflow: hidden;
    background: #f3f4f6;
}

.article-related-card__thumb.ef-media--card {
    aspect-ratio: 3 / 2;
}

.article-related-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.article-related-card__body {
    padding: 0.875rem;
}

.article-related-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.45;
    margin-bottom: 0.375rem;
}

.article-related-card:hover .article-related-card__title {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-related-card__meta {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Thumbnails relacionados / sidebar */
.feed-thumbnail-img,
.feed-card-img,
.sidebar-thumbnail-img {
    object-fit: cover !important;
    object-position: center 30% !important;
}

.article-sidebar-mais-lidas {
    width: 100%;
}

.article-sidebar-mais-lidas__item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
    text-decoration: none;
}

.article-sidebar-mais-lidas__item--featured {
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

.article-sidebar-mais-lidas__thumb {
    flex-shrink: 0;
    width: 4.25rem;
    height: 2.875rem;
    border-radius: 6px;
    overflow: hidden;
}

.article-sidebar-mais-lidas__item--featured .article-sidebar-mais-lidas__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 96px;
    border-radius: 8px;
}

.article-sidebar-mais-lidas__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
    color: #1f2937;
    min-height: 3.0375rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-sidebar-mais-lidas__item--featured .article-sidebar-mais-lidas__title {
    width: 100%;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
}

.article-sidebar-mais-lidas__item:hover .article-sidebar-mais-lidas__title {
    color: #dc2626;
}

/* Gate editorial — prévia com fade + card de acesso */
.feed-gate-editorial {
    position: relative;
    margin-top: 0.5rem;
    overflow: hidden;
    padding-bottom: 1.5rem;
}

.feed-gate-preview {
    position: relative;
}

.feed-gate-preview .article-body {
    margin-bottom: 0;
}

.feed-gate-preview__fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 55%, #ffffff 100%);
    pointer-events: none;
    z-index: 2;
}

.feed-gate-blurred {
    position: relative;
    max-height: 140px;
    overflow: hidden;
    margin-top: -24px;
    color: #6b7280;
    user-select: none;
    pointer-events: none;
}

.feed-gate-blurred .article-body,
.feed-gate-blurred__body {
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 0;
}

.feed-gate-blurred__body .article-dropcap > p:first-of-type:first-letter,
.feed-gate-blurred__body > p:first-of-type:first-letter {
    float: none;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
    color: inherit;
    font-weight: inherit;
}

.feed-gate-blurred::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.75) 45%, #ffffff 100%);
    z-index: 1;
}

.feed-gate-blurred::after {
    content: "";
    position: absolute;
    inset: 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2;
}

.feed-gate-card-wrap {
    position: relative;
    margin-top: -56px;
    padding: 0 12px;
    z-index: 10;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.feed-gate-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 20px 40px -12px rgba(17, 24, 39, 0.18);
}

.feed-gate-card__note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 14px;
}

.feed-gate-card-meta {
    margin-top: 1.25rem;
}

.feed-gate-card-meta .article-reaction {
    margin-bottom: 1.25rem;
}

.feed-gate-card-meta .article-source-credits {
    margin-bottom: 0;
}

.feed-gate-card__brand,
.feed-gate-card__brand img {
    display: none;
}

.feed-gate-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.feed-gate-card__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.35;
}

.feed-gate-card__stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.feed-gate-card__stats span {
    font-size: 0.75rem;
    color: #6b7280;
}

.feed-gate-card__stats i {
    color: #7c3aed;
    margin-right: 4px;
}

.feed-gate-card__subtitle {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 18px;
}

.feed-gate-card__btn-linkedin {
    width: 100%;
    padding: 11px 16px;
    background: #0a66c2;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.feed-gate-card__btn-linkedin:hover {
    background: #004182;
}

.feed-gate-card__divider {
    position: relative;
    text-align: center;
    margin: 16px 0;
}

.feed-gate-card__divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.feed-gate-card__divider span {
    position: relative;
    padding: 0 12px;
    background: #ffffff;
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.feed-gate-card__form {
    margin: 0;
}

.feed-gate-card__input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    color: #111827;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.feed-gate-card__input::placeholder {
    color: #9ca3af;
}

.feed-gate-card__input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
    background: #ffffff;
}

.feed-gate-card__btn {
    width: 100%;
    padding: 11px 16px;
    background: #7c3aed;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color 0.2s ease;
}

.feed-gate-card__btn:hover {
    background: #6d28d9;
}

.feed-gate-card__btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.feed-gate-card__note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 14px;
    line-height: 1.45;
}

.feed-gate-card__note i {
    color: #7c3aed;
    margin-right: 4px;
}

.feed-gate-success {
    padding: 8px 4px;
    text-align: center;
}

.feed-gate-success__icon {
    color: #7c3aed;
    font-size: 2rem;
    margin-bottom: 12px;
}

.feed-gate-success__title {
    color: #111827;
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.feed-gate-success__text {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.45;
}

/* Legado: aliases para compatibilidade */
.content-gate-wrapper-feed {
    position: relative;
}

.content-gate-feed {
    position: relative;
}

.article-page-grid {
    align-items: start;
}

.article-sidebar-v4 {
    padding-top: 0.75rem;
    max-width: 300px;
    width: 100%;
}

@media (min-width: 768px) {
    .article-hero-v4__media {
        max-height: 260px;
    }

    .article-hero-v4__title {
        font-size: 1.75rem;
        font-weight: 800;
        max-width: none;
    }

    .article-meta--hero {
        font-size: 0.8125rem;
    }

    .article-reading-shell {
        padding-top: 1rem;
    }

    .article-sidebar-v4 {
        padding-top: 1rem;
    }

    .article-body {
        font-size: 1.1rem;
    }

    .article-inline-image {
        width: 80%;
    }

    .feed-gate-blurred {
        max-height: 180px;
    }

    .feed-gate-card-wrap {
        max-width: 480px;
        margin-top: -64px;
        padding: 0;
    }

    .feed-gate-card {
        padding: 28px 32px;
        border-radius: 12px;
    }

    .feed-gate-card__title {
        font-size: 1.25rem;
    }

    .article-related-v4__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .article-hero-v4__media {
        max-height: 300px;
    }

    .article-hero-v4__title {
        font-size: 2rem;
        line-height: 1.15;
    }

    .article-sidebar-v4 {
        padding-top: 1rem;
    }

    .feed-gate-blurred {
        max-height: 220px;
    }

    .feed-gate-card-wrap {
        max-width: 520px;
        margin-top: -72px;
    }

    .feed-gate-card {
        padding: 32px 36px;
    }

    .feed-gate-card__title {
        font-size: 1.375rem;
    }
}

@media (max-width: 1023px) {
    .article-sidebar-v4 {
        display: none;
    }
}

img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}
