/*--------------------------------------------------------------
# Generic
--------------------------------------------------------------*/

/* Normalize - Essential for cross-browser consistency */
html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    box-sizing: border-box; /* Ellathukum sethu ingayae pottudalam */
}

/* Inherit box-sizing globally */
*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
}

main {
    display: block;
}

/* Media Elements */
img {
    border-style: none;
    height: auto;
    max-width: 100%;
}

/* Typography Normalize */
h1 {
    font-size: 2em;
    margin: 0.67em 0;
}

hr {
    box-sizing: content-box;
    height: 0;
    overflow: visible;
}

pre, code, kbd, samp {
    font-family: monospace, monospace;
    font-size: 1em;
}

small {
    font-size: 80%;
}

sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub { bottom: -0.25em; }
sup { top: -0.5em; }

/* Links */
a {
    background-color: transparent;
    text-decoration: none;
}

abbr[title] {
    border-bottom: none;
    text-decoration: underline dotted;
}

b, strong {
    font-weight: bolder;
}

/* Forms Normalize
--------------------------------------------- */
button, input, optgroup, select, textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
}

button, select {
    text-transform: none;
}

button, [type="button"], [type="reset"], [type="submit"] {
    -webkit-appearance: button;
    appearance: button; 
    cursor: pointer;    /* Idhu mukkiyam */
}

button::-moz-focus-inner, [type="button"]::-moz-focus-inner, 
[type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

textarea {
    overflow: auto;
    vertical-align: top;
}

/* Login Checkbox Alignment (Unga Custom Code) */
.login-remember {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
}

.login-remember input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Base Typography
--------------------------------------------- */
body {
    color: #404040;
    font-family: 'Noto Sans Tamil', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    background: #fff;
}

h1, h2, h3, h4, h5, h6 {
    clear: both;
    margin: 1.5em 0 0.5em; /* Standard spacing */
}

p {
    margin-bottom: 1.5em;
}

dfn, cite, em, i {
    font-style: italic;
}

blockquote {
    margin: 0 1.5em 1.5em;
    padding: 0 1em;
    border-left: 4px solid var(--brand-color); /* Theme-oda match aagum */
}

pre {
    background: #eee;
    font-family: "Courier 10 Pitch", courier, monospace;
    line-height: 1.6;
    margin-bottom: 1.6em;
    max-width: 100%;
    overflow: auto;
    padding: 1.6em;
}

code, kbd, tt, var {
    font-family: monaco, consolas, monospace;
}

mark, ins {
    background: #fff9c0;
    text-decoration: none;
}
/* Elements
--------------------------------------------- */
hr {
    background-color: #eee;
    border: 0;
    height: 1px;
    margin: 2em 0;
}

ul, ol {
    margin: 0 0 1.5em 1.5em; /* Padding optimized for readability */
    padding: 0;
}

ul { list-style: disc; }
ol { list-style: decimal; }

li > ul, li > ol {
    margin-bottom: 0;
    margin-left: 1.5em;
}

dt { font-weight: 700; }
dd { margin: 0 0 1.5em 1.5em; }

embed, iframe, object {
    max-width: 100%;
    border-radius: 8px; /* Added subtle rounding */
}

table {
    margin: 0 0 1.5em;
    width: 100%;
    border-collapse: collapse;
}

/* Links (Themed for Forest Green)
--------------------------------------------- */
a {
    color: #1b5e20; /* Dark Green to match your brand */
    transition: color 0.2s ease-in-out;
}

a:hover, a:focus, a:active {
    color: #2e7d32; /* Slightly lighter green on hover */
    text-decoration: underline;
}

a:focus {
    outline: 2px solid rgba(27, 94, 32, 0.3);
    outline-offset: 2px;
}

/* Forms (Professional & Modernized)
--------------------------------------------- */
/* Generic Input Styling */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 12px;
    width: 100%;
    background: #fafafa;
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: #1b5e20;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

/* Button Styling (Clean & Modern) */
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    background: #1b5e20;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    line-height: 1;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
    background: #2e7d32;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.2);
}

