/*
Theme Name: Anora
Theme URI: https://example.com/anora
Author: Notion Web
Author URI: https://example.com
Description: A beautiful, clean Notion-style WordPress theme.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: anora
Tags: custom-colors, custom-menu, custom-logo, editor-style, featured-images
*/

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Notion Color System */
    --notion-white: #ffffff;
    --notion-off-white: #fbfbfa;
    --notion-gray-50: #f7f6f3;
    --notion-gray-100: #ebeae6;
    --notion-gray-200: #d8d7d3;
    --notion-gray-300: #b8b7b3;
    --notion-gray-400: #99989a;
    --notion-gray-500: #73726e;
    --notion-gray-600: #5a5a5a;
    --notion-gray-700: #454545;
    --notion-gray-800: #2f2f2f;
    --notion-black: #1f1f1f;

    /* Accent Colors */
    --notion-accent: #2383e2;
    --notion-accent-hover: #0b6bcb;
    --notion-accent-bg: rgba(35, 131, 226, 0.1);

    /* Typography */
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 'Apple Color Emoji', Arial, sans-serif;
    --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --anora-header-padding: 1.5rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Layout */
    --content-narrow: 680px;
    --content-default: 900px;
    --content-wide: 1200px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);

    /* Border Radius */
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
body.dark-mode {
    --notion-white: #191919;
    /* Dark Bg */
    --notion-off-white: #202020;
    --notion-gray-50: #252525;
    --notion-gray-100: #303030;
    --notion-gray-200: #404040;
    --notion-gray-300: #606060;
    --notion-gray-400: #808080;
    --notion-gray-500: #a0a0a0;
    --notion-gray-600: #c0c0c0;
    --notion-gray-700: #d0d0d0;
    --notion-gray-800: #e0e0e0;
    --notion-black: #ffffff;
    /* White Text */

    --anora-header-top-bg: #202020;
    --anora-header-main-bg: #191919;
    --anora-header-bottom-bg: #191919;
}

/* ============================================
   BASE RESET & TYPOGRAPHY
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-system);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--notion-gray-800);
    background-color: var(--notion-white);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--notion-black);
    margin-top: 0;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.75em;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.25em;
}

a {
    color: var(--notion-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

a:hover {
    color: var(--notion-accent-hover);
    text-decoration: none;
    border-bottom-color: transparent;
}

/* ============================================
   LAYOUT
   ============================================ */
.site-content {
    margin-top: 1.5rem;
}



