/* MasterStudy Custom Quote Block
   Styles matching wp-block-quote from etechnologie-root */
.ms-custom-quote {
    position: relative;
    background-color: #FFFFFF;
    border: none !important;
    border-left: none !important;
    margin: 3rem 0 40px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    font-weight: 400;
    line-height: 1.7;
    quotes: none;
}

.ms-custom-quote::before {
    content: "\201C";
    font-family: Georgia, 'Times New Roman', serif;
    background-color: var(--ms-accent-primary, #4A7BD9);
    width: 36px;
    height: 36px;
    position: absolute;
    left: 25px;
    top: -18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    padding-top: 4px;
    box-sizing: border-box;
}

.ms-custom-quote p {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 400;
    margin: 0 !important;
}

.ms-custom-quote p:first-child {
    padding-top: 1.5rem;
}

.ms-custom-quote p:last-child {
    padding-top: 0;
}

.ms-custom-quote p a {
    color: var(--bb-primary-color, var(--accent_color, rgba(227,6,19,1)));
    text-decoration: none;
}

.ms-custom-quote cite {
    display: block;
    font-style: normal;
    font-weight: 500;
    color: #273044;
    font-size: 14px;
    line-height: 1.4;
    padding: 0 1.5rem 1.5rem 1.5rem;
}

/* Custom Horizontal Line */
hr.ms-custom-line {
    width: 40%;
    height: 3px;
    border: none !important;
    background: var(--ms-accent-line, #4D5E6F);
    margin: 30px auto;
    border-radius: 3px;
}

/* Course player specific overrides */
.masterstudy-course-player-lesson .ms-custom-quote {
    border-left: none !important;
    border: none !important;
}

/* Zaokrąglenie zdjęć w treści lekcji (tylko w obszarze treści, nie UI) */
.masterstudy-course-player-lesson .masterstudy-course-player-lesson__content img,
.masterstudy-course-player-lesson .entry-content img,
.masterstudy-course-player-lesson .ms-two-col__image img {
    border-radius: 6px;
}

/* Przerwa nad nagłówkami w treści lekcji */
.masterstudy-course-player-lesson .masterstudy-course-player-lesson__content h2,
.masterstudy-course-player-lesson .masterstudy-course-player-lesson__content h3,
.masterstudy-course-player-lesson .entry-content h2,
.masterstudy-course-player-lesson .entry-content h3 {
    margin-top: 20px;
}

/* Linia dekoracyjna pod nagłówkami lekcji (tylko w treści, nie UI) */
.masterstudy-course-player-lesson .masterstudy-course-player-lesson__content h2::after,
.masterstudy-course-player-lesson .masterstudy-course-player-lesson__content h3::after,
.masterstudy-course-player-lesson .entry-content h2::after,
.masterstudy-course-player-lesson .entry-content h3::after,
.masterstudy-course-player-lesson__title::after,
.masterstudy-single-lesson__title::after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    background: var(--ms-accent-heading-line, var(--ms-accent-primary, #4A7BD9));
    margin-top: 15px;
    margin-bottom: 20px;
    border-radius: 2px;
}

/* Wyśrodkowanie linii gdy nagłówek jest wyśrodkowany */
.masterstudy-course-player-lesson .masterstudy-course-player-lesson__content h2[style*="center"]::after,
.masterstudy-course-player-lesson .masterstudy-course-player-lesson__content h3[style*="center"]::after,
.masterstudy-course-player-lesson .entry-content h2[style*="center"]::after,
.masterstudy-course-player-lesson .entry-content h3[style*="center"]::after {
    margin-left: auto;
    margin-right: auto;
}

/* Ukryj linię dekoracyjną wewnątrz komponentów pluginu */
.ms-hero-img h2::after,
.ms-hero-img h3::after,
.ms-hero-img p::after,
.ms-two-col__text h3::after,
.ms-accordion__content h2::after,
.ms-accordion__content h3::after,
.ms-hidden__content h2::after,
.ms-hidden__content h3::after {
    display: none !important;
}

/* Spacer */
.ms-spacer {
    display: block;
    width: 100%;
}

/* =============================================
   Style list w lekcjach MasterStudy
   ============================================= */

/* Domyślna lista wypunktowana — styl ze strzałką */
.masterstudy-course-player-lesson ul {
    list-style: none !important;
    padding-left: 0 !important;
}

.masterstudy-course-player-lesson ul > li {
    position: relative;
    padding-left: 36px !important;
    margin-bottom: 12px !important;
}

.masterstudy-course-player-lesson ul > li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: auto;
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-accent-primary, #4A7BD9) url('../images/list-arrow.svg') no-repeat center center;
    background-size: 10px;
    border-radius: 3px;
    padding: 0 6px;
    font-size: 0.75rem;
}

/* Lista circle — koło z ikoną check */
.masterstudy-course-player-lesson ul[style*="circle"] > li:before {
    content: "\2713";
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    background: var(--ms-accent-primary, #4A7BD9);
    background-image: none;
    border-radius: 50%;
    padding: 0;
    top: 1px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Lista square — wykrzyknik */
.masterstudy-course-player-lesson ul[style*="square"] > li:before {
    content: "!";
    background: #ff6b00;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

/* lista numerowana */
.masterstudy-course-player-lesson ol {
    list-style: none;
    counter-reset: lesson-step;
    padding-left: 0;
}

.masterstudy-course-player-lesson ol > li {
    counter-increment: lesson-step;
    position: relative;
    padding-left: 48px;
    margin-bottom: 16px;
}

.masterstudy-course-player-lesson ol > li:before {
    content: counter(lesson-step);
    position: absolute;
    left: 0;
    top: 2px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-accent-primary, #4a7bd9);
    color: #fff;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
}

/* =============================================
   Dwie kolumny (obraz + opis)
   ============================================= */
.ms-two-col {
    display: flex;
    gap: 24px;
    margin: 2rem 0;
    align-items: flex-start;
}

.ms-two-col__image {
    flex: 0 0 50%;
    max-width: 50%;
}

.ms-two-col__image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.ms-two-col__text {
    flex: 1;
}

.ms-two-col__text h3 {
    margin: 0 0 0.5em 0;
    font-size: 1.2rem;
    color: #1d2327;
}

.ms-two-col__text h3::after {
    display: none;
}

.ms-two-col__text p {
    margin: 0 0 1em 0;
    line-height: 1.7;
}

.ms-two-col--right {
    flex-direction: row-reverse;
}

/* Jeśli obrazek jest pusty (usunięty), tekst zajmuje pełną szerokość */
.ms-two-col__image:empty,
.ms-two-col__image:not(:has(img)) {
    display: none;
}

.ms-two-col__image:empty ~ .ms-two-col__text,
.ms-two-col__image:not(:has(img)) ~ .ms-two-col__text {
    flex: 0 0 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .ms-two-col,
    .ms-two-col--right {
        flex-direction: column;
    }
    .ms-two-col__image {
        flex: none;
        max-width: 100%;
    }
}

/* =============================================
   Obraz tła z tekstem (hero)
   ============================================= */
.ms-hero-img {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: 2rem 0;
    min-height: 300px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    overflow: hidden;
}

.ms-hero-img__overlay {
    position: absolute;
    inset: 0;
    background: var(--ms-accent-hero-overlay, rgba(0, 0, 0, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
}

.ms-hero-img__text {
    position: relative;
    z-index: 1;
    color: #fff;
    padding: 2rem 3rem;
    max-width: 800px;
    text-align: center;
}

.ms-hero-img__text p,
.ms-hero-img__text span,
.ms-hero-img__text {
    color: #fff !important;
    font-size: 1.25rem;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .ms-hero-img {
        min-height: 200px;
    }
    .ms-hero-img__text {
        padding: 1.5rem;
    }
    .ms-hero-img__text p {
        font-size: 1rem;
    }
}

/* =============================================
   Akordeon
   ============================================= */
.ms-accordion {
    margin: 1.5rem 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.ms-accordion + .ms-accordion {
    margin-top: -1rem;
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.ms-accordion__item {
    border-bottom: 1px solid #e0e0e0;
}

.ms-accordion__item:last-child {
    border-bottom: none;
}

.ms-accordion__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    -webkit-user-select: none;
    user-select: none;
}

.ms-accordion__header:hover {
    background: #f9f9f9;
}

.ms-accordion__title {
    font-weight: 600;
    color: #1d2327;
}

.ms-accordion__icon {
    font-size: 1.25rem;
    font-weight: 300;
    color: #666;
    flex-shrink: 0;
    margin-left: 16px;
    transition: transform 0.2s;
}

.ms-accordion__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ms-accordion__item.ms-accordion--open .ms-accordion__body {
    max-height: 2000px;
}

.ms-accordion__item.ms-accordion--open {
    border-left: 3px solid var(--ms-accent-accordion, #ff6b00);
}

.ms-accordion__item.ms-accordion--open .ms-accordion__icon {
    color: #333;
}

.ms-accordion__content {
    padding: 0 20px 16px 20px;
}

.ms-accordion__content p {
    margin: 0 0 1em 0;
    line-height: 1.7;
}

/* =============================================
   Checklista
   ============================================= */
.ms-checklist {
    margin: 1.5rem 0;
}

.ms-checklist__item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.ms-checklist__item:last-child {
    border-bottom: none;
}

.ms-checklist__checkbox {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 2px solid var(--ms-accent-checklist, #8B1A1A);
    border-radius: 4px;
    cursor: pointer;
    margin-top: 2px;
    position: relative;
    transition: background-color 0.15s, border-color 0.15s;
}

.ms-checklist__item.ms-checklist--checked .ms-checklist__checkbox {
    background-color: var(--ms-accent-checklist, #8B1A1A);
    border-color: var(--ms-accent-checklist, #8B1A1A);
}

.ms-checklist__item.ms-checklist--checked .ms-checklist__checkbox::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 3px;
    width: 7px;
    height: 13px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.ms-checklist__text {
    flex: 1;
}

.ms-checklist__text p {
    margin: 0;
    line-height: 1.7;
    font-size: 1rem;
}

/* =============================================
   Sekcja ukryta (reveal)
   ============================================= */
.ms-hidden {
    margin: 1.5rem 0;
}

.ms-hidden__btn {
    display: inline-block;
    padding: 10px 28px;
    background: var(--ms-accent-primary, #4A7BD9);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.2s;
}

.ms-hidden__btn:hover {
    opacity: 0.9;
}

.ms-hidden__content {
    display: none;
    margin-top: 16px;
    padding: 16px 20px;
    background: #f9f9f9;
    border-left: 3px solid var(--ms-accent-primary, #4A7BD9);
    border-radius: 0 6px 6px 0;
}

.ms-hidden__content p {
    margin: 0 0 1em 0;
    line-height: 1.7;
}

.ms-hidden.ms-hidden--revealed .ms-hidden__content {
    display: block;
}

.ms-hidden.ms-hidden--revealed .ms-hidden__btn {
    display: none;
}
