/* ======================================================================
   CIO CODEX THEME – SINGLE POST STYLES
   Dark glassmorphism, hero com imagem, sidebar sticky, posts relacionados
   Versão: 1.0.0
   ====================================================================== */

/* -------------------------------------------------------
   DESIGN TOKENS (espelha homepage.css para uso standalone)
   ------------------------------------------------------- */
:root {
    --sp-bg:           #0a0e17;
    --sp-bg-card:      #0d1220;
    --sp-surface:      #141a2a;
    --sp-border:       rgba(0, 200, 255, 0.12);
    --sp-border-hover: rgba(0, 200, 255, 0.35);
    --sp-accent:       #00c8ff;
    --sp-accent-dark:  #0090cc;
    --sp-text:         #ffffff;
    --sp-text-muted:   rgba(255, 255, 255, 0.62);
    --sp-text-subtle:  rgba(255, 255, 255, 0.42);
    --sp-radius:       16px;
    --sp-radius-sm:    10px;
    --sp-font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* -------------------------------------------------------
   BASE DO ARTIGO
   ------------------------------------------------------- */
.cio-sp-article {
    background: var(--sp-bg);
    color: var(--sp-text);
    font-family: var(--sp-font);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.cio-sp-article *,
.cio-sp-article *::before,
.cio-sp-article *::after {
    box-sizing: border-box;
}

/* ======================================================================
   HERO
   ====================================================================== */
.cio-sp-hero {
    position: relative;
    width: 100%;
    min-height: 460px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(180deg, #00081e 0%, #060d1f 100%);
    overflow: hidden;
}

/* Imagem de fundo */
.cio-sp-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    transform: scale(1.04);
    transition: transform 8s ease;
}
.cio-sp-hero:hover .cio-sp-hero-bg {
    transform: scale(1);
}

/* Gradiente overlay */
.cio-sp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 14, 23, 0.25) 0%,
        rgba(10, 14, 23, 0.55) 40%,
        rgba(10, 14, 23, 0.92) 75%,
        rgba(10, 14, 23, 1.00) 100%
    );
    z-index: 1;
}

/* Conteúdo do hero */
.cio-sp-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 110px 24px 56px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Breadcrumb ── */
.cio-sp-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12.5px;
    color: var(--sp-text-subtle);
}
.cio-sp-breadcrumb a {
    color: var(--sp-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.cio-sp-breadcrumb a:hover {
    color: var(--sp-accent);
}
.cio-sp-breadcrumb-sep {
    opacity: 0.5;
}

/* ── Badges ── */
.cio-sp-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.cio-sp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.cio-sp-badge--cat {
    background: rgba(0, 200, 255, 0.15);
    border: 1px solid rgba(0, 200, 255, 0.30);
    color: var(--sp-accent);
    transition: background 0.2s, border-color 0.2s;
}
.cio-sp-badge--cat:hover {
    background: rgba(0, 200, 255, 0.25);
    border-color: rgba(0, 200, 255, 0.50);
}
.cio-sp-badge--premium {
    background: linear-gradient(135deg, #f5c518 0%, #e0a800 100%);
    color: #0a0e17;
}
.cio-sp-badge--sm {
    padding: 3px 10px;
    font-size: 10px;
}

/* ── Título ── */
.cio-sp-title {
    font-size: clamp(26px, 4vw, 46px);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.025em;
    color: var(--sp-text);
    margin: 0;
}

/* ── Meta ── */
.cio-sp-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--sp-text-muted);
}
.cio-sp-meta-author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sp-text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.cio-sp-meta-author:hover {
    color: var(--sp-accent);
}
.cio-sp-meta-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 200, 255, 0.40);
    display: block;
}
.cio-sp-meta-date,
.cio-sp-meta-read {
    display: flex;
    align-items: center;
    gap: 5px;
}
.cio-sp-meta-sep {
    opacity: 0.35;
}

/* ======================================================================
   WRAPPER + CORPO
   ====================================================================== */
.cio-sp-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.cio-sp-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    padding-top: 52px;
    align-items: start;
}

/* ======================================================================
   ÁREA DE CONTEÚDO
   ====================================================================== */
.cio-sp-content {
    min-width: 0;
}

