/* RESET & VARIABLES */
:root {
    --bg-color: #f4f5f7;
    --text-color: #333333;
    --primary-blue: #0033ff;
    --light-blue: #00e5ff;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --footer-bg: #111111;
    --footer-bottom: #000000;
    --tag-bg: #0044cc;
    --meta-color: #777777;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
}

a {
    text-decoration: none;
    color: var(--primary-blue);
    transition: color var(--transition);
}

a:hover {
    color: #0022aa;
}

img {
    max-width: 100%;
    display: block;
}

/* DARK MODE VARIABLES */
body.dark-theme {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --white: #1e1e1e;
    --border-color: #333333;
    --meta-color: #aaaaaa;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* LAYOUT CONTAINERS */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    text-align: center;
}

.logo img {
    width: 60px;
    margin: 0 auto 10px;
}

.logo p {
    color: var(--light-blue);
    font-weight: bold;
    font-size: 14px;
    line-height: 1.2;
    text-transform: uppercase;
}

.header-actions {
    position: absolute;
    right: 20px;
    display: flex;
    gap: 10px;
}

.header-actions button {
    background: var(--primary-blue);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
}

.header-actions button:hover {
    background: #0022bb;
}

.header-actions img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.main-nav {
    background-color: var(--primary-blue);
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.main-nav a {
    color: white;
    display: block;
    padding: 15px 30px;
    font-weight: 600;
    font-size: 14px;
}

.main-nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* MAIN GRID */
.layout-grid {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}

.articles-list {
    flex: 1;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* ARTICLE CARDS */
.post-card {
    display: flex;
    background: var(--white);
    margin-bottom: 30px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.post-image {
    width: 300px;
    flex-shrink: 0;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background: var(--tag-bg);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 2px;
    text-transform: uppercase;
}

.post-content h2 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--text-color);
    line-height: 1.3;
}

.post-meta {
    display: flex;
    gap: 15px;
    color: var(--meta-color);
    font-size: 12px;
    margin-bottom: 15px;
    align-items: center;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item img {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

body.dark-theme .meta-item img {
    filter: invert(1);
}

.post-content p {
    font-size: 14px;
    color: var(--meta-color);
}

/* SIDEBAR WIDGETS */
.widget {
    background: var(--white);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border-radius: 4px;
}

.widget h3 {
    font-size: 18px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.search-widget form {
    display: flex;
}

.search-widget input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    background: var(--bg-color);
    color: var(--text-color);
    outline: none;
}

.search-widget button {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: bold;
}

.recent-widget ul {
    list-style: none;
}

.recent-widget li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.recent-widget li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.recent-widget a {
    color: var(--text-color);
    font-size: 14px;
    display: block;
    line-height: 1.4;
}

.recent-widget a:hover {
    color: var(--primary-blue);
}

/* VOCÊ PERDEU SECTION */
.missed-section {
    background: var(--white);
    padding: 30px;
    margin: 40px 0;
    box-shadow: var(--shadow);
    border-radius: 4px;
}

.section-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 20px;
}

.missed-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.missed-card {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.missed-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.missed-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 20px 15px 15px;
    color: white;
}

.missed-overlay h4 {
    font-size: 14px;
    margin-top: 10px;
    line-height: 1.3;
}

/* RECOMENDAÇÕES */
.recommendations-section {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.recommendation-card {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 400px;
}

.recommendation-card h3 {
    border-bottom: 2px solid var(--primary-blue);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

.recommendation-card img {
    border-radius: 8px;
    margin-bottom: 15px;
    width: 100%;
}

.recommendation-card p {
    font-size: 13px;
    color: var(--meta-color);
}

/* WELCOME TEXT */
.welcome-text {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    text-align: center;
}

.welcome-text h2 {
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.welcome-text p {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.8;
}

/* FOOTER */
footer {
    background: var(--footer-bg);
    color: #fff;
}

.footer-top {
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid #222;
}

.footer-logo img {
    width: 50px;
    margin: 0 auto 10px;
    filter: brightness(0) invert(1);
}

.footer-logo p {
    color: var(--light-blue);
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
}

.footer-bottom {
    background: var(--footer-bottom);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    color: #888;
    font-size: 12px;
}

.footer-links a {
    color: #888;
    font-size: 12px;
    margin-left: 20px;
}

.footer-links a:hover {
    color: white;
}

.disclaimer {
    background: var(--footer-bottom);
    padding: 10px 20px 30px;
    text-align: center;
    font-size: 11px;
    color: #666;
}

.disclaimer p {
    max-width: 1200px;
    margin: 0 auto;
}

/* COOKIE MODAL */
.cookie-modal {
    position: fixed;
    bottom: 30px;
    right: -400px; /* Hidden state */
    width: 320px;
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid var(--primary-blue);
}

.cookie-modal.show {
    right: 30px;
}

.cookie-content h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.cookie-content p {
    font-size: 12px;
    color: var(--meta-color);
    margin-bottom: 15px;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.cookie-buttons button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    flex: 1;
    transition: opacity var(--transition);
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color) !important;
}

.cookie-buttons button:hover {
    opacity: 0.8;
}

/* BACK TO TOP */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary-blue);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0,51,255,0.4);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

#back-to-top:hover {
    background: #0022bb;
    transform: translateY(-3px);
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .layout-grid {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .missed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .post-card {
        flex-direction: column;
    }
    .post-image {
        width: 100%;
        height: 200px;
    }
    .header-actions {
        position: static;
        margin-top: 20px;
    }
    .header-container {
        flex-direction: column;
    }
    .main-nav ul {
        flex-direction: column;
    }
    .main-nav a {
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    .footer-links a {
        margin: 5px 10px;
        display: inline-block;
    }
}

@media (max-width: 480px) {
    .missed-grid {
        grid-template-columns: 1fr;
    }
    .cookie-modal {
        width: calc(100% - 40px);
        right: -100%;
    }
    .cookie-modal.show {
        right: 20px;
        bottom: 20px;
    }
}
/* Inner page styles */
/* =========================================
   INTERNAL PAGE STYLES 
========================================= */

/* Single Article Container */
.single-article {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Typography - Headings & Text */
.article-title {
    font-size: 32px;
    line-height: 1.2;
    color: var(--text-color);
    margin-bottom: 20px;
    font-weight: 800;
}

.article-meta {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.article-content h2 {
    font-size: 26px;
    color: var(--primary-blue);
    margin: 35px 0 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.article-content h3 {
    font-size: 22px;
    color: var(--text-color);
    margin: 30px 0 15px;
}

.article-content h4 {
    font-size: 19px;
    color: var(--text-color);
    margin: 25px 0 10px;
}

.article-content h5 {
    font-size: 17px;
    color: var(--text-color);
    margin: 20px 0 10px;
}

.article-content h6 {
    font-size: 15px;
    color: var(--meta-color);
    text-transform: uppercase;
    margin: 20px 0 10px;
}

.article-content p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 20px;
}

.article-content span.highlight {
    background-color: rgba(0, 51, 255, 0.1);
    color: var(--primary-blue);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Responsive Images */
.responsive-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.main-article-img {
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.inline-img {
    margin: 30px 0;
}

/* Table of Contents (TOC) */
.toc {
    background-color: var(--bg-color);
    border-left: 4px solid var(--primary-blue);
    padding: 20px;
    margin: 0 0 30px 0;
    border-radius: 0 8px 8px 0;
}

.toc-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-color);
}

.toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 10px;
}

.toc a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.toc a:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* Lists in Article Content */
.article-content ul, 
.article-content ol {
    margin: 0 0 25px 25px;
    padding-left: 20px;
    color: var(--text-color);
}

.article-content ul {
    list-style-type: disc;
}

.article-content ol {
    list-style-type: decimal;
}

.article-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.article-content li::marker {
    color: var(--primary-blue);
    font-weight: bold;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin: 30px 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

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

.article-content th {
    background-color: var(--primary-blue);
    color: var(--white);
    font-weight: bold;
}

.article-content tr:nth-child(even) {
    background-color: rgba(0,0,0,0.02);
}

/* Contact Form Inside Article */
.contact-form-container {
    background-color: var(--bg-color);
    padding: 30px;
    border-radius: 8px;
    margin: 40px 0;
    border: 1px solid var(--border-color);
}

.contact-form-container h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

.contact-form input, 
.contact-form textarea, 
.comment-form input, 
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 15px;
    background: var(--white);
    color: var(--text-color);
    outline: none;
    transition: border-color var(--transition);
}

.contact-form input:focus, 
.contact-form textarea:focus, 
.comment-form input:focus, 
.comment-form textarea:focus {
    border-color: var(--primary-blue);
}

/* Comments Section */
.comments-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.comments-section h3 {
    font-size: 24px;
    margin-bottom: 25px;
    color: var(--text-color);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.comment-form textarea {
    margin-bottom: 20px;
    resize: vertical;
}

.btn-submit {
    background-color: var(--primary-blue);
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--transition), transform 0.2s;
}

.btn-submit:hover {
    background-color: #0022bb;
    transform: translateY(-2px);
}

/* Internal Linking Block (Related Articles) */
.related-articles-section {
    margin: 50px 0;
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

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

.related-grid .post-card {
    flex-direction: column;
    margin-bottom: 0;
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.related-grid .post-image {
    width: 100%;
    height: 180px;
}

.related-grid .post-content h4 {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-color);
}

.related-grid .post-content p {
    font-size: 13px;
    color: var(--meta-color);
    margin-bottom: 0;
}

/* Dark Mode Overrides for Internal Page */
body.dark-theme .single-article,
body.dark-theme .related-articles-section {
    background: var(--white); /* In root it is defined as dark grey #1e1e1e */
}

body.dark-theme .toc,
body.dark-theme .contact-form-container {
    background-color: var(--bg-color);
}

body.dark-theme .article-content th {
    background-color: #002288;
}

body.dark-theme .article-content tr:nth-child(even) {
    background-color: rgba(255,255,255,0.05);
}

body.dark-theme .contact-form input, 
body.dark-theme .contact-form textarea, 
body.dark-theme .comment-form input, 
body.dark-theme .comment-form textarea {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Responsive Adjustments for Internal Page */
@media (max-width: 768px) {
    .article-title {
        font-size: 24px;
    }
    .single-article {
        padding: 20px;
    }
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
    .related-grid .post-image {
        height: auto;
        aspect-ratio: 16/9;
    }
}