/* Highlighted course (hero): left title/text/button, right cover image, with a
 * dark indigo divider underneath - matches the Figma "Tananyagok" layout. */

.highlighted-course {
    display: flex;
    flex-direction: row;
    gap: var(--spacing);
    align-items: center;
    border-bottom: 4px solid var(--secondary-color);
    padding-bottom: var(--spacing);
    margin-bottom: var(--spacing);
}

.h-course-info {
    flex: 1 1 0;
    min-width: 0;
}

/* The hero / empty-state heading is the page-level <h1> for SEO (one h1 per
 * page), but it must look exactly like the surrounding h2s, not the 45px
 * "Awesome Newbie" display h1 from elements.css. Re-apply the h2 typography
 * (Balo 30px); margin/color/weight already match via the global reset. */
.h-course-info h1 {
    font-family: 'Balo', sans-serif;
    font-size: 30px;
}

.h-course-info-description {
    margin: calc(var(--spacing)/2) 0;
}

.h-course-image {
    flex: 0 0 auto;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--light-color);
}

.h-course-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .highlighted-course {
        flex-direction: column;
        align-items: stretch;
    }
    .h-course-image {
        max-width: 100%;
    }
}


/*
Course cards (Figma): the cover image fills the top of the card, and a dark
indigo bar sits only at the bottom with the title + the gold action button.
The card itself is light, not a solid blue box.
*/

.course {
    display: flex;
    flex-direction: column;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--dark-shadow-color);
    overflow: hidden;
    height: 100%;
}

.course-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--light-color);
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback when a course has no cover yet. */
.course-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    opacity: 0.35;
}
.course-image-placeholder .material-icons { font-size: 64px; }

.course-info {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing) / 3);
    flex: 1 1 auto;
    background-color: var(--secondary-color);
    color: var(--background-color);
    padding: var(--horizontal-spacing);
}

.course-info h3 {
    margin: 0;
    line-height: 1.15;
}

/* The action button is pushed to the bottom so every card's button aligns. */
.course-info .btn {
    margin-top: auto;
}

/* The "Adatlap" secondary link sits on the dark-navy card body, where the default
   text-only navy is unreadable. Use the light title tone + underline so it still
   reads as a link (Gery 12379: keep the navy card, fix the label). ~14:1 on #232153. */
.course-datasheet-link.btn.text-only {
    color: var(--background-color);
    text-decoration: underline;
}
.course-datasheet-link.btn.text-only:hover {
    opacity: 0.8;
}

/* Course CTA: the unlock form and the secondary buttons previously had no layout
   and flowed inline, so the "Megveszem a dobozt" button overlapped the input row
   (Gery 2026-11-19 teszt, 3. kep). Stack them with clear spacing; the unlock form
   itself is a wrapping row so the label+input+button never collide and it reflows
   on narrow screens. */
.course-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: calc(var(--spacing) / 2);
}
.course-cta .unlock-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: calc(var(--spacing) / 3);
    width: 100%;
}
.course-cta .unlock-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 200px;
    min-width: 0;
}
.course-cta .unlock-form input {
    width: 100%;
}
.course-cta .unlock-form .p1-error {
    flex-basis: 100%;
    margin: 0;
}


/* Course view styles */


/* Progress bar */

.course-progress-bar {
    width: 100%;
    height: fit-content;
    display: grid;
    grid-template-columns: 1fr min-content;
    gap: var(--horizontal-spacing);
    align-items: center;
    margin-bottom: calc(var(--spacing) / 2);
}

.course-progress-bar .progress-bar {
    --value: 0%;
    width: 100%;
    height: 10px;
    background: transparent;
    border: 1px solid var(--dark-color);
    border-radius: 5px;
    overflow: hidden;
}

.course-progress-bar .progress-bar::after {
    content: "";
    display: block;
    height: 100%;
    width: var(--value);
    background: var(--primary-color);
    transition: width 0.4s ease;
}

.course-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: calc(var(--spacing) / 2);
}

@media (max-width: 1000px) {
    .course-content {
        display: flex;
        flex-direction: column-reverse;
    }
}


/* Lesson toggle */

.lessons-toggle {
    display: none;
}


/* mobile */

