/* Spiridon Homepage Manager 1.1.11
 * Local layout corrections for saint product rows only.
 * Deliberately scoped to .sp-home-saint-* so catalog, category and related
 * WooCommerce product cards keep their existing theme styles.
 */

.sp-home-saint-row {
    grid-template-columns: minmax(330px, .42fr) minmax(0, 1fr);
    align-items: stretch;
}

.sp-home-saint-card {
    position: relative;
    isolation: isolate;
    min-height: 0;
    height: 100%;
}

.sp-home-saint-card__media {
    position: relative;
    z-index: 1;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    padding-left: 10px;
    background: transparent;
    border-radius: 0 0 24px 24px;
}

/* Optional visual treatment, enabled per saint block in the plugin settings.
 * Both layers stay behind the transparent PNG and are clipped by the card. */
.sp-home-saint-card__media::before,
.sp-home-saint-card__media::after {
    position: absolute;
    pointer-events: none;
    content: "";
}

.sp-home-saint-card__media::before {
    z-index: 0;
    top: 5%;
    left: 50%;
    width: clamp(112px, 92%, 170px);
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 225, 132, .52) 0%,
        rgba(244, 195, 69, .27) 34%,
        rgba(244, 195, 69, .10) 54%,
        rgba(244, 195, 69, 0) 73%);
    filter: blur(8px);
    opacity: 0;
}

.sp-home-saint-card__media::after {
    z-index: 0;
    inset: 0;
    background:
        radial-gradient(circle at 3% 42%, transparent 0 25px, rgba(255, 255, 255, .13) 26px 27px, transparent 28px 43px, rgba(255, 255, 255, .07) 44px 45px, transparent 46px),
        linear-gradient(45deg, transparent 47%, rgba(255, 255, 255, .055) 48% 52%, transparent 53%) 0 0 / 28px 28px,
        linear-gradient(-45deg, transparent 47%, rgba(255, 255, 255, .045) 48% 52%, transparent 53%) 0 0 / 28px 28px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .72) 58%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .72) 58%, transparent 100%);
    opacity: 0;
}

.sp-home-saint-row--halo-glow .sp-home-saint-card__media::before {
    opacity: 1;
}

.sp-home-saint-row--media-pattern .sp-home-saint-card__media::after {
    opacity: 1;
}

.sp-home-saint-row--gold.sp-home-saint-row--media-pattern .sp-home-saint-card__media::after {
    background:
        radial-gradient(circle at 3% 42%, transparent 0 25px, rgba(84, 66, 30, .18) 26px 27px, transparent 28px 43px, rgba(84, 66, 30, .11) 44px 45px, transparent 46px),
        linear-gradient(45deg, transparent 47%, rgba(84, 66, 30, .105) 48% 52%, transparent 53%) 0 0 / 28px 28px,
        linear-gradient(-45deg, transparent 47%, rgba(84, 66, 30, .085) 48% 52%, transparent 53%) 0 0 / 28px 28px;
    filter: none;
    opacity: .72;
}

.sp-home-saint-card__media img {
    display: block;
    width: auto;
    height: auto;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center center;
    clip-path: inset(0 round 0 0 24px 24px);
    position: relative;
    z-index: 2;
}
body.wp-theme-spiridon.theme-spiridon .sp-home-saint-card__media img {
    border-radius: 0 0 24px 24px;}

.sp-home-saint-card__content {
    position: relative;
    z-index: 2;
}

.sp-home-saint-card h3 {
    color: var(--sp-home-saint-title-color, inherit);
}

.sp-home-saint-row .sp-home-saint-card__button {
    background: var(--sp-home-saint-button-color, rgba(255, 255, 255, .2));
    color: #fff;
}

.sp-home-saint-row .sp-home-saint-card__button:visited,
.sp-home-saint-row .sp-home-saint-card__button:hover,
.sp-home-saint-row .sp-home-saint-card__button:focus {
    color: #fff;
}

.sp-home-saint-products {
    min-width: 0;
}

/* The grid now reacts to the real number of returned products and the
 * available width. No count-specific 2/3/4-column rules are required. */
.sp-home-saint-products ul.products {
    grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
    height: auto;
    min-height: 100%;
    align-items: stretch;
    gap: 1px;
    background: #e4e9ef;
}

.sp-home-saint-products ul.products li.product.product-card {
    height: auto;
    min-height: 0;
}
body.wp-theme-spiridon.theme-spiridon .sp-home-saint-products ul.products li.product.product-card {
    border: 0;}

