/**
 * Pet Match Pro - Hero Search Template
 *
 * Styles the single-animal "hero" layout (adopt-search-hero) used to fill a
 * hero/banner image zone. Self-contained: only .pmp-hero-* selectors, no edits
 * to the shared search/compact styles. Reuses the plugin's --pmp-* color tokens
 * so admin color settings still drive the CTA. Mobile-first, no !important.
 *
 * @package PetMatchPro
 * @since 8.17.1
 */

/* ---------------------------------------------------------------------------
   Layout wrapper
   --------------------------------------------------------------------------- */
.pmp-template-hero.pmp-search-results-container {
    width: 100%;
    margin: 0;
}

/* The shared bundle sets .pmp-search-results to display:grid; with no grid-N
   column class the hero would land in an auto-sized implicit column that
   collapses to the image's intrinsic (thumbnail) width. Force block flow.
   div-qualified to outrank the bundle's div.pmp-search-results selector. */
.pmp-search-results.pmp-hero,
div.pmp-search-results.pmp-hero {
    display: block;
    width: 100%;
}

/* ---------------------------------------------------------------------------
   Hero card / image
   --------------------------------------------------------------------------- */
.pmp-hero-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: var(--pmp-hero-aspect, 4 / 3);
    overflow: hidden;
    border-radius: var(--pmp-hero-radius, 12px);
    background-color: var(--pmp-color-primary, #024463);
}

.pmp-hero-link {
    position: absolute;
    inset: 0;
    display: block;
    text-decoration: none;
    color: #ffffff;
}

.pmp-hero-card .pmp-hero-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.pmp-hero-link:hover .pmp-hero-image,
.pmp-hero-link:focus-visible .pmp-hero-image {
    transform: scale(1.04);
}

/* Gradient scrim for text legibility (WCAG contrast over photos) */
.pmp-hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.65) 0%,
        rgba(0, 0, 0, 0.25) 38%,
        rgba(0, 0, 0, 0) 62%
    );
    pointer-events: none;
}

/* Keyboard focus visibility */
.pmp-hero-link:focus-visible {
    outline: 3px solid var(--pmp-color-cta, #f38d81);
    outline-offset: -3px;
}

/* ---------------------------------------------------------------------------
   Overlay content (name + CTA)
   --------------------------------------------------------------------------- */
.pmp-hero-overlay-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: clamp(1rem, 4%, 2rem);
}

.pmp-hero-name {
    color: #ffffff;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

/* CTA - reuses CTA token, mirrors the search CTA button treatment */
.pmp-hero-cta {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background-color: var(--pmp-color-cta, #f38d81);
    color: #ffffff;
    border: 1px solid var(--pmp-color-cta, #f38d81);
    border-radius: 4px;
    font-size: clamp(0.95rem, 1.4vw, 1.05rem);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pmp-hero-link:hover .pmp-hero-cta,
.pmp-hero-link:focus-visible .pmp-hero-cta {
    background-color: var(--pmp-color-primary, #024463);
    border-color: var(--pmp-color-primary, #024463);
    color: #ffffff;
}

/* Banner reuses the shared search banner styles; ensure it sits above scrim */
.pmp-hero-card .pmp-search-banner {
    position: absolute;
    z-index: 3;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (min-width: 980px) {
    .pmp-hero-card {
        aspect-ratio: var(--pmp-hero-aspect-desktop, 1 / 1);
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .pmp-hero-image,
    .pmp-hero-cta {
        transition: none;
    }

    .pmp-hero-link:hover .pmp-hero-image,
    .pmp-hero-link:focus-visible .pmp-hero-image {
        transform: none;
    }
}
