/* ==========================================================================
   Home Modules — shared stylesheet
   Used by: comingEventDiv.php, ourclasses.php, ourTeacher.php

   Every module wraps its <section> in BOTH:
     - the shared ".homeModule" class (base look: colors, header,
       carousel controls, slider mechanics, expandable text, empty state)
     - its own module class (".homeEventModule" / ".homeClassModule" /
       ".homeTeacherModule") used only for the handful of things that
       differ between modules: card width, image treatment, etc.

   Include this file once on any page that uses one or more of the
   three modules.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Shared base — colors, header, controls, slider, expandable text
   -------------------------------------------------------------------------- */

.homeModule {
    --homeModule-cream: #f8f4ef;
    --homeModule-card: #fffaf6;
    --homeModule-brown: #5d4637;
    --homeModule-brownSoft: #7d6655;
    --homeModule-line: #d9cbbd;
    --homeModule-tag: #eee2d5;
    --homeModule-shadow: 0 12px 28px rgba(88, 66, 50, 0.12);

    overflow: hidden;
    padding: 5px 0;
    color: var(--homeModule-brown);
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.9), transparent 24%),
        radial-gradient(circle at 80% 80%, rgba(229, 215, 200, 0.45), transparent 24%),
        var(--homeModule-cream);
}

.homeModule *,
.homeModule *::before,
.homeModule *::after {
    box-sizing: border-box;
}

/* ---------- Header ---------- */

.homeModule__header {
    margin-bottom: 0;
    text-align: center;
}

.homeModule__lotus {
    width: 56px;
    margin: 0 auto 4px;
    color: #d7c6b4;
}

.homeModule__lotus svg {
    display: block;
    width: 100%;
    height: auto;
    fill: currentColor;
}

.homeModule__titleRow {
    display: flex;
    align-items: center;
    gap: 34px;
    width: min(950px, 100%);
    margin: 0 auto;
}

.homeModule__titleLine {
    flex: 1;
    height: 1px;
    background: var(--homeModule-line);
}

.homeModule__titleRow h2 {
    margin: 0;
    color: #513d30;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(22px, 6vw, 33px);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

/* ---------- Carousel controls (prev/next buttons) ---------- */

.homeModule__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1120px, calc(100% - 32px));
    margin: 4px auto 0;
}

.homeModule__button {
    width: 20px;
    height: 20px;
    border: 1px solid var(--homeModule-line);
    border-radius: 50%;
    color: var(--homeModule-brown);
    background: var(--homeModule-card);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: color 0.2s ease, background 0.2s ease;
}

.homeModule__button:hover,
.homeModule__button:focus {
    outline: none;
    color: #ffffff;
    background: var(--homeModule-brown);
}

/* ---------- Slider track (drag + snap carousel) ---------- */

.homeModule__slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 12px max(16px, calc((100vw - 1120px) / 2)) 28px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    cursor: grab;
}

.homeModule__slider::-webkit-scrollbar {
    display: none;
}

.homeModule__slider.homeModule__slider--dragging {
    scroll-snap-type: none;
    cursor: grabbing;
    user-select: none;
}

/* ---------- Card base (each module adds its own flex-basis) ---------- */

