/*
Theme Name: Typing Theme
Theme URI: https://typingpractice.org/
Description: Ultra-lightweight, high-performance, and modern WordPress theme designed specifically for typing practice, 100/100 Core Web Vitals, native social sharing, and optimal UX.
Version: 1.1.9
Author: Typing Practice Team
Author URI: https://typingpractice.org/
Text Domain: typing-theme
*/

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES & DESIGN SYSTEM
   ========================================================================== */
:root {
    --tp-primary: #0284c7;
    --tp-primary-dark: #0369a1;
    --tp-primary-light: #e0f2fe;
    --tp-secondary: #0d9488;
    --tp-accent-green: #16a34a;
    --tp-accent-green-light: #dcfce7;
    --tp-slate-900: #0f172a;
    --tp-slate-800: #1e293b;
    --tp-slate-700: #334155;
    --tp-slate-600: #475569;
    --tp-slate-500: #64748b;
    --tp-slate-300: #cbd5e1;
    --tp-slate-200: #e2e8f0;
    --tp-slate-100: #f1f5f9;
    --tp-slate-50: #f8fafc;
    --tp-white: #ffffff;

    --tp-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --tp-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    --tp-radius-sm: 6px;
    --tp-radius-md: 10px;
    --tp-radius-lg: 14px;
    --tp-radius-full: 9999px;

    --tp-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --tp-shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07);
    --tp-shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.1);

    --tp-max-width: 1200px;
    --tp-content-width: 860px;
    --tp-header-height: 72px;
    --tp-upper-height: 40px;
}

/* ==========================================================================
   2. RESET & BASE ELEMENTS (CWV OPTIMIZED)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--tp-font-sans);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--tp-slate-800);
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    position: relative;
}

img, svg, video {
    max-width: 100%;
    height: auto;
    display: inline-block;
    vertical-align: middle;
}

a {
    color: var(--tp-primary);
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

a:hover {
    color: var(--tp-primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.6em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tp-slate-900);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }

p, ul, ol, blockquote, table {
    margin-top: 0;
    margin-bottom: 1.4em;
}

.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;
}

/* ==========================================================================
   3. LAYOUT CONTAINERS
   ========================================================================== */
.tp-site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

.tt-container {
    width: 100%;
    max-width: var(--tp-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.tt-content-container {
    max-width: var(--tp-content-width);
    margin-left: auto;
    margin-right: auto;
}

.tp-main-content {
    flex: 1 0 auto;
    padding: 24px 0 60px 0;
}

/* ==========================================================================
   4. UPPER UTILITY MENU BAR (SLEEK, COMPACT, & FULLY RESPONSIVE)
   ========================================================================== */
.tp-upper-bar {
    background-color: #0f172a;
    color: #94a3b8;
    font-size: 0.825rem;
    height: 38px;
    line-height: 38px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 100;
}

.tp-upper-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 38px;
    gap: 12px;
}

.tp-upper-nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
    line-height: 1;
}

.tp-upper-nav a {
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: color 0.15s ease;
}

.tp-upper-nav a:hover {
    color: #38bdf8;
}

.tp-upper-auth {
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1;
}

.tp-theme-toggle-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    color: #ffffff;
    padding: 0;
    transition: all 0.2s ease;
}

.tp-theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.tp-theme-moon { display: none; }
.tp-theme-sun { display: inline-block; }
[data-theme="dark"] .tp-theme-sun { display: none; }
[data-theme="dark"] .tp-theme-moon { display: inline-block; }

.tp-mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tp-slate-200);
}

.tp-mobile-drawer-header .tp-theme-toggle-btn {
    background: var(--tp-slate-100);
    border-color: var(--tp-slate-300);
    color: var(--tp-slate-800);
}

.tp-upper-nav a[href*="my-report"],
.tp-upper-nav a[href*="my-course"],
.tp-upper-nav a[href*="courses"],
.tp-report-pill,
.tp-course-pill {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 45%, #ea580c 100%) !important;
    color: #ffffff !important;
    padding: 4px 13px;
    border-radius: var(--tp-radius-full);
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.22);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.tp-upper-nav a[href*="my-report"]:hover,
.tp-upper-nav a[href*="my-course"]:hover,
.tp-upper-nav a[href*="courses"]:hover,
.tp-report-pill:hover,
.tp-course-pill:hover {
    color: #ffffff !important;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.5);
    filter: brightness(1.08);
}

.tp-login-pill {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 45%, #ea580c 100%);
    color: #ffffff !important;
    padding: 4px 14px;
    border-radius: var(--tp-radius-full);
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.22);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.tp-login-pill:hover {
    color: #ffffff !important;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.5);
    filter: brightness(1.08);
}

.tp-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(234, 88, 12, 0.18) 100%);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: var(--tp-radius-full);
    padding: 3px 10px 3px 4px;
    box-shadow: 0 1px 6px rgba(245, 158, 11, 0.15);
    color: #fef3c7;
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1;
}

.tp-user-badge .tp-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #f59e0b;
    display: inline-block;
    vertical-align: middle;
}

