/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-dark: #0f172a;
    --text-gray: #475569;
    --text-light: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-footer: #0a1128;
    --border-color: #e2e8f0;
    --radius: 8px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    --text-dark: #f8fafc;
    --text-gray: #cbd5e1;
    --bg-white: #0f172a;
    --bg-light: #1e293b;
    --border-color: #334155;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-gray);
    background-color: var(--bg-white);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

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

.section {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn--primary {
    background-color: var(--primary-color);
    color: #fff;
}

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

.btn--outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
}

.btn--outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover {
    background-color: var(--bg-light);
}

.badge {
    background-color: #e0e7ff;
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 12px;
}

.badge--text {
    background: none;
    padding: 0;
    margin-bottom: 4px;
}

/* Header */
.header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Main Nav */
.main-nav {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-light);
}

.main-nav__list {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
}

.main-nav__list a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
}

@media (max-width: 992px) {
    .hero__grid {
        grid-template-columns: 1fr;
    }
}

.hero-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 400px;
    display: flex;
    align-items: flex-end;
}

.hero__grid .hero-card:first-child {
    grid-column: span 1;
}

.hero-card__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.5s;
}

.hero-card:hover .hero-card__bg {
    transform: scale(1.05);
}

.hero-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    z-index: 2;
}

.hero-card__content {
    position: relative;
    z-index: 3;
    padding: 30px;
    color: #fff;
}

.hero-card__content h2 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 15px;
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #e2e8f0;
}

.author-meta--dark {
    color: var(--text-gray);
}

.avatar {
    border-radius: 50%;
    object-fit: cover;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

.section-header::before,
.section-header::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    padding: 0 20px;
    font-size: 20px;
}

/* Popular Posts */
.popular__list {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.popular-item {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 250px;
    padding: 10px;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.popular-item:hover {
    background-color: var(--bg-light);
}

.popular-item__img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.popular-item__info h3 {
    font-size: 15px;
}

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

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card__body {
    padding: 20px;
}

.card__title {
    font-size: 18px;
    margin-bottom: 15px;
}

.card--overlay {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 100%;
    min-height: 350px;
}

.card--overlay .card__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.card--overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    z-index: 2;
}

.card--overlay .card__content {
    position: relative;
    z-index: 3;
    padding: 20px;
    color: #fff;
}

.card--overlay .card__title {
    color: #fff;
}

/* Featured Content */
.featured__inner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .featured__inner {
        grid-template-columns: 1fr;
    }
}

.featured-post__img {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 20px;
    max-height: 400px;
    object-fit: cover;
}

.featured-post__title {
    font-size: 28px;
    margin-bottom: 10px;
}

.featured-post__excerpt {
    margin: 15px 0;
    font-size: 16px;
}

.read-more {
    font-weight: 600;
    color: var(--primary-color);
}

/* Search Sidebar */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form__input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-white);
    color: var(--text-dark);
}

/* Welcome Text */
.welcome-text {
    background-color: var(--bg-light);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.welcome-text__box {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}

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

/* Footer */
.footer {
    background-color: var(--bg-footer);
    color: #cbd5e1;
    padding: 60px 0 20px;
}

.footer h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .footer__grid {
        grid-template-columns: 1fr;
    }
}

.disclaimer-col p {
    font-size: 14px;
    opacity: 0.8;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    font-size: 14px;
    transition: color 0.2s;
}

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

.footer__bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
}

/* Cookie Banner Modal (Right Positioned) */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    right: -400px; /* Hidden initially */
    width: 350px;
    background: var(--bg-white);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    z-index: 1000;
    transition: right 0.4s ease-in-out;
}

.cookie-banner.show {
    right: 20px;
}

.cookie-banner__content {
    padding: 20px;
}

.cookie-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cookie-header h3 {
    font-size: 16px;
    margin: 0;
}

.cookie-banner p {
    font-size: 13px;
    margin-bottom: 15px;
}

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