.container {
    width: 100%;
    /* Default container should be wide enough to hold wide content */
    max-width: var(--content-wide);
    /* 1200px */
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Templates */
.content-narrow .site-main {
    max-width: var(--content-narrow);
    margin: 0 auto;
}

.content-wide .site-main {
    max-width: var(--content-wide);
    margin: 0 auto;
}

.content-full .site-main {
    max-width: 100%;
}

.content-centered .site-main {
    margin: 0 auto;
}

/* Sidebar */
.content-area.has-sidebar {
    display: grid;
    gap: var(--space-2xl);
    grid-template-columns: 1fr 300px;
}

.content-area.sidebar-left {
    grid-template-columns: 300px 1fr;
}

/* Site Header */
.site-header {
    background-color: var(--notion-white);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Row Styles */
.header-row,
.footer-row {
    width: 100%;
    /* Default Bg fallback */
    background-color: #fff;
    /* Center Content Vertically in Row */
    display: flex;
    align-items: center;
    /* Prevent layout shift */
}

.header-row {
    border-bottom: 1px solid transparent;
}

/* Apply Header Width */
.builder-header .row-container.container,
.site-footer .row-container.container {
    max-width: var(--anora-header-width, var(--content-wide));
}

.row-top {
    background-color: var(--anora-header-top-bg);
    min-height: var(--anora-header-top-height);
    /* Optional */
}

.row-main {
    background-color: var(--anora-header-main-bg);
    min-height: var(--anora-header-main-height);
}

.row-bottom {
    background-color: var(--anora-header-bottom-bg);
    min-height: var(--anora-header-bottom-height);
}

.row-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Zones */
.header-zone,
.footer-zone {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.zone-left {
    justify-content: flex-start;
    flex: 1;
}

.zone-center {
    justify-content: center;
    flex: 1;
}

.zone-right {
    justify-content: flex-end;
    flex: 1;
}

/* Footer Main Row */
.footer-row.row-main {
    padding: var(--anora-header-padding) 0;
    border-top: 1px solid var(--notion-gray-200);
}

body.dark-mode .footer-row.row-main {
    border-top-color: var(--notion-gray-200);
}

/* Footer Main Row 4-Cols */
.zone-col1,
.zone-col2,
.zone-col3,
.zone-col4 {
    flex: 1;
    min-width: 0;
    /* Prevent overflow */
    justify-content: flex-start;
    /* Default align left, or use specialized alignment? */
    align-self: flex-start;
    /* Top align content */
    padding: 0 15px;
    /* Gutter */
}

/* Optional: Alignments */
.zone-col1 {
    justify-content: flex-start;
}

.zone-col2 {
    justify-content: flex-start;
}

.zone-col3 {
    justify-content: flex-start;
}

.zone-col4 {
    justify-content: flex-start;
}

@media (max-width: 900px) {

    /* Tablet: 2 Columns */
    .footer-row .row-container.container {
        flex-wrap: wrap;
    }

    /* Main Row Zones (Columns) */
    .footer-row.row-main .footer-zone {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 30px;
        padding-right: 15px;
        /* Adjust spacing if needed */
    }

    /* Top/Bottom Rows might still want 100% or stay as is? 
       Usually Top/Bottom are simple. Let's keep them stacking or 100% if needed. 
       The previous rule made ALL .footer-zone 100%. 
       Let's stick to making Top/Bottom 100% for safety on tablet too, or auto.
    */
    .footer-row:not(.row-main) .footer-zone {
        flex: 0 0 100%;
        justify-content: center;
        margin-bottom: 15px;
    }
}

@media (max-width: 600px) {
    /* Mobile: Reset Flexbox completely */

    /* 1. Force the container to be a block, not flex */
    .footer-row .row-container.container,
    .footer-row .row-container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px;
        /* Minimal gutters */
        padding-right: 15px;
        box-sizing: border-box;
    }

    /* 2. Zones: Block, Full Width, No Flex Squeezing */
    .footer-row.row-main .footer-zone,
    .footer-zone {
        display: block !important;
        width: 100% !important;
        flex: none !important;
        max-width: 100% !important;
        margin-bottom: 30px;
        padding: 0 !important;
    }

    /* 3. Reduce Vertical Row Padding */
    .footer-row.row-main {
        padding: 30px 0;
    }

    /* 4. Ensure internal items expand */
    .footer-zone>* {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Footer Element Styles */
.footer-branding {
    width: 100%;
}

/* Ensure footer items expand */
.footer-zone>* {
    max-width: 100%;
    /* Safety */
}

/* Specific fix for branding expanding in flex row */
.footer-zone .footer-branding {
    flex: 1;
    min-width: 0;
    /* Allow text wrapping */
}

.footer-logo-description {
    margin-top: 10px;
    font-size: 0.95rem;
    color: var(--notion-gray-600);
    line-height: 1.5;
}

/* Items */
.header-social .dashicons {
    font-size: 20px;
}


/* Footer Navigation */
.footer-navigation {
    width: 100%;
    text-align: center;
}

.footer-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-navigation li {
    margin-bottom: 6px;
}

.footer-navigation a {
    display: inline-block;
    /* Centered by parent text-align: center */
    padding: 6px 10px;
    color: var(--notion-gray-600);
    text-decoration: none;
    border-radius: 6px;
    font-size: var(--font-size-body-sm);
    font-weight: 500;
    line-height: 1;
    transition: all 0.2s ease;
    /* margin-left removed */
}

.footer-navigation a:hover {
    background-color: var(--notion-gray-100);
    color: var(--notion-black);
}


.anora-search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--notion-gray-600);
    padding: 0;
    display: flex;
    /* Align icon */
    align-items: center;
}

/* Mobile Logic */
.header-mobile-wrapper {
    display: none;
}

@media (max-width: 960px) {
    .header-row.device-desktop {
        display: none;
    }

    .header-mobile-wrapper {
        display: block;
    }

    .header-mobile-wrapper .header-row {
        padding: 14px 0;
        min-height: 60px;
    }

    .header-mobile-wrapper .row-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .header-mobile-wrapper .zone-left {
        flex: 1;
        justify-content: flex-start;
    }

    .header-mobile-wrapper .zone-right {
        flex: 0 0 auto;
        justify-content: flex-end;
    }
}

/* ============================================
   SEARCH UI & MODAL
   ============================================ */
/* Search Trigger (Spotlight Style) */
.header-search-trigger {
    display: flex;
    align-items: center;
    background: var(--notion-gray-50);
    border: 1px solid var(--notion-gray-200);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--notion-gray-500);
    cursor: pointer;
    font-size: 14px;
    gap: 8px;
    min-width: 200px;
    transition: all 0.2s ease;
}

.header-search-trigger:hover {
    background: var(--notion-gray-100);
    border-color: var(--notion-gray-300);
    color: var(--notion-gray-700);
}

.header-search-trigger .search-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--notion-gray-500);
}

