/* Custom Styles for AISA Intelligent Data Room */

/* Global font */
body {
    font-family: "Avenir Next", "Avenir", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Header logo */
.header-logo {
    display: block;
}

/* Section Box Styles */
.section-box {
    background-color: #1f2937; /* gray-800 */
    border: 1px solid #374151; /* gray-700 */
    border-radius: 0.5rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 150ms ease-in-out;
}

.section-box:hover {
    border-color: #6b7280; /* gray-500 */
    background-color: #1a1f2e; /* slightly lighter than gray-800 */
}

.section-box:active {
    transform: scale(0.98);
}

.section-box.active {
    border-color: #6b7280; /* gray-500 */
    background-color: #1a1f2e;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

.section-box .box-content {
    text-align: center;
}

.section-box .box-content h3 {
    color: white;
    font-size: 1.3125rem;
}

.section-box .box-content p {
    font-size: 0.9375rem;
}

/* Subsection Tab Styles */
.subsection-tab {
    padding: 0.5rem 1rem;
    background-color: #1f2937; /* gray-800 */
    border: 1px solid #374151; /* gray-700 */
    border-radius: 0.25rem;
    color: #d1d5db; /* gray-300 */
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 150ms ease-in-out;
}

.subsection-tab:hover {
    background-color: #374151; /* gray-700 */
    border-color: #4b5563; /* gray-600 */
}

.subsection-tab.active {
    background-color: #374151; /* gray-700 */
    border-color: #6b7280; /* gray-500 */
    color: white;
}

/* ========== Feature panel content (injected via script.js) ========== */
/* Panel title: image by default; text when section selected */
#featureTitle {
    text-align: center;
}

/* Full-width image: spans full width of feature panel, responsive on all devices */
#featureTitle .feature-title-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    object-fit: contain;
    object-position: center;
}

#featureTitle .feature-title-fallback {
    display: none;
}

#featureTitle .feature-title-fallback--visible {
    display: block;
}

#featureTitle .feature-title-text {
    display: none;
}

#featureTitle.has-section .feature-title-image,
#featureTitle.has-section .feature-title-fallback,
#featureTitle.has-section .feature-title-fallback--visible {
    display: none !important;
}

#featureTitle.has-section .feature-title-text {
    display: block;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
}

#featureContent {
    line-height: 1.65;
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: 1.0625rem;
}

/* Lists and resource rows: left-aligned for readability within the centered panel */
#featureContent .content-doc-list,
#featureContent .feature-bullet-list,
#featureContent .resource-list,
#featureContent .content-resource-list {
    text-align: left;
}

/* Centre the Overview \"Round Details\" block while keeping lines readable */
#featureContent .feature-round-details-list {
    text-align: center;
    list-style-position: inside;
    padding-left: 0;
}

#featureContent .feature-round-details-list li {
    padding-left: 0;
}

/* Base: typography and spacing for scannable, investor-grade reading */

#featureContent p {
    margin-bottom: 1rem;
    color: #9ca3af;
}

#featureContent p:last-child {
    margin-bottom: 0;
}

/* Logical section wrapper — use for grouping subsections */
#featureContent .feature-section {
    margin-bottom: 1.5rem;
}

#featureContent .feature-section:last-child {
    margin-bottom: 0;
}

/* Subsection headings */
#featureContent .feature-heading,
#featureContent .feature-subheading {
    font-weight: 600;
    color: #e5e7eb;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

#featureContent .feature-heading {
    font-size: 1.0625rem;
    margin-top: 1.5rem;
    color: #d1d5db;
}

#featureContent .feature-heading:first-child {
    margin-top: 0;
}

#featureContent .feature-subheading {
    font-size: 0.9375rem;
    margin-top: 1rem;
    color: #9ca3af;
}

/* Intro / lead paragraphs */
#featureContent .feature-intro {
    margin-bottom: 1.25rem;
    color: #b1b5bb;
}

/* Bullet lists */
#featureContent .content-doc-list,
#featureContent .feature-bullet-list {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0 0 1rem 0;
    color: #9ca3af;
}

#featureContent .content-doc-list li,
#featureContent .feature-bullet-list li {
    margin-bottom: 0.35rem;
    padding-left: 0.25rem;
}

/* Note box — “Available on request” / subtle callouts */
#featureContent .note-box,
#featureContent .content-note {
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    background-color: rgba(31, 41, 55, 0.5);
    color: #6b7280;
    font-size: 0.9375rem;
    line-height: 1.5;
}

#featureContent .note-box {
    border-left: 3px solid #4b5563;
}

/* Coming Soon — Concierge panel */
#featureContent .coming-soon-box,
#featureContent .content-note--highlight {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    background-color: rgba(55, 65, 81, 0.25);
    color: #9ca3af;
    font-size: 1rem;
}

#featureContent .coming-soon-box {
    border-left: 3px solid #6b7280;
}

