/*
Theme Name: BlueLight Modern
Theme URI: https://example.com/bluelight
Author: Developer
Author URI: https://example.com
Description: A simple, modern WordPress theme with a light blue color scheme. Features customizable colors, category tabs, and download custom fields.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bluelight
Tags: light, blue, modern, responsive, customizer, custom-colors
*/

/* ===== CSS Variables ===== */
:root {
    --primary-color: #1976d2;
    --accent-color: #2196f3;
    --header-bg: #ffffff;
    --footer-bg: #1a1a2e;
    --light-bg: #e3f2fd;
    --body-bg: #f5f8fc;
    --text-color: #333333;
    --text-light: #666666;
    --text-white: #ffffff;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --shadow: 0 2px 12px rgba(25, 118, 210, 0.08);
    --shadow-hover: 0 4px 20px rgba(25, 118, 210, 0.15);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: all 0.3s ease;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1200px;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--body-bg);
    color: var(--text-color);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Container ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
    background: var(--header-bg);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.site-logo a {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.site-logo img {
    max-height: 48px;
}

/* ===== Navigation ===== */
.main-navigation {
    background: var(--primary-color);
}

.main-navigation .container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu li a {
    display: block;
    padding: 14px 22px;
    color: var(--text-white);
    font-weight: 500;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a,
.nav-menu li.current_page_item a {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Nav Search (inside navigation bar) */
.nav-search {
    margin-left: auto;
    flex: 0 0 260px;
    position: relative;
}

.nav-search form {
    display: flex;
    align-items: center;
}

.nav-search input {
    width: 100%;
    padding: 7px 38px 7px 14px;
    border: none;
    border-radius: 50px;
    font-size: 0.85rem;
    font-family: var(--font-main);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transition: var(--transition);
}

.nav-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.nav-search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.nav-search button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition);
}

.nav-search button:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Sub-menu */
.nav-menu li .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    min-width: 220px;
    box-shadow: var(--shadow-hover);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    display: none;
    z-index: 100;
    list-style: none;
}

.nav-menu li:hover .sub-menu {
    display: block;
}

.nav-menu li .sub-menu a {
    color: var(--text-color);
    padding: 10px 18px;
    font-size: 0.88rem;
    text-transform: none;
    border-bottom: 1px solid var(--border-color);
}

.nav-menu li .sub-menu a:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

/* ===== Layout: Content + Sidebar ===== */
.site-content {
    padding: 30px 0;
}

.content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    flex: 0 0 300px;
    position: sticky;
    top: 100px;
}

/* ===== Category Tabs ===== */
.category-section {
    margin-bottom: 35px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 3px solid var(--primary-color);
    padding: 0;
    overflow: hidden;
}

.category-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-white);
    background: var(--primary-color);
    padding: 12px 22px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-tabs {
    display: flex;
    gap: 0;
    list-style: none;
}

.category-tabs li a {
    display: block;
    padding: 12px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-light);
    border-left: 1px solid var(--border-color);
    transition: var(--transition);
}

.category-tabs li a:hover,
.category-tabs li a.active {
    background: var(--light-bg);
    color: var(--primary-color);
}

.tab-content {
    background: var(--card-bg);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
}

.tab-pane {
    display: none;
    padding: 20px;
}

.tab-pane.active {
    display: block;
}

/* ===== Post Cards ===== */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.post-card {
    display: flex;
    gap: 18px;
    padding: 18px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.post-card .post-thumbnail {
    flex: 0 0 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.post-card .post-thumbnail img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-card .post-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-card .post-category {
    display: inline-block;
    padding: 3px 10px;
    background: var(--light-bg);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    width: fit-content;
}

.post-card .post-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-card .post-title a {
    color: var(--text-color);
}

.post-card .post-title a:hover {
    color: var(--primary-color);
}

.post-card .post-excerpt {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .post-meta {
    font-size: 0.8rem;
    color: #999;
    display: flex;
    gap: 15px;
}

.post-card .post-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== Sidebar Widgets ===== */
.widget {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 25px;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.widget ul {
    list-style: none;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
}

.widget ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* ===== Single Post ===== */
.single-post-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 35px;
}

.single-post-content .entry-title {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    color: var(--text-color);
}

.single-post-content .entry-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.single-post-content .entry-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.single-post-content .entry-content {
    font-size: 1rem;
    line-height: 1.8;
}

.single-post-content .entry-content h2,
.single-post-content .entry-content h3,
.single-post-content .entry-content h4 {
    margin: 25px 0 12px;
    color: var(--text-color);
}

.single-post-content .entry-content p {
    margin-bottom: 16px;
}

.single-post-content .entry-content img {
    border-radius: var(--radius-sm);
    margin: 15px 0;
}

.single-post-content .entry-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--light-bg);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}

.single-post-content .entry-content pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 18px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.88rem;
}