button:active,
input[type="button"]:active {
    transform: translateY(0);
}

/* Navigation
--------------------------------------------- */
.main-navigation {
    display: block;
    width: 100%;
    background: #fff;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none; /* Mobile first: hidden by default */
}

/* Desktop Menu (Modern Flexbox) */
@media screen and (min-width: 48em) {
    .main-navigation ul {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }

    .main-navigation li {
        position: relative;
    }

    .main-navigation a {
        padding: 15px 10px;
        color: #333;
        font-weight: 600;
        font-size: 15px;
    }

    .main-navigation a:hover {
        color: #1b5e20;
    }

    /* Dropdown Styling */
    .main-navigation ul ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        box-shadow: 0 8px 15px rgba(0,0,0,0.1);
        z-index: 999;
        min-width: 200px;
        border-top: 3px solid #1b5e20;
    }

    .main-navigation ul ul li { width: 100%; }
    .main-navigation ul ul a { padding: 12px 20px; border-bottom: 1px solid #f5f5f5; }
    
    .main-navigation li:hover > ul {
        display: block;
    }
}

/* Post & Page Structure
--------------------------------------------- */
.post, .page {
    margin-bottom: 3em;
}

.entry-header { margin-bottom: 1.5em; }

.entry-title {
    font-size: 2rem;
    color: #212121;
    line-height: 1.2;
}

.entry-content, .entry-summary {
    line-height: 1.8;
    color: #444;
}

/* Posts Navigation (Next/Prev) */
.post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 2em 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.nav-next { text-align: right; }

/* Galleries (Clean Grid)
--------------------------------------------- */
.gallery {
    display: grid;
    grid-gap: 15px;
    margin-bottom: 1.5em;
}

/* Loop for gallery columns 2 to 9 */
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 600px) {
    .gallery { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Widgets
--------------------------------------------- */
.widget {
    margin-bottom: 2.5em;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #1b5e20;
    color: #1b5e20;
}
/*--------------------------------------------------------------
# Utilities
--------------------------------------------------------------*/

/* Accessibility (Essential for SEO) */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: var(--brand-color);
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Alignments */
.alignleft { float: left; margin: 0 1.5em 1.5em 0; }
.alignright { float: right; margin: 0 0 1.5em 1.5em; }
.aligncenter { clear: both; display: block; margin: 0 auto 1.5em; }

/*--------------------------------------------------------------
# SM TAMIL NOVELS - FOREST GREEN THEME (CORE)
--------------------------------------------------------------*/

:root {
    --brand-color: #1b5e20;
    --brand-light: #4caf50;
    --text-dark: #0b0707;
    --text-muted: #1d1c1c;
    --bg-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --header-height: 70px;
}

/* Global Reset Overrides */
body {
    background-color: #fff;
    font-family: 'Noto Sans Tamil', sans-serif;
    color: var(--text-dark);
}

/* Sticky Header */
.site-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 0;
    border-top: 4px solid var(--brand-color);
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    height: 100%;
}

/* Branding */
.site-title-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--brand-color);
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.site-title-text:hover {
    color: var(--brand-light);
}

/* Jetpack Infinite Scroll */
.infinite-scroll .posts-navigation,
.infinite-scroll.neverending .site-footer {
    display: none;
}
/* 2. HEADER COMPONENTS
--------------------------------------------- */
/* Search Bar */
.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
    position: relative;
}

.header-search input.search-field {
    width: 100%;
    background: #f0f0f0; /* Slightly lighter for better contrast */
    border: 1px solid transparent;
    border-radius: 24px;
    padding: 10px 45px 10px 20px;
    font-size: 14px;
    transition: 0.3s ease;
}