.tp-user-badge .tp-user-name {
    color: #fef3c7;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.tp-logout-pill,
.tp-auth-link {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 5px rgba(234, 88, 12, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    line-height: 1.3;
    display: inline-block;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.tp-logout-pill:hover,
.tp-auth-link:hover {
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(234, 88, 12, 0.5);
    filter: brightness(1.08);
}

.tp-mobile-menu-drawer a[href*="my-report"],
.tp-mobile-menu-drawer a[href*="my-course"],
.tp-mobile-menu-drawer a[href*="courses"],
.tp-mobile-report-pill,
.tp-mobile-course-pill {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 45%, #ea580c 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

.tp-mobile-menu-drawer a[href*="student-login"],
.tp-mobile-login-pill {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 45%, #ea580c 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

.tp-mobile-logout-pill {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

@media (max-width: 640px) {
    .tp-upper-bar {
        height: auto;
        min-height: 38px;
        line-height: normal;
        padding: 4px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tp-upper-bar::-webkit-scrollbar {
        display: none;
    }
    .tp-upper-inner {
        height: auto;
        gap: 6px;
        font-size: 0.78rem;
        padding-left: 12px;
        padding-right: 12px;
        min-width: 0;
    }
    .tp-upper-nav {
        min-width: 0;
        flex-shrink: 1;
    }
    .tp-upper-nav ul {
        gap: 6px;
        flex-wrap: nowrap;
    }
    .tp-upper-nav a {
        font-size: 0.75rem;
    }
    .tp-upper-nav a[href*="my-report"],
    .tp-upper-nav a[href*="my-course"],
    .tp-upper-nav a[href*="courses"],
    .tp-report-pill,
    .tp-course-pill {
        padding: 3px 8px !important;
        font-size: 0.72rem !important;
        gap: 4px !important;
        white-space: nowrap !important;
    }
    .tp-upper-auth {
        gap: 6px;
        flex-shrink: 0;
    }
    .tp-theme-toggle-btn {
        width: 26px;
        height: 26px;
        font-size: 0.78rem;
    }
    .tp-user-badge {
        font-size: 0.72rem;
        padding: 2px 6px 2px 3px;
        gap: 4px;
        white-space: nowrap;
    }
    .tp-login-pill {
        padding: 3px 8px !important;
        font-size: 0.72rem !important;
        gap: 4px !important;
        white-space: nowrap !important;
    }
    .tp-logout-pill {
        padding: 2px 6px !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 380px) {
    .tp-upper-inner {
        padding-left: 8px;
        padding-right: 8px;
        gap: 4px;
    }
    .tp-upper-nav ul {
        gap: 4px;
    }
    .tp-upper-nav a[href*="my-report"],
    .tp-upper-nav a[href*="my-course"],
    .tp-report-pill,
    .tp-course-pill,
    .tp-login-pill {
        padding: 2px 6px !important;
        font-size: 0.68rem !important;
    }
}

/* ==========================================================================
   5. PRIMARY NAVIGATION & HEADER (PROPORTIONATE & SLEEK)
   ========================================================================== */
.tp-main-header {
    background-color: var(--tp-white);
    border-bottom: 1px solid var(--tp-slate-200);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    position: relative;
    z-index: 90;
}

.tp-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-height: 64px;
    gap: 20px;
}

.tp-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    max-height: 50px;
}

.tp-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    line-height: 1;
}

.tp-brand-logo-img,
.tp-brand img,
.custom-logo,
.tp-logo-img {
    max-height: 42px !important;
    max-width: 42px !important;
    width: 42px !important;
    height: 42px !important;
    object-fit: contain !important;
    border-radius: 8px;
    display: block;
    flex-shrink: 0;
}

.tp-brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: baseline;
    font-family: var(--tp-font-sans);
    line-height: 1;
    transition: transform 0.2s ease;
}

.tp-brand-link:hover .tp-brand-title {
    transform: scale(1.02);
}

.tp-brand-part-1 {
    color: #0284c7;
    font-weight: 800;
}

.tp-brand-part-2 {
    color: #0d9488;
    font-weight: 800;
}

.tp-brand-part-3 {
    color: #ea580c;
    font-weight: 800;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 640px) {
    .tp-brand-title {
        font-size: 1.1rem;
        letter-spacing: -0.02em;
    }
    .tp-brand-link {
        gap: 8px;
    }
    .tp-brand-logo-img,
    .tp-brand img,
    .custom-logo,
    .tp-logo-img {
        max-height: 32px !important;
        max-width: 32px !important;
        width: 32px !important;
        height: 32px !important;
    }
}

@media (max-width: 380px) {
    .tp-brand-title {
        font-size: 0.95rem;
    }
}

.tp-main-nav {
    display: flex;
    align-items: center;
}

.tp-main-nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
}

.tp-main-nav li {
    position: relative;
}

.tp-main-nav a {
    display: block;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    border-radius: var(--tp-radius-md);
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
    position: relative;
}

.tp-main-nav a:hover,
.tp-main-nav .current-menu-item > a,
.tp-main-nav .current_page_item > a {
    color: var(--tp-primary);
    background-color: var(--tp-slate-100);
}

.tp-main-nav .current-menu-item > a,
.tp-main-nav .current_page_item > a {
    font-weight: 800;
    color: var(--tp-primary-dark);
    box-shadow: inset 0 -3px 0 0 var(--tp-primary);
}

.tp-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--tp-radius-md);
    color: var(--tp-slate-800);
    align-items: center;
    justify-content: center;
}

.tp-menu-toggle:focus-visible {
    outline: 2px solid var(--tp-primary);
}

.tp-menu-toggle svg {
    width: 26px;
    height: 26px;
}

.tp-mobile-menu-drawer {
    display: none;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    padding: 24px 20px;
}

.tp-mobile-menu-drawer.is-open {
    right: 0;
}

.tp-mobile-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    float: right;
    color: var(--tp-slate-600);
    padding: 4px 8px;
}

