:root {
    --bg-dark: #f7f4ec;
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #f97316;
    --accent: #0f766e;
    --text-main: #172033;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(148, 163, 184, 0.24);
    --body-gradient-top: radial-gradient(circle, rgba(96, 165, 250, 0.35) 0%, rgba(247, 244, 236, 0) 70%);
    --body-gradient-bottom: radial-gradient(circle, rgba(251, 146, 60, 0.28) 0%, rgba(247, 244, 236, 0) 72%);
    --surface-strong: rgba(255, 255, 255, 0.82);
    --font-heading: 'Playfair Display', 'Noto Sans Khmer', serif;
    --font-body: 'Outfit', 'Noto Sans Khmer', sans-serif;
}

html[data-theme="daylight"],
body[data-theme="daylight"] {
    --bg-dark: #f7f4ec;
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #f97316;
    --accent: #0f766e;
    --text-main: #172033;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(148, 163, 184, 0.24);
    --body-gradient-top: radial-gradient(circle, rgba(96, 165, 250, 0.35) 0%, rgba(247, 244, 236, 0) 70%);
    --body-gradient-bottom: radial-gradient(circle, rgba(251, 146, 60, 0.28) 0%, rgba(247, 244, 236, 0) 72%);
    --surface-strong: rgba(255, 255, 255, 0.82);
}

html[data-theme="midnight"],
body[data-theme="midnight"] {
    --bg-dark: #0f111a;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #14b8a6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --body-gradient-top: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, rgba(0, 0, 0, 0) 70%);
    --body-gradient-bottom: radial-gradient(circle, rgba(236, 72, 153, 0.4) 0%, rgba(0, 0, 0, 0) 70%);
    --surface-strong: rgba(15, 17, 26, 0.82);
}

html[data-theme="sunrise"],
body[data-theme="sunrise"] {
    --bg-dark: #1f1426;
    --primary: #f97316;
    --primary-light: #fdba74;
    --secondary: #fb7185;
    --accent: #facc15;
    --text-main: #fff7ed;
    --text-muted: #f5c7b8;
    --glass-bg: rgba(255, 247, 237, 0.08);
    --glass-border: rgba(255, 237, 213, 0.14);
    --body-gradient-top: radial-gradient(circle, rgba(249, 115, 22, 0.52) 0%, rgba(0, 0, 0, 0) 70%);
    --body-gradient-bottom: radial-gradient(circle, rgba(251, 113, 133, 0.4) 0%, rgba(0, 0, 0, 0) 72%);
    --surface-strong: rgba(31, 20, 38, 0.84);
}

html[data-theme="forest"],
body[data-theme="forest"] {
    --bg-dark: #081512;
    --primary: #22c55e;
    --primary-light: #86efac;
    --secondary: #0ea5a4;
    --accent: #facc15;
    --text-main: #ecfdf5;
    --text-muted: #9ed8be;
    --glass-bg: rgba(236, 253, 245, 0.05);
    --glass-border: rgba(134, 239, 172, 0.12);
    --body-gradient-top: radial-gradient(circle, rgba(34, 197, 94, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    --body-gradient-bottom: radial-gradient(circle, rgba(14, 165, 164, 0.28) 0%, rgba(0, 0, 0, 0) 70%);
    --surface-strong: rgba(8, 21, 18, 0.84);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: block;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Base Gradients setup inside app-container */
body::before,
body::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -2;
    opacity: 0.5;
}

body::before {
    top: -100px;
    left: -150px;
    background: var(--body-gradient-top);
}

body::after {
    bottom: -150px;
    right: -100px;
    background: var(--body-gradient-bottom);
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.app-container {
    width: 100%;
    max-width: 1700px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

/* Responsive Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    aside.sidebar {
        width: 100% !important;
        position: static !important;
    }
}

/* Header */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
    gap: 1.25rem;
    position: relative;
    isolation: isolate;
    z-index: 1001;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.highlight {
    color: var(--primary-light);
    font-style: italic;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-width: 0;
}

.site-nav .nav-links {
    align-items: center;
    gap: 1.25rem;
}

.nav-group {
    position: relative;
    list-style: none;
}

.nav-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-group-toggle:hover,
.nav-group.is-open .nav-group-toggle {
    color: var(--text-main);
}

.nav-group-caret {
    font-size: 0.9rem;
    line-height: 1;
}

.nav-group-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    min-width: 220px;
    padding: 0.8rem;
    border-radius: 16px;
    background: var(--surface-strong);
    border: 1px solid var(--glass-border);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1);
    z-index: 55;
}

.nav-group.is-open .nav-group-menu {
    display: grid;
    gap: 0.35rem;
}

.nav-group-menu a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    transition: background 0.3s ease, color 0.3s ease;
}

.nav-group-menu a:hover,
.nav-group-menu a.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.theme-picker-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.theme-picker-select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    padding-right: 1.1rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 0.65rem) calc(50% - 1px), calc(100% - 0.35rem) calc(50% - 1px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.theme-picker-select:focus {
    outline: none;
}

.theme-picker-select option {
    color: #0f111a;
}

.nav-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nav-toggle svg {
    width: 22px;
    height: 22px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease, transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.05rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--glass-border);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0.32rem;
    left: 14%;
    width: 72%;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
    opacity: 0.9;
}