/* ── Tipografia do artigo ── */
.cio-sp-entry-content {
    font-size: 17px;
    line-height: 1.82;
    color: rgba(255, 255, 255, 0.85);
}
.cio-sp-entry-content > * + * {
    margin-top: 0;
}
.cio-sp-entry-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--sp-text);
    margin: 52px 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sp-border);
    letter-spacing: -0.02em;
    line-height: 1.3;
}
.cio-sp-entry-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--sp-text);
    margin: 40px 0 14px;
    line-height: 1.35;
}
.cio-sp-entry-content h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--sp-text);
    margin: 30px 0 10px;
}
.cio-sp-entry-content p {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.82);
}
.cio-sp-entry-content a {
    color: var(--sp-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.cio-sp-entry-content a:hover {
    color: #fff;
}
.cio-sp-entry-content strong {
    color: var(--sp-text);
    font-weight: 700;
}
.cio-sp-entry-content em {
    color: var(--sp-text-muted);
}
.cio-sp-entry-content ul,
.cio-sp-entry-content ol {
    padding-left: 24px;
    margin: 0 0 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cio-sp-entry-content li {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.7;
}
.cio-sp-entry-content ul li::marker {
    color: var(--sp-accent);
}
.cio-sp-entry-content blockquote {
    margin: 36px 0;
    padding: 20px 24px;
    border-left: 3px solid var(--sp-accent);
    background: var(--sp-bg-card);
    border-radius: 0 var(--sp-radius-sm) var(--sp-radius-sm) 0;
    color: var(--sp-text-muted);
    font-style: italic;
    font-size: 16px;
    line-height: 1.75;
}
.cio-sp-entry-content blockquote p {
    margin: 0;
}
.cio-sp-entry-content code {
    font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 14px;
    background: rgba(0, 200, 255, 0.10);
    color: var(--sp-accent);
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid rgba(0, 200, 255, 0.18);
}
.cio-sp-entry-content pre {
    font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 14px;
    background: #070c17;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    padding: 20px 24px;
    overflow-x: auto;
    margin: 28px 0;
}
.cio-sp-entry-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.88);
}
.cio-sp-entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--sp-radius-sm);
    border: 1px solid var(--sp-border);
    display: block;
    margin: 8px 0;
}
.cio-sp-entry-content figure {
    margin: 28px 0;
}
.cio-sp-entry-content figcaption {
    font-size: 13px;
    color: var(--sp-text-subtle);
    text-align: center;
    margin-top: 8px;
}
.cio-sp-entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    font-size: 14.5px;
}
.cio-sp-entry-content th {
    background: var(--sp-surface);
    color: var(--sp-text);
    padding: 11px 16px;
    text-align: left;
    border: 1px solid var(--sp-border);
    font-weight: 600;
}
.cio-sp-entry-content td {
    padding: 11px 16px;
    border: 1px solid var(--sp-border);
    color: rgba(255, 255, 255, 0.82);
}
.cio-sp-entry-content tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.025);
}
.cio-sp-entry-content hr {
    border: none;
    border-top: 1px solid var(--sp-border);
    margin: 44px 0;
}

/* ── Tags ── */
.cio-sp-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 44px;
    padding-top: 24px;
    border-top: 1px solid var(--sp-border);
    font-size: 13px;
    color: var(--sp-text-subtle);
}
.cio-sp-tags > svg {
    flex-shrink: 0;
    color: var(--sp-accent);
}
.cio-sp-tags > span {
    font-weight: 600;
    color: var(--sp-text-muted);
}
.cio-sp-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: 100px;
    color: var(--sp-text-muted);
    font-size: 12.5px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.cio-sp-tag:hover {
    background: rgba(0, 200, 255, 0.10);
    border-color: rgba(0, 200, 255, 0.30);
    color: var(--sp-accent);
}

/* ── Compartilhar ── */
.cio-sp-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding: 18px 20px;
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
}
.cio-sp-share-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--sp-text-muted);
    margin-right: 4px;
}
.cio-sp-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    line-height: 1;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    font-family: var(--sp-font);
}
.cio-sp-share-btn:hover {
    transform: translateY(-1px);
}
.cio-sp-share-btn--linkedin { background: rgba(10, 102, 194, 0.20); color: #60a5fa; }
.cio-sp-share-btn--linkedin:hover { background: rgba(10, 102, 194, 0.35); }
.cio-sp-share-btn--x { background: rgba(255, 255, 255, 0.08); color: #fff; }
.cio-sp-share-btn--x:hover { background: rgba(255, 255, 255, 0.15); }
.cio-sp-share-btn--facebook { background: rgba(24, 119, 242, 0.20); color: #60a5fa; }
.cio-sp-share-btn--facebook:hover { background: rgba(24, 119, 242, 0.35); }
.cio-sp-share-btn--copy { background: var(--sp-surface); color: var(--sp-text-muted); }
.cio-sp-share-btn--copy:hover { background: rgba(0, 200, 255, 0.10); color: var(--sp-accent); }

/* ── Navegação anterior / próximo ── */
.cio-sp-postnav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 28px;
}
.cio-sp-postnav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    text-decoration: none;
    color: var(--sp-text);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.cio-sp-postnav-item:hover {
    border-color: var(--sp-border-hover);
    background: var(--sp-surface);
    transform: translateY(-2px);
}
.cio-sp-postnav-item > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}
.cio-sp-postnav-next > div {
    text-align: right;
}
.cio-sp-postnav-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sp-accent);
}
.cio-sp-postnav-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sp-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cio-sp-postnav-item svg {
    flex-shrink: 0;
    color: var(--sp-text-subtle);
}
.cio-sp-postnav-item:only-child {
    grid-column: 1 / -1;
}

