/* Main Styles */

body {
    font-family: "Inter", sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
}

html,
body {
    overflow-x: hidden;
}

/* Define primary color as a CSS variable */
:root {
    --primary-color: rgba(126,36,34,1);
    --primary-color-light-hover: rgba(126,36,34,0.1);
    --primary-color-dark-hover: rgba(126,36,34,0.9);
    --mobile-header-height: 3.5rem;
}

.directory-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 112px;
    padding: 0.85rem 1.2rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.directory-action-btn--primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 14px 30px rgba(126, 36, 34, 0.14);
}

.directory-action-btn--primary:hover,
.directory-action-btn--primary:focus-visible {
    background-color: rgba(126, 36, 34, 0.88);
    transform: translateY(-1px);
}

.directory-action-btn--secondary {
    background-color: white;
    color: #334155;
    border-color: #cbd5e1;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.directory-action-btn--secondary:hover,
.directory-action-btn--secondary:focus-visible {
    background-color: #f8fafc;
    transform: translateY(-1px);
}

.directory-action-btn:focus-visible {
    outline: 2px solid rgba(126, 36, 34, 0.25);
    outline-offset: 2px;
}

/* Custom styles for the mobile menu transition */
.mobile-menu {
    position: fixed;
    inset: var(--mobile-header-height) 0 0;
    z-index: 40;
    padding: 0.75rem 1rem 1rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.38));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.mobile-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-panel {
    max-width: 32rem;
    margin: 0 auto;
    max-height: calc(100dvh - var(--mobile-header-height) - 1.5rem);
    overflow-y: auto;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(18px);
}

.mobile-menu-panel button {
    min-height: 2.875rem;
}

/* Styles for mobile submenu (accordion) */
.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #f8f8f8;
    border-radius: 0.75rem;
}
.mobile-submenu.open {
    max-height: 32rem;
    transition: max-height 0.5s ease-in;
}
.mobile-submenu-item {
    padding-left: 2.5rem;
}

body.mobile-menu-open {
    overflow: hidden;
    touch-action: none;
}

/* Aspect ratio for map embed */
.aspect-w-16 {
    position: relative;
    width: 100%;
}
.aspect-w-16.aspect-h-9::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 9 / 16 * 100 */
}
.aspect-w-16 iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Custom scrollbar for video list */
.video-list-scroll {
    /* max-height removed, will use flex-grow */
    overflow-y: auto;
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: var(--primary-color) #f1f1f1; /* For Firefox */
}
.video-list-scroll::-webkit-scrollbar {
    width: 8px;
}
.video-list-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.video-list-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}
.video-list-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color-dark-hover);
}

/* Styles for truncated video description with scrollbar */
.video-description-scroll {
    max-height: 200px; /* Limit height and enable scrolling */
    overflow-y: auto;
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: var(--primary-color) #f1f1f1; /* For Firefox */
    padding-right: 8px; /* Add some padding to prevent scrollbar from touching text */
}
.video-description-scroll::-webkit-scrollbar {
    width: 8px;
}
.video-description-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.video-description-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}
.video-description-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color-dark-hover);
}

/* Desktop Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 0.375rem; /* rounded-md */
    overflow: hidden; /* Ensures rounded corners apply to children */
}