.btn-subscribe {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.85rem 1.6rem;
    border-radius: 30px;
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(236, 72, 153, 0.26);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.btn-subscribe:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 14px 28px rgba(236, 72, 153, 0.38);
    filter: saturate(1.08);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
    margin-top: 0.9rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-main);
}

/* Main Content */
main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--surface-strong);
    /* Fallback for browsers that don't support backdrop-filter */
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Hero Section */
.hero {
    padding: 4rem 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out;
}

.badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.quote-container {
    margin: 3rem 0;
    position: relative;
    max-width: 800px;
}

.quote-mark {
    font-family: var(--font-heading);
    font-size: 6rem;
    color: var(--text-muted);
    opacity: 0.1;
    position: absolute;
    line-height: 1;
}

.quote-mark.open {
    top: -20px;
    left: -40px;
}

.quote-mark.close {
    bottom: -40px;
    right: -40px;
}

.main-quote {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.3;
    font-weight: 600;
    background: linear-gradient(180deg, #FFFFFF 0%, #B4B4DB 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.5s ease;
    text-wrap: balance;
}

.author-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
    transition: opacity 0.5s ease;
}

.author-line {
    width: 40px;
    height: 2px;
    background: var(--accent);
}

.author-name {
    font-size: 1.25rem;
    color: var(--accent);
    font-weight: 400;
    letter-spacing: 1px;
}

/* Actions */
.actions {
    display: flex;
    gap: 1.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: transparent;
}

/* Collection Section */
.collection-section {
    padding-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grid-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    min-height: 200px;
}

.grid-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.4);
}

.card-quote {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.card-author {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.card-author-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

/* Articles Section */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    transition: transform 0.4s ease;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-8px);
}

.article-img-cont {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.article-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-card:hover .article-img {
    transform: scale(1.05);
}

.article-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-title-sm {
    font-size: 1.3rem;
    font-family: var(--font-heading);
    margin-bottom: 0.75rem;
    color: var(--text-main);
    line-height: 1.25;
}

.article-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more-btn {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-decoration: none;
}

/* Single Article View */
.article-hero {
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-dark), transparent);
}

.article-title {
    font-size: 3rem;
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    color: var(--text-main);
    line-height: 1.2;
}

.article-shell {
    max-width: 1020px;
}

.article-reading {
    padding: 2.35rem 2.5rem;
}

.article-body {
    overflow-wrap: anywhere;
    font-size: 1.2rem;
    line-height: 1.9;
}

.article-body>*+* {
    margin-top: 1.15rem;
}

.article-body p {
    margin: 0;
}