.sp-home-saint-products .product-card__link,
.sp-home-saint-products .product-card__content {
    overflow: visible;
}

.sp-home-saint-products .woocommerce-loop-product__title {
    display: block;
    overflow: visible;
    min-height: 0;
    margin: 8px 0 0;
    padding: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: initial;
    -webkit-line-clamp: unset;
}
body.wp-theme-spiridon.theme-spiridon .sp-home-saint-products .woocommerce-loop-product__title {
    color: #08265a;
    font-family: var(--sp-serif, Georgia, "Times New Roman", serif);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;}

.sp-home-saint-products .woocommerce-loop-product__title a,
.sp-home-saint-products .product-card__link .woocommerce-loop-product__title {
    text-decoration: none;
}
body.wp-theme-spiridon.theme-spiridon .sp-home-saint-products .woocommerce-loop-product__title a,
body.wp-theme-spiridon.theme-spiridon .sp-home-saint-products .product-card__link .woocommerce-loop-product__title {
    color: #08265a;}

.sp-home-saint-products .product-card__footer {
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .sp-home-saint-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .sp-home-saint-products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Holy-place cards use the same quiet white-card language as homepage
 * product cards. The whole card is the link; it has no separate CTA state. */
.sp-home-place-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 12px;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid #e4e9ef;
    border-radius: 14px;
    background: #fff;
    color: #102f50;
    box-shadow: 0 8px 24px rgba(23, 43, 70, .07);
    text-decoration: none;
    transition: none;
}

.sp-home-place-card:hover,
.sp-home-place-card:focus,
.sp-home-place-card:visited {
    transform: none;
    border-color: #e4e9ef;
    background: #fff;
    color: #102f50;
    box-shadow: 0 8px 24px rgba(23, 43, 70, .07);
}

.sp-home-place-card__media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    background: #f7faff;
}

.sp-home-place-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
}

.sp-home-place-card__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 3px 5px;
}

.sp-home-place-card strong {
    color: #102f50;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    line-height: 1.15;
    text-shadow: none;
}

.sp-home-place-card small {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    color: #697588;
    font-size: 13px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.sp-home-place-card.is-without-image {
    background: #fff;
}

@media (max-width: 480px) {
    .sp-home-saint-products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* v1.2.0: compact product card authority for the saint section. */
.sp-home-saint-products .product-card--compact .woocommerce-loop-product__title {
    display: -webkit-box;
    min-height: 32px;
    max-height: 32px;
    margin-top: 3px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
body.wp-theme-spiridon.theme-spiridon .sp-home-saint-products .product-card--compact .woocommerce-loop-product__title {
    font-size: 12px;
    line-height: 1.35;}
.sp-home-saint-products .product-card--compact .product-card__actions .yith-wcwl-add-to-wishlist,
.sp-home-saint-products .product-card--compact .product-card__actions .yith-add-to-wishlist-button-block,
.sp-home-saint-products .product-card--compact .product-card__actions .yith-wcwl-add-button { order: 1; }
.sp-home-saint-products .product-card--compact .product-card__actions .sp-product-card__cart { order: 2; }

/* v1.2.2: tighter saint row and full-height portrait without top/bottom gaps. */
.sp-home-saint-card__media img {
    align-self: center;
    width: auto;
    height: calc(100% - 10px);
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center center;
}

.sp-home-saint-card__content {
    padding-top: 13px;
    padding-bottom: 13px;
}

@media (min-width: 761px) {
    body.wp-theme-spiridon.theme-spiridon .sp-home-saint-row--desktop-count-1 .sp-home-saint-products li.product:nth-child(n+2),
    body.wp-theme-spiridon.theme-spiridon .sp-home-saint-row--desktop-count-2 .sp-home-saint-products li.product:nth-child(n+3),
    body.wp-theme-spiridon.theme-spiridon .sp-home-saint-row--desktop-count-3 .sp-home-saint-products li.product:nth-child(n+4) {
        display: none;}
}

@media (max-width: 760px) {
    body.wp-theme-spiridon.theme-spiridon .sp-home-saint-products ul.products li.product:nth-child(-n+4) {
        display: flex;}
    body.wp-theme-spiridon.theme-spiridon .sp-home-saint-products ul.products li.product:nth-child(n+5) {
        display: none;}
}