/* ======================================================================
   SIDEBAR
   ====================================================================== */
.cio-sp-sidebar {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Índice ── */
.cio-sp-toc {
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    overflow: hidden;
}
.cio-sp-toc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--sp-accent);
    border-bottom: 1px solid var(--sp-border);
    background: var(--sp-surface);
}
.cio-sp-toc-list {
    padding: 8px 0;
}
.cio-sp-toc-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cio-sp-toc-item a {
    display: block;
    padding: 7px 18px;
    font-size: 13px;
    color: var(--sp-text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    line-height: 1.5;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.cio-sp-toc-item a:hover,
.cio-sp-toc-item a.is-active {
    color: var(--sp-accent);
    border-left-color: var(--sp-accent);
    background: rgba(0, 200, 255, 0.06);
}
.cio-sp-toc-h3 a {
    padding-left: 32px;
    font-size: 12.5px;
}

/* ── Box do autor ── */
.cio-sp-author-box {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
}
.cio-sp-author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 200, 255, 0.35);
    flex-shrink: 0;
    display: block;
}
.cio-sp-author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.cio-sp-author-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--sp-text-subtle);
}
.cio-sp-author-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--sp-text);
    text-decoration: none;
    transition: color 0.2s;
}
.cio-sp-author-name:hover {
    color: var(--sp-accent);
}
.cio-sp-author-bio {
    font-size: 12.5px;
    color: var(--sp-text-muted);
    line-height: 1.55;
    margin: 4px 0 0;
}

/* ======================================================================
   POSTS RELACIONADOS
   ====================================================================== */
.cio-sp-related {
    margin-top: 64px;
    padding-top: 52px;
    border-top: 1px solid var(--sp-border);
}
.cio-sp-related-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    margin-bottom: 36px;
}
.cio-sp-related-prelabel {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--sp-accent);
}
.cio-sp-related-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--sp-text);
    margin: 0;
    letter-spacing: -0.02em;
}
.cio-sp-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.cio-sp-related-card {
    display: flex;
    flex-direction: column;
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--sp-text);
    position: relative;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.cio-sp-related-card:hover {
    border-color: var(--sp-border-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 200, 255, 0.12);
}
.cio-sp-related-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--sp-surface);
}
.cio-sp-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}
.cio-sp-related-card:hover .cio-sp-related-thumb img {
    transform: scale(1.05);
}
.cio-sp-related-nothumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 200, 255, 0.25);
}
.cio-sp-related-info {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.cio-sp-related-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.45;
    color: var(--sp-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cio-sp-related-date {
    font-size: 12px;
    color: var(--sp-text-subtle);
    margin-top: auto;
}
.cio-sp-related-arrow {
    position: absolute;
    bottom: 18px;
    right: 18px;
    color: var(--sp-text-subtle);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s, transform 0.2s;
}
.cio-sp-related-card:hover .cio-sp-related-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ======================================================================
   RESPONSIVO
   ====================================================================== */
@media (max-width: 1100px) {
    .cio-sp-body {
        grid-template-columns: 1fr 260px;
        gap: 32px;
    }
}

@media (max-width: 860px) {
    .cio-sp-body {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .cio-sp-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .cio-sp-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .cio-sp-hero {
        min-height: 380px;
    }
    .cio-sp-hero-inner {
        padding: 90px 16px 44px;
    }
    .cio-sp-wrap {
        padding: 0 16px 56px;
    }
    .cio-sp-body {
        padding-top: 36px;
    }
    .cio-sp-entry-content {
        font-size: 16px;
        line-height: 1.75;
    }
    .cio-sp-postnav {
        grid-template-columns: 1fr;
    }
    .cio-sp-sidebar {
        grid-template-columns: 1fr;
    }
    .cio-sp-related-grid {
        grid-template-columns: 1fr;
    }
    .cio-sp-share {
        gap: 8px;
    }
    .cio-sp-share-btn {
        padding: 7px 12px;
        font-size: 12.5px;
    }
}