.header-search-trigger .search-label {
    flex: 1;
    text-align: left;
}

.header-search-trigger .search-shortcut {
    border: 1px solid var(--notion-gray-200);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    background: #fff;
    color: var(--notion-gray-500);
}

.header-search-trigger .search-shortcut kbd {
    font-family: inherit;
}

/* Dark Mode Toggle */
.header-icon-btn {
    background: transparent;
    border: 1px solid var(--notion-gray-200);
    border-radius: 6px;
    /* Square with rounded corners */
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--notion-gray-600);
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 0;
}

.header-icon-btn .anora-icon {
    width: var(--anora-dark-mode-icon-size, 18px);
    height: var(--anora-dark-mode-icon-size, 18px);
    display: block;
    fill: currentColor;
    line-height: 1;
}

.header-icon-btn:hover {
    background: var(--notion-gray-50);
    color: var(--notion-black);
    border-color: var(--notion-gray-300);
}

/* Tooltip implementation */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    margin-top: 8px;
    /* Spacing below button */
    right: 0;
    left: auto;
    transform: none;
    /* No X transform needed */
    background: var(--notion-black);
    color: var(--notion-white);
    /* Use variable to auto-invert */
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid transparent;
}

/* Dark Mode border adjustment (keep for visibility on dark bg) */
body.dark-mode [data-tooltip]:hover::after {
    border-color: var(--notion-gray-200);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }

    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}


/* ── Search Modal ────────────────────────────────────────────────────────── */
.anora-search-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 12vh;
    padding-left: 16px;
    padding-right: 16px;
    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.anora-search-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.anora-search-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 15, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.anora-search-modal-wrapper {
    position: relative;
    background: var(--notion-white);
    width: 100%;
    max-width: 620px;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /* Animated entrance */
    transform: scale(0.96) translateY(-8px);
    transition: transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.22s ease, background-color var(--transition-fast);
    opacity: 0;
}

body.dark-mode .anora-search-modal-wrapper {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--notion-gray-200);
}

.anora-search-modal.is-open .anora-search-modal-wrapper {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Search Input Bar ─────────────────────────────────────────────────────── */
.anora-search-box {
    border-bottom: 1px solid var(--notion-gray-100);
}

.anora-search-box .search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    width: 100%;
}

