/* =========================================================
   public_html/assets/css/artigo.css
   Estilos exclusivos da página de artigo individual:
   layout, tipografia do conteúdo, share, embeds e comentários.
   ========================================================= */

/* ===========================
   ARTICLE SINGLE PAGE
   =========================== */

.article-single-page {
    padding: var(--spacing-xl) 0;
}

.article-single-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.article-single-header {
    margin-bottom: var(--spacing-2xl);
}

.article-single-title {
    font-family: var(--font-display), var(--font-primary);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.article-single-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.article-single-image {
    margin: 2rem 0;
}

.article-single-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.article-single-reading-time {
    font-size: 0.85rem;
    color: var(--text-light);
}

.article-single-page .article-meta {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.article-single-page .article-meta > span {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.article-single-page .article-meta .article-views {
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===========================
   ARTICLE CONTENT TYPOGRAPHY
   =========================== */

.article-single-content {
    font-family: var(--font-primary);
    line-height: 1.85;
    font-size: 16px;
    color: var(--text-primary);
    word-wrap: break-word;
}

.article-single-content h1,
.article-single-content h2,
.article-single-content h3,
.article-single-content h4,
.article-single-content h5,
.article-single-content h6 {
    font-family: var(--font-display), var(--font-primary);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 1.5em 0 0.5em 0;
    line-height: 1.3;
}

.article-single-content h1 { font-size: 2.2em; }
.article-single-content h2 { font-size: 1.8em; }
.article-single-content h3 { font-size: 1.5em; }
.article-single-content h4 { font-size: 1.3em; }
.article-single-content h5 { font-size: 1.1em; }
.article-single-content h6 { font-size: 1em; }

.article-single-content p {
    margin: 1em 0;
}

.article-single-content ul,
.article-single-content ol {
    margin: 1em 0 1em 2em;
    padding: 0;
}

.article-single-content li {
    margin: 0.5em 0;
}

.article-single-content a {
    color: var(--secondary-color);
    text-decoration: none;
}

.article-single-content a:hover {
    text-decoration: underline;
}

.article-single-content blockquote {
    border-left: 4px solid var(--border-color);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--bg-secondary);
}

.article-single-content code {
    font-family: var(--font-mono);
    background: var(--bg-secondary);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.95em;
}

.article-single-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1em 0;
}

.article-single-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 0.95em;
}

.article-single-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
    overflow-x: auto;
    display: block;
}

.article-single-content th,
.article-single-content td {
    border: 1px solid var(--border-color);
    padding: 0.6em 1em;
    text-align: left;
}

.article-single-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.article-single-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    border-radius: 4px;
}

.article-single-content em,
.article-single-content i {
    font-style: italic;
}

.article-single-content strong,
.article-single-content b {
    font-weight: bold;
}

.article-single-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2em 0;
}

.article-single-content del {
    text-decoration: line-through;
}

.article-single-content .MathJax {
    display: inline-block;
    margin: 0.5em 0;
}

@media screen and (max-width: 768px) {
    .article-single-content table {
        display: block;
        overflow-x: auto;
    }
}

/* ===========================
   ARTICLE SHARE BUTTONS
   =========================== */

.article-single-share {
    margin: var(--spacing-xl);
    text-align: center;
}

.article-single-share h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.share-buttons a,
.share-buttons button.copy-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 140px;
    height: 42px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.share-buttons svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.share-buttons a:hover,
.share-buttons button.copy-link:hover {
    background-color: var(--bg-hover);
    transform: translateY(-1px);
}

.share-buttons a.fb svg { fill: #1877f2; }
.share-buttons a.tw svg { fill: #1da1f2; }
.share-buttons a.li svg { fill: #0077b5; }
.share-buttons button.copy-link svg { fill: currentColor; }

/* ===========================
   ARTICLE LINKS
   =========================== */

.article-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: var(--spacing-md);
}

.article-links a {
    display: inline-block;
    padding: 0.65rem 1.2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.article-links a:hover {
    background: var(--primary-color);
    color: var(--on-primary);
    border-color: var(--primary-color);
}

/* ===========================
   EMBEDS — Spotify, YouTube, Twitter, Instagram, TikTok, etc.
   =========================== */

.embed-container {
    margin: 2rem auto;
    max-width: 100%;
    clear: both;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.spotify-embed {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    background: #000;
}

.spotify-embed iframe {
    border-radius: 12px;
    display: block;
}

.twitter-embed {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
}

.twitter-embed .twitter-tweet {
    margin: 0 auto !important;
}

.instagram-embed {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
    min-height: 400px;
}

.instagram-embed .instagram-media {
    margin: 0 auto !important;
}

.tiktok-embed {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
}

.tiktok-embed blockquote {
    margin: 0 auto !important;
}

.codepen-embed {
    margin: 2rem auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.gist-embed {
    margin: 2rem auto;
    border-radius: 8px;
    overflow: hidden;
}

.gist-embed .gist {
    max-width: 100%;
}

.gist-embed .gist .gist-file {
    border-radius: 8px;
}

.soundcloud-embed {
    margin: 2rem auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.embed-container.loading {
    min-height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: embedLoading 1.5s infinite;
    border-radius: 12px;
}

@keyframes embedLoading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 768px) {
    .embed-container {
        margin: 1.5rem 0;
    }

    .video-embed {
        border-radius: 8px;
    }

    .spotify-embed {
        border-radius: 8px;
    }

    .codepen-embed iframe {
        height: 300px !important;
    }
}

@media (prefers-color-scheme: dark) {
    .embed-container.loading {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
}

/* ===========================
   COMENTÁRIOS
   =========================== */

.comments-section {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 4rem;
}

.comments-container {
    max-width: 720px;
    margin: 0 auto;
}

.comments-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.comments-empty {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.comment {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.comment-author {
    font-size: 0.9rem;
    font-weight: 600;
}

.comment-date {
    font-size: 0.78rem;
    color: var(--text-light);
}

.comment-body {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.comment-form-wrapper {
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.comment-form-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.comment-form-notice {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

#commentForm .form-group {
    margin-bottom: 1.1rem;
}

#commentForm label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
}

#commentForm label small {
    font-weight: 400;
    color: var(--text-light);
    margin-left: 0.3rem;
}

#commentForm input[type="text"],
#commentForm input[type="email"],
#commentForm textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast);
    outline: none;
}

#commentForm input:focus,
#commentForm textarea:focus {
    border-color: var(--secondary-color);
}

#commentForm textarea {
    resize: vertical;
    min-height: 110px;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

#comment-submit {
    margin-top: 0.5rem;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--on-primary);
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

#comment-submit:hover    { opacity: 0.8; }
#comment-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.comment-msg {
    margin-top: 0.85rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}

.comment-msg--ok  { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.comment-msg--err { background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-border); }

@media (max-width: 600px) {
    .comment-header { flex-direction: column; gap: 0.2rem; }

    .article-single-page .article-meta {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 0.4rem;
    }

    .article-single-reading-time {
        grid-column: span 2;
        justify-content: center;
    }

    .article-single-page .article-meta > span {
        justify-content: flex-start;
    }
}