.tp-mobile-menu-drawer ul {
    list-style: none;
    margin: 40px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-mobile-menu-drawer a {
    display: block;
    padding: 12px 14px;
    font-weight: 600;
    color: var(--tp-slate-800);
    border-radius: var(--tp-radius-sm);
}

.tp-mobile-menu-drawer a:hover {
    background-color: var(--tp-slate-100);
    color: var(--tp-primary);
}

.tp-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tp-mobile-overlay.is-active {
    opacity: 1;
}

@media (max-width: 860px) {
    .tp-header-inner {
        height: 56px;
        max-height: 56px;
    }
    .custom-logo,
    .tp-logo-img,
    .tp-brand img {
        max-height: 38px !important;
        max-width: 170px !important;
    }
    .tp-main-nav {
        display: none;
    }
    .tp-menu-toggle {
        display: flex;
    }
    .tp-mobile-menu-drawer {
        display: block;
    }
    .tp-mobile-overlay {
        display: block;
        pointer-events: none;
    }
    .tp-mobile-overlay.is-active {
        pointer-events: auto;
    }
}

/* ==========================================================================
   6. SEARCH BAR (.custom-wp-search-container)
   ========================================================================== */
.custom-wp-search-container {
    max-width: 620px;
    width: 100% !important;
    min-height: 52px;
    height: 52px;
    box-sizing: border-box;
    margin: 24px auto;
    padding: 0;
    border-radius: 50px;
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.08);
    border: 1px solid var(--tp-slate-200);
    overflow: hidden;
    transition: all 0.3s ease;
    background: #ffffff;
}

@media (max-width: 640px) {
    .custom-wp-search-container {
        margin: 14px auto 16px auto;
        min-height: 46px;
        height: 46px;
    }
}

.custom-wp-search-container:focus-within {
    box-shadow: 0 6px 24px rgba(2, 132, 199, 0.16);
    border-color: #38bdf8;
    transform: translateY(-2px);
}

.custom-wp-search-container .search-form {
    display: flex;
    margin: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.custom-wp-search-container label {
    flex-grow: 1;
    display: block;
    margin: 0;
}

.custom-wp-search-container .search-field {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    padding: 12px 22px;
    font-size: 1rem;
    font-family: var(--tp-font-sans);
    color: var(--tp-slate-800);
    outline: none;
    line-height: 1.5;
    border-radius: 50px 0 0 50px;
    box-sizing: border-box;
}

.custom-wp-search-container .search-field::placeholder {
    color: #94a3b8;
}

.custom-wp-search-container .search-submit {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    border: none;
    padding: 0 24px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0 50px 50px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-wp-search-container .search-submit:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
}

/* ==========================================================================
   7. PWA INSTALL BANNER (#pwa-install-banner)
   ==========================================================================
   Position: in normal document flow, directly BELOW the search bar and
   ABOVE the main content. Expands/collapses smoothly when PWA install
   becomes available. (Restored from the previous fixed-overlay version
   at the user's request — the banner now sits at the top of the content
   area where it is most visible.)
   ========================================================================== */
#pwa-install-banner {
    display: flex;
    visibility: hidden;
    opacity: 0;
    max-height: 0;
    padding: 0 20px;
    margin: 0 auto;
    overflow: hidden;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    max-width: 620px;
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--tp-radius-lg);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.12);
    text-align: center;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    border: 1px solid #7dd3fc;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                margin 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease,
                visibility 0.3s ease;
}

#pwa-install-banner.is-visible {
    visibility: visible;
    opacity: 1;
    max-height: 160px;
    padding: 16px 22px;
    margin-top: 18px;
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    #pwa-install-banner {
        gap: 10px;
    }
    #pwa-install-banner.is-visible {
        padding: 12px 14px;
        margin-top: 12px;
        margin-bottom: 16px;
    }
    #pwa-install-banner p {
        font-size: 0.88rem;
    }
    #pwa-install-button {
        padding: 8px 16px;
        font-size: 0.88rem;
    }
}

#pwa-install-banner p {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0c4a6e;
}

#pwa-install-button {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    border: none;
    border-radius: var(--tp-radius-md);
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#pwa-install-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

/* ==========================================================================
   8. SINGLE POST & PAGE TYPOGRAPHY
   ========================================================================== */
.tp-article-card {
    background-color: var(--tp-white);
    border: 1px solid var(--tp-slate-200);
    border-radius: var(--tp-radius-lg);
    padding: 40px;
    box-shadow: var(--tp-shadow-sm);
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (max-width: 640px) {
    .tt-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .tp-article-card {
        padding: 18px 12px !important;
        border-radius: 12px !important;
    }
}

.entry-content {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.entry-content img,
.entry-content figure,
.entry-content .wp-caption,
figure.wp-caption,
.wp-block-image,
.wp-block-image img,
.custom-bottom-featured-image {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
}

.entry-content figure,
.entry-content .wp-caption,
figure.wp-caption {
    width: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    clear: both;
}

.entry-content .wp-caption img,
figure.wp-caption img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.entry-content .wp-caption-text {
    font-size: 0.88rem;
    color: var(--tp-slate-600);
    text-align: center;
    margin-top: 8px;
    line-height: 1.4;
}

.entry-header {
    margin-bottom: 25px;
}

.entry-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--tp-slate-900);
    line-height: 1.25;
    margin: 0 0 15px 0;
    letter-spacing: -0.025em;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--tp-primary);
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (max-width: 768px) {
    .entry-title {
        font-size: 1.65rem;
    }
}

