/* =============================================================================
   GENBYTE PRESS — SINGLE POST & RETENÇÃO
   Layout 1 (Padrão), Layout 2 (Impact Hero), Áudio TTS, TOC & E-E-A-T
   ============================================================================= */

/* --------------------------------------------------------------------------
   1. BARRA DE PROGRESSO DE LEITURA (ZERO CLS)
   -------------------------------------------------------------------------- */
.gbp-reading-progress,
.fwx-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background-color: var(--gbp-color-primary, #0066cc);
    z-index: 10000;
    width: 0%;
    transition: width 0.1s ease-out;
}

.gbp-has-sticky-header .gbp-reading-progress,
.gbp-sticky-header .fwx-reading-progress {
    top: 0;
}

.gbp-reading-percent,
.fwx-reading-percent {
    position: absolute;
    right: 0;
    top: 6px;
    transform: translateX(50%);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--gbp-font-family, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    color: var(--gbp-color-primary, #0066cc);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 3px 6px;
    border-radius: 6px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    opacity: 0.9;
    visibility: visible;
    transition: opacity 0.2s ease;
}

[data-theme="dark"] .gbp-reading-percent,
[data-theme="dark"] .fwx-reading-percent {
    background: #1a1a1a;
    color: var(--gbp-color-primary, #38bdf8);
    border-color: rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------------------------------
   2. MIGALHAS DE PÃO (BREADCRUMBS)
   -------------------------------------------------------------------------- */
.gbp-breadcrumbs,
.fwx-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.825rem;
    color: var(--gbp-color-text-muted);
    margin-bottom: 16px;
}

.gbp-breadcrumbs a,
.fwx-breadcrumbs a {
    color: var(--gbp-color-text-muted);
    text-decoration: none;
    transition: color var(--gbp-transition);
}

.gbp-breadcrumbs a:hover,
.fwx-breadcrumbs a:hover {
    color: var(--gbp-color-primary);
}

.gbp-bc-sep,
.fwx-bc-sep {
    opacity: 0.5;
}

.gbp-bc-current,
.fwx-bc-current {
    color: var(--gbp-color-text);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   3. ESTRUTURA DO SINGLE POST
   -------------------------------------------------------------------------- */
.gbp-single-layout,
.fwx-single-layout {
    display: grid;
    gap: 40px;
    margin-top: 30px;
    margin-bottom: 60px;
}

.gbp-single-layout.no-sidebar,
.fwx-single-layout.no-sidebar {
    grid-template-columns: minmax(0, 1fr);
    max-width: 860px;
}

.gbp-single-layout.has-sidebar,
.fwx-single-layout.has-sidebar {
    grid-template-columns: minmax(0, 1fr) 340px;
}

@media (max-width: 992px) {
    .gbp-single-layout.has-sidebar,
    .fwx-single-layout.has-sidebar {
        grid-template-columns: 1fr;
    }
}

.gbp-single-content,
.fwx-single-content {
    min-width: 0;
}

/* Header do Artigo - Layout 1 */
.entry-header {
    margin-bottom: 24px;
}

.entry-title {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    line-height: 1.2;
    margin-top: 12px;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.entry-excerpt {
    font-size: 1.2rem;
    color: var(--gbp-color-text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    font-style: italic;
}

.entry-thumbnail,
.fwx-hero-thumb {
    margin-bottom: 30px;
    border-radius: var(--gbp-rad-12);
    overflow: hidden;
}

.entry-thumbnail img,
.fwx-hero-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* Header do Artigo - Layout 2 (Impact Hero de Largura Total) */
.gbp-single-header-2,
.fwx-single-header-2 {
    max-width: 960px;
    margin: 30px auto 20px auto;
    text-align: center;
    padding: 0 20px;
}

.gbp-single-header-2 .gbp-breadcrumbs,
.fwx-single-header-2 .fwx-breadcrumbs,
.gbp-single-header-2 .entry-meta,
.fwx-single-header-2 .entry-meta {
    justify-content: center;
}

.gbp-hero-wide-thumb,
.fwx-hero-wide-thumb {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto 40px auto;
    padding: 0 20px;
    border-radius: var(--gbp-rad-16);
    overflow: hidden;
}

.gbp-hero-wide-thumb img,
.fwx-hero-wide-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 21 / 9;
    object-fit: cover;
    border-radius: var(--gbp-rad-16);
}

@media (max-width: 768px) {
    .gbp-hero-wide-thumb img,
    .fwx-hero-wide-thumb img {
        aspect-ratio: 16 / 9;
    }
}

/* --------------------------------------------------------------------------
   4. LEITOR DE ÁUDIO TTS (SPEECH SYNTHESIS)
   -------------------------------------------------------------------------- */
.gbp-tts-wrapper,
.fwx-tts-wrapper {
    margin: 25px 0;
    padding: 14px 20px;
    background: var(--gbp-color-surface, #f8fafc);
    border: 1px solid var(--gbp-color-border);
    border-radius: var(--gbp-rad-8);
}

[data-theme='dark'] .gbp-tts-wrapper,
html[data-theme='dark'] .fwx-tts-wrapper {
    background: var(--gbp-color-surface-card);
    border-color: var(--gbp-color-border-dark);
}

.gbp-tts-player,
.fwx-tts-player {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gbp-tts-control,
.fwx-tts-control {
    background: var(--gbp-color-primary);
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--gbp-transition);
    flex-shrink: 0;
}

.gbp-tts-control:hover,
.fwx-tts-control:hover {
    background: var(--gbp-color-secondary);
    transform: scale(1.05);
}

.gbp-tts-stop,
.fwx-tts-stop {
    background: var(--gbp-color-surface);
    color: var(--gbp-color-text);
    border: 1px solid var(--gbp-color-border);
}

.gbp-tts-progress-container,
.fwx-tts-progress-container {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

[data-theme='dark'] .gbp-tts-progress-container,
html[data-theme='dark'] .fwx-tts-progress-container {
    background: rgba(255, 255, 255, 0.1);
}

.gbp-tts-progress-fill,
.fwx-tts-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gbp-color-primary);
    transition: width 0.15s linear;
}

.gbp-tts-label,
.fwx-tts-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gbp-color-text);
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. BOTÕES DE COMPARTILHAMENTO (ZERO JS)
   -------------------------------------------------------------------------- */
.gbp-share-buttons,
.fwx-share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 30px 0;
    padding: 16px 0;
    border-top: 1px solid var(--gbp-color-border);
    border-bottom: 1px solid var(--gbp-color-border);
}

.gbp-share-title,
.fwx-share-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-right: 6px;
}

.gbp-share-item,
.fwx-share-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--gbp-rad-4);
    color: #ffffff !important;
    text-decoration: none;
    transition: var(--gbp-transition);
}