.entry-tags {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.entry-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: var(--light-bg);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 0.8rem;
    margin: 3px;
    transition: var(--transition);
}

.entry-tags a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ===== Download Box ===== */
.download-box {
    background: linear-gradient(135deg, var(--light-bg), #fff);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    margin: 25px 0;
    overflow: hidden;
}

.download-box-header {
    background: var(--primary-color);
    color: var(--text-white);
    padding: 14px 22px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-box-header svg {
    width: 20px;
    height: 20px;
}

.download-table {
    width: 100%;
    border-collapse: collapse;
}

.download-table th {
    background: rgba(25, 118, 210, 0.08);
    padding: 12px 22px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.download-table td {
    padding: 12px 22px;
    border-top: 1px solid var(--border-color);
    font-size: 0.92rem;
}

.download-table tr:hover td {
    background: var(--light-bg);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    background: var(--primary-color);
    color: var(--text-white) !important;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
}

.download-btn:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.3);
    color: #fff !important;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 35px;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--primary-color);
    color: #fff;
}

/* ===== Comments ===== */
.comments-area {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-top: 30px;
}

.comments-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.comment-list {
    list-style: none;
}

.comment {
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment:last-child {
    border-bottom: none;
}

.comment-author img {
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

.comment-author .fn {
    font-weight: 600;
    color: var(--text-color);
}

.comment-metadata {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 5px 0 10px;
}

.comment-content p {
    font-size: 0.92rem;
    line-height: 1.6;
}

.comment-respond {
    margin-top: 25px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.92rem;
    transition: var(--transition);
    margin-bottom: 12px;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
}

.comment-form .submit {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: var(--transition);
}

.comment-form .submit:hover {
    background: var(--accent-color);
    box-shadow: 0 3px 12px rgba(33, 150, 243, 0.3);
}

/* ===== Footer ===== */
.site-footer {
    background: var(--footer-bg);
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget .widget-title {
    color: #fff;
    border-bottom-color: var(--accent-color);
}

.footer-widget ul li a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-widget ul li a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* ===== Page Template ===== */
.page-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 35px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* ===== Archive Header ===== */
.archive-header {
    background: var(--card-bg);
    padding: 25px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border-left: 4px solid var(--primary-color);
}

.archive-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
}

.archive-description {
    font-size: 0.92rem;
    color: var(--text-light);
    margin-top: 6px;
}

/* ===== 404 Page ===== */
.error-404 {
    text-align: center;
    padding: 60px 30px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.error-404 h1 {
    font-size: 5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.error-404 p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.error-404 .search-form {
    max-width: 400px;
    margin: 0 auto;
}

/* ===== Search Form ===== */
.search-form {
    display: flex;
    gap: 8px;
}

.search-form .search-field {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.92rem;
    font-family: var(--font-main);
}

.search-form .search-submit {
    padding: 10px 22px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-form .search-submit:hover {
    background: var(--accent-color);
}

/* ===== Post Navigation ===== */
.post-navigation {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
    background: var(--card-bg);
    padding: 18px 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-navigation .nav-previous:hover,
.post-navigation .nav-next:hover {
    box-shadow: var(--shadow-hover);
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.post-navigation .nav-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        gap: 12px;
    }

    .nav-search {
        flex: 1 1 100%;
        order: 3;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .nav-menu.active {
        display: flex;
    }

    .main-navigation .container {
        flex-wrap: wrap;
    }

    .nav-menu li .sub-menu {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.06);
    }

    .category-header {
        flex-direction: column;
        align-items: stretch;
    }

    .category-tabs {
        border-top: 1px solid var(--border-color);
    }

    .post-card {
        flex-direction: column;
    }

    .post-card .post-thumbnail {
        flex: none;
    }

    .post-card .post-thumbnail img {
        height: 180px;
    }

    .single-post-content {
        padding: 22px;
    }

    .post-navigation {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .site-logo a {
        font-size: 1.3rem;
    }

    .nav-menu li a {
        padding: 12px 16px;
        font-size: 0.88rem;
    }
}

/* ===== Grid Display Mode ===== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.post-grid-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-grid-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.post-grid-link {
    display: block;
    text-decoration: none;
    color: var(--text-color);
}

.post-grid-thumb {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--light-bg);
}

.post-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-grid-item:hover .post-grid-thumb img {
    transform: scale(1.05);
}

.post-grid-nothumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-light);
    background: var(--light-bg);
}

.post-grid-title {
    padding: 10px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

/* ===== List Display Mode ===== */
.post-list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.post-list-item {
    border-bottom: 1px solid var(--border-color);
}

.post-list-item:last-child {
    border-bottom: none;
}

.post-list-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 6px;
    color: var(--text-color);
    font-size: 0.92rem;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.post-list-link:hover {
    background: var(--light-bg);
    color: var(--primary-color);
    padding-left: 12px;
}

.post-list-bullet {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.post-list-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== List Hover Image Popup ===== */
.bluelight-hover-popup {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    width: 180px;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    border: 3px solid var(--card-bg);
    opacity: 0;
    transition: opacity 0.15s ease;
    overflow: hidden;
    background: var(--card-bg);
}

.bluelight-hover-popup.visible {
    opacity: 1;
}

.bluelight-hover-popup img {
    width: 100%;
    height: auto;
    display: block;
}

/* Grid responsive */
@media (max-width: 768px) {
    .post-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .post-grid-title {
        font-size: 0.78rem;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Post Rating ===== */
.post-rating-box {
    margin-top: 30px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--primary-color);
    background: linear-gradient(135deg, var(--light-bg), #fff);
}

.rating-header {
    background: var(--primary-color);
    padding: 14px 22px;
}

.rating-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: 0.3px;
}

.rating-body {
    padding: 25px 22px;
    text-align: center;
}

.rating-stars {
    display: inline-flex;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: var(--transition);
}

.rating-stars.voted {
    cursor: default;
}

.rating-stars.submitting {
    opacity: 0.5;
    pointer-events: none;
}

.rating-star {
    display: inline-flex;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.rating-star svg {
    fill: #d4d4d4;
    stroke: #bbb;
    stroke-width: 0.5;
    transition: fill 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.rating-star.hovered svg {
    fill: #f5c518;
    stroke: #e0a800;
    transform: scale(1.15);
    filter: drop-shadow(0 0 4px rgba(245, 165, 35, 0.4));
}

.rating-star.filled svg {
    fill: #f5a623;
    stroke: #e09500;
}

.rating-stars.voted .rating-star.filled svg {
    fill: #f5a623;
    stroke: #e09500;
    animation: starPulse 0.4s ease;
}

@keyframes starPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}

.rating-star:not(.hovered):not(.filled) svg:hover {
    fill: #e0d5b0;
}

.rating-info {
    font-size: 0.95rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.info-star {
    color: #d4d4d4;
    font-size: 1.1rem;
}

.info-star.filled {
    color: #f5a623;
}

.rating-count {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-left: 4px;
}

.rating-loading {
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

.rating-message {
    margin-top: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 50px;
    display: inline-block;
    transition: opacity 0.5s ease;
    min-height: 0;
}

.rating-message:empty {
    display: none;
}

.rating-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.rating-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.rating-message.fade-out {
    opacity: 0;
}

/* Rating responsive */
@media (max-width: 768px) {
    .rating-body {
        padding: 20px 15px;
    }

    .rating-star svg {
        width: 28px;
        height: 28px;
    }

    .rating-info {
        font-size: 0.85rem;
    }
}

/* ===== Media Embed Box ===== */
.media-embed-box {
    background: linear-gradient(135deg, var(--light-bg), #fff);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    margin: 25px 0;
    overflow: hidden;
}

.media-episode-count {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 500;
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: 50px;
}

/* Episode Tab Bar */
.media-episode-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 2px solid var(--border-color);
    padding: 0;
    gap: 0;
}

.media-episode-tabs::-webkit-scrollbar {
    height: 4px;
}

.media-episode-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.media-episode-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.episode-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
    transition: all 0.25s ease;
    position: relative;
    flex-shrink: 0;
    font-family: inherit;
}

.episode-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    border-radius: 3px 3px 0 0;
    transition: background 0.25s ease;
}

.episode-tab:hover {
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.02);
}

.episode-tab.active {
    color: var(--primary-color);
    font-weight: 600;
}

.episode-tab.active::after {
    background: var(--primary-color);
}

.episode-tab-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-light);
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.episode-tab.active .episode-tab-number {
    background: var(--primary-color);
    color: #fff;
}

.episode-tab-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Episode Panels */
.media-episode-panels {
    padding: 20px;
}

.media-episode-panel {
    display: none;
}

.media-episode-panel.active {
    display: block;
    animation: episodeFadeIn 0.3s ease;
}

@keyframes episodeFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Embed Elements (shared) */
.media-embed-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 10px;
    padding-left: 2px;
}

.media-embed-player {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}

.media-embed-player iframe,
.media-embed-player video {
    display: block;
    width: 100%;
    border-radius: var(--radius-sm);
}

.media-embed-player iframe {
    min-height: 400px;
}

@media (max-width: 768px) {
    .media-episode-panels {
        padding: 15px;
    }

    .media-embed-player iframe {
        min-height: 250px;
    }

    .episode-tab {
        padding: 10px 14px;
        font-size: 0.8rem;
    }

    .episode-tab-number {
        width: 20px;
        height: 20px;
        font-size: 0.68rem;
    }

    .episode-tab-name {
        max-width: 100px;
    }
}

/* ===== Mini Rating (Post Listings) ===== */
.mini-rating {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
    font-size: 0;
    white-space: nowrap;
}

.mini-star {
    font-size: 0.7rem;
    color: #d4d4d4;
    line-height: 1;
}

.mini-star.filled {
    color: #f5a623;
}

.mini-avg {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    margin-left: 3px;
}

.post-grid-rating {
    padding: 4px 12px 10px;
    text-align: center;
}

/* ===== Dark Mode Toggle ===== */
.dark-mode-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.dark-mode-toggle:hover {
    border-color: var(--primary-color);
    background: var(--light-bg);
    transform: rotate(15deg);
}

.toggle-icon-dark {
    display: inline;
}

.toggle-icon-light {
    display: none;
}

.dark-mode .toggle-icon-dark {
    display: none;
}

.dark-mode .toggle-icon-light {
    display: inline;
}

/* ===== Dark Mode Theme ===== */
.dark-mode {
    --body-bg: #121212;
    --card-bg: #1e1e1e;
    --header-bg: #1a1a1a;
    --text-color: #e0e0e0;
    --text-light: #aaaaaa;
    --text-white: #ffffff;
    --border-color: #333333;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Preserve primary/accent from preset, adapt light-bg and footer-bg */
.dark-mode {
    --light-bg: #1e1e2e;
    --footer-bg: #0d0d0d;
}

body.dark-mode {
    background-color: var(--body-bg);
    color: var(--text-color);
}

/* Header */
.dark-mode .site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

.dark-mode .site-logo a {
    color: var(--text-white);
}

.dark-mode .header-search input,
.dark-mode .nav-search input {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color);
    color: var(--text-color);
}

.dark-mode .header-search button {
    background: var(--primary-color);
}

.dark-mode .dark-mode-toggle {
    border-color: #444;
}

.dark-mode .dark-mode-toggle:hover {
    background: #2a2a2a;
    border-color: var(--primary-color);
}

/* Navigation */
.dark-mode .main-navigation {
    background: var(--primary-color);
}

.dark-mode .nav-menu li .sub-menu {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-mode .nav-menu li .sub-menu a {
    color: var(--text-color);
    border-bottom-color: var(--border-color);
}

.dark-mode .nav-menu li .sub-menu a:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

/* Cards */
.dark-mode .post-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .post-card:hover {
    border-color: var(--primary-color);
}

.dark-mode .post-title a {
    color: var(--text-color);
}

.dark-mode .post-title a:hover {
    color: var(--primary-color);
}

.dark-mode .post-excerpt {
    color: var(--text-light);
}

.dark-mode .post-meta {
    color: var(--text-light);
}

/* Sidebar */
.dark-mode .sidebar .widget {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .sidebar .widget-title {
    border-bottom-color: var(--border-color);
}

/* Category Sections */
.dark-mode .category-section {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .section-header {
    border-bottom-color: var(--border-color);
}

.dark-mode .tab-link {
    color: var(--text-light);
}

.dark-mode .tab-link.active,
.dark-mode .tab-link:hover {
    color: var(--primary-color);
}

/* List items */
.dark-mode .post-list-link {
    color: var(--text-color);
}

.dark-mode .post-list-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
}

.dark-mode .post-list-item {
    border-bottom-color: var(--border-color);
}

/* Grid items */
.dark-mode .post-grid-item {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .post-grid-title {
    color: var(--text-color);
}

/* Single post */
.dark-mode .single-post-content {
    color: var(--text-color);
}

.dark-mode .entry-title {
    color: var(--text-white);
}

.dark-mode .entry-meta {
    color: var(--text-light);
}

.dark-mode .entry-content {
    color: var(--text-color);
}

.dark-mode .entry-content a {
    color: var(--accent-color);
}

.dark-mode .entry-tags a {
    background: #2a2a2a;
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Download / Media boxes */
.dark-mode .download-box,
.dark-mode .media-embed-box {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.dark-mode .media-episode-tabs {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: var(--border-color);
}

.dark-mode .episode-tab {
    color: var(--text-light);
}

.dark-mode .episode-tab:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .episode-tab.active {
    color: var(--primary-color);
}

.dark-mode .episode-tab-number {
    background: var(--border-color);
    color: var(--text-light);
}

.dark-mode .episode-tab.active .episode-tab-number {
    background: var(--primary-color);
    color: #fff;
}

.dark-mode .media-embed-title {
    color: var(--text-color);
}

.dark-mode .download-table {
    color: var(--text-color);
}

.dark-mode .download-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.dark-mode .download-table td {
    border-color: var(--border-color);
}

.dark-mode .download-btn {
    background: var(--primary-color);
    color: var(--text-white);
}

/* Rating box */
.dark-mode .post-rating-box {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.dark-mode .rating-info {
    color: var(--text-color);
}

.dark-mode .rating-count {
    color: var(--text-light);
}

.dark-mode .rating-message.success {
    background: #1b3a1b;
    color: #66bb6a;
    border-color: #2e5a2e;
}

.dark-mode .rating-message.error {
    background: #3a1b1b;
    color: #ef5350;
    border-color: #5a2e2e;
}

/* Mini rating in dark */
.dark-mode .mini-avg {
    color: var(--text-light);
}

/* Post navigation */
.dark-mode .post-navigation {
    border-color: var(--border-color);
}

.dark-mode .nav-previous,
.dark-mode .nav-next {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .nav-label {
    color: var(--text-light);
}

.dark-mode .nav-title {
    color: var(--text-color);
}

.dark-mode .nav-title:hover {
    color: var(--primary-color);
}

/* Comments */
.dark-mode .comments-area {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .comment-body {
    border-color: var(--border-color);
}

.dark-mode .comment-author {
    color: var(--text-color);
}

.dark-mode .comment-content {
    color: var(--text-color);
}

.dark-mode .comment-form input,
.dark-mode .comment-form textarea {
    background: #2a2a2a;
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Footer */
.dark-mode .site-footer {
    background: var(--footer-bg);
}

/* Pagination */
.dark-mode .pagination a {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.dark-mode .pagination a:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.dark-mode .pagination .current {
    background: var(--primary-color);
    color: var(--text-white);
}

/* Search page */
.dark-mode .search-results-header {
    color: var(--text-color);
}

/* Scrollbar */
.dark-mode ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: #444;
}

/* Hover popup */
.dark-mode .bluelight-hover-popup {
    border-color: var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* Transitions for smooth toggle */
body,
.site-header,
.post-card,
.category-section,
.sidebar .widget,
.post-grid-item,
.download-box,
.media-embed-box,
.post-rating-box,
.post-navigation,
.nav-previous,
.nav-next,
.site-footer,
.comments-area,
.entry-tags a,
.pagination a {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}