@media (max-width: 480px) {
    .entry-title {
        font-size: 1.35rem;
        padding-bottom: 10px;
        line-height: 1.3;
    }
}

.entry-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.9rem;
    color: var(--tp-slate-500);
    margin-bottom: 15px;
}

.entry-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.entry-header .post-thumbnail,
.page-header-image,
.hero-featured-image,
.featured-image {
    display: none !important;
}

.last-updated {
    font-size: 0.85rem;
    font-weight: 600;
    color: #15803d;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 6px 14px;
    border-radius: var(--tp-radius-full);
    margin-top: 5px;
    margin-bottom: 25px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.last-updated strong {
    font-weight: 700;
}

.entry-content {
    color: var(--tp-slate-800);
    font-size: 1.05rem;
    line-height: 1.8;
}

h2:not(.screen-reader-text):not(.widget-title):not(.site-title):not(.entry-title):not(.nav-title):not(.tp-card-title):not(.rp-title),
.entry-content h2,
.tp-article-card h2,
.wp-block-heading:is(h2) {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.28;
    letter-spacing: -0.022em;
    color: var(--tp-slate-900);
    margin-top: 2.2em;
    margin-bottom: 0.8em;
    padding-bottom: 8px;
    border-bottom: 3.5px solid #0284c7 !important;
    display: block;
}

h3:not(.screen-reader-text):not(.widget-title):not(.site-title):not(.nav-title):not(.tp-card-title):not(.rp-title),
.entry-content h3,
.tp-article-card h3,
.wp-block-heading:is(h3) {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.36;
    letter-spacing: -0.015em;
    color: var(--tp-slate-900);
    margin-top: 1.9em;
    margin-bottom: 0.7em;
    padding-bottom: 6px;
    border-bottom: 3.0px solid #10b981 !important;
    display: block;
}

h4:not(.screen-reader-text):not(.widget-title):not(.site-title):not(.nav-title):not(.tp-card-title):not(.rp-title):not(.tp-footer-col h4):not(.tp-author-name),
.entry-content h4,
.tp-article-card h4,
.wp-block-heading:is(h4) {
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -0.01em;
    color: var(--tp-slate-800);
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    padding-bottom: 5px;
    border-bottom: 2.5px solid #f59e0b !important;
    display: block;
}

@media (max-width: 640px) {
    h2:not(.screen-reader-text):not(.widget-title):not(.site-title):not(.entry-title):not(.nav-title):not(.tp-card-title):not(.rp-title),
    .entry-content h2,
    .tp-article-card h2,
    .wp-block-heading:is(h2) {
        font-size: 1.45rem;
        line-height: 1.3;
        margin: 1.8em 0 0.6em 0;
        padding-bottom: 6px;
    }
    h3:not(.screen-reader-text):not(.widget-title):not(.site-title):not(.nav-title):not(.tp-card-title):not(.rp-title),
    .entry-content h3,
    .tp-article-card h3,
    .wp-block-heading:is(h3) {
        font-size: 1.22rem;
        line-height: 1.38;
        margin: 1.5em 0 0.5em 0;
        padding-bottom: 5px;
    }
    h4:not(.screen-reader-text):not(.widget-title):not(.site-title):not(.nav-title):not(.tp-card-title):not(.rp-title):not(.tp-footer-col h4):not(.tp-author-name),
    .entry-content h4,
    .tp-article-card h4,
    .wp-block-heading:is(h4) {
        font-size: 1.08rem;
        line-height: 1.45;
        margin: 1.3em 0 0.45em 0;
    }
}

.entry-content p {
    margin-bottom: 1.5em;
}

/* ==========================================================================
   9. INTERLINKING GRID (.typing-links & .links-grid)
   ========================================================================== */
.typing-links {
    margin: 35px 0;
    padding: 24px;
    background: linear-gradient(135deg, #f8fbff 0%, #f0f6fc 100%);
    border: 1px solid #d0e1f9;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.typing-links h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--tp-slate-900);
    font-weight: 700;
    border-bottom: none;
    padding-bottom: 0;
}

.typing-links .links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.links-grid a,
.links-grid .current-link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    text-align: center;
    border-radius: var(--tp-radius-md);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.links-grid a {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--tp-primary);
    text-decoration: none;
}

.links-grid a:hover {
    background: var(--tp-primary);
    border-color: var(--tp-primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.25);
}

.links-grid .current-link-item {
    background: #e2e8f0;
    border: 1px solid #94a3b8;
    color: #0f172a;
    font-weight: 700;
    cursor: default;
}

.links-grid a::before,
.links-grid .current-link-item::before {
    content: "⌨️";
    font-size: 1.1rem;
}

/* ==========================================================================
   10. BOTTOM FEATURED IMAGE (.custom-featured-image-below)
   ========================================================================== */
.custom-featured-image-below {
    margin: 36px auto 24px auto;
    text-align: center;
    width: 100%;
    max-width: 100%;
    clear: both;
    box-sizing: border-box;
}

.custom-featured-image-below img.custom-bottom-featured-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--tp-radius-lg);
    margin-left: auto;
    margin-right: auto;
    box-shadow: var(--tp-shadow-md);
    border: 1px solid var(--tp-slate-200);
}

/* ==========================================================================
   12. RELATED POSTS (.related-posts, .rp-grid)
   ========================================================================== */
.related-posts {
    margin-top: 40px;
    padding: 24px;
    background: #f8fafc;
    border: 1px solid var(--tp-slate-200);
    border-radius: var(--tp-radius-lg);
    box-shadow: var(--tp-shadow-sm);
}

