/* =========================================================
   DIRECTORY GOO — TUTORIALS V1
   Approved responsive UI
   Desktop / Tablet / Mobile
   Presentation only — CMS/backend content preserved
   ========================================================= */


/* ---------------------------------------------------------
   SECTION HEADING
   --------------------------------------------------------- */

.toturial-row {
    position: relative;
}

/* Heading block immediately preceding Tutorials */
.row:has(+ .toturial-row) h3,
.toturial-row ~ * h3 {
    color: #17231c;
}


/* ---------------------------------------------------------
   DESKTOP / BASE
   --------------------------------------------------------- */

.toturial-row {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow: visible !important;

    margin-left: -10px !important;
    margin-right: -10px !important;
    row-gap: 20px;
}


/* Tutorial column */
.toturial-row > * {
    padding-left: 10px !important;
    padding-right: 10px !important;
}


/* Tutorial card
   The existing column becomes the visual card container.
*/
.toturial-row > * {
    position: relative;

    background: #ffffff;
    border: 1px solid #e5ede8;
    border-radius: 14px;

    overflow: hidden;

    box-shadow:
        0 8px 26px rgba(20, 55, 38, 0.055),
        0 2px 6px rgba(20, 55, 38, 0.035);

    transition:
        transform .22s ease,
        box-shadow .22s ease,
        border-color .22s ease;
}


/* Tutorial image */
.toturial-row img[alt="tutorialImg"] {
    display: block;

    width: 100% !important;
    height: 230px;

    object-fit: cover;

    margin: 0 !important;

    border-radius: 12px 12px 0 0;

    background: #f2faf5;
}


/* Content spacing
   Keep existing HTML structure intact.
*/
.toturial-row > * > div:not(:first-child),
.toturial-row > * > p,
.toturial-row > * > h4,
.toturial-row > * > h5,
.toturial-row > * > h6 {
    position: relative;
}


/* Titles */
.toturial-row h4,
.toturial-row h5,
.toturial-row h6 {
    color: #17231c !important;

    font-weight: 700 !important;
    line-height: 1.35;

    margin-top: 14px;
}


/* Tutorial description */
.toturial-row .tutorial-description {
    color: #536158 !important;

    font-size: 14px !important;
    line-height: 1.55 !important;

    margin-bottom: 18px !important;
}


/* Existing play button/icon */
.toturial-row .play-icon {
    z-index: 2;

    width: 62px;
    height: 62px;

    filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .14));

    transition:
        transform .2s ease,
        filter .2s ease;
}


/* ---------------------------------------------------------
   DESKTOP HOVER
   --------------------------------------------------------- */

@media (hover: hover) and (pointer: fine) {

    .toturial-row > *:hover {
        transform: translateY(-4px);

        border-color: rgba(47, 143, 70, .24);

        box-shadow:
            0 15px 36px rgba(20, 55, 38, .09),
            0 4px 10px rgba(20, 55, 38, .045);
    }

    .toturial-row > *:hover .play-icon {
        transform: scale(1.07);

        filter:
            drop-shadow(0 7px 15px rgba(0, 0, 0, .16));
    }
}


/* ---------------------------------------------------------
   VIEW ALL BUTTON
   --------------------------------------------------------- */

