/* Fyreside – Light minimal theme, mobile-first */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,800;1,9..144,400&display=swap');

/* Mobile-first: 18px base for readability on budget phones */
html {
    scroll-behavior: smooth;
    font-size: 18px;
}
@media (min-width: 768px) {
    html { font-size: 16px; }
}
::selection { background: rgba(194, 83, 58, 0.15); color: #2D2A26; }

/* Minimum tap target: 48px for all interactive elements on mobile */
@media (max-width: 767px) {
    a, button { min-height: 48px; }
    input, select, textarea { min-height: 52px; font-size: 16px; }
}

/* Sticky bottom CTA bar for course/event detail pages on mobile */
.mobile-sticky-cta {
    display: none;
}
@media (max-width: 1023px) {
    .mobile-sticky-cta {
        display: block;
        position: fixed;
        bottom: 64px; /* above the mobile nav bar */
        left: 0;
        right: 0;
        z-index: 40;
        background: #fff;
        border-top: 1px solid #E8E6E1;
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    }
    /* Hide the desktop sidebar pricing on mobile when sticky CTA is active */
    .desktop-sidebar-pricing {
        display: none;
    }
    /* Extra bottom padding for main content so sticky CTA doesn't overlap */
    .has-sticky-cta {
        padding-bottom: 100px;
    }
}
@media (min-width: 1024px) {
    .desktop-sidebar-pricing {
        display: block;
    }
}

/* Display heading font */
.heading-display, .font-display {
    font-family: 'Fraunces', Georgia, serif;
}

/* Subtle glow for primary buttons on hover */
.btn-terra {
    transition: all 0.2s ease;
}
.btn-terra:hover {
    box-shadow: 0 4px 14px rgba(194, 83, 58, 0.25);
}

/* Card hover lift */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(194, 83, 58, 0.2);
}

/* Custom scrollbar for light theme */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #F5F4F1; }
::-webkit-scrollbar-thumb { background: #D4D1CB; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9C9890; }

/* Focus ring override */
input:focus, select:focus, textarea:focus, button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(194, 83, 58, 0.3);
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.5s ease;
}

/* Accordion transition */
.accordion-body {
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

/* Terra gradient text */
.text-terra-gradient {
    background: linear-gradient(135deg, #E26B4A, #C2533A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Prose styling for light theme — mobile-first reading comfort */
.prose-warm {
    color: #5C5955;
    line-height: 1.8;
    font-size: 1rem;
    word-break: break-word;
}
.prose-warm > *:first-child { margin-top: 0; }
.prose-warm > *:last-child { margin-bottom: 0; }
.prose-warm h1 {
    color: #2D2A26;
    font-weight: 700;
    font-size: 1.5em;
    margin-top: 1.75em;
    margin-bottom: 0.6em;
    line-height: 1.3;
}
.prose-warm h2 {
    color: #2D2A26;
    font-weight: 700;
    font-size: 1.3em;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.35;
}
.prose-warm h3 {
    color: #2D2A26;
    font-weight: 600;
    font-size: 1.15em;
    margin-top: 1.4em;
    margin-bottom: 0.5em;
    line-height: 1.4;
}
.prose-warm h4 {
    color: #3D3A36;
    font-weight: 600;
    font-size: 1em;
    margin-top: 1.3em;
    margin-bottom: 0.4em;
}
.prose-warm p { margin-bottom: 1.1em; }
.prose-warm a { color: #C2533A; text-decoration: underline; text-underline-offset: 2px; }
.prose-warm a:hover { color: #A3402D; }
.prose-warm strong { color: #3D3A36; font-weight: 600; }
.prose-warm em { font-style: italic; }
.prose-warm ul, .prose-warm ol { padding-left: 1.5em; margin-bottom: 1.1em; }
.prose-warm ul { list-style-type: disc; }
.prose-warm ol { list-style-type: decimal; }
.prose-warm li { margin-bottom: 0.35em; line-height: 1.7; }
.prose-warm li > ul, .prose-warm li > ol { margin-top: 0.35em; margin-bottom: 0; }
.prose-warm blockquote {
    border-left: 3px solid #C2533A;
    padding: 0.75em 1em;
    margin: 1.25em 0;
    color: #5C5955;
    background: #FAFAF8;
    border-radius: 0 0.5em 0.5em 0;
    font-style: italic;
}
.prose-warm blockquote p:last-child { margin-bottom: 0; }
.prose-warm code {
    background: #F5F4F1;
    padding: 0.15em 0.4em;
    border-radius: 0.25em;
    font-size: 0.88em;
    color: #C2533A;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.prose-warm pre {
    background: #2D2A26;
    color: #E8E6E1;
    padding: 1.25em;
    border-radius: 0.75em;
    overflow-x: auto;
    margin: 1.25em 0;
    font-size: 0.88em;
    line-height: 1.6;
}
.prose-warm pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.prose-warm hr {
    border: none;
    border-top: 1px solid #E8E6E1;
    margin: 1.75em 0;
}
.prose-warm img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5em;
    margin: 1em 0;
}
.prose-warm table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25em 0;
    font-size: 0.95em;
}
.prose-warm th, .prose-warm td {
    border: 1px solid #E8E6E1;
    padding: 0.5em 0.75em;
    text-align: left;
}
.prose-warm th {
    background: #F5F4F1;
    font-weight: 600;
    color: #3D3A36;
}

/* Text-only lessons: hero layout with no video above */
.lesson-text-hero {
    margin-top: 0;
}

/* Mobile bottom nav safe area */
.mobile-nav {
    padding-bottom: env(safe-area-inset-bottom);
}

/* ============================================
   Portrait-mode video player for mobile
   ============================================ */

/* Video container — 16:9 on desktop, taller on portrait mobile */
.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 default */
    background: #000;
    border-radius: 0.75rem;
    overflow: hidden;
}

@media (max-width: 767px) and (orientation: portrait) {
    .video-container {
        padding-top: 75%; /* 4:3 ratio — taller for portrait viewing */
        border-radius: 0;
    }

    /* In the lesson player, remove horizontal padding so video is edge-to-edge */
    .lesson-video-wrapper {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        margin-top: -1.5rem;
    }
}

/* Portrait video — aspect ratio set dynamically via JS --video-ratio */
.video-container.portrait-video {
    padding-top: 0;
    aspect-ratio: var(--video-ratio, 9/16);
    max-height: 70vh;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Fullscreen button overlay */
.video-fullscreen-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.video-fullscreen-btn:hover,
.video-fullscreen-btn:active {
    background: rgba(0, 0, 0, 0.8);
}

/* Only show fullscreen button on mobile/tablet */
@media (min-width: 1024px) {
    .video-fullscreen-btn {
        display: none;
    }
}

/* Orientation hint toast */
.orientation-hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    pointer-events: none;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Lesson player: video takes most of the screen on mobile */
@media (max-width: 767px) {
    .lesson-content-mobile {
        padding: 0;
    }

    .lesson-content-mobile .lesson-info {
        padding: 1rem 1rem 0;
    }

    .lesson-content-mobile .lesson-text {
        margin: 0 1rem 1rem;
        padding: 1.25rem;
    }

    .lesson-content-mobile .lesson-divider {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .lesson-content-mobile .lesson-attachment {
        padding: 0 1rem 1rem;
    }
}

/* Preview video container on course detail — edge-to-edge on mobile */
@media (max-width: 767px) and (orientation: portrait) {
    .preview-video-wrapper {
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .preview-video-wrapper .video-container {
        border-radius: 0;
    }
}