.related-posts h3 {
    font-size: 1.35rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--tp-slate-900);
    font-weight: 700;
    border-bottom: 2px solid var(--tp-slate-200);
    padding-bottom: 8px;
}

.rp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.rp-item {
    background: #ffffff;
    border: 1px solid var(--tp-slate-200);
    border-radius: var(--tp-radius-md);
    transition: all 0.25s ease;
    box-shadow: var(--tp-shadow-sm);
    overflow: hidden;
}

.rp-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--tp-shadow-md);
    border-color: #93c5fd;
}

.rp-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.rp-item .rp-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--tp-slate-800);
    transition: color 0.2s ease;
}

.rp-item a:hover .rp-title {
    color: var(--tp-primary);
}

.rp-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--tp-radius-sm);
    display: block;
    background-color: var(--tp-slate-100);
}

@media (max-width: 600px) {
    .rp-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   13. POST NAVIGATION (PREVIOUS & NEXT BUTTONS)
   ========================================================================== */
.post-navigation {
    margin-top: 45px;
    padding-top: 30px;
    border-top: 1px solid var(--tp-slate-200);
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.post-navigation .nav-links .nav-next:only-child {
    grid-column: 2;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    min-width: 0;
}

.post-navigation .nav-previous a,
.post-navigation .nav-next a {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 20px;
    background: #ffffff;
    border: 1.5px solid var(--tp-slate-200);
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
    position: relative;
    overflow: hidden;
}

.post-navigation .nav-previous a::before,
.post-navigation .nav-next a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.post-navigation .nav-previous a:hover,
.post-navigation .nav-next a:hover {
    border-color: #0284c7;
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(2, 132, 199, 0.14);
}

.post-navigation .nav-previous a:hover::before,
.post-navigation .nav-next a:hover::before {
    opacity: 1;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tp-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}

.post-navigation .nav-next .nav-subtitle {
    justify-content: flex-end;
}

.post-navigation .nav-previous a:hover .nav-subtitle {
    transform: translateX(-4px);
}

.post-navigation .nav-next a:hover .nav-subtitle {
    transform: translateX(4px);
}

.post-navigation .nav-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--tp-slate-800);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.post-navigation a:hover .nav-title {
    color: var(--tp-primary-dark);
}

@media (max-width: 640px) {
    .post-navigation .nav-links {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .post-navigation .nav-links .nav-next:only-child {
        grid-column: 1;
    }
    .post-navigation .nav-next {
        text-align: left;
    }
    .post-navigation .nav-next .nav-subtitle {
        justify-content: flex-start;
    }
}

/* ==========================================================================
   14. POST GRID & BLOG ARCHIVES
   ========================================================================== */
.tp-archive-header {
    margin-bottom: 35px;
    text-align: center;
}

.tp-archive-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--tp-slate-900);
    margin: 0 0 10px 0;
}

.tp-archive-desc {
    font-size: 1.1rem;
    color: var(--tp-slate-600);
    max-width: 600px;
    margin: 0 auto;
}

.tp-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.tp-post-card {
    background: #ffffff;
    border: 1px solid var(--tp-slate-200);
    border-radius: var(--tp-radius-lg);
    overflow: hidden;
    box-shadow: var(--tp-shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tp-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tp-shadow-md);
    border-color: #bae6fd;
}

.tp-post-card .tp-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background-color: var(--tp-slate-100);
}

.tp-post-card .tp-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tp-post-card .tp-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px 0;
}

.tp-post-card .tp-card-title a {
    color: var(--tp-slate-900);
    text-decoration: none;
}

.tp-post-card .tp-card-title a:hover {
    color: var(--tp-primary);
}

.tp-post-card .tp-card-meta {
    font-size: 0.85rem;
    color: var(--tp-slate-500);
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
}

.tp-post-card .tp-card-excerpt {
    font-size: 0.95rem;
    color: var(--tp-slate-600);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.tp-read-more {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background-color: var(--tp-slate-100);
    color: var(--tp-primary-dark);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--tp-radius-full);
    transition: all 0.2s ease;
}

.tp-read-more:hover {
    background-color: var(--tp-primary);
    color: #ffffff;
}

.tp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.tp-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--tp-radius-md);
    background: #ffffff;
    border: 1px solid var(--tp-slate-200);
    color: var(--tp-slate-700);
    font-weight: 600;
    font-size: 0.95rem;
}

.tp-pagination .page-numbers:hover,
.tp-pagination .page-numbers.current {
    background-color: var(--tp-primary);
    color: #ffffff;
    border-color: var(--tp-primary);
}

/* ==========================================================================
   15. COMMENTS TEMPLATE
   ========================================================================== */
#comments {
    margin-top: 45px;
    padding-top: 30px;
    border-top: 1px solid var(--tp-slate-200);
}

.comments-title {
    font-size: 1.4rem;
    margin-bottom: 25px;
}

.comment-list {
    list-style: none;
    margin: 0 0 35px 0;
    padding: 0;
}

.comment-list .comment {
    background-color: var(--tp-slate-50);
    border: 1px solid var(--tp-slate-200);
    border-radius: var(--tp-radius-md);
    padding: 20px;
    margin-bottom: 18px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-weight: 700;
}

.comment-author img {
    border-radius: 50%;
}

.comment-meta {
    font-size: 0.8rem;
    color: var(--tp-slate-500);
    margin-bottom: 10px;
}

.comment-form p {
    margin-bottom: 15px;
}