.modal-search-icon {
    width: 22px;
    height: 22px;
    color: var(--notion-gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-search-icon .anora-icon {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.anora-search-box .search-field {
    flex: 1;
    border: none;
    font-size: 17px;
    font-weight: 400;
    outline: none;
    color: var(--notion-black);
    background: transparent;
    padding: 0;
    line-height: 1.5;
    min-width: 0;
}

/* Hide native browser clear button */
.anora-search-box .search-field::-webkit-search-cancel-button,
.anora-search-box .search-field::-webkit-search-decoration {
    -webkit-appearance: none;
    display: none;
}

.anora-search-box .search-field::placeholder {
    color: var(--notion-gray-400);
}

.search-clear-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--notion-white);
    border: 1px solid var(--notion-gray-200);
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--notion-gray-500);
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 1px 0 var(--notion-gray-200);
    transition: background 0.12s, color 0.12s;
    line-height: 1.5;
    font-family: inherit;
}

body.dark-mode .search-clear-btn {
    box-shadow: 0 1px 0 var(--notion-gray-100);
}

.search-clear-btn.is-visible {
    display: flex;
}

.search-clear-btn:hover {
    background: var(--notion-gray-200);
    color: var(--notion-gray-700);
}

body.dark-mode .search-clear-btn:hover {
    color: var(--notion-gray-800);
}

.modal-close-btn {
    background: var(--notion-gray-100);
    border: none;
    cursor: pointer;
    color: var(--notion-gray-500);
    padding: 5px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: var(--notion-gray-200);
    color: var(--notion-gray-700);
}

body.dark-mode .modal-close-btn:hover {
    color: var(--notion-gray-800);
}

.modal-close-btn .anora-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

/* ── Quick Links / Suggestions ───────────────────────────────────────────── */
.anora-search-suggestions {
    padding: 12px 14px;
}

.suggestion-group .group-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--notion-gray-400);
    margin: 4px 6px 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: var(--notion-gray-700);
    border-radius: 8px;
    margin-bottom: 2px;
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
}

.suggestion-item::before {
    content: '→';
    font-size: 0.85rem;
    color: var(--notion-gray-300);
    flex-shrink: 0;
}

.suggestion-item:hover,
.suggestion-item.is-active {
    background: var(--notion-gray-50);
    color: var(--notion-black);
}

.suggestion-item:hover::before,
.suggestion-item.is-active::before {
    color: var(--notion-accent);
}

/* ── Footer (keyboard shortcuts) ─────────────────────────────────────────── */
.anora-search-footer {
    padding: 10px 18px;
    background: var(--notion-gray-50);
    border-top: 1px solid var(--notion-gray-100);
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--notion-gray-400);
}

.anora-search-footer .shortcuts {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.anora-search-footer kbd {
    background: var(--notion-white);
    border: 1px solid var(--notion-gray-200);
    border-radius: 5px;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 11px;
    color: var(--notion-gray-500);
    box-shadow: 0 1px 0 var(--notion-gray-200);
}

body.dark-mode .anora-search-footer kbd {
    box-shadow: 0 1px 0 var(--notion-gray-100);
}

/* ── Live Search Result Items ────────────────────────────────────────────── */
.search-result-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-type {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--notion-gray-400);
    text-transform: capitalize;
    background: var(--notion-gray-100);
    border-radius: 4px;
    padding: 2px 6px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Loading / empty state */
.search-state-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 10px 6px;
    color: var(--notion-gray-400);
    font-size: 0.9rem;
}

/* Ask ChatGPT row */
.search-ask-gpt {
    border: 1px solid rgba(16, 163, 127, 0.2) !important;
    background: rgba(16, 163, 127, 0.04) !important;
    margin-top: 6px;
}

.search-ask-gpt:hover {
    background: rgba(16, 163, 127, 0.1) !important;
}

.search-ask-gpt .search-result-type {
    background: rgba(16, 163, 127, 0.12);
    color: #0a7a5e;
}