.toturial-row + .col-sm-12 .view-all-btn,
.toturial-row ~ .col-sm-12 .view-all-btn {
    min-width: 210px;

    padding: 12px 28px !important;

    background: var(--color-leaf, #2f8f46) !important;

    border:
        1px solid var(--color-leaf, #2f8f46) !important;

    border-radius: 8px !important;

    color: #ffffff !important;

    font-size: 14px !important;
    font-weight: 600 !important;

    text-decoration: none !important;

    box-shadow:
        0 7px 18px rgba(47, 143, 70, .18);

    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}


/* Arrow without changing backend/React text */
.toturial-row + .col-sm-12 .view-all-btn::after,
.toturial-row ~ .col-sm-12 .view-all-btn::after {
    content: " →";

    display: inline-block;

    margin-left: 8px;

    font-size: 17px;
    line-height: 1;

    transition: transform .2s ease;
}


@media (hover: hover) and (pointer: fine) {

    .toturial-row + .col-sm-12 .view-all-btn:hover,
    .toturial-row ~ .col-sm-12 .view-all-btn:hover {
        background: #27843e !important;
        border-color: #27843e !important;

        transform: translateY(-2px);

        box-shadow:
            0 10px 22px rgba(47, 143, 70, .23);
    }

    .toturial-row + .col-sm-12 .view-all-btn:hover::after,
    .toturial-row ~ .col-sm-12 .view-all-btn:hover::after {
        transform: translateX(3px);
    }
}


/* =========================================================
   DESKTOP
   1200px+
   Three equal tutorial cards
   ========================================================= */

@media (min-width: 1200px) {

    .toturial-row > * {
        flex: 0 0 calc(33.333333% - 0px) !important;
        width: 33.333333% !important;
        max-width: 33.333333% !important;
    }

    .toturial-row img[alt="tutorialImg"] {
        height: 230px;
    }

    .toturial-row .tutorial-description {
        font-size: 14px !important;
    }
}


/* =========================================================
   TABLET
   768px — 1199px

   Two cards first row.
   Third card remains responsive and balanced.
   ========================================================= */

@media (min-width: 768px) and (max-width: 1199.98px) {

    .toturial-row {
        margin-left: -8px !important;
        margin-right: -8px !important;

        row-gap: 16px;
    }

    .toturial-row > * {
        flex: 0 0 50% !important;
        width: 50% !important;
        max-width: 50% !important;

        padding-left: 8px !important;
        padding-right: 8px !important;

        border-radius: 12px;
    }


    /* Last odd card can use full row */
    .toturial-row > *:last-child:nth-child(odd) {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }


    .toturial-row img[alt="tutorialImg"] {
        height: 190px;

        border-radius: 10px 10px 0 0;
    }


    .toturial-row h4,
    .toturial-row h5,
    .toturial-row h6 {
        font-size: 15px !important;
    }


    .toturial-row .tutorial-description {
        font-size: 13.5px !important;
        line-height: 1.5 !important;
    }


    .toturial-row + .col-sm-12 .view-all-btn,
    .toturial-row ~ .col-sm-12 .view-all-btn {
        min-width: 200px;

        padding: 11px 26px !important;
    }
}


/* =========================================================
   MOBILE
   <= 767px

   Compact single-column cards.
   No horizontal carousel.
   ========================================================= */

@media (max-width: 767.98px) {

    /* Neutralize original homepage horizontal-scroll rule */
    .row.toturial-row {
        display: flex !important;
        flex-wrap: wrap !important;

        overflow: visible !important;

        margin-left: 0 !important;
        margin-right: 0 !important;

        row-gap: 12px;
    }


    .toturial-row > * {
        flex: 0 0 100% !important;

        width: 100% !important;
        max-width: 100% !important;

        padding-left: 0 !important;
        padding-right: 0 !important;

        margin-bottom: 0 !important;

        border-radius: 10px;
    }


    /*
       Compact horizontal-card presentation where
       the existing markup permits it.
    */
    .toturial-row img[alt="tutorialImg"] {
        width: 100% !important;
        height: 175px;

        object-fit: cover;

        border-radius: 9px 9px 0 0;
    }


    .toturial-row h4,
    .toturial-row h5,
    .toturial-row h6 {
        font-size: 14px !important;

        line-height: 1.35;

        margin-top: 12px;
    }


    .toturial-row .tutorial-description {
        font-size: 12.75px !important;
        line-height: 1.48 !important;

        margin-bottom: 14px !important;
    }


    .toturial-row .play-icon {
        width: 52px;
        height: 52px;
    }


    /* Mobile CTA */
    .toturial-row + .col-sm-12,
    .toturial-row ~ .col-sm-12 {
        padding-top: 14px !important;
    }


    .toturial-row + .col-sm-12 .view-all-btn,
    .toturial-row ~ .col-sm-12 .view-all-btn {
        display: inline-flex !important;

        align-items: center;
        justify-content: center;

        width: 100% !important;
        max-width: 300px;

        min-width: 0;

        padding: 12px 22px !important;

        border-radius: 8px !important;

        font-size: 13.5px !important;
    }
}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 374.98px) {

    .toturial-row img[alt="tutorialImg"] {
        height: 155px;
    }

    .toturial-row h4,
    .toturial-row h5,
    .toturial-row h6 {
        font-size: 13.5px !important;
    }

    .toturial-row .tutorial-description {
        font-size: 12.25px !important;
    }

    .toturial-row + .col-sm-12 .view-all-btn,
    .toturial-row ~ .col-sm-12 .view-all-btn {
        max-width: 280px;
    }
}

/* =========================================================
   DIRECTORY GOO — TUTORIALS V1.1
   Tablet refinement
   Prevent oversized third tutorial card
   ========================================================= */

@media (min-width: 768px) and (max-width: 1199.98px) {

    /*
       Keep all three tutorials balanced in one row.
       Overrides V1's 2 + 1 tablet layout.
    */
    .toturial-row > *,
    .toturial-row > *:last-child:nth-child(odd) {
        flex: 0 0 33.333333% !important;
        width: 33.333333% !important;
        max-width: 33.333333% !important;
    }

    .toturial-row {
        align-items: stretch !important;
        row-gap: 16px;
    }

    .toturial-row > * {
        border-radius: 11px !important;
    }

    /*
       Compact tablet artwork.
       Prevent third image from expanding vertically.
    */
    .toturial-row img[alt="tutorialImg"] {
        width: 100% !important;
        height: 150px !important;
        max-height: 150px !important;

        object-fit: contain !important;

        padding: 8px;

        background: #f6faf7;

        border-radius: 10px 10px 0 0 !important;
    }

    .toturial-row .play-icon {
        width: 48px !important;
        height: 48px !important;
    }

    /*
       Tablet typography
    */
    .toturial-row h4,
    .toturial-row h5,
    .toturial-row h6 {
        font-size: 14px !important;
        line-height: 1.3 !important;
    }

    .toturial-row .tutorial-description {
        font-size: 12.5px !important;
        line-height: 1.45 !important;
    }

    /*
       View All spacing
    */
    .toturial-row + .col-sm-12,
    .toturial-row ~ .col-sm-12 {
        padding-top: 18px !important;
    }

    .toturial-row + .col-sm-12 .view-all-btn,
    .toturial-row ~ .col-sm-12 .view-all-btn {
        min-width: 190px !important;

        padding: 11px 25px !important;

        border-radius: 7px !important;
    }
}

/* =========================================================
   DIRECTORY GOO — TUTORIALS V1.2
   Tablet readability refinement
   ========================================================= */

@media (min-width: 768px) and (max-width: 1199.98px) {

    /* Slightly more compact artwork */
    .toturial-row img[alt="tutorialImg"] {
        height: 138px !important;
        max-height: 138px !important;
        padding: 7px !important;
    }

    /* Stronger, more readable card titles */
    .toturial-row h4,
    .toturial-row h5,
    .toturial-row h6 {
        font-size: 13.5px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
    }

    /*
       CMS text remains untouched.
       Only the tablet card preview is visually limited.
    */
    .toturial-row .tutorial-description {
        display: -webkit-box !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 6;

        overflow: hidden !important;

        font-size: 12px !important;
        line-height: 1.45 !important;

        margin-bottom: 14px !important;
    }

    /* Keep cards visually balanced */
    .toturial-row > * {
        min-height: 350px;
    }

    /* Cleaner separation before CTA */
    .toturial-row + .col-sm-12,
    .toturial-row ~ .col-sm-12 {
        padding-top: 16px !important;
        padding-bottom: 6px !important;
    }
}