.comment-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--tp-slate-700);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--tp-slate-300);
    border-radius: var(--tp-radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px var(--tp-primary-light);
}

.comment-form .submit {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    padding: 12px 28px;
    font-weight: 700;
    border-radius: var(--tp-radius-full);
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.25);
    transition: all 0.2s ease;
}

.comment-form .submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(2, 132, 199, 0.35);
}

/* ==========================================================================
   16. FOOTER STYLES
   ========================================================================== */
.tp-site-footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 50px 0 25px 0;
    font-size: 0.95rem;
    border-top: 1px solid #1e293b;
}

.tp-footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .tp-footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.tp-footer-col h4,
.tp-site-footer .tp-footer-col h4 {
    color: #ffffff !important;
    font-size: 1.15rem;
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 6px;
    font-weight: 700;
    border-bottom: 2.5px solid #f59e0b !important;
    display: inline-block;
    letter-spacing: -0.01em;
}

.tp-footer-col p {
    line-height: 1.6;
    color: #94a3b8;
}

.tp-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tp-footer-col a {
    color: #cbd5e1;
}

.tp-footer-col a:hover {
    color: #38bdf8;
}

.tp-footer-bottom {
    padding-top: 25px;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
}

.tp-footer-bottom a {
    color: #cbd5e1;
}

.tp-footer-bottom a:hover {
    color: #ffffff;
}

.tp-404-container {
    text-align: center;
    padding: 60px 20px;
}

.tp-404-code {
    font-size: 6rem;
    font-weight: 900;
    color: var(--tp-primary);
    line-height: 1;
    margin-bottom: 10px;
    letter-spacing: -0.05em;
}

.tp-404-title {
    font-size: 2rem;
    margin-bottom: 15px;
}

.tp-404-desc {
    font-size: 1.1rem;
    color: var(--tp-slate-600);
    max-width: 500px;
    margin: 0 auto 30px auto;
}

/* ==========================================================================
   17. SIDEBAR & 2-COLUMN LAYOUT
   ========================================================================== */
.tp-layout-wrapper {
    width: 100%;
}

.tp-layout-wrapper.no-sidebar:not(:has(.tp-sidebar)) .tp-main-column {
    max-width: var(--tp-content-width);
    margin-left: auto;
    margin-right: auto;
}

.tp-layout-wrapper.has-sidebar,
.tp-layout-wrapper:has(.tp-sidebar) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: start;
    width: 100%;
}

.tp-sidebar {
    width: 300px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 20px;
}

@media (max-width: 768px) {
    .tp-layout-wrapper.has-sidebar,
    .tp-layout-wrapper:has(.tp-sidebar) {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .tp-sidebar {
        width: 100%;
        position: static;
    }
}

.tp-widget-box {
    background-color: var(--tp-white);
    border: 1px solid var(--tp-slate-200);
    border-radius: var(--tp-radius-lg);
    padding: 24px;
    box-shadow: var(--tp-shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    word-break: break-word;
}

.tp-widget-box:hover {
    border-color: #93c5fd;
    box-shadow: var(--tp-shadow-md);
}

.tp-widget-box .widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--tp-slate-900);
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tp-primary);
    line-height: 1.3;
}

.tp-widget-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tp-widget-box li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--tp-slate-700);
    padding: 4px 0;
    transition: color 0.15s ease, transform 0.15s ease;
}

.tp-widget-box li a:hover {
    color: var(--tp-primary);
    transform: translateX(4px);
}

.tp-widget-box p {
    margin-bottom: 1em;
    line-height: 1.6;
    color: var(--tp-slate-700);
}

.tp-widget-box p:last-child {
    margin-bottom: 0;
}