.search-gpt-icon {
    font-size: 1rem;
    color: #10a37f;
    flex-shrink: 0;
    line-height: 1;
}

/* Spinner */
.search-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--notion-gray-200);
    border-top-color: var(--notion-gray-500);
    border-radius: 50%;
    animation: search-spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes search-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Anora Design System
   ========================================================================== */

/* Grid System */
.anora-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 30px;
}

/* Post Card */
.post-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    height: 100%;
    background: var(--notion-gray-50);
    border: 1px solid var(--notion-gray-100);
    padding: 12px;
}

.post-card:hover {
    transform: translateY(-2px);
}

.post-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2px;
}

.post-title {
    margin-top: 0;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Notiontour Specifics */
.notiontour-single-post .entry-title {
    font-weight: 700;
    letter-spacing: -0.02em;
    max-width: 100%;
}




.notiontour-single-post .entry-lead {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Ensure content fills the grid column */
.notiontour-single-post .entry-content,
.notiontour-single-post .entry-header,
.notiontour-single-post .entry-thumbnail,
.notiontour-page .entry-content,
.notiontour-page .entry-header,
.notiontour-page .entry-thumbnail {
    max-width: 100%;
    width: 100%;
}

.notiontour-single-post .entry-thumbnail,
.notiontour-page .entry-thumbnail {
    overflow: hidden;
    /* Prevent spillover */
    display: block;
    /* Box Design */
    background: var(--notion-gray-50);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--notion-gray-100);
}

.notiontour-single-post .entry-thumbnail img,
.notiontour-page .entry-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}



.anora-post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: var(--content-wide, 1200px);
    /* Use variable for consistency */
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--space-lg);
    /* Match container padding */
}

@media (min-width: 1024px) {
    .anora-post-grid {
        grid-template-columns: 240px minmax(0, 1fr) 280px;
        gap: 2.5rem;
        align-items: start;
        /* Required for sticky children to work */
    }

    /* Left: TOC Box */
    .entry-toc-wrapper {
        background: var(--notion-gray-50);
        padding: 14px;
        /* More compact */
        border-radius: 8px;
        border: 1px solid var(--notion-gray-100);
        height: fit-content;
        /* Sticky removed */
    }

    /* ... existing code ... */

    .toc-header {
        font-size: 1rem;
        color: var(--notion-black);
        font-weight: 700;
        margin-bottom: 0;
        /* Removed default margin */
        text-transform: none;
        /* Match reference */
        cursor: pointer;
        user-select: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .toc-header.toc-open {
        margin-bottom: 16px;
        /* Add margin only when open */
    }


    /* Right: Sidebar Divider */
    .entry-sidebar-wrapper {
        border-left: 1px solid var(--notion-gray-200);
        padding-left: 24px;
        /* Sticky removed */
    }
}



/* Sidebar Optin */
.sidebar-optin {
    background: var(--notion-gray-50);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--notion-gray-100);
}

/* Entry Meta Enhancements */
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.entry-meta .sep {
    color: var(--notion-gray-300);
}

.entry-meta a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.entry-meta a:hover {
    border-color: currentColor;
    color: var(--notion-black);
}

.affiliate-disclaimer {
    font-size: 0.85rem;
    color: var(--notion-gray-400);
}

.optin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.optin-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--notion-black);
    margin: 0;
    padding-right: 10px;
}

.optin-icon .anora-icon {
    width: 32px;
    height: 32px;
    color: var(--notion-accent);
    fill: currentColor;
    transform: rotate(-10deg);
}

.optin-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--notion-gray-200);
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.optin-input:focus {
    border-color: var(--notion-accent);
    outline: none;
}