@media (max-width: 1000px) {
    .lesson-control-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: calc(var(--spacing) / 2);
    }
    .lessons-toggle {
        display: block;
        width: fit-content;
    }
    .lessons-container {
        margin-top: 0 !important;
        overflow: hidden;
        transition: height 0.3s ease;
        height: 0;
    }
    .lesson.open {
        margin-top: calc(var(--spacing) / 2);
    }
}

@media (max-width: 768px) {
    .lesson-control-container {
        flex-direction: column;
    }
    .lessons-toggle {
        padding: 0;
    }
}


/* Course video style */

.course-video {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing)/2);
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Click-to-load facade: a full-cover poster (uploaded cover, cached provider
   thumbnail, or the course cover) with a centred play button. The video
   provider is only contacted after the viewer presses play. */
.video-facade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(var(--spacing) / 2);
    background: #000 center / cover no-repeat;
    color: #fff;
    text-align: center;
}

/* A scrim keeps the play button and text readable over any poster image. */
.video-facade.has-poster::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.15));
}

.video-facade .video-play,
.video-facade .video-facade-text {
    position: relative;
    z-index: 1;
}

.video-facade .video-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.15s ease, background 0.15s ease;
}

.video-facade .video-play .material-icons {
    font-size: 42px;
    color: #fff;
}

.video-facade:hover .video-play,
.video-facade:focus-visible .video-play {
    transform: scale(1.06);
    background: rgba(0, 0, 0, 0.7);
}

.video-facade-text {
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.video-facade-text small {
    font-weight: 400;
    font-size: 0.8em;
    opacity: 0.85;
}

.video-facade:focus-visible {
    outline: 3px solid var(--accent-color, #D46627);
    outline-offset: -3px;
}


/* TABS */

.tabs {
    width: 100%;
}

.tab-buttons {
    display: flex;
    flex-direction: row;
    gap: var(--horizontal-spacing);
    margin-bottom: calc(var(--spacing)/2);
}

.tab {
    position: relative;
    padding: var(--vertical-spacing) 0;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.tab::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 0;
    height: 4px;
    background: var(--primary-color);
    border-radius: 5px;
    transform: translateX(-50%);
}

.tab.active::after {
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


/* ATTACHMENTS */

.attachments {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing) / 2);
}

.attachment {
    display: flex;
    flex-direction: row;
    gap: calc(var(--spacing) / 2);
    align-items: center;
    cursor: pointer;
    width: fit-content;
}

.attachment:hover {
    animation: jump 1s ease-in-out infinite;
}

@keyframes jump {
    0% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(4px);
    }
    50% {
        transform: translateY(0);
    }
}

.attachment-icon {
    height: min-content;
    padding: var(--vertical-spacing);
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
}

.attachment-icon img {
    display: block;
    height: 35px;
    filter: invert(1);
}


/* Lessons info style */

.lessons-info {
    height: fit-content;
    padding: var(--horizontal-spacing);
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: 0 0 8px var(--dark-shadow-color);
}

.lessons-container {
    margin-top: calc(var(--spacing) / 2);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing) / 3);
}

.lesson {
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: row;
    gap: var(--horizontal-spacing);
    align-items: center;
}

.lesson img {
    height: 35px;
}

.lesson .lesson-title {
    font-weight: bold;
}


/* SOCIAL */

.social-sharing,
.social-sharing h2 {
    margin-top: var(--spacing);
}

.shared-container .item {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
}

