/*
Theme Name: Sourov
Theme URI: https://sourovdeb.com
Author: Sourov Deb
Description: A clean, fast, pillar-based theme for teaching, philosophy, and resources. Editorial front page, filterable journal archive, and a friendly, academic voice. Built with automation, AI integration, and SEO optimization.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sourov
Tags: blog, education, custom-menu, featured-images, threaded-comments, translation-ready, sticky-post, two-columns
*/

/* =============================================
   DESIGN TOKENS  (derived from the approved prototype)
   ============================================= */
:root {
    --accent:        #667eea;
    --accent-2:      #764ba2;
    --accent-grad:   linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    --ink:           #2c3e50;   /* headings + strong text */
    --body:          #374151;   /* body copy            */
    --muted:         #6b7280;   /* secondary text       */
    --faint:         #9ca3af;   /* meta / timestamps    */

    --bg:            #fafbfc;   /* page background      */
    --surface:       #ffffff;   /* cards / nav / sections */
    --surface-alt:   #f3f4f6;   /* alternating section  */
    --tint:          #f8f7ff;   /* soft accent panel    */
    --line:          #e5e7eb;   /* hairline borders     */

    /* Pillar accents */
    --pillar-english:      #3b82f6;
    --pillar-english-bg:   #dbeafe;
    --pillar-english-fg:   #1e40af;
    --pillar-philosophy:   #8b5cf6;
    --pillar-philosophy-bg:#ede9fe;
    --pillar-philosophy-fg:#6d28d9;
    --pillar-journal:      #f59e0b;
    --pillar-journal-bg:   #fef3c7;
    --pillar-journal-fg:   #92400e;
    --pillar-resources:    #10b981;
    --pillar-resources-bg: #d1fae5;
    --pillar-resources-fg: #065f46;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --radius:    8px;
    --radius-lg: 12px;
    --radius-pill: 20px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.10);

    --wrap:      1100px;
    --wrap-text: 780px;
}

/* =============================================
   RESET / BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--body);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 700; line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 2.5rem; letter-spacing: -0.5px; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
blockquote {
    margin: 1.5rem 0; padding: 0.5rem 0 0.5rem 1.25rem;
    border-left: 4px solid var(--accent);
    color: var(--muted); font-style: italic;
}
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { background: var(--ink); color: #f8fafc; padding: 1rem 1.25rem; border-radius: var(--radius); overflow: auto; }
code { background: var(--surface-alt); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* =============================================
   LAYOUT HELPERS
   ============================================= */
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.container--text { max-width: var(--wrap-text); }
.section { padding: 56px 0; }
.section--white { background: var(--surface); }
.section--alt   { background: var(--surface-alt); }
.skip-link {
    position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
    padding: 10px 16px; border-radius: 0 0 var(--radius) 0; z-index: 999;
}
.skip-link:focus { left: 0; color: #fff; }

/* =============================================
   HEADER / NAV
   ============================================= */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 100;
}
.site-header__inner {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; max-width: var(--wrap); margin: 0 auto;
}
.site-brand { display: flex; align-items: center; gap: 12px; }
.site-brand__title {
    font-size: 20px; font-weight: 700; letter-spacing: -0.5px;
    color: var(--accent); margin: 0;
}
.site-brand__title a { color: inherit; }
.site-brand__tagline { display: none; }
.custom-logo { max-height: 40px; width: auto; }

.nav-toggle {
    display: none; background: none; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 8px 10px; cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; transition: 0.2s; }