/* Apply flexbox to dropdown content buttons for alignment */
.dropdown-content button {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: flex; /* Changed from block */
    align-items: center; /* Vertically align icon and text */
    gap: 8px; /* Add space between icon and text */
    text-align: left;
    width: 100%;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-content button:hover {
    background-color: var(--primary-color-light-hover);
    color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Page Transition Styles */
.page-transition-container {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.page-exit-active {
    opacity: 0;
}

.page-enter-active {
    opacity: 1;
}

.prose {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.prose img,
.prose iframe,
.prose video,
.prose table {
    max-width: 100%;
}

.prose table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

@media (min-width: 640px) {
    :root {
        --mobile-header-height: 4rem;
    }
}

@media (max-width: 820px) {
    header .md\:block {
        display: none !important;
    }

    header .md\:hidden {
        display: block !important;
    }

    header {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    footer .flex.items-center {
        justify-content: center;
        text-align: center;
        flex-wrap: wrap;
    }

    .dropdown-content {
        min-width: 13rem;
    }
}

@media (max-width: 767px) {
    footer .flex.items-center {
        justify-content: center;
        text-align: center;
        flex-wrap: wrap;
    }

    .dropdown-content {
        min-width: 13rem;
    }
}

/* Blog article specific typography and layout under post viewer */
#post-article-body.prose, .prose#post-article-body {
    color: #1f2937; /* slate-800 */
    line-height: 1.78;
    font-size: 1rem;
}

#post-article-body.prose h1,
#post-article-body.prose h2,
#post-article-body.prose h3,
#post-article-body.prose h4 {
    color: #0f172a; /* slate-900 */
    line-height: 1.2;
    margin-top: 1.6rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
}

#post-article-body.prose h1 { font-size: 1.8rem; }
#post-article-body.prose h2 { font-size: 1.45rem; }
#post-article-body.prose h3 { font-size: 1.2rem; }

#post-article-body.prose p {
    margin: 0.9rem 0;
    color: #374151; /* slate-700 */
    font-size: 1.02rem;
}

#post-article-body.prose p + h2,
#post-article-body.prose p + h3 {
    margin-top: 1.2rem;
}

#post-article-body.prose ul,
#post-article-body.prose ol {
    margin: 0.75rem 0 0.75rem 1.25rem;
    padding: 0;
    color: #374151;
}

#post-article-body.prose li {
    margin: 0.45rem 0;
}

#post-article-body.prose blockquote {
    border-left: 4px solid rgba(126,36,34,0.12);
    background: rgba(126,36,34,0.03);
    padding: 0.9rem 1rem;
    margin: 1rem 0;
    color: #0f172a;
    font-style: italic;
    border-radius: 0.375rem;
}

.pull-quote blockquote,
#post-article-body.prose .pull-quote {
    max-width: 52rem;
    margin: 1.25rem auto;
    text-align: center;
}

#post-article-body.prose img {
    display: block;
    margin: 1rem auto;
    border-radius: 0.5rem;
    box-shadow: 0 6px 18px rgba(15,23,42,0.06);
}

/* Figures generated from [IMG]...[/IMG] */
.post-figure {
    text-align: center;
    margin: 1rem 0;
}
.post-figure img {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
}

#post-article-body.prose figure {
    margin: 1rem 0;
}

#post-article-body.prose pre,
#post-article-body.prose code {
    background: #0f172a10;
    padding: 0.45rem 0.6rem;
    border-radius: 0.375rem;
    overflow-x: auto;
}

#post-article-body.prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

#post-article-body.prose table th,
#post-article-body.prose table td {
    border: 1px solid #e6e9ee;
    padding: 0.6rem 0.75rem;
    text-align: left;
}

/* Sidebar blocks inside article content (e.g., .sidebar) */
#post-article-body.prose .sidebar {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    padding: 1rem;
    border-radius: 0.75rem;
    margin: 1rem 0;
}

@media (min-width: 1024px) {
    #post-article-body.prose h1 { font-size: 2rem; }
    #post-article-body.prose { font-size: 1.03rem; }
}

/* Remove the visible border around the main article card while keeping layout */
#post-article-inner {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Sidebar / Fact Box styling inside article content */
#post-article-body.prose .sidebar,
#post-article-body.prose .fact-box {
    background: #fff6f4; /* subtle warm background */
    border: 1px solid rgba(126,36,34,0.12);
    padding: 1rem 1.1rem;
    border-radius: 0.75rem;
    color: #0f172a;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.98rem;
    line-height: 1.6;
    margin: 1rem 0;
}

#post-article-body.prose .fact-box h3,
#post-article-body.prose .sidebar h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    color: #7e2422;
    margin-top: 0;
}