.cookie-banner__actions .btn {
    flex: 1;
    padding: 8px;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 400px) {
    .cookie-banner {
        width: calc(100% - 40px);
    }
    .cookie-banner.show {
        right: 20px;
    }
}

/* Inner page styles */
/* Article Page specific styles */

.article-page {
    padding-top: 40px;
    padding-bottom: 0;
}

.article-header {
    margin-bottom: 30px;
}

.breadcrumbs {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.breadcrumbs a {
    color: var(--text-gray);
    transition: color 0.2s;
}

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

.breadcrumbs span {
    color: var(--text-dark);
    font-weight: 500;
}

.article-title {
    font-size: 36px;
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-meta {
    font-size: 14px;
}

.article-hero {
    margin-bottom: 40px;
}

.article-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

@media (max-width: 992px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
}

/* Article Typograhpy & Content Elements */
.article-content {
    color: var(--text-gray);
    font-size: 17px;
    line-height: 1.8;
}

.article-content h1, 
.article-content h2, 
.article-content h3, 
.article-content h4, 
.article-content h5, 
.article-content h6 {
    color: var(--text-dark);
    margin-top: 2em;
    margin-bottom: 0.75em;
}

.article-content h2 {
    font-size: 28px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.article-content h3 {
    font-size: 22px;
}

.article-content h4 {
    font-size: 18px;
}

.article-content h5 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content .lead-text {
    font-size: 20px;
    font-weight: 300;
    color: var(--text-dark);
    margin-bottom: 2em;
}

.article-content span {
    /* Specific styling applied to span to highlight internal text styling */
    background-color: rgba(37, 99, 235, 0.05);
    border-bottom: 1px dashed var(--primary-color);
    color: var(--text-dark);
}

.article-content ul, 
.article-content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

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

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

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

/* Article Images */
.article-img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
}

.article-img--main {
    max-height: 500px;
    object-fit: cover;
}

.article-img--inline {
    margin: 2em 0 0.5em 0;
    max-height: 400px;
    object-fit: cover;
}

.img-caption {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 2em;
    font-style: italic;
}

/* Table of Contents */
.toc {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 2.5em;
}

.toc__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.toc__header h3 {
    margin: 0;
    font-size: 18px;
}

.toc__list {
    list-style: none !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
}

.toc__list li {
    margin-bottom: 10px !important;
}

.toc__list a {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    display: block;
}

.toc__list a:hover {
    color: var(--primary-color);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 2em;
}

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

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

.content-table th {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-weight: 600;
}

.content-table tbody tr:nth-of-type(even) {
    background-color: rgba(0,0,0,0.02);
}

[data-theme="dark"] .content-table tbody tr:nth-of-type(even) {
    background-color: rgba(255,255,255,0.02);
}

.content-table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

/* Sidebar Widgets */
.sidebar-widget {
    background-color: var(--bg-light);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 20px;
}

.sidebar-widget h3 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 15px;
}

.sidebar-widget p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* Custom Forms (Contact & Comments) */
.custom-form {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

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

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-white);
    color: var(--text-dark);
    font-family: var(--font-main);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    resize: vertical;
}

.btn--full {
    width: 100%;
    text-align: center;
}

/* Comments Section */
.comments-section {
    border-top: 1px solid var(--border-color);
}

.section-header--left {
    justify-content: flex-start;
    text-align: left;
}

.section-header--left::before {
    display: none;
}

.section-header--left .section-title {
    padding-left: 0;
}

.comments-form-wrap {
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--radius);
}

.comments-form-wrap h3 {
    margin-bottom: 10px;
}

.comments-form-wrap p {
    font-size: 14px;
    margin-bottom: 25px;
}

/* Related Posts overrides */
.related-posts .grid-4 {
    gap: 30px;
}

.related-posts.bg-light {
    margin-top: 40px;
    padding-bottom: 60px;
    border-radius: var(--radius);
}