/* ================================================================
   The Holy Tutor — Theme Stylesheet
   Matches the React frontend design (App.jsx header/footer)
   Colors: #1A1A2E (dark navy), #1E2E56 (green), #F38B00 (gold)
   ================================================================ */

/* ── Reset & Base ────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    background: #F5F5F7;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ── Container ───────────────────────────────────────────────── */

.tht-container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ── Buttons ─────────────────────────────────────────────────── */

.tht-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s; border: none; line-height: 1.4;
    min-height: 44px;
}
.tht-btn-primary { background: #1E2E56; color: #fff; }
.tht-btn-primary:hover { background: #152244; }
.tht-btn-outline { background: transparent; color: #1E2E56; border: 1px solid #1E2E56; }
.tht-btn-outline:hover { background: #1E2E56; color: #fff; }

/* ================================================================
   HEADER — Sticky dark navy bar
   ================================================================ */

.tht-header {
    background: #1A1A2E;
    position: sticky;
    top: 0;
    z-index: 50;
}

.tht-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.tht-logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.tht-logo-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #1E2E56;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.tht-logo-badge svg { width: 16px; height: 16px; }
.tht-logo-badge--sm { width: 28px; height: 28px; }
.tht-logo-badge--sm svg { width: 14px; height: 14px; }

.tht-logo-text {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.tht-logo-text span { color: #F38B00; }
.tht-logo-text--sm { font-size: 13px; }

/* Custom logo image override */
.tht-logo-link .custom-logo-link { display: flex; }
.tht-logo-link .custom-logo { height: 20px; width: auto; }

/* Unified site logo (plugin Settings → site_logo_url) */
.tht-logo-img { height: 40px; width: auto; display: block; }
.tht-footer-logo-img { height: 36px; width: auto; display: block; }

/* Navigation */
.tht-nav-primary { display: flex; align-items: center; }
.tht-nav-list { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }
.tht-nav-list li { position: relative; }
.tht-nav-list a {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}
.tht-nav-list a:hover,
.tht-nav-list .current-menu-item > a,
.tht-nav-list .current_page_item > a {
    color: #F38B00;
}

/* Sub-menu dropdown */
.tht-nav-list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 8px 0;
    min-width: 180px;
    z-index: 60;
    margin-top: 8px;
}
.tht-nav-list li:hover > .sub-menu { display: block; }
.tht-nav-list .sub-menu a {
    color: #374151;
    display: block;
    padding: 8px 16px;
    font-size: 13px;
}
.tht-nav-list .sub-menu a:hover { background: #F3F4F6; color: #1E2E56; }

/* Header Right */
.tht-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tht-lang-btn {
    background: #1E2E56;
    color: #fff;
    font-size: 12px;
    border: none;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    font-family: inherit;
}
.tht-lang-btn:hover { background: #152244; }
.tht-lang-btn svg { width: 14px; height: 14px; }

.tht-login-btn {
    border: 1px solid rgba(255,255,255,0.7);
    color: #fff;
    background: transparent;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.tht-login-btn:hover { background: #fff; color: #1A1A2E; }

/* Hamburger */
.tht-hamburger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    cursor: pointer;
}
.tht-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    transition: transform 0.3s, opacity 0.3s;
}
.tht-hamburger.is-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.tht-hamburger.is-active span:nth-child(2) { opacity: 0; }
.tht-hamburger.is-active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
.tht-mobile-menu {
    display: none;
    background: #1A1A2E;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 16px;
}
.tht-mobile-menu.is-open { display: block; }
.tht-mobile-nav-list { list-style: none; margin: 0; padding: 0; }
.tht-mobile-nav-list a {
    display: block;
    padding: 12px 16px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: color 0.2s;
}
.tht-mobile-nav-list a:hover,
.tht-mobile-nav-list .current-menu-item > a { color: #F38B00; }

.tht-mobile-actions { padding: 16px 16px 0; display: flex; gap: 12px; }
.tht-mobile-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.tht-mobile-btn-primary { background: #F38B00; color: #1A1A2E; }
.tht-mobile-btn-primary:hover { background: #b89841; }
.tht-mobile-btn-outline { border: 1px solid #EF4444; color: #EF4444; }
.tht-mobile-btn-outline:hover { background: rgba(239,68,68,0.1); }

/* ================================================================
   MAIN CONTENT
   ================================================================ */

.tht-main {
    min-height: 60vh;
    padding: 40px 0;
}

/* Page Title */
.tht-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 24px;
    line-height: 1.3;
}
.tht-page-title span { color: #1E2E56; }

/* ── Blog Post Grid (Masonry / Pinterest style) ─────────────── */

.tht-post-grid {
    columns: 3 320px;
    column-gap: 24px;
    margin: 0;
}

.tht-post-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s, transform 0.2s;
    margin: 0 0 24px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
}
.tht-post-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.tht-post-thumb-link { display: block; }
.tht-post-thumb-img { width: 100%; height: 200px; object-fit: cover; }

.tht-post-thumb-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #1E2E56 0%, #1A1A2E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tht-post-thumb-placeholder svg { width: 48px; height: 48px; fill: rgba(255,255,255,0.3); }

.tht-post-body { padding: 20px; }

.tht-post-meta {
    font-size: 12px;
    color: #9CA3AF;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
}
.tht-post-meta a {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
}

.tht-post-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1A1A2E;
    margin-bottom: 8px;
    line-height: 1.4;
}
.tht-post-card-title a { color: inherit; }
.tht-post-card-title a:hover { color: #1E2E56; }

.tht-post-excerpt {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
    margin-bottom: 16px;
}

.tht-read-more {
    color: #1E2E56;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 44px;
    min-height: 44px;
    padding-block: 10px;
}
.tht-read-more:hover { color: #F38B00; }

/* ── Pagination ──────────────────────────────────────────────── */

.tht-pagination { margin-top: 40px; }
.tht-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.tht-pagination .page-numbers {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    background: #fff;
    color: #374151;
    border: 1px solid #E5E7EB;
}
.tht-pagination .page-numbers:hover { background: #1E2E56; color: #fff; border-color: #1E2E56; }
.tht-pagination .page-numbers.current { background: #1E2E56; color: #fff; border-color: #1E2E56; }

/* ── Single Post ─────────────────────────────────────────────── */

.tht-single-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; }
.tht-single-layout:only-child { grid-template-columns: 1fr; max-width: 800px; }

.tht-breadcrumb { font-size: 13px; color: #9CA3AF; margin-bottom: 20px; }
.tht-breadcrumb a { color: #6B7280; display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.tht-breadcrumb a:hover { color: #1E2E56; }
.tht-breadcrumb-sep { margin: 0 6px; }
.tht-breadcrumb-current { color: #374151; }

.tht-featured-image { margin-bottom: 24px; border-radius: 12px; overflow: hidden; }
.tht-featured-image img { width: 100%; height: auto; }

.tht-article-header { margin-bottom: 32px; }
.tht-article-meta { font-size: 13px; color: #9CA3AF; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tht-article-meta a { color: #1E2E56; display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.tht-article-meta a:hover { color: #F38B00; }
.tht-meta-sep { color: #D1D5DB; }
.tht-article-title { font-size: 32px; font-weight: 700; color: #1A1A2E; line-height: 1.3; }

.tht-entry-content { font-size: 16px; line-height: 1.8; color: #374151; }
.tht-entry-content h2 { font-size: 24px; font-weight: 700; color: #1A1A2E; margin: 32px 0 16px; }
.tht-entry-content h3 { font-size: 20px; font-weight: 600; color: #1A1A2E; margin: 24px 0 12px; }
.tht-entry-content p { margin-bottom: 16px; }
.tht-entry-content ul, .tht-entry-content ol { margin: 0 0 16px 24px; }
.tht-entry-content ul { list-style: disc; }
.tht-entry-content ol { list-style: decimal; }
.tht-entry-content li { margin-bottom: 4px; }
.tht-entry-content a { color: #1E2E56; font-weight: 500; }
.tht-entry-content a:hover { color: #F38B00; }
.tht-entry-content blockquote {
    border-left: 4px solid #1E2E56;
    padding: 16px 20px;
    margin: 24px 0;
    background: #F0FDF4;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #1A1A2E;
}
.tht-entry-content img { border-radius: 8px; margin: 16px 0; }
.tht-entry-content pre {
    background: #1A1A2E;
    color: #E5E7EB;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 14px;
}
.tht-entry-content code { background: #F3F4F6; padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.tht-entry-content pre code { background: none; padding: 0; }

/* Tags */
.tht-article-tags { margin-top: 32px; padding-top: 20px; border-top: 1px solid #E5E7EB; font-size: 14px; color: #6B7280; }
.tht-article-tags a { color: #1E2E56; font-weight: 500; display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.tht-article-tags a:hover { color: #F38B00; }
.tht-tags-label { font-weight: 600; color: #374151; }

/* Post Navigation */
.tht-post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #E5E7EB;
    gap: 20px;
}
.tht-prev-post, .tht-next-post {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 48%;
    min-height: 44px;
    justify-content: center;
}
.tht-next-post { text-align: right; margin-left: auto; }
.tht-nav-label { font-size: 12px; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.5px; }
.tht-nav-title { font-size: 15px; font-weight: 600; color: #1A1A2E; }
.tht-prev-post:hover .tht-nav-title,
.tht-next-post:hover .tht-nav-title { color: #1E2E56; }

/* ── Page Content ────────────────────────────────────────────── */

.tht-page-content { background: #fff; border-radius: 16px; padding: 40px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

/* ── Sidebar ─────────────────────────────────────────────────── */

.tht-sidebar { position: sticky; top: 80px; }
.tht-widget { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.tht-widget-title { font-size: 16px; font-weight: 700; color: #1A1A2E; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #1E2E56; }

/* ── 404 Page ────────────────────────────────────────────────── */

.tht-404 { text-align: center; padding: 80px 16px; }
.tht-404-title { font-size: 96px; font-weight: 800; color: #1E2E56; line-height: 1; margin-bottom: 16px; }
.tht-404-text { font-size: 20px; color: #6B7280; margin-bottom: 32px; }

/* ── No Results ──────────────────────────────────────────────── */

.tht-no-results { text-align: center; padding: 60px 16px; }
.tht-no-results h2 { font-size: 24px; font-weight: 700; color: #1A1A2E; margin-bottom: 12px; }
.tht-no-results p { color: #6B7280; margin-bottom: 20px; }

/* ── Search Form ─────────────────────────────────────────────── */

.search-form {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
}
.search-form .search-field {
    flex: 1;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.search-form .search-field:focus { border-color: #1E2E56; }
.search-form .search-submit {
    min-height: 44px;
    padding: 10px 20px;
    background: #1E2E56;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.search-form .search-submit:hover { background: #152244; }

/* ── Comments ────────────────────────────────────────────────── */

.tht-comments { margin-top: 40px; }
.tht-comments-title { font-size: 20px; font-weight: 700; color: #1A1A2E; margin-bottom: 20px; }
.tht-comment-list { list-style: none; }
.tht-comment-list .comment { padding: 20px 0; border-bottom: 1px solid #E5E7EB; }
.tht-comment-list .comment-body { display: flex; gap: 16px; }
.tht-comment-list .comment-author img { border-radius: 50%; }
.tht-comment-list .comment-metadata { font-size: 12px; color: #9CA3AF; }
.tht-comment-list .comment-content { font-size: 14px; margin-top: 8px; }

#respond { margin-top: 32px; }
#respond .comment-reply-title { font-size: 20px; font-weight: 700; color: #1A1A2E; margin-bottom: 16px; }
#respond label { display: block; font-size: 14px; font-weight: 500; color: #374151; margin-bottom: 4px; }
#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"],
#respond textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    font-family: inherit;
}
#respond textarea { min-height: 120px; resize: vertical; }
#respond input:focus, #respond textarea:focus { outline: none; border-color: #1E2E56; }

/* Archive desc */
.tht-archive-desc { color: #6B7280; margin-bottom: 24px; font-size: 15px; }

/* ================================================================
   FOOTER
   ================================================================ */

.tht-footer {
    background: #1A1A2E;
    color: #fff;
    padding: 48px 0 24px;
    margin-top: 0;
}

.tht-footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

.tht-footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.tht-footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-bottom: 16px;
}

.tht-social-icons { display: flex; gap: 10px; margin-top: 16px; }
.tht-social-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #4B5563;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    transition: all 0.2s;
}
.tht-social-icon:hover { color: #fff; border-color: #fff; }
.tht-social-icon svg { width: 16px; height: 16px; }

.tht-store-badges { display: flex; gap: 8px; margin-top: 16px; }
.tht-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1F2937;
    color: #D1D5DB;
    font-size: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #374151;
    transition: border-color 0.2s;
    min-width: 44px;
    min-height: 44px;
}
.tht-store-badge:hover { border-color: #6B7280; color: #fff; }
.tht-store-badge svg { width: 14px; height: 14px; }

.tht-footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}
.tht-footer-links { list-style: none; margin: 0; padding: 0; }
.tht-footer-links li { margin-bottom: 2px; }
.tht-footer-links a,
.tht-footer-links span { font-size: 14px; color: #9CA3AF; transition: color 0.2s; }
.tht-footer-links a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.tht-footer-links a:hover { color: #F38B00; }

.tht-footer-contact li { font-size: 14px; color: #9CA3AF; }
.tht-contact-label { color: #6B7280; }

.tht-footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 24px;
    text-align: center;
}
.tht-footer-bottom p { color: #6B7280; font-size: 14px; }
.tht-footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    margin-top: 12px;
}
.tht-footer-legal a { color: #9CA3AF; font-size: 14px; transition: color 0.2s; display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.tht-footer-legal a:hover { color: #F38B00; }

/* WP nav menu integration in footer */
.tht-footer-col .menu { list-style: none; margin: 0; padding: 0; }
.tht-footer-col .menu li { margin-bottom: 2px; }
.tht-footer-col .menu a { font-size: 14px; color: #9CA3AF; transition: color 0.2s; display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.tht-footer-col .menu a:hover { color: #F38B00; }

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 1024px) {
    .tht-nav-primary,
    .tht-header-actions { display: none; }
    .tht-hamburger { display: flex; }

    .tht-post-grid { columns: 2 280px; }
    .tht-footer-grid { grid-template-columns: repeat(2, 1fr); }
    .tht-single-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .tht-post-grid { columns: 1; }
    .tht-footer-grid { grid-template-columns: 1fr; }
    .tht-page-title { font-size: 22px; }
    .tht-article-title { font-size: 24px; }
    .tht-page-content { padding: 24px; }
    .tht-404-title { font-size: 64px; }
}

/* ── RTL Support ─────────────────────────────────────────────── */

[dir="rtl"] .tht-nav-list { direction: rtl; }
[dir="rtl"] .tht-breadcrumb-sep { margin: 0 6px; }
[dir="rtl"] .tht-entry-content ul,
[dir="rtl"] .tht-entry-content ol { margin: 0 24px 16px 0; }
[dir="rtl"] .tht-entry-content blockquote { border-left: none; border-right: 4px solid #1E2E56; border-radius: 8px 0 0 8px; }
[dir="rtl"] .tht-next-post { text-align: left; margin-left: 0; margin-right: auto; }
[dir="rtl"] .search-form .search-field { border-radius: 0 8px 8px 0; }
[dir="rtl"] .search-form .search-submit { border-radius: 8px 0 0 8px; }

/* ── WP Admin Bar Fix ────────────────────────────────────────── */

.admin-bar .tht-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tht-header { top: 46px; } }