.main-nav ul { display: flex; gap: 8px; align-items: center; list-style: none; margin: 0; padding: 0; }
.main-nav a {
    display: inline-block; color: var(--ink); background: transparent;
    font-size: 14px; font-weight: 600; padding: 8px 16px;
    border-radius: var(--radius-pill);
    transition: background 0.2s ease, color 0.2s ease;
}
.main-nav a:hover { background: var(--surface-alt); color: var(--ink); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a,
.main-nav .current-menu-parent > a {
    background: var(--accent); color: #fff;
}
/* Fallback menu (no menu assigned) mirrors the same pills */
.main-nav--fallback ul { gap: 8px; }

/* =============================================
   HERO  (front page, editorial)
   ============================================= */
.hero {
    background: var(--accent-grad);
    color: #fff; padding: 88px 24px; text-align: center;
}
.hero__inner { max-width: 900px; margin: 0 auto; }
.hero__eyebrow {
    font-size: 13px; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; opacity: 0.85; margin-bottom: 16px;
}
.hero__title { color: #fff; font-size: 2.75rem; margin: 0 0 20px; line-height: 1.2; }
.hero__excerpt { font-size: 18px; opacity: 0.95; max-width: 640px; margin: 0 auto 32px; }
.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 28px; border: 1px solid transparent; border-radius: var(--radius);
    font-weight: 600; font-size: 14px; cursor: pointer; line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); color: #fff; }
.btn--on-accent { background: #fff; color: var(--accent); }
.btn--on-accent:hover { color: var(--accent-2); box-shadow: var(--shadow-md); }
.btn--ghost-accent { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.4); }
.btn--ghost-accent:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* =============================================
   AUTHOR CARD
   ============================================= */
.author-card {
    max-width: var(--wrap-text); margin: 0 auto;
    background: var(--tint); border-radius: var(--radius-lg);
    padding: 32px; display: flex; gap: 20px; align-items: center;
}
.author-card__avatar {
    width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
    background: var(--accent-grad); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 24px;
}
.author-card__name { font-weight: 700; font-size: 16px; color: var(--ink); margin: 0 0 4px; }
.author-card__bio  { margin: 0; font-size: 14px; color: var(--muted); }

/* =============================================
   SECTION HEADS
   ============================================= */
.section-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 32px; gap: 16px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 1.75rem; }
.section-head__link { font-weight: 600; font-size: 14px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { margin: 0 0 8px; font-size: 2rem; }
.page-head p  { color: var(--muted); font-size: 15px; margin: 0; }

/* =============================================
   POST CARDS  (archive / index / recent)
   ============================================= */
.post-list { display: grid; gap: 18px; }
.post-card {
    display: block; padding: 22px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card__meta { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.post-card__date { color: var(--faint); font-size: 13px; }
.post-card__title { font-size: 17px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.5; }
.post-card__thumb { border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.post-card__thumb img { width: 100%; object-fit: cover; }

/* Category badge + pillar theming */
.cat-badge {
    display: inline-block; padding: 4px 12px; border-radius: 12px;
    font-size: 12px; font-weight: 600;
    background: var(--surface-alt); color: var(--muted);
}
.cat-badge--english      { background: var(--pillar-english-bg);    color: var(--pillar-english-fg); }
.cat-badge--philosophy   { background: var(--pillar-philosophy-bg); color: var(--pillar-philosophy-fg); }
.cat-badge--journal      { background: var(--pillar-journal-bg);    color: var(--pillar-journal-fg); }
.cat-badge--resources    { background: var(--pillar-resources-bg);  color: var(--pillar-resources-fg); }

/* =============================================
   FILTER CHIPS  (journal archive)
   ============================================= */
.filter-chips { display: flex; gap: 10px; margin-bottom: 32px; flex-wrap: wrap; }
.filter-chip {
    padding: 8px 18px; border-radius: var(--radius-pill);
    font-size: 13px; font-weight: 600; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* =============================================
   RESOURCE / PILLAR CARDS  (teaching page)
   ============================================= */
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.pillar-card {
    background: var(--surface); padding: 32px; border-radius: var(--radius);
    border-left: 4px solid var(--accent);
}
.pillar-card--english    { border-left-color: var(--pillar-english); }
.pillar-card--philosophy { border-left-color: var(--pillar-philosophy); }
.pillar-card--journal    { border-left-color: var(--pillar-journal); }
.pillar-card--resources  { border-left-color: var(--pillar-resources); }
.pillar-card h3 { font-size: 18px; margin: 0 0 12px; }
.pillar-card p  { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.pillar-card__link { font-weight: 600; font-size: 14px; }

/* Legacy compatibility (kept from v1) */
.pillar-english-teaching { border-left: 4px solid var(--pillar-english); }
.pillar-philosophy       { border-left: 4px solid var(--pillar-philosophy); }
.pillar-resources        { border-left: 4px solid var(--pillar-resources); }

/* =============================================
   CONTENT LAYOUT  (single / page / with sidebar)
   ============================================= */
.content-area { padding: 56px 0 80px; }
.has-sidebar .content-wrap {
    display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 48px;
    max-width: var(--wrap); margin: 0 auto; padding: 0 24px;
}
.no-sidebar .content-wrap { max-width: var(--wrap-text); margin: 0 auto; padding: 0 24px; }

.entry-header { margin-bottom: 28px; }
.entry-title { font-size: 2.25rem; margin: 0.5rem 0; }
.entry-meta { display: flex; gap: 14px; align-items: center; color: var(--faint); font-size: 14px; flex-wrap: wrap; }
.entry-featured { border-radius: var(--radius-lg); overflow: hidden; margin: 0 0 28px; }
.entry-content { font-size: 17px; color: var(--body); }
.entry-content > * { margin-bottom: 1.2rem; }
.entry-content h2 { margin-top: 2rem; }
.entry-content h3 { margin-top: 1.5rem; }
.entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.entry-content img { border-radius: var(--radius); }
.entry-footer { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.entry-footer .tag-links a {
    display: inline-block; margin: 0 6px 6px 0; padding: 4px 12px;
    background: var(--surface-alt); border-radius: 12px; font-size: 13px; color: var(--muted);
}

.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; }
.post-nav a { display: block; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); flex: 1; }
.post-nav a:hover { box-shadow: var(--shadow-md); }
.post-nav .nav-label { display: block; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.post-nav .nav-next { text-align: right; }

/* =============================================
   PAGINATION
   ============================================= */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; flex-wrap: wrap; }
.pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px;
}
.pagination .page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .page-numbers:hover:not(.current) { border-color: var(--accent); color: var(--accent); }

/* =============================================
   SIDEBAR / WIDGETS
   ============================================= */
.sidebar .widget {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 22px; margin-bottom: 24px;
}
.sidebar .widget-title { font-size: 15px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 0 0 14px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar ul li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sidebar ul li:last-child { border-bottom: 0; }

/* =============================================
   FORMS
   ============================================= */
.form-input, input[type="text"], input[type="email"], input[type="search"], input[type="url"],
textarea, select {
    width: 100%; padding: 12px 14px; border: 1px solid #d1d5db;
    border-radius: var(--radius); font-family: inherit; font-size: 15px;
    background: var(--surface); color: var(--ink);
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: var(--ink); }

.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] { flex: 1; }

/* =============================================
   COMMENTS
   ============================================= */
.comments-area { max-width: var(--wrap-text); margin: 56px auto 0; padding: 0 24px; }
.comments-title { font-size: 1.5rem; margin-bottom: 24px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment { margin-bottom: 24px; }
.comment-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.comment-author { font-weight: 700; color: var(--ink); }
.comment-author .avatar { border-radius: 50%; margin-right: 10px; vertical-align: middle; }
.comment-metadata { font-size: 13px; color: var(--faint); margin: 4px 0 10px; }
.comment-list .children { list-style: none; margin: 16px 0 0 32px; padding: 0; }
.comment-respond { margin-top: 32px; }
.comment-reply-link, .comment-respond .submit {
    display: inline-block; margin-top: 8px; background: var(--accent); color: #fff;
    padding: 8px 18px; border-radius: var(--radius); border: 0; font-weight: 600; cursor: pointer; font-size: 14px;
}
.comment-reply-link:hover, .comment-respond .submit:hover { background: var(--accent-2); color: #fff; }

/* =============================================
   AI-ASSISTED NOTICE  (from AI_Integration filter)
   ============================================= */
.ai-assisted-notice {
    margin-top: 30px; padding: 15px; background: #f0f9ff;
    border-left: 4px solid var(--accent); border-radius: var(--radius);
    font-size: 0.9em; color: var(--pillar-english-fg);
}

/* =============================================
   404 / SEARCH EMPTY
   ============================================= */
.error-404, .no-results { max-width: var(--wrap-text); margin: 0 auto; text-align: center; padding: 80px 24px; }
.error-404 .code { font-size: 5rem; font-weight: 800; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }

/* =============================================
   FOOTER
   ============================================= */
.site-footer { background: var(--ink); color: #fff; padding: 48px 24px; }
.site-footer__inner { max-width: var(--wrap); margin: 0 auto; text-align: center; }
.site-footer nav ul { display: flex; gap: 20px; justify-content: center; list-style: none; padding: 0; margin: 0 0 20px; flex-wrap: wrap; }
.site-footer nav a { color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 600; }
.site-footer nav a:hover { color: #fff; }
.site-footer__copy { margin: 0 0 6px; font-size: 14px; }
.site-footer__tag  { margin: 0; font-size: 13px; opacity: 0.7; }

/* =============================================
   ACCESSIBILITY HELPERS
   ============================================= */
.screen-reader-text {
    border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
    height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
.sticky-badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 860px) {
    .has-sidebar .content-wrap { grid-template-columns: 1fr; }
    .hero__title { font-size: 2rem; }
    h1 { font-size: 2rem; }
}
@media (max-width: 640px) {
    .nav-toggle { display: block; }
    .main-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--surface); border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-sm); display: none; padding: 12px 24px 20px;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
    .main-nav a { display: block; }
    .hero { padding: 64px 24px; }
    .author-card { flex-direction: column; text-align: center; }
    .post-nav { flex-direction: column; }
}