.header-search input.search-field:focus {
    background: #fff;
    border-color: var(--brand-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.search-submit {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    /* கீழிருப்பவை புதுசாகச் சேர்த்தது */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 1;
    transition: color 0.3s ease; /* கலர் மட்டும் மாறட்டும், இடம் மாற வேண்டாம் */
}

.search-submit:hover {
    background: none !important;
    border: none !important;
    transform: translateY(-50%) !important; /* ஹோவர் செய்யும்போதும் அதே இடத்தில் இருக்க வைக்கும் */
    color: #1b5e20; /* ஹோவர் செய்யும்போது கலர் மட்டும் மாறும் */
}

/* Navigation Icons */
.nav-list {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 13px; /* Slightly smaller for premium look */
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item .material-icons-outlined {
    font-size: 22px;
    margin-bottom: 2px;
}

.nav-item:hover a, 
.nav-item.current-menu-item a {
    color: var(--brand-color);
}

/* 3. NOVEL SECTIONS (HOME PAGE)
--------------------------------------------- */
.novel-section { margin-bottom: 40px; }

.section-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-gray);
}

/* Scroll Container (Hide Scrollbar) */
.scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 18px;
    padding-bottom: 15px;
    scrollbar-width: none; 
    -ms-overflow-style: none;  
}

.scroll-container::-webkit-scrollbar { display: none; }

/* Square Book Card */
.book-card { width: 160px; flex-shrink: 0; }