.shared-container .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shared-container .item .creator-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--vertical-spacing);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 85%, rgba(0, 0, 0, 0) 90%, rgba(0, 0, 0, 0) 100%);
    color: var(--light-color);
}
/* Round 2: admin fields/toggles surfaced on the public pages. */
.course-highlight-desc { margin: 6px 0 14px; opacity: 0.95; }
.curriculum-module-desc { margin: 2px 0 8px; opacity: 0.85; font-size: 0.95em; }
.lesson-required-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 700;
    background: var(--primary-color);
    color: var(--dark-color, #2b2a4a);
    vertical-align: middle;
}
.lesson-share { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.lesson-share-btn { display: inline-flex; align-items: center; gap: 6px; }
.lesson-share-status { font-size: 0.85em; opacity: 0.8; }

/* ---- Hero carousel (Tananyagok top) --------------------------------------
 * One featured course per slide, in the same left-text / right-image layout
 * as the single hero. Slides are stacked in one grid cell so the height stays
 * stable (no layout shift) while the active slide cross-fades. Controls sit in
 * a row below the slide: prev arrow, dots, next arrow. The indigo divider that
 * used to sit under .highlighted-course now lives on the carousel. */
.hero-carousel {
    position: relative;
    border-bottom: 4px solid var(--secondary-color);
    padding-bottom: var(--spacing);
    margin-bottom: var(--spacing);
}

.hero-carousel-viewport {
    display: grid;
}

/* Each slide reuses .highlighted-course for the inner layout, but the divider
 * and outer spacing belong to the carousel, not the slide. */
.hero-carousel .highlighted-course {
    border-bottom: none;
    margin: 0;
    padding: 0;
}

.hero-slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.hero-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: calc(var(--spacing) / 2);
}

.hero-carousel-arrow {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--secondary-color);
    background: var(--background-color);
    color: var(--secondary-color);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.hero-carousel-arrow:hover,
.hero-carousel-arrow:focus-visible {
    background: var(--secondary-color);
    color: #fff;
}

.hero-carousel-dots {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-carousel-dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border: none;
    border-radius: 50%;
    /* Inactive dots are the indigo brand colour at reduced opacity so they
       stay clearly visible on the light page background (plain --light-color
       blended in and was almost invisible). */
    background: var(--secondary-color);
    opacity: 0.35;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.hero-carousel-dot:hover,
.hero-carousel-dot:focus-visible {
    opacity: 0.6;
}

.hero-carousel-dot.is-active {
    background: var(--primary-color);
    opacity: 1;
    transform: scale(1.25);
}

/* Small label above the slide title (e.g. "Uj tanfolyam"); it is the course's
   highlight tag, not the title. */
.hero-slide-eyebrow {
    margin: 0 0 4px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary-color);
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide { transition: none; }
}

/* Unlock success panel (Gery 12374): after redeeming a code / entering a
   password, we list the materials that became available instead of opening a
   lesson. Used in the courses-page dialog and inline on the course page. */
.unlock-success-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 0 6px;
    color: var(--secondary-color);
}
.unlock-success-list {
    margin: 6px 0 14px;
    padding-left: 1.2em;
}
.unlock-success-list li { margin: 4px 0; }
.unlock-success-list a { color: var(--accent-color); font-weight: 600; }

/* Rich-text lists in admin-written descriptions (Gery, 2026-11-20): a global
   reset left ul/ol with no left padding, so the bullets hung outside the text
   column. Indent them so the bullets sit inside, under the paragraph text. */
.h-course-info-description ul, .h-course-info-description ol,
.course-highlight-desc ul, .course-highlight-desc ol,
.curriculum-module-desc ul, .curriculum-module-desc ol,
.lesson-description ul, .lesson-description ol {
    padding-left: 1.6em;
    margin: 0.5em 0;
}
.h-course-info-description li, .course-highlight-desc li,
.curriculum-module-desc li, .lesson-description li { margin: 0.2em 0; }

/* Scheduled release countdown (settings.available_from, Gery 2026-11-20). */
.release-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--secondary-color, #231f4f);
    color: #fff;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.release-countdown .material-icons { font-size: 1.1em; }
.release-countdown--card {
    align-self: center;
    box-sizing: border-box;
    max-width: 100%;
    margin: 4px auto 8px;
    padding: 4px 10px;
    gap: 4px;
    font-size: 0.8rem;
    line-height: 1.25;
    text-align: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.35);
}
/* Narrow card: "2 nap" and the clock wrap onto two lines instead of overflowing. */
.release-countdown--card .release-countdown-text { min-width: 0; overflow-wrap: anywhere; }
/* Long uppercase box names (MÉZESKALÁCS) must not run past the card either. */
.course .course-info { container-type: inline-size; }
.course .course-info h3 { font-size: min(25px, 14cqi); overflow-wrap: break-word; }
.release-countdown--page { max-width: 100%; box-sizing: border-box; flex-wrap: wrap; justify-content: center; }
.release-countdown--page { font-size: 1.05em; padding: 10px 16px; }