.tp-widget-box .custom-html-widget {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================================================
   18. DARK MODE ENGINE (PURE CSS & ZERO FLICKER)
   ========================================================================== */
[data-theme="dark"] {
    --tp-primary: #38bdf8;
    --tp-primary-dark: #0284c7;
    --tp-primary-light: #0c4a6e;
    --tp-slate-900: #f8fafc;
    --tp-slate-800: #e2e8f0;
    --tp-slate-700: #cbd5e1;
    --tp-slate-600: #94a3b8;
    --tp-slate-500: #64748b;
    --tp-slate-300: #334155;
    --tp-slate-200: #1e293b;
    --tp-slate-100: #0f172a;
    --tp-slate-50: #0b0f19;
    --tp-white: #111827;
    color-scheme: dark;
}

[data-theme="dark"] body {
    background-color: #0b0f19;
    color: #e2e8f0;
}

[data-theme="dark"] .tp-upper-bar {
    background-color: #060911;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .tp-main-header {
    background-color: #111827;
    border-bottom-color: #1e293b;
}

[data-theme="dark"] .tp-main-nav a {
    color: #f1f5f9;
}

[data-theme="dark"] .tp-main-nav a:hover,
[data-theme="dark"] .tp-main-nav .current-menu-item > a,
[data-theme="dark"] .tp-main-nav .current_page_item > a {
    color: #38bdf8;
    background-color: #1e293b;
}

[data-theme="dark"] .tp-menu-toggle {
    color: #f1f5f9;
}

[data-theme="dark"] .tp-mobile-menu-drawer {
    background-color: #111827;
    border-left: 1px solid #1e293b;
}

[data-theme="dark"] .tp-mobile-menu-drawer a {
    color: #f1f5f9;
}

[data-theme="dark"] .tp-mobile-menu-drawer a:hover {
    background-color: #1e293b;
    color: #38bdf8;
}

[data-theme="dark"] .tp-mobile-drawer-header {
    border-bottom-color: #1e293b;
}

[data-theme="dark"] .tp-mobile-drawer-header .tp-theme-toggle-btn {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .tp-mobile-close {
    color: #94a3b8;
}

[data-theme="dark"] .tp-article-card,
[data-theme="dark"] .tp-widget-box,
[data-theme="dark"] .rp-item,
[data-theme="dark"] .tp-post-card,
[data-theme="dark"] .related-posts,
[data-theme="dark"] .comment-list .comment {
    background-color: #111827;
    border-color: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] .tp-post-card .tp-card-title a {
    color: #f8fafc;
}

[data-theme="dark"] .tp-post-card .tp-card-title a:hover {
    color: #38bdf8;
}

[data-theme="dark"] .tp-read-more {
    background-color: #1e293b;
    color: #38bdf8;
}

[data-theme="dark"] .tp-read-more:hover {
    background-color: #0284c7;
    color: #ffffff;
}

[data-theme="dark"] .custom-wp-search-container {
    background-color: #111827;
    border-color: #334155;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .custom-wp-search-container .search-field {
    color: #f8fafc;
}

[data-theme="dark"] .typing-links {
    background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
    border-color: #1e293b;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .typing-links h2 {
    color: #f8fafc;
}

[data-theme="dark"] .links-grid a {
    background: #1e293b;
    border-color: #334155;
    color: #38bdf8;
}

[data-theme="dark"] .links-grid a:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

[data-theme="dark"] .links-grid .current-link-item {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] #pwa-install-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-color: #38bdf8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] #pwa-install-banner p {
    color: #38bdf8;
}

[data-theme="dark"] .last-updated {
    background-color: rgba(22, 163, 74, 0.15);
    border-color: rgba(22, 163, 74, 0.3);
    color: #4ade80;
}

[data-theme="dark"] .tp-pagination .page-numbers {
    background-color: #111827;
    border-color: #1e293b;
    color: #cbd5e1;
}

[data-theme="dark"] .tp-pagination .page-numbers:hover,
[data-theme="dark"] .tp-pagination .page-numbers.current {
    background-color: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

[data-theme="dark"] .comment-form input[type="text"],
[data-theme="dark"] .comment-form input[type="email"],
[data-theme="dark"] .comment-form input[type="url"],
[data-theme="dark"] .comment-form textarea {
    background-color: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] h2:not(.screen-reader-text):not(.widget-title):not(.site-title):not(.entry-title):not(.nav-title):not(.tp-card-title):not(.rp-title),
[data-theme="dark"] .entry-content h2,
[data-theme="dark"] .tp-article-card h2,
[data-theme="dark"] .wp-block-heading:is(h2) {
    color: #f8fafc;
    border-bottom-color: #38bdf8 !important;
}

[data-theme="dark"] h3:not(.screen-reader-text):not(.widget-title):not(.site-title):not(.nav-title):not(.tp-card-title):not(.rp-title),
[data-theme="dark"] .entry-content h3,
[data-theme="dark"] .tp-article-card h3,
[data-theme="dark"] .wp-block-heading:is(h3) {
    color: #f1f5f9;
    border-bottom-color: #34d399 !important;
}

[data-theme="dark"] h4:not(.screen-reader-text):not(.widget-title):not(.site-title):not(.nav-title):not(.tp-card-title):not(.rp-title):not(.tp-footer-col h4):not(.tp-author-name),
[data-theme="dark"] .entry-content h4,
[data-theme="dark"] .tp-article-card h4,
[data-theme="dark"] .wp-block-heading:is(h4) {
    color: #e2e8f0;
    border-bottom-color: #fbbf24 !important;
}

[data-theme="dark"] .post-navigation {
    border-top-color: #1e293b;
}

[data-theme="dark"] .post-navigation .nav-previous a,
[data-theme="dark"] .post-navigation .nav-next a {
    background-color: #111827;
    border-color: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .post-navigation .nav-previous a:hover,
[data-theme="dark"] .post-navigation .nav-next a:hover {
    background-color: #162032;
    border-color: #0284c7;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .post-navigation .nav-subtitle {
    color: #38bdf8;
}

[data-theme="dark"] .post-navigation .nav-title {
    color: #f1f5f9;
}

[data-theme="dark"] .post-navigation a:hover .nav-title {
    color: #38bdf8;
}

[data-theme="dark"] .tp-user-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(234, 88, 12, 0.22) 100%);
    border-color: rgba(245, 158, 11, 0.55);
}

[data-theme="dark"] .tp-user-badge .tp-user-name {
    color: #fde68a;
}

/* ==========================================================================
   19. AUTHOR BOX (.tp-author-box)
   ========================================================================== */
.tp-author-box {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--tp-slate-200);
    border-left: 4px solid var(--tp-primary);
    border-radius: var(--tp-radius-lg);
    padding: 24px;
    margin: 32px 0 28px 0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    position: relative;
    box-sizing: border-box;
}

.tp-author-avatar-col {
    flex-shrink: 0;
}

.tp-author-avatar {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0284c7;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.22);
    display: block;
    background-color: var(--tp-slate-100);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tp-author-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
}

.tp-author-details-col {
    flex-grow: 1;
    min-width: 0;
}