.gbp-share-item:hover,
.fwx-share-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.gbp-share-whatsapp, .fwx-share-whatsapp { background-color: #25d366; }
.gbp-share-telegram, .fwx-share-telegram { background-color: #0088cc; }
.gbp-share-twitter, .fwx-share-twitter { background-color: #111111; }
.gbp-share-facebook, .fwx-share-facebook { background-color: #1877f2; }
.gbp-share-linkedin, .fwx-share-linkedin { background-color: #0a66c2; }

/* --------------------------------------------------------------------------
   6. CAIXA DE AUTOR E-E-A-T
   -------------------------------------------------------------------------- */
.gbp-author-box,
.fwx-author-box {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 24px;
    background: var(--gbp-color-surface, #f8fafc);
    border: 1px solid var(--gbp-color-border);
    border-radius: var(--gbp-rad-12);
    margin: 40px 0;
}

[data-theme='dark'] .gbp-author-box,
html[data-theme='dark'] .fwx-author-box {
    background: var(--gbp-color-surface-card);
    border-color: var(--gbp-color-border-dark);
}

.gbp-author-box-avatar img,
.fwx-author-box-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gbp-color-primary);
}

.gbp-author-box-name,
.fwx-author-box-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.gbp-author-box-desc,
.fwx-author-box-desc {
    font-size: 0.925rem;
    color: var(--gbp-color-text-muted);
    line-height: 1.6;
    margin: 0 0 10px 0;
}

/* --------------------------------------------------------------------------
   7. POSTS RELACIONADOS
   -------------------------------------------------------------------------- */
.gbp-related-posts,
.fwx-related-posts {
    margin: 50px 0;
}

.gbp-related-title,
.fwx-related-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gbp-color-primary);
}

.gbp-related-grid,
.fwx-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .gbp-related-grid,
    .fwx-related-grid {
        grid-template-columns: 1fr;
    }
}

.gbp-related-item,
.fwx-related-item {
    background: var(--gbp-color-surface);
    border: 1px solid var(--gbp-color-border);
    border-radius: var(--gbp-rad-8);
    overflow: hidden;
    transition: var(--gbp-transition);
}

.gbp-related-item:hover,
.fwx-related-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.gbp-related-thumb img,
.fwx-related-thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.gbp-related-post-title,
.fwx-related-post-title {
    font-size: 0.95rem;
    padding: 12px 14px 4px 14px;
    margin: 0;
    line-height: 1.4;
}

.gbp-related-post-title a,
.fwx-related-post-title a {
    color: var(--gbp-color-heading, var(--gbp-color-text));
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   8. LIGHTBOX OVERLAY (NATIVO ZERO JQUERY)
   -------------------------------------------------------------------------- */
.gbp-lightbox-overlay,
.fwx-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 20px;
}

.gbp-lightbox-overlay img,
.fwx-lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--gbp-rad-4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.gbp-lightbox-close,
.fwx-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
}

/* v1.2.0: o wrapper interno não pode quebrar a grade conteúdo + sidebar */
.gbp-single-layout > .gbp-main-content-layout {
    display: contents;
}

@media (max-width: 992px) {
    .gbp-single-layout.has-sidebar,
    .fwx-single-layout.has-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }
}

.gbp-single-layout > .gbp-main-content-layout > * {
    min-width: 0;
}

/* v1.2.0: o markup de breadcrumbs usa <ol> + classes gbp-breadcrumb-*; alinha ao estilo acima */
.gbp-breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: inherit;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gbp-single-header .gbp-breadcrumbs,
.gbp-single-header-2 .gbp-breadcrumbs,
.gbp-single-header .gbp-breadcrumbs-list,
.gbp-single-header-2 .gbp-breadcrumbs-list {
    justify-content: center;
}

.gbp-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.gbp-breadcrumb-sep {
    opacity: 0.5;
}

.gbp-breadcrumb-current {
    color: var(--gbp-color-text);
    font-weight: 600;
    max-width: 38ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* v1.2.0: botões de compartilhar legíveis (ícone + texto brancos sobre a cor da rede) */
.gbp-share-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.gbp-btn-share,
.fwx-btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 6px;
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.gbp-btn-share:hover,
.fwx-btn-share:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
}

.gbp-btn-share svg {
    flex-shrink: 0;
}