.optin-submit {
    width: 100%;
    padding: 10px;
    background: var(--notion-accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.optin-submit:hover {
    background: var(--notion-accent-hover);
}



.toc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    /* Removed old border-left */
}

.toc-item a {
    display: block;
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--notion-gray-500, #787774);
    text-decoration: none;
    transition: all 0.2s ease;
}

.toc-item a:hover,
.toc-item.active a {
    color: var(--notion-black, #000);
    font-weight: 500;
}

.toc-h3 a {
    padding-left: 16px;
    font-size: 0.85rem;
}

.toc-header {
    font-size: 1rem;
    color: var(--notion-black);
    font-weight: 700;
    margin-bottom: 0;
    text-transform: none;
    /* Match reference */
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toc-header.toc-open {
    margin-bottom: 16px;
}

.toc-toggle-icon {
    transition: transform 0.2s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--notion-gray-400);
}

.toc-toggle-icon .anora-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.toc-open .toc-toggle-icon {
    transform: rotate(90deg);
}


/* Back to Top */
.anora-scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--notion-white);
    border: 1px solid var(--notion-gray-200);
    box-shadow: var(--shadow-sm);
    color: var(--notion-gray-500);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    pointer-events: none;
    z-index: 999;
}

.anora-scroll-top:hover {
    background: var(--notion-gray-50);
    color: var(--notion-black);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.anora-scroll-top svg,
.anora-scroll-top .anora-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

@media (max-width: 767px) {
    .anora-scroll-top {
        display: none !important;
    }
}

/* Rounded Utilities */
.rounded {
    border-radius: 4px;
}

.rounded-lg {
    border-radius: 8px;
}

/* Text Utilities */
.text-muted {
    color: var(--notion-gray-500, #787774);
}

.text-small {
    font-size: 0.875rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-center {
    text-align: center;
}

/* Spacing */
.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.mt-5 {
    margin-top: 3rem;
}

.pt-5 {
    padding-top: 3rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.entry-divider {
    border: none;
    border-top: 1px solid var(--notion-gray-100);
    width: 100%;
    margin: var(--space-xl) 0;
}

/* Off Canvas (Existing) */
.mobile-offcanvas-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    padding: 20px;
    display: none;
    /* Hide by default (Desktop) */
    flex-direction: column;
}

.mobile-offcanvas-menu.is-open {
    right: 0;
}

.mobile-offcanvas-menu .offcanvas-item {
    margin-bottom: 20px;
}

/* Responsive Header Visibility */
.header-row.device-mobile,
.header-mobile-wrapper {
    display: none;
}

@media (max-width: 960px) {
    .header-row.device-desktop {
        display: none;
    }

    .header-row.device-mobile,
    .header-mobile-wrapper {
        display: block;
    }
}

.site-branding img,
.custom-logo-link img {
    max-width: var(--anora-logo-width, 150px);
    height: auto;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.site-title a {
    color: var(--notion-black) !important;
    text-decoration: none;
    border-bottom: none !important;
}

.site-header.is-sticky {

    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--notion-white);
    border-bottom: 1px solid var(--notion-gray-100);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Admin Bar Offset */
.admin-bar .site-header.is-sticky {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .site-header.is-sticky {
        top: 46px;
    }
}


@media (max-width: 600px) {
    .admin-bar .site-header.is-sticky {
        top: 0;
    }
}


/* Sidebar Widgets */
.sidebar-widget {
    margin-top: 2rem;
    /* Reduced top margin since it's now a box */
    padding: 20px;
    background: var(--notion-gray-50);
    border-radius: 8px;
    border: 1px solid var(--notion-gray-100);
}

.latest-posts-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}


.widget-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--notion-gray-400);
    margin-bottom: 1rem;
}

.latest-post-item {
    margin-bottom: 1rem;
}

.latest-post-item:last-child {
    margin-bottom: 0;
}

.latest-post-item a {
    display: block;
    font-weight: 600;
    color: var(--notion-black);
    text-decoration: none;
    line-height: 1.4;
    font-size: 0.95rem;
    transition: color 0.15s ease;
}

.latest-post-item a:hover {
    color: var(--wp--preset--color--primary);
}

.latest-post-item .text-muted {
    font-size: 0.8rem;
    color: var(--notion-gray-400);
    margin-top: 4px;
}



.site-header .container {

    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navigation */
.main-navigation {
    display: block;
}

.main-navigation ul {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    display: block;
    padding: var(--space-xs) var(--space-sm);
    color: var(--notion-gray-600);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
    text-decoration: none;
}

.main-navigation a:hover {
    color: var(--notion-black);
}

/* Dropdown indicator for items with submenus */
.main-navigation li.menu-item-has-children>a {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-navigation li.menu-item-has-children>a::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23999'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.main-navigation li.menu-item-has-children:hover>a::after {
    transform: rotate(180deg);
}

/* Dropdown Submenus */
.main-navigation li {
    position: relative;
}

.main-navigation ul ul.sub-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--notion-white);
    border: 1px solid var(--notion-gray-100);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xs) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 999;
}