#featureContent .coming-soon-box strong {
    color: #d1d5db;
}

/* CTA block (e.g. Contact) */
#featureContent .content-cta {
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    background-color: rgba(31, 41, 55, 0.5);
}

/* Resource list — document / link rows */
#featureContent .resource-list,
#featureContent .content-resource-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 1rem 0;
}

#featureContent .resource-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#featureContent .resource-item,
#featureContent .content-resource-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid #374151;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

#featureContent .resource-item:hover,
#featureContent .content-resource-item:hover {
    border-color: #4b5563;
    background-color: rgba(55, 65, 81, 0.35);
}

#featureContent .resource-link,
#featureContent .content-resource-link {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}

#featureContent .resource-link:hover,
#featureContent .content-resource-link:hover {
    color: #c7d2fe;
    text-decoration: underline;
}

#featureContent .resource-label,
#featureContent .content-resource-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: auto;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Scrollbar styling */
.overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background-color: #111827; /* gray-900 */
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background-color: #374151; /* gray-700 */
    border-radius: 4px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background-color: #4b5563; /* gray-600 */
}

/* ========== Mobile layout (max-width: 768px) ========== */
/* Goal: natural page scroll, visible feature panel, compact 3x3 grid, no viewport trap */
@media (max-width: 768px) {
    /* Allow full page scroll; remove viewport lock */
    body.body-layout {
        min-height: 100vh;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Main container: natural height, no flex viewport calc */
    .main-layout {
        height: auto;
        min-height: 0;
        overflow: visible;
        flex: none;
    }

    /* Header: compact, stable */
    .site-header {
        height: 3.5rem;
        flex-shrink: 0;
        padding: 0 1rem;
    }

    .site-header img {
        height: 1.5rem;
    }

    .site-header span {
        font-size: 0.9375rem;
    }

    /* Feature panel: always visible, constrained height with internal scroll */
    .feature-panel {
        flex: none;
        min-height: 12rem;
        max-height: 42vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid #1f2937;
    }

    .feature-panel-title {
        flex-shrink: 0;
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        letter-spacing: 0.05em;
    }

    .feature-panel-content {
        flex: 1;
        min-height: 6rem;
        overflow-y: auto;
        padding: 0.5rem 1rem;
        font-size: 0.9375rem;
        -webkit-overflow-scrolling: touch;
    }

    /* Feature content typography: legible on mobile */
    #featureContent .feature-heading {
        margin-top: 1rem;
        font-size: 0.9375rem;
    }

    #featureContent p {
        margin-bottom: 0.75rem;
        font-size: 0.9375rem;
    }

    #featureContent .resource-item,
    #featureContent .content-resource-item {
        padding: 0.5rem 0.75rem;
    }

    #featureContent .resource-link,
    #featureContent .content-resource-link {
        font-size: 0.9375rem;
    }

    #featureContent .note-box,
    #featureContent .content-note {
        font-size: 0.875rem;
    }

    /* Section grid: less padding, smaller gap, generous bottom padding so last row is fully visible */
    .section-grid {
        padding: 0.75rem 0.5rem 3rem;
        flex-shrink: 0;
    }

    .section-grid-inner {
        gap: 0.375rem;
        min-height: 0;
    }

    /* Grid cards: compact, square-ish, smaller type */
    .section-box {
        padding: 0.5rem 0.375rem;
        border-radius: 0.375rem;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .section-box .box-content {
        width: 100%;
        min-width: 0;
        text-align: center;
    }

    .section-box .box-content h3 {
        font-size: 0.75rem;
        font-weight: 600;
        margin-bottom: 0.15rem;
        line-height: 1.2;
        color: white;
    }

    .section-box .box-content p {
        font-size: 0.625rem;
        line-height: 1.25;
        color: #9ca3af;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* ========== Very small screens (max-width: 480px) ========== */
@media (max-width: 480px) {
    .site-header {
        height: 3rem;
    }

    .site-header span {
        font-size: 0.875rem;
    }

    .feature-panel {
        min-height: 10rem;
        max-height: 38vh;
    }

    .feature-panel-title {
        font-size: 0.8125rem;
    }

    .feature-panel-content {
        font-size: 0.875rem;
    }

    #featureContent .feature-heading {
        font-size: 0.875rem;
    }

    #featureContent p {
        font-size: 0.875rem;
    }

    #featureContent .resource-link,
    #featureContent .content-resource-link {
        font-size: 0.875rem;
    }

    .section-grid {
        padding: 0.5rem 0.375rem 3rem;
    }

    .section-grid-inner {
        gap: 0.25rem;
    }

    .section-box {
        padding: 0.375rem 0.25rem;
    }

    .section-box .box-content h3 {
        font-size: 0.6875rem;
    }

    .section-box .box-content p {
        font-size: 0.5625rem;
        -webkit-line-clamp: 1;
    }
}