.homeModule__card {
    overflow: hidden;
    border: 1px solid rgba(220, 205, 190, 0.65);
    border-radius: 11px;
    color: var(--homeModule-brown);
    background: var(--homeModule-card);
    box-shadow: var(--homeModule-shadow);
    scroll-snap-align: start;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.homeModule__card:hover,
.homeModule__card:focus {
    outline: none;
    transform: translateY(-6px);
    box-shadow: 0 18px 34px rgba(88, 66, 50, 0.18);
}

.homeModule__divider {
    height: 1px;
    margin: 0 0 18px;
    background: #bcae9f;
}

/* ---------- Expandable text ("See more" / "See less") ---------- */

.homeModule__expandable {
    overflow: hidden;
    transition: max-height 0.35s ease;
    text-align: left;
}

.homeModule__expandable.homeModule__expandable--expanded {
    max-height: 1000px;
}

.homeModule__expandableText {
    margin: 0;
    color: #674f40;
    font-size: 16px;
    line-height: 1.45;
}

.homeModule__seeMore {
    display: none;
    margin: 8px auto 0;
    padding: 0;
    border: 0;
    color: var(--homeModule-brown);
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.homeModule__seeMore:hover,
.homeModule__seeMore:focus {
    outline: none;
    color: #9a7255;
}

/* ---------- Empty state ---------- */

.homeModule__empty {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px;
    border: 1px solid var(--homeModule-line);
    border-radius: 10px;
    color: var(--homeModule-brownSoft);
    background: var(--homeModule-card);
    text-align: center;
}

/* ---------- Shared small icons ---------- */

.homeModule__calendarIcon,
.homeModule__clockIcon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.homeModule__smallLotusIcon {
    width: 28px;
    height: 25px;
    fill: currentColor;
}

/* ---------- Shared responsive base ---------- */

@media (max-width: 600px) {
    .homeModule {
        padding: 5px 0;
    }

    .homeModule__controls {
        width: calc(100% - 32px);
    }

    .homeModule__lotus {
        width: 44px;
    }

    .homeModule__titleRow {
        gap: 14px;
    }

    .homeModule__titleLine {
        min-width: 16px;
    }

    .homeModule__titleRow h2 {
        font-size: clamp(18px, 10vw, 24px);
    }

    .homeModule__slider {
        gap: 14px;
        padding: 10px 16px 24px;
    }
}


/* --------------------------------------------------------------------------
   2. Upcoming Events module (.homeEventModule)
   -------------------------------------------------------------------------- */

.homeEventModule .homeModule__card {
    display: block;
    flex: 0 0 310px;
}

/* A4 portrait ratio: 210 / 297 */
.homeEventModule .homeModule__posterWrap {
    width: 100%;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    background: #ece2d7;
}

.homeEventModule .homeModule__poster {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.homeEventModule .homeModule__posterFallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    color: var(--homeModule-brownSoft);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent),
        #e9ddd0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    text-align: center;
}

.homeEventModule .homeModule__content {
    padding: 19px 20px 21px;
    text-align: center;
}

.homeEventModule .homeModule__eventTitle {
    display: -webkit-box;
    min-height: 44px;
    margin: 0;
    overflow: hidden;
    color: #5a4334;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
    font-weight: 500;
    line-height: 1.1;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.homeEventModule .homeModule__date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid #dfd0c1;
    color: var(--homeModule-brownSoft);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

@media (max-width: 600px) {
    .homeEventModule .homeModule__card {
        flex-basis: min(78vw, 310px);
    }

    .homeEventModule .homeModule__content {
        padding: 17px 16px 19px;
    }

    .homeEventModule .homeModule__eventTitle {
        font-size: 23px;
    }

    .homeEventModule .homeModule__date {
        font-size: 13px;
    }
}


/* --------------------------------------------------------------------------
   3. Our Classes module (.homeClassModule)
   -------------------------------------------------------------------------- */

.homeClassModule .homeModule__card {
    flex: 0 0 365px;
    border-color: rgba(220, 205, 190, 0.55);
}

.homeClassModule .homeModule__content {
    padding: 28px 29px 22px;
    text-align: center;
}

.homeClassModule .homeModule__classTitle {
    min-height: 38px;
    margin: 0 0 17px;
    color: #5a4334;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.05;
}

/* Description collapses to ~2 lines by default */
.homeClassModule .homeModule__expandable {
    max-height: 54px;
}

.homeClassModule .homeModule__details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid #dfd0c1;
    border-bottom: 1px solid #dfd0c1;
    color: #624b3b;
    font-size: 16px;
    font-weight: 600;
}

.homeClassModule .homeModule__detailItem {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.homeClassModule .homeModule__detailSeparator {
    width: 1px;
    height: 24px;
    background: #d8c8b9;
}

.homeClassModule .homeModule__image {
    display: block;
    width: 100%;
    height: 312px;
    object-fit: cover;
}

@media (max-width: 600px) {
    .homeClassModule .homeModule__card {
        flex-basis: min(86vw, 365px);
    }

    .homeClassModule .homeModule__content {
        padding: 23px 20px 18px;
    }

    .homeClassModule .homeModule__classTitle {
        font-size: 24px;
    }

    .homeClassModule .homeModule__expandableText {
        font-size: 15px;
    }

    .homeClassModule .homeModule__details {
        gap: 10px;
        font-size: 14px;
    }

    .homeClassModule .homeModule__image {
        height: 270px;
    }
}


/* --------------------------------------------------------------------------
   4. Our Teachers module (.homeTeacherModule)
   -------------------------------------------------------------------------- */

.homeTeacherModule .homeModule__card {
    display: flex;
    flex: 0 0 390px;
    flex-direction: column;
    border-color: rgba(220, 205, 190, 0.65);
}

/* Photo on the left, short name on the right */
.homeTeacherModule .homeModule__teacherHeader {
    display: flex;
    align-items: center;
    min-height: 160px;
    border-bottom: 1px solid #dfd0c1;
    background: #f7efe7;
}

.homeTeacherModule .homeModule__photoWrap {
    flex: 0 0 150px;
    width: 150px;
    height: 160px;
    overflow: hidden;
    background: transparent;
}

.homeTeacherModule .homeModule__photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    padding: 10px;
}

.homeTeacherModule .homeModule__nameWrap {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    padding: 20px 24px;
    text-align: left;
}

.homeTeacherModule .homeModule__name {
    margin: 0;
    color: #5a4334;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 36px;
    font-weight: 500;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.homeTeacherModule .homeModule__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px 26px 27px;
    text-align: left;
}

/* Bio collapses to ~3 lines by default */
.homeTeacherModule .homeModule__expandable {
    //max-height: 66px;
}

.homeTeacherModule .homeModule__expandableText {
    font-size: 15px;
}

.homeTeacherModule .homeModule__classes {
    margin-top: auto;
    padding-top: 20px;
}

.homeTeacherModule .homeModule__classTags {
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    gap: 7px;
}

.homeTeacherModule .homeModule__classTag {
    display: inline-block;
    padding: 7px 10px;
    border: 1px solid #dccaba;
    border-radius: 999px;
    color: #624b3b;
    background: var(--homeModule-tag);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.15;
}

@media (max-width: 600px) {
    .homeTeacherModule .homeModule__card {
        flex-basis: min(86vw, 390px);
    }

    .homeTeacherModule .homeModule__teacherHeader {
        min-height: 135px;
    }

    .homeTeacherModule .homeModule__photoWrap {
        flex-basis: 125px;
        width: 125px;
        height: 135px;
    }

    .homeTeacherModule .homeModule__nameWrap {
        padding: 18px;
    }

    .homeTeacherModule .homeModule__name {
        font-size: 30px;
    }

    .homeTeacherModule .homeModule__content {
        padding: 22px 20px 23px;
    }
}