.book-cover {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: var(--bg-gray);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.book-card:hover .book-cover img { transform: scale(1.08); }

/* 4. WRITE & DASHBOARD
--------------------------------------------- */
.sm-write-wrap, .sm-dash-wrap {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

.btn-brand-green {
    background-color: var(--brand-color);
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.btn-brand-green:hover {
    background-color: var(--brand-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(27, 94, 32, 0.2);
}

/* Admin Notifications */
.admin-notice-section {
    background: #f9fbf9;
    border-left: 4px solid var(--brand-color);
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
}
/* 5. WRITE DASHBOARD - PREMIUM LOOK
--------------------------------------------- */
.write-hero-banner {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), 
                url('https://images.unsplash.com/photo-1455390582262-044cdead277a?auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    padding: 60px 30px; /* Compact padding */
    text-align: center;
    color: #fff;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-title {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 25px;
    max-width: 600px;
    margin-inline: auto;
}

/* Admin Updates Section */
.admin-updates-container { max-width: 900px; margin: 0 auto; }

.section-heading {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--bg-gray);
    padding-bottom: 10px;
}

.update-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 12px;
    transition: 0.3s;
}

.update-card:hover {
    border-color: var(--brand-color);
    transform: translateX(5px); /* Subtle slide effect */
}

.update-icon {
    background: #e8f5e9;
    color: var(--brand-color);
    width: 45px;
    height: 45px;
    border-radius: 12px; /* Stylish rounded corners */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 6. SINGLE STORY PAGE (Novel View)
--------------------------------------------- */
.story-header-card {
    display: flex;
    gap: 30px;
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.main-cover {
    width: 180px;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.story-main-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--brand-color); /* Red-ah Green-ah mathittaen */
    margin-bottom: 10px;
}

.genre-tag {
    background: var(--bg-gray);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.story-stats {
    display: flex;
    gap: 40px;
    margin: 20px 0;
    padding: 15px 0;
    border-block: 1px solid var(--bg-gray);
}

.stat-val { font-weight: 800; font-size: 18px; color: var(--text-dark); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

.btn-read-now {
    background: var(--brand-color);
    color: #fff !important;
    padding: 12px 35px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-block;
    transition: 0.3s;
}

.btn-read-now:hover {
    background: var(--brand-light);
    transform: scale(1.05);
}

/* Author Strip */
.author-strip {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.auth-img { 
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    margin-right: 15px;
    border: 2px solid var(--bg-gray);
}

.btn-follow { 
    background: transparent; 
    color: var(--brand-color); 
    border: 1.5px solid var(--brand-color); 
    padding: 6px 18px; 
    border-radius: 20px; 
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-follow:hover {
    background: var(--brand-color);
    color: #fff;
}

/* 7. EPISODE LIST (SINGLE STORY PAGE)
--------------------------------------------- */
.episode-list-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.episode-item {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--bg-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s ease;
}

.episode-item:hover {
    border-color: var(--brand-color);
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.08);
    transform: translateY(-2px);
}

.epi-link { 
    font-weight: 700; 
    color: var(--text-dark); 
    font-size: 15px; 
    margin-bottom: 2px;
}

.epi-date { font-size: 11px; color: var(--text-muted); }

.btn-read-sm {
    font-size: 12px;
    color: var(--brand-color);
    border: 1.5px solid var(--brand-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.btn-read-sm:hover {
    background: var(--brand-color);
    color: #fff !important;
}

/* 8. READING PAGE (READER UI)
--------------------------------------------- */
.reading-toolbar {
    position: sticky;
    top: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--bg-gray);
    z-index: 100;
    padding: 12px 20px;
}

.toolbar-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Settings Panel Refined */
.settings-panel {
    position: absolute;
    right: 20px;
    top: 55px;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 260px;
}

/* Themes (Clean UI) */
.theme-options { display: flex; gap: 8px; }

.theme-btn { 
    flex: 1; 
    border: 2px solid #eee; 
    padding: 8px; 
    cursor: pointer; 
    border-radius: 8px; 
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.theme-btn.light { background: #fff; color: #333; }
.theme-btn.sepia { background: #f4ecd8; color: #5b4636; border-color: #eaddc1; }
.theme-btn.dark { background: #222; color: #eee; border-color: #333; }

.theme-btn.active { border-color: var(--brand-color) !important; }

/* Reader Content */
.reader-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 50px 25px;
    min-height: 100vh;
    font-size: 19px; /* Slightly larger for readability */
    line-height: 1.9;
    transition: background 0.4s, color 0.4s;
}

/* Theme Application */
.theme-sepia .reader-container, .theme-sepia body { background: #f4ecd8; color: #3e2b1e; }
.theme-dark .reader-container, .theme-dark body { background: #121212; color: #b0b0b0; }

.reader-content h1 {
    font-size: 28px;
    margin-bottom: 40px;
    text-align: center;
    color: inherit;
}

/* Nav Buttons (Reader) */
.reader-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(128,128,128,0.2);
}

.nav-btn {
    padding: 12px 25px;
    background: var(--brand-color);
    color: #fff !important;
    border-radius: 30px;
    font-weight: 600;
    transition: 0.3s;
}

.nav-btn.disabled { background: #ccc !important; opacity: 0.6; }

/* Responsive Fixes */
@media(max-width: 768px) {
    .episode-list-grid { grid-template-columns: 1fr; }
    .story-header-card { flex-direction: column; align-items: center; text-align: center; }
    .reader-container { font-size: 18px; padding: 30px 20px; }
}

/* 9. HEADER ACTIONS & BADGES
--------------------------------------------- */
.cart-icon-container {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-count-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--brand-color); /* Updated to Green */
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 50%;
    border: 2px solid #fff;
    line-height: 1;
    min-width: 18px;
    text-align: center;
}

/* Gray Search Bar (Modern & Clean) */
.header-search {
    flex: 1;
    margin: 0 40px;
    max-width: 500px;
}

.search-form-gray {
    display: flex;
    background: var(--bg-gray);
    border-radius: 30px; /* Fully rounded */
    overflow: hidden;
    height: 42px;
    align-items: center;
    border: 1px solid transparent;
    transition: 0.3s;
}

.search-form-gray:focus-within {
    background: #fff;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.search-field-gray {
    background: transparent;
    border: none;
    padding: 0 20px;
    flex: 1;
    outline: none;
    font-size: 14px;
    color: var(--text-dark);
}

/* 10. EPISODE VIEW (SINGLE NOVEL PART)
--------------------------------------------- */
.sm-episode-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 15px;
}

.sm-breadcrumb a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
}

.sm-breadcrumb a:hover { color: var(--brand-color); }

.sm-bookmark-btn {
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    background: var(--bg-gray);
    color: var(--text-muted);
    transition: 0.3s;
}

.sm-bookmark-btn.active {
    color: var(--brand-color); /* Red to Green */
    background: #e8f5e9;
}

/* Episode Content Box */
.sm-episode-content-box {
    background: #fff;
    padding: 45px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.episode-main-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--brand-color);
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 2px solid var(--bg-gray);
    padding-bottom: 20px;
}

.episode-text {
    font-size: 19px;
    line-height: 1.9;
    color: #333;
}

/* Share Buttons */
.sm-share-section {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--bg-gray);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.share-icon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 30px;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    transition: 0.3s ease;
}

.share-icon.whatsapp { background: #25D366; }
.share-icon.facebook { background: #1877F2; }

.share-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Bottom Navigation Buttons */
.sm-episode-nav {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 60px;
}

.nav-btn {
    background: var(--brand-color);
    color: #fff !important;
    padding: 14px 25px;
    border-radius: 30px;
    font-weight: 700;
    flex: 1;
    text-align: center;
    transition: 0.3s;
}

.nav-btn.index {
    background: #fff;
    color: var(--brand-color) !important;
    border: 2px solid var(--brand-color);
}

.nav-btn.index:hover {
    background: var(--brand-color);
    color: #fff !important;
}

.nav-btn.disabled {
    background: #eee !important;
    color: #bbb !important;
    cursor: not-allowed;
}

/* Responsive Fixes */
@media (max-width: 600px) {
    .sm-episode-nav { flex-direction: column; }
    .sm-episode-content-box { padding: 25px 20px; }
    .episode-main-title { font-size: 20px; }
}

/* 11. READING MODES & TOOLBARS
--------------------------------------------- */
/* Cute Vertical Sticky Toolbar */
.cute-reading-toolbar {
    position: fixed;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 15px 10px;
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.toolbar-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-group button, 
.back-link-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #555;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.setting-group button:hover, 
.back-link-icon:hover {
    transform: scale(1.1);
    background: var(--brand-color);
    color: #fff;
}

.setting-group button.active,
.setting-group button.active-bm {
    background: var(--brand-color) !important;
    color: #fff !important;
}

/* Theme Application Logic */
.sm-episode-container {
    transition: all 0.4s ease;
}

/* 1. Light Mode (Default) */
.mode-light .sm-episode-container { background: #fff; color: #333; }

/* 2. Sepia Mode */
.mode-sepia, .mode-sepia body { background: #f4ecd8 !important; }
.mode-sepia .sm-episode-container { background: #f4ecd8; color: #5b4636; }
.mode-sepia .sm-episode-content-box { background: #fdf6e3; border-color: #eaddc1; }
.mode-sepia .episode-main-title { color: #5b4636; border-color: rgba(91, 70, 54, 0.1); }

/* 3. Dark Mode */
.mode-dark, .mode-dark body { background: #1a1a1a !important; }
.mode-dark .sm-episode-container { background: #1a1a1a; color: #dcdcdc; }
.mode-dark .sm-episode-content-box { background: #262626; border-color: #333; }
.mode-dark .episode-main-title { color: #fff; border-color: rgba(255, 255, 255, 0.1); }
.mode-dark .episode-text { color: #dcdcdc; }

/* 12. STAR RATING SYSTEM
--------------------------------------------- */
.episode-rating-area { 
    margin: 40px 0; 
    padding: 25px; 
    background: var(--bg-gray); 
    border-radius: 16px; 
    text-align: center; 
}

.star-rating { 
    direction: rtl; 
    display: inline-flex; 
    font-size: 32px; 
}

.star-rating input { display: none; }

.star-rating label { 
    color: #ddd; 
    cursor: pointer; 
    transition: 0.2s; 
    padding: 0 4px;
}

.star-rating input:checked ~ label, 
.star-rating label:hover, 
.star-rating label:hover ~ label { 
    color: #fbc02d; 
}

/* 13. COMMENTS SECTION
--------------------------------------------- */
.episode-comments { 
    max-width: 800px; 
    margin: 60px auto; 
}

.comment-list li.comment { 
    background: #fff; 
    padding: 25px; 
    border-radius: 16px; 
    border: 1px solid var(--border-color); 
    margin-bottom: 25px; 
    list-style: none;
}

.comment-author .fn {
    color: var(--brand-color) !important;
    font-weight: 700;
    font-size: 16px;
}

.comment-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* Responsive Toolbar */
@media (max-width: 768px) {
    .cute-reading-toolbar { 
        right: 10px; 
        padding: 10px 6px; 
    }
    .setting-group button { width: 34px; height: 34px; font-size: 16px; }
}

/* 14. HISTORY & BOOKMARK LIST (NOTIFICATION STYLE)
--------------------------------------------- */
.history-list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.history-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: 0.3s ease;
}

.history-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-color: var(--brand-color);
    transform: translateX(5px);
}

.hist-icon {
    width: 40px;
    height: 40px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-color);
    margin-right: 15px;
}

.hist-link {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
    text-decoration: none;
    margin-bottom: 2px;
}

.hist-date { font-size: 11px; color: var(--text-muted); }

/* 15. NOVEL PORTAL GRID (7-COLUMN LAYOUT)
--------------------------------------------- */
.story-portal-container { 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 30px 15px; 
}

.scroll-container { 
    display: flex; 
    gap: 15px; 
    overflow-x: auto; 
    padding-bottom: 20px; 
    scroll-snap-type: x mandatory; 
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar { display: none; }

/* Desktop: 7 Cards */
.book-card { 
    min-width: calc(100% / 7 - 13px); 
    max-width: calc(100% / 7 - 13px); 
    flex: 0 0 auto; 
    scroll-snap-align: start; 
}

.book-cover-wrap { 
    position: relative; 
    aspect-ratio: 2/3; 
    border-radius: 10px; 
    overflow: hidden; 
    background: var(--bg-gray); 
    margin-bottom: 8px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); 
}

.trending-rank { 
    position: absolute; 
    top: 8px; 
    left: 8px; 
    background: #d32f2f; 
    color: white; 
    padding: 2px 8px; 
    font-size: 10px;
    font-weight: 800; 
    border-radius: 4px; 
    z-index: 2; 
}

.rating-top-badge { 
    position: absolute; 
    top: 8px; 
    right: 8px; 
    background: rgba(0,0,0,0.7); 
    color: #ffc107; 
    padding: 2px 6px; 
    font-size: 10px; 
    font-weight: 700;
    border-radius: 4px; 
}

/* Typography */
.card-info h3 { 
    font-size: 13px; 
    font-weight: 700; 
    line-height: 1.3; 
    color: inherit; /* H3-oda dark color-aiyae edukka sollum */
    text-decoration: none;
    height: 36px; 
    overflow: hidden; 

 
    /* Standard properties for warning fix */
    display: -webkit-box; 
    display: box; /* Standard (if supported) */
    
    -webkit-line-clamp: 2; 
    line-clamp: 2; /* Future standard */
    
    -webkit-box-orient: vertical; 
    box-orient: vertical; /* Standard */
}

/* 16. MOBILE MENU & RESPONSIVE
--------------------------------------------- */
@media (max-width: 768px) {
    /* 2.3 Cards Peek Logic */
    .book-card { 
        min-width: calc(100% / 2.3 - 12px); 
        max-width: calc(100% / 2.3 - 12px); 
    }

    .menu-toggle-btn {
        display: block;
        background: var(--brand-color);
        color: #fff;
        padding: 12px;
        text-align: center;
        border-radius: 8px;
        cursor: pointer;
        margin-bottom: 15px;
        font-weight: 700;
        font-size: 14px;
        box-shadow: 0 4px 10px rgba(27, 94, 32, 0.2);
    }

    .sm-dash-menu {
        display: none; 
        flex-direction: column;
        background: #0a2e0c; /* Darker Green for Mobile Menu */
        padding: 10px;
        border-radius: 12px;
        gap: 5px;
    }

    .sm-dash-menu.active { display: flex; }
}

@media (min-width: 769px) {
    .menu-toggle-btn { display: none; }
    .sm-dash-menu { display: flex !important; gap: 20px; }
}

/* Image mela badge sariya ukkara */
.book-cover-wrap { 
    position: relative; 
    overflow: hidden;
    border-radius: 8px;
}

.ep-count-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 5;
}

/* Section Title link color */
.section-title-link {
    color: inherit;
}
/*--------------------------------------------------------------
# Custom Story Styles - Adding at the end
--------------------------------------------------------------*/

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.book-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: 0.3s ease;
}

/* இதுதான் படத்தைப் பெரியதாக்கும் முக்கியமான பகுதி */
.book-cover img {
    width: 100% !important;
    height: 270px !important; 
    object-fit: cover !important; /* object-image நீக்கப்பட்டது */
    border-radius: 8px;
    display: block;
}

.book-title {
    font-size: 16px;
    margin: 10px 0 5px;
    color: #1b5e20; /* Theme Green Color */
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
}

.book-author {
    font-size: 13px;
    color: #777;
    text-align: center;
}

/* Rating Badge Color Fix */
.rating-badge {
    background: rgba(0,0,0,0.7);
    color: #ffc107;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 12px;
}

/* Mobile View - 2 per row */
@media (max-width: 600px) {
    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .book-cover img {
        height: 220px !important;
    }
}

/* --- UNIVERSAL CARD FIX --- */
.book-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* படங்கள் அமுங்காமல் இருக்க Aspect Ratio முறை */
.book-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3; /* இதான் மேஜிக் - கார்டு அகலத்திற்கு ஏற்ப உயரம் மாறும் */
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.book-cover-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* ARCHIVE GRID FIX */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* HOME PAGE SCROLL FIX */
.scroll-container .book-card {
    min-width: calc(100% / 7 - 12px);
    max-width: calc(100% / 7 - 12px);
}

@media (max-width: 900px) {
    .scroll-container .book-card {
        min-width: calc(100% / 4 - 10px);
    }
}

@media (max-width: 600px) {
    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .scroll-container .book-card {
        min-width: calc(100% / 2.3 - 10px);
    }
}

.site-main {
    padding-left: 5px;
    padding-right: 5px;
}

@media (min-width: 1200px) {
    .container {
        width: 1170px;
        margin: 0 auto;
    }
}
/* விண்டோ உயரத்தில் பாடியை செட் செய்ய */
html, body {
    height: 100%;
    margin: 0;
}

/* மெயின் ராப்பர் (Site Wrapper) */
#page {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* முழு திரையின் உயரத்தை எடுத்துக்கொள்ளும் */
}

/* மெயின் கன்டென்ட் ஏரியாவை விரிக்க */
#primary, .site-main {
    flex: 1 0 auto;
}

/* ஃபுட்டர் எப்போதும் அடியில் இருக்க */
.site-footer {
    flex-shrink: 0;
}

.new-badge {
    position: absolute;
    top: 36px;
    right: 8px;
    background: #ff9800;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 5;
}
.story-meta{
font-size:13px;
color:#666;
margin-top:6px;
}

/* Force sticky header on all pages */
#masthead,
.site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
}

.admin-bar #masthead,
.admin-bar .site-header {
    top: 32px !important;
}

@media (max-width: 782px) {
    .admin-bar #masthead,
    .admin-bar .site-header {
        top: 46px !important;
    }
}