.article-body img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1.2rem auto;
    border-radius: 12px;
    object-fit: cover;
}

.article-body .image-left,
.article-body .image-right {
    width: min(46%, 320px);
}

.article-body .image-left {
    float: left;
    margin: 0.4rem 1.5rem 1rem 0;
}

.article-body .image-right {
    float: right;
    margin: 0.4rem 0 1rem 1.5rem;
}

.article-body::after {
    content: "";
    display: block;
    clear: both;
}

@media (max-width: 768px) {
    .article-shell {
        max-width: 100%;
    }

    .article-reading {
        padding: 1.35rem 1rem;
    }

    .article-title {
        font-size: 2.3rem;
    }

    .article-body {
        font-size: 1.05rem;
        line-height: 1.75;
    }

    .article-body .image-left,
    .article-body .image-right {
        width: 100%;
        float: none;
        margin: 1.25rem 0;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 12px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

textarea.form-input {
    resize: vertical;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

.info-shell {
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
}

.info-hero {
    padding: 2.6rem 2.8rem;
    margin-bottom: 2rem;
}

.info-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.info-title {
    margin-top: 1rem;
    font-family: var(--font-heading);
    font-size: 3.2rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.info-intro {
    margin-top: 1rem;
    max-width: 760px;
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.8;
}

.info-grid {
    display: grid;
    gap: 1.5rem;
}

.info-card {
    padding: 2rem;
}

.info-card h2 {
    font-family: var(--font-heading);
    font-size: 1.55rem;
    margin-bottom: 0.75rem;
}

.info-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
}

.info-card p,
.info-card li,
.info-card a,
.info-card address {
    color: var(--text-muted);
    line-height: 1.8;
    font-style: normal;
}

.info-card ul {
    list-style: none;
    display: grid;
    gap: 0.8rem;
}

.sitemap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.sitemap-list {
    list-style: none;
    display: grid;
    gap: 0.8rem;
}

.sitemap-list a {
    color: var(--text-main);
    text-decoration: none;
}

.sitemap-list a:hover {
    color: var(--primary-light);
}

html[data-theme="daylight"] .navbar {
    padding: 1rem 1.25rem;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 248, 240, 0.72));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 22px 55px rgba(37, 99, 235, 0.08);
}

html[data-theme="daylight"] .logo,
html[data-theme="daylight"] .highlight {
    background: linear-gradient(135deg, #1d4ed8, #f97316 78%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

html[data-theme="daylight"] .nav-links a,
html[data-theme="daylight"] .nav-group-toggle {
    color: #4b5563;
}

html[data-theme="daylight"] .nav-links a {
    background: rgba(255, 255, 255, 0.52);
    border-color: rgba(148, 163, 184, 0.12);
}

html[data-theme="daylight"] .nav-links a:hover,
html[data-theme="daylight"] .nav-links a.active {
    color: #10203a;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.86));
    border-color: rgba(96, 165, 250, 0.24);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.12);
}

html[data-theme="daylight"] .nav-group-menu {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

html[data-theme="daylight"] .nav-group-menu a:hover,
html[data-theme="daylight"] .nav-group-menu a.active {
    background: rgba(37, 99, 235, 0.08);
}

html[data-theme="daylight"] .btn-subscribe {
    background: linear-gradient(135deg, #2563eb, #f97316);
    box-shadow: 0 16px 30px rgba(249, 115, 22, 0.22);
}

html[data-theme="daylight"] .theme-picker {
    background: rgba(255, 255, 255, 0.66);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.06);
}

html[data-theme="daylight"] .badge,
html[data-theme="daylight"] .info-eyebrow {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(249, 115, 22, 0.14));
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

html[data-theme="daylight"] .main-quote,
html[data-theme="daylight"] .section-title,
html[data-theme="daylight"] .article-title,
html[data-theme="daylight"] .article-title-sm,
html[data-theme="daylight"] .info-title,
html[data-theme="daylight"] .info-card h2 {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 48%, #f97316 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

html[data-theme="daylight"] .main-quote {
    text-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}

html[data-theme="daylight"] .author-name {
    color: #0f766e;
    font-weight: 600;
}

html[data-theme="daylight"] .card-quote,
html[data-theme="daylight"] .article-body,
html[data-theme="daylight"] .info-card p,
html[data-theme="daylight"] .info-card li,
html[data-theme="daylight"] .info-card a,
html[data-theme="daylight"] .info-card address {
    color: #334155;
}

html[data-theme="daylight"] .article-excerpt,
html[data-theme="daylight"] .info-intro,
html[data-theme="daylight"] .card-author,
html[data-theme="daylight"] .footer-links a,
html[data-theme="daylight"] footer {
    color: #64748b;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .site-nav {
        display: none;
        position: absolute;
        top: calc(100% + 0.85rem);
        right: 0;
        width: min(380px, calc(100vw - 2rem));
        padding: 1.15rem;
        border-radius: 22px;
        background: rgba(15, 17, 26, 0.96);
        border: 1px solid var(--glass-border);
        box-shadow: 0 24px 50px rgba(0, 0, 0, 0.32);
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        z-index: 1002;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav .nav-links {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }

    .nav-group {
        width: 100%;
    }

    .nav-group-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .nav-group-menu {
        position: static;
        min-width: 0;
        width: 100%;
        margin-top: 0.6rem;
        padding: 0.65rem;
        box-shadow: none;
    }

    .nav-actions {
        width: 100%;
        margin-top: 0.25rem;
        padding-top: 0.85rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .nav-actions .btn-subscribe {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .theme-picker {
        width: 100%;
        justify-content: space-between;
        border-radius: 16px;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .navbar {
        margin-bottom: 2rem;
    }

    .app-container {
        padding: 1rem 0.75rem;
        width: 100%;
    }

    .site-nav {
        width: calc(100vw - 2rem);
    }

    .nav-actions {
        padding-top: 0.75rem;
    }

    .nav-actions .btn-subscribe {
        width: 100%;
    }

    .info-hero,
    .info-card {
        padding: 1.35rem;
    }

    .info-title {
        font-size: 2.25rem;
    }

    .info-intro {
        font-size: 1rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar>nav>.nav-links {
        display: none;
    }

    .main-quote {
        font-size: 2.2rem;
    }

    .hero {
        padding: 3rem 1.5rem;
    }

    /* Responsive Ads */
    .ad-container, .ad-direct-container {
        width: 100% !important;
        max-width: 100vw !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .ad-container img, .ad-direct-container img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Responsive Popup */
    #adPopupModal .glass-panel {
        width: 95% !important;
        padding: 1rem !important;
    }

    #adPopupModal .action-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    /* Social Bar Mobile Optimization */
    #social-bar-container {
        padding: 0 0.5rem;
    }
}

.ad-container, .ad-direct-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
}

.ad-direct-container > * {
    max-width: 100% !important;
}

.ad-direct-container img {
    height: auto !important;
}

.ad-iframe {
    width: 100%;
    border: 0;
    background: transparent;
    display: block;
}

/* Premium Custom Ad Styles */
.custom-native-ad {
    display: block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.custom-native-ad:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.custom-ad-media {
    width: 100%;
    position: relative;
}

.custom-ad-img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-ad-body {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .custom-ad-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .custom-ad-url {
        max-width: 100%;
        text-align: center;
    }
    
    .custom-ad-cta {
        width: 100%;
        text-align: center;
    }
}

.custom-ad-text {
    flex: 1;
}

.custom-ad-badge {
    display: inline-block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.custom-ad-url {
    font-size: 0.75rem;
    color: var(--primary-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.custom-ad-cta {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Sidebar specific native ad */
.sidebar .custom-native-ad {
    max-width: 100%;
}

.sidebar .custom-ad-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.sidebar .custom-ad-cta {
    width: 100%;
    text-align: center;
}