.main-navigation li:hover>ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Submenu items */
.main-navigation ul ul.sub-menu li {
    position: relative;
}

.main-navigation ul ul.sub-menu a {
    padding: 8px 16px;
    font-size: 0.9rem;
    color: var(--notion-gray-600);
    white-space: nowrap;
    border-radius: 0;
}

.main-navigation ul ul.sub-menu a:hover {
    color: var(--notion-black);
    background: var(--notion-gray-50);
}

/* Nested submenus (level 3+) open to the right */
.main-navigation ul ul.sub-menu ul.sub-menu {
    top: 0;
    left: 100%;
    margin-left: 2px;
}

/* Mobile Toggle (Hidden on Desktop) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0;
    font-weight: 600;
    color: var(--notion-gray-600);
    cursor: pointer;
}

/* ============================================
   NOTION COMPONENTS
   ============================================ */
/* ... (Existing Notion Components) ... */

/* Responsive */
@media (max-width: 960px) {

    /* Branding / Layout */
    .site-header {
        padding: var(--space-sm) 0;
    }

    .site-header .container {
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }

    /* Navigation */
    .menu-toggle {
        display: block;
        /* Show Toggle */
        order: 2;
        margin-left: auto;
    }

    .site-branding {
        order: 1;
        margin-right: var(--space-md);
    }

    .header-actions {
        display: none;
        /* Hide standard actions on mobile if offcanvas is used */
    }

    .main-navigation {
        order: 4;
        width: 100%;
    }

    .main-navigation ul {
        display: flex;
        /* Always visible list */
        flex-direction: column;
        gap: 0;
        background: var(--notion-gray-50);
        padding: var(--space-md);
        border-radius: var(--radius-md);
        margin-top: var(--space-md);
    }

    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid var(--notion-gray-100);
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        padding: var(--space-md) var(--space-xs);
    }

    .content-area.has-sidebar {
        grid-template-columns: 1fr;
    }

    .mobile-offcanvas-menu {
        display: flex;
        /* Activate on Mobile */
    }
}

/* Author Box */
.author-box .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

@media (min-width: 768px) {
    .author-box .avatar {
        width: 100px;
        height: 100px;
    }
}

.author-social .anora-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    opacity: 0.6;
    transition: all 0.2s;
}

.author-social a:hover .anora-icon {
    opacity: 1;
    color: var(--notion-black);
}

.hover-text-dark:hover {
    color: var(--notion-black) !important;
}

/* Post Images Box Design */
.entry-content figure.wp-block-image {
    margin: 2rem 0;
    padding: 10px;
    /* Smaller padding for images */
    background: var(--notion-gray-50);
    border-radius: 8px;
    border: 1px solid var(--notion-gray-100);
}

.entry-content figure.wp-block-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    /* Inner radius */
}

/* Also target plain images if they aren't in figures */
.entry-content>img {
    margin: 2rem 0;
    padding: 10px;
    background: var(--notion-gray-50);
    border-radius: 8px;
    border: 1px solid var(--notion-gray-100);
    width: auto;
    /* Allow auto width */
    max-width: 100%;
}

