/**
 * BDITHOME homepage — bigger message portraits and smooth hover zoom.
 * Only the featured message and other-message cards of template-parts/hero-slider.php
 * are targeted. No generic .group, .hero-card, or .rounded-full rules.
 */

/* Featured/principal message: 64px -> 150px. Other messages: 48px -> 116px. */
.hero-section > .container > .grid > [class~="lg:order-2"] .w-16.h-16 {
    width: 150px !important;
    height: 150px !important;
    flex-shrink: 0 !important;
    border-radius: 50%;
    overflow: hidden;
    transition: box-shadow .35s ease, border-color .35s ease;
}
.hero-section > .container > .grid > [class~="lg:order-5"] .w-12.h-12 {
    width: 116px !important;
    height: 116px !important;
    flex-shrink: 0 !important;
    border-radius: 50%;
    overflow: hidden;
    transition: box-shadow .35s ease, border-color .35s ease;
}

/* Keep images crisp and round, and make only the photo zoom inside its frame. */
.hero-section > .container > .grid > [class~="lg:order-2"] .w-16.h-16 img,
.hero-section > .container > .grid > [class~="lg:order-5"] .w-12.h-12 img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    transform: scale(1);
    transition: transform .55s cubic-bezier(.2, .7, .2, 1);
    backface-visibility: hidden;
}

/* Hovering on the image or its message card causes a smooth picture zoom. */
@media (hover: hover) and (pointer: fine) {
    .hero-section > .container > .grid > [class~="lg:order-2"]:hover .w-16.h-16 img,
    .hero-section > .container > .grid > [class~="lg:order-5"] .group:hover .w-12.h-12 img {
        transform: scale(1.17);
    }
    .hero-section > .container > .grid > [class~="lg:order-2"]:hover .w-16.h-16,
    .hero-section > .container > .grid > [class~="lg:order-5"] .group:hover .w-12.h-12 {
        box-shadow: 0 4px 16px rgba(0, 106, 78, .21);
    }

    /* Small lift on secondary message cards; does not affect the entire grid. */
    .hero-section > .container > .grid > [class~="lg:order-5"] .grid > .group:hover {
        transform: translateY(-2px);
        box-shadow: 0 7px 19px rgba(0, 0, 0, .08);
    }
}

.hero-section > .container > .grid > [class~="lg:order-5"] .grid > .group {
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

/* Allow longer Bengali names to wrap rather than vanish behind larger portraits. */
.hero-section > .container > .grid > [class~="lg:order-2"] .w-16.h-16 + div,
.hero-section > .container > .grid > [class~="lg:order-5"] .w-12.h-12 + div {
    min-width: 0;
}
.hero-section > .container > .grid > [class~="lg:order-2"] h4.line-clamp-1 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    max-height: 4.05em;
    line-height: 1.35;
    overflow: hidden;
}
.hero-section > .container > .grid > [class~="lg:order-5"] h4.truncate {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    white-space: normal;
    line-height: 1.35;
    max-height: 4.05em;
    overflow: hidden;
}

/* Responsive portrait sizes prevent overflow on narrow mobile devices. */
@media (max-width: 480px) {
    .hero-section > .container > .grid > [class~="lg:order-2"] .w-16.h-16 {
        width: 120px !important;
        height: 120px !important;
    }
    .hero-section > .container > .grid > [class~="lg:order-5"] .w-12.h-12 {
        width: 100px !important;
        height: 100px !important;
    }
}

/* Keep the names readable beside the portraits on the smallest phones. */
@media (max-width: 360px) {
    .hero-section > .container > .grid > [class~="lg:order-2"] .w-16.h-16 {
        width: 110px !important;
        height: 110px !important;
    }
    .hero-section > .container > .grid > [class~="lg:order-5"] .w-12.h-12 {
        width: 92px !important;
        height: 92px !important;
    }
}

/* Respect reduced-motion settings, including during keyboard navigation. */
@media (prefers-reduced-motion: reduce) {
    .hero-section > .container > .grid > [class~="lg:order-2"] .w-16.h-16,
    .hero-section > .container > .grid > [class~="lg:order-5"] .w-12.h-12,
    .hero-section > .container > .grid > [class~="lg:order-2"] .w-16.h-16 img,
    .hero-section > .container > .grid > [class~="lg:order-5"] .w-12.h-12 img,
    .hero-section > .container > .grid > [class~="lg:order-5"] .grid > .group {
        transition: none !important;
        transform: none !important;
    }
}
