/*
 Theme Name:   SmartMag Child — PiraNOT
 Theme URI:    https://piranot.com.br
 Description:  Child theme do SmartMag 10.3.2 com customizações PiraNOT (3-col Folha, drop-cap, author ribbon).
 Author:       PiraNOT Engineering
 Author URI:   https://piranot.com.br
 Template:     smart-mag
 Version:      1.0.0
 License:      GPL v2 or later
 Text Domain:  smart-mag-child
*/

/* =============================================
   LAYOUT 3 COLUNAS — CSS GRID (substitui col-1+col-8+col-4)
   Grid de 12 colunas real, sem overflow.
   ============================================= */

/* Desktop: meta-col (1fr ~80px) + content (8fr) + sidebar (4fr) */
@media (min-width: 992px) {
    .pn-single-folha {
        display: grid !important;
        grid-template-columns: 80px 1fr 300px;
        gap: 0 24px;
        /* Override ts-row flex behavior */
        flex-wrap: nowrap !important;
    }

    .pn-single-folha > .pn-single-meta-column {
        /* Remove o col-1 do Bootstrap, usar grid */
        width: auto !important;
        max-width: none !important;
        flex: none !important;
        padding: 0 !important;
        /* Override inline styles from Design Engine */
        margin-top: 0 !important;
    }

    .pn-single-folha > .pn-single-main {
        /* Remove col-8 do Bootstrap, grid controla */
        width: auto !important;
        max-width: none !important;
        flex: none !important;
    }

    .pn-single-folha > .main-sidebar {
        /* Remove col-4 do Bootstrap, grid controla */
        width: auto !important;
        max-width: none !important;
        flex: none !important;
    }
}

/* Tablet: sem meta-col, content + sidebar */
@media (min-width: 768px) and (max-width: 991px) {
    .pn-single-folha {
        display: flex !important;
        flex-wrap: wrap !important;
    }
    .pn-single-folha > .pn-single-meta-column {
        display: none !important;
    }
    .pn-single-folha > .pn-single-main {
        width: 66.666% !important;
        flex: 0 0 66.666% !important;
    }
    .pn-single-folha > .main-sidebar {
        width: 33.333% !important;
        flex: 0 0 33.333% !important;
    }
}

/* Mobile: tudo empilhado */
@media (max-width: 767px) {
    .pn-single-folha {
        display: block !important;
    }
    .pn-single-folha > .pn-single-meta-column {
        display: none !important;
    }
    .pn-single-folha > .pn-single-main {
        width: 100% !important;
    }
    .pn-single-folha > .main-sidebar {
        width: 100% !important;
    }
}

/* =============================================
   META COLUMN — Estilo refinado (sem inline styles)
   ============================================= */
.pn-single-meta-column {
    border-right: 1px solid #eee;
    padding-right: 16px !important;
    padding-top: 10px;
}

.pn-single-meta-column .pn-meta-sticky {
    position: sticky;
    top: 100px;
}

.pn-single-meta-column .pn-meta-date {
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
}

.pn-single-meta-column .pn-meta-author {
    margin-bottom: 20px;
}

.pn-single-meta-column .pn-meta-author-name {
    font-size: 13px;
    font-weight: 700;
    display: block;
}

.pn-single-meta-column .pn-meta-author-role {
    font-size: 11px;
    color: #2E86AB;
}

.pn-single-meta-column .pn-share-mini {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =============================================
   COLUMNIST HEADER — Estilo refinado (sem inline styles)
   ============================================= */
.pn-columnist-header {
    margin-bottom: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-top: 4px solid #1a1a2e;
    display: flex;
    align-items: center;
    gap: 25px;
    border-radius: 4px;
}

.pn-columnist-header__avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.pn-columnist-header__kicker {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    color: #2E86AB;
    letter-spacing: 1px;
    display: block;
}

.pn-columnist-header__name {
    margin: 5px 0;
    font-size: 32px;
    font-family: serif;
}

.pn-columnist-header__bio {
    margin: 0;
    color: #666;
    font-size: 15px;
    line-height: 1.4;
}

@media (max-width: 767px) {
    .pn-columnist-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 15px;
    }
    .pn-columnist-header__avatar {
        width: 80px;
        height: 80px;
    }
    .pn-columnist-header__name {
        font-size: 24px;
    }
}

/* =============================================
   DROP-CAP UNIFICADO — Apenas via classe CSS
   Sem JS/PHP manipulation, sem ::first-letter hack.
   O PHP adiciona .has-drop-cap no primeiro <p>.
   ============================================= */
.single .post-content p.has-drop-cap:not(:focus):first-letter,
.single .entry-content p.has-drop-cap:not(:focus):first-letter {
    font-size: 4rem;
    float: left;
    line-height: 0.8;
    padding-right: 8px;
    padding-top: 4px;
    color: var(--pn-accent, #0b3b5b);
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
}

/* Remove o ::first-letter genérico que competia */
/* (piranot-editorial.css usava entry-content > p:first-of-type::first-letter) */

/* =============================================
   AUTHOR RIBBON UNIFICADO
   ============================================= */
.pn-author-ribbon {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    margin: 14px 0 12px;
    padding: 12px;
    border: 1px solid #e6ebf0;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9fc 100%);
}

.pn-author-ribbon__avatar img {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid #fff;
}

.pn-author-ribbon__kicker {
    display: block;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #5a6f86;
}

.pn-author-ribbon__column {
    font-size: .8rem;
    font-weight: 700;
    color: #111b27;
    margin-left: 6px;
}

.pn-author-ribbon__name {
    display: inline-block;
    margin-top: 2px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #111b27;
    text-decoration: none;
}

.pn-author-ribbon__byline {
    font-size: .85rem;
    color: #516171;
    margin-top: 2px;
}

.pn-author-ribbon__dot {
    margin: 0 6px;
}

.pn-author-ribbon__bio {
    margin: 4px 0 0;
    font-size: .9rem;
    color: #516171;
}

.pn-author-ribbon__disclaimer {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    padding-top: 8px;
    border-top: 1px solid #e5edf5;
    font-size: .76rem;
    line-height: 1.45;
    color: #5b6f85;
}

.pn-author-ribbon__eyebrow-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 767px) {
    .pn-author-ribbon {
        grid-template-columns: 1fr;
    }
    .pn-author-ribbon__avatar img {
        width: 62px;
        height: 62px;
    }
}