/* Pagination Styling */
.pagination-wrapper {
    margin-top: 3rem;
    text-align: center;
}

.page-numbers {
    display: inline-block;
    padding: 8px 16px;
    background: var(--notion-gray-50);
    border: 1px solid var(--notion-gray-100);
    border-radius: 6px;
    color: var(--notion-black);
    text-decoration: none;
    margin: 0 4px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.page-numbers:hover {
    background: var(--notion-gray-100);
    border-color: var(--notion-gray-200);
    color: var(--notion-black);
    text-decoration: none;
    border-bottom-color: var(--notion-gray-200);
    /* override default link hover */
}

.page-numbers.current {
    background: var(--notion-black);
    color: var(--notion-white);
    border-color: var(--notion-black);
}

.page-numbers.dots {
    background: transparent;
    border-color: transparent;
    padding-left: 0;
    padding-right: 0;
}

/* Author Box Styling */
.entry-author-box {
    background: var(--notion-gray-50);
    border: 1px solid var(--notion-gray-100);
    padding: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.entry-author-box .author-avatar {
    flex-shrink: 0;
}

.entry-author-box .avatar-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--notion-gray-200);
}

.entry-author-box .author-info {
    flex-grow: 1;
}

.entry-author-box .author-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--notion-gray-500);
    margin-bottom: 4px;
}

.entry-author-box .author-name {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.entry-author-box .author-name a {
    color: inherit;
    text-decoration: none;
}

.entry-author-box .author-bio {
    font-size: 0.95rem;
    color: var(--notion-gray-600);
    margin-bottom: 12px;
}

.entry-author-box .author-social {
    display: flex;
    gap: 12px;
}

.entry-author-box .author-social a {
    color: var(--notion-gray-400);
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.entry-author-box .author-social a:hover {
    color: var(--notion-black);
}

@media (max-width: 640px) {
    .entry-author-box {
        flex-direction: column;
        text-align: center;
    }

    .entry-author-box .author-social {
        justify-content: center;
    }
}

/* Notiontour Homepage Header */
.notion-home-header-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

@media (min-width: 960px) {
    .notion-home-header-grid {
        grid-template-columns: 1fr 400px;
        /* Content takes space, newsletter fixed width */
        gap: 60px;
    }
}

.notion-home-header-grid .hero-title {
    font-size: clamp(2rem, 5vw + 1rem, 3rem);
    font-weight: 800;
    margin-bottom: 0.25em;
    letter-spacing: -0.03em;
}

.notion-home-header-grid .hero-description {
    font-size: clamp(1rem, 2vw + 1rem, 1.25rem);
    line-height: 1.6;
    max-width: 600px;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
    .anora-hero.section-padding {
        padding-top: 2rem !important;
        padding-bottom: 1rem !important;
    }
}

/* Reuse existing sidebar-optin styles, just ensuring it looks good in header */
.header-newsletter .sidebar-optin {
    background: var(--notion-white);
    border: 1px solid var(--notion-gray-200);
    box-shadow: var(--shadow-sm);
}



.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    gap: 30px;
}

@media (min-width: 1024px) {
    .series-grid {
        grid-template-columns: repeat(4, 1fr);
        /* Force 4 columns on large screens */
    }
}

.series-card {
    background: var(--notion-white);
    border: 1px solid var(--notion-gray-200);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.series-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.series-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.series-thumbnail img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.series-content {
    padding: 1rem;
}

.series-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.series-excerpt,
.post-excerpt {
    font-size: 0.85rem;
    color: var(--notion-gray-500);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   RESPONSIVE HEADER & FOOTER FIXES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.site-title {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
}

@media (max-width: 960px) {

    .site-branding img,
    .custom-logo-link img {
        max-width: 120px;
    }
}

/* Dark Mode Logo Toggling */
body.dark-mode .logo-light:not(.logo-only) {
    display: none !important;
}

body.dark-mode .logo-dark {
    display: block !important;
}