.tp-author-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.tp-author-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--tp-slate-900);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.tp-author-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, rgba(3, 105, 161, 0.12) 100%);
    color: var(--tp-primary);
    border: 1px solid rgba(2, 132, 199, 0.25);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.tp-author-window {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: var(--tp-radius-md);
    padding: 12px 16px;
    margin-top: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tp-author-bio {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--tp-slate-700);
}

@media (max-width: 600px) {
    .tp-author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        padding: 20px 16px;
    }
    .tp-author-header {
        justify-content: center;
    }
    .tp-author-window {
        text-align: left;
    }
}

[data-theme="dark"] .tp-author-box {
    background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
    border-color: #1e293b;
    border-left-color: #38bdf8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .tp-author-avatar {
    border-color: #38bdf8;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .tp-author-name {
    color: #f8fafc;
}

[data-theme="dark"] .tp-author-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .tp-author-window {
    background: #0b1120;
    border-color: #1e293b;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .tp-author-bio {
    color: #cbd5e1;
}

[data-theme="dark"] .tp-brand-part-1 {
    color: #38bdf8;
}

[data-theme="dark"] .tp-brand-part-2 {
    color: #2dd4bf;
}

[data-theme="dark"] .tp-brand-part-3 {
    background: linear-gradient(135deg, #fbbf24, #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   20. FULL RESPONSIVE INTEGRATION (TYPING PRACTICE, COURSES & HOMEPAGE)
   ========================================================================== */
.entry-content,
.tp-article-card,
.tp-main-column,
.tp-layout-wrapper {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

.tp-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

@media (max-width: 640px) {
    .tp-container {
        padding: 14px 10px !important;
        margin: 16px auto !important;
        border-radius: 14px !important;
        min-height: auto !important;
    }
    .tp-header {
        margin-bottom: 12px !important;
    }
    .tp-metrics {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 4px !important;
    }
    .tp-metric {
        padding: 6px 2px !important;
        border-radius: 8px !important;
        box-shadow: 1px 1px 3px #d1d1d1, -1px -1px 3px #ffffff !important;
    }
    .tp-metric-label {
        font-size: 0.68rem !important;
        margin-bottom: 2px !important;
    }
    .tp-metric-value {
        font-size: 1.15rem !important;
    }
    .tp-branding {
        font-size: 0.8rem !important;
        margin-top: 8px !important;
    }
    .tp-words {
        font-size: 1.18rem !important;
        line-height: 1.6 !important;
        padding: 12px 10px !important;
        height: 110px !important;
        margin-bottom: 14px !important;
        border-radius: 10px !important;
    }
    .tp-input-area {
        flex-direction: column !important;
        gap: 10px !important;
    }
    #tp-input {
        width: 100% !important;
        padding: 12px 14px !important;
        font-size: 1.05rem !important;
        box-sizing: border-box !important;
        border-radius: 10px !important;
    }
    .tp-input-area .tp-button,
    #tp-start-btn {
        width: 100% !important;
        min-width: 0 !important;
        padding: 12px 20px !important;
        font-size: 1rem !important;
        box-sizing: border-box !important;
        border-radius: 10px !important;
    }
    .tp-results-box {
        padding: 20px 14px !important;
        border-radius: 12px !important;
    }
    .tp-results-box h3 {
        font-size: 1.6em !important;
        margin-bottom: 15px !important;
    }
    .tp-results-main-stats {
        gap: 16px !important;
    }
    .tp-results-stat-value {
        font-size: 1.8em !important;
    }
}

@media (max-width: 380px) {
    .tp-metrics {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    .tp-metric-value {
        font-size: 1.1rem !important;
    }
}

.tp-course-grid,
.tp-course-card,
.tp-course-single-card-wrapper {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 640px) {
    .tp-course-card {
        max-width: 100% !important;
        border-radius: 12px !important;
    }
    .tp-course-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

.features-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap: 20px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
}

.feature-card {
    background-color: var(--tp-white) !important;
    border: 1px solid var(--tp-slate-200) !important;
    border-radius: 14px !important;
    padding: 24px 18px !important;
    text-align: center !important;
    box-shadow: var(--tp-shadow-sm) !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    margin: 0 auto 20px auto !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.feature-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: var(--tp-shadow-md) !important;
}

.feature-card img {
    width: 64px !important;
    height: 64px !important;
    margin-bottom: 14px !important;
    object-fit: contain !important;
}

.feature-card h3 {
    font-size: 1.25rem !important;
    margin: 0 0 10px 0 !important;
    color: var(--tp-slate-900) !important;
}

.feature-card p {
    color: var(--tp-slate-600) !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-bottom: 18px !important;
}

.hp-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 22px !important;
    font-size: 0.925rem !important;
    font-weight: 700 !important;
    border-radius: var(--tp-radius-full) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25) !important;
    transition: all 0.2s ease !important;
}

.hp-button:hover {
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35) !important;
}

.homepage-section {
    max-width: 100% !important;
    margin: 30px auto !important;
    padding: 0 !important;
    text-align: center !important;
}

.homepage-section h2 {
    font-size: 1.6rem !important;
    margin-bottom: 12px !important;
}

.typing-links {
    margin: 25px 0 !important;
    padding: 16px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

.typing-links .links-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 10px !important;
}

@media (max-width: 480px) {
    .typing-links .links-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   21. PREFERS-REDUCED-MOTION ACCESSIBILITY
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .tp-theme-toggle-btn:hover,
    .tp-article-card:hover,
    .post-navigation .nav-previous a:hover,
    .post-navigation .nav-next a:hover,
    .feature-card:hover,
    .tp-post-card:hover,
    .rp-item:hover {
        transform: none;
    }
}