/*
Theme Name: Elayne
Theme URI: https://imagewize.com/themes/elayne
Author: Jasper Frumau
Author URI: https://imagewize.com
Description: A premium business block theme with advanced patterns for professional websites. Features industry-specific pattern sets for spa, real estate, and professional services with built-in conversion optimization.
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.0
Version: 3.6.4
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: elayne
Tags: block-patterns, block-styles, blog, custom-colors, custom-logo, custom-menu, editor-style, featured-images, full-site-editing, one-column, rtl-language-support, template-editing, threaded-comments, translation-ready, wide-blocks

Elayne WordPress Theme, (C) 2025 Jasper Frumau
Elayne is distributed under the terms of the GNU GPL.
*/

/**
 * Table of Contents
 *
 *  1. Partial Underline (post titles)
 *  2. Layout Helpers (alignfull bleed)
 *  3. Checkmark List
 *  4. Avatar
 *  5. Spa & Wellness Style Variation
 *  6. Cart Icon
 *  7. Mobile Navigation
 *  8. Portfolio Masonry Grid
 *  9. WooCommerce Product Grid
 * 10. Post Author & Date Alignment
 * 11. Link Underline
 * 12. Comment Form Spacing
 * 13. Legal Hero Split Layout
 * 14. Diagonal Hero Section
 * 15. Diagonal Banner Section
 * 16. Layout Utilities (overlay-grid-wrap, floating-badge, icon-pulse, stats-divider)
 * 17. Skip Link Accessibility
 * 18. Safari Scrollbar Fix
 */

/* Partial underline styling for post titles (matches Versifier) */
.has-partial-underline a {
    display: inline-block;
    border-bottom: 2px solid currentColor !important;
    border-image: linear-gradient(to right, currentColor 33%, transparent 33%) 1;
    padding-bottom: 0.25rem;
    text-decoration: none !important;
}

.has-partial-underline-center.has-partial-underline-third a {
    border-image: linear-gradient(to right, transparent 33.33%, currentColor 33.33%, currentColor 66.66%, transparent 66.66%) 1 !important;
}

.wp-block-post-title.has-partial-underline-center.has-partial-underline-third {
    position: relative;
    padding-bottom: 0.5rem;
}

.wp-block-post-title.has-partial-underline-center.has-partial-underline-third::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 33.33%;
    right: 33.33%;
    height: 2px;
    background-color: currentColor;
}

.wp-block-post-title.has-partial-underline-center.has-partial-underline-third a {
    border-bottom: none !important;
    border-image: none !important;
    text-decoration: none !important;
}

/* Opt-out helper: add body class "no-partial-underline" to disable underline styles */
body.no-partial-underline .has-partial-underline a,
body.no-partial-underline .wp-block-post-title.has-partial-underline-center.has-partial-underline-third a {
    border-bottom: none !important;
    border-image: none !important;
    padding-bottom: 0;
}

body.no-partial-underline .wp-block-post-title.has-partial-underline-center.has-partial-underline-third {
    padding-bottom: 0;
}

body.no-partial-underline .wp-block-post-title.has-partial-underline-center.has-partial-underline-third::after {
    display: none;
}

/* Layout helpers: allow alignfull blocks inside post content to bleed edge-to-edge while root padding stays on */
.wp-site-blocks .wp-block-post-content .alignfull {
    margin-left: calc(-1 * var(--wp--style--root--padding-left, 0px));
    margin-right: calc(-1 * var(--wp--style--root--padding-right, 0px));
    width: calc(100% + var(--wp--style--root--padding-left, 0px) + var(--wp--style--root--padding-right, 0px));
    max-width: 100vw;
}

/* Checkmark list style for pricing tables */
.is-style-checkmark-list {
    list-style: none;
    padding-left: 0;
}

.is-style-checkmark-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-left: 0 !important;
}

.is-style-checkmark-list li::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background-image: url('patterns/images/check-circle.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-top: 0.125rem;
}

figure.is-avatar,
.wp-block-image.is-avatar {
    width: var(--wp--custom--avatar-size) !important;
    height: var(--wp--custom--avatar-size) !important;
    max-width: var(--wp--custom--avatar-size) !important;
}

.is-avatar img {
    width: var(--wp--custom--avatar-size) !important;
    height: var(--wp--custom--avatar-size) !important;
    max-width: var(--wp--custom--avatar-size) !important;
    aspect-ratio: 1;
    object-fit: cover;
}

/* ========================================================================
   Spa & Wellness Style Variation (from Velora Spa theme)
   ======================================================================== */

/* Overlapping columns styling */
@media (min-width: 782px) {
    .is-style-overlap-columns .wp-block-column:nth-child(2) {
        margin-left: -10%;
        z-index: 2;
        position: relative;
        align-self: center;
    }

    /* Styling for reversed overlapping columns */
    .is-style-overlap-columns-reversed .wp-block-column:nth-child(1) {
        margin-right: -10%;
        margin-left: 0;
        z-index: 2;
        position: relative;
        align-self: center;
    }
}

/* Spa post grid styling */
.spa-post-grid .wp-block-post-featured-image {
    width: 100%;
}

.spa-post-grid .wp-block-post-featured-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Cart icon styling */
.cart-icon {
    margin: 0 !important;
    transition: transform 0.2s ease;
}

.cart-icon img {
    display: block;
    width: 24px;
    height: 24px;
}

.cart-icon a:hover {
    opacity: 0.8;
}

.cart-icon a:hover img {
    filter: brightness(0) sepia(100%) saturate(500%) hue-rotate(175deg);
    transform: scale(1.1);
}

/* Mobile navigation adjustments */
@media (max-width: 781px) {
    .wp-block-site-title {
        padding-left: 2.8rem;
    }

    .mobile-centered-nav .wp-block-navigation__responsive-container-open {
        margin: 0 auto;
    }

    .mobile-centered-nav {
        width: 100%;
        justify-content: center;
    }

    .mobile-centered-nav .wp-block-navigation__responsive-container-open {
        position: relative;
        left: 0;
        transform: translateX(0);
    }
}

/* Masonry grid layout using CSS columns */
.portfolio-masonry-grid {
    column-count: 3;
    column-gap: 16px;
}

.portfolio-masonry-grid .portfolio-item {
    break-inside: avoid;
    margin-bottom: 16px;
    display: inline-block;
    width: 100%;
}

/* Responsive masonry columns */
@media (max-width: 1024px) {
    .portfolio-masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .portfolio-masonry-grid {
        column-count: 1;
    }
}

/* WooCommerce Product Collection responsive grid (3-2-1 columns) */
.wc-block-product-template.is-flex-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem !important;
}

.wc-block-product-template.is-flex-container > li {
    width: auto !important;
}

@media (max-width: 1024px) {
    .wc-block-product-template.is-flex-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 640px) {
    .wc-block-product-template.is-flex-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* ========================================================================
   Post Author & Post Date Alignment Fix
   ======================================================================== */

/* Ensure post author and post date are vertically aligned when in a flex container */
.wp-block-post-author {
    display: flex;
    align-items: center;
}

/* Align author content (name) with the center of the avatar */
.wp-block-post-author__content {
    display: flex;
    align-items: center;
}

/* Ensure post date aligns with author name */
.wp-block-post-date {
    display: flex;
    align-items: center;
}

/* ========================================================================
   Link Underline Styling
   ======================================================================== */

/* Firefox-specific fix for thick underlines  */
@-moz-document url-prefix() {
    a {
        text-decoration-thickness: .1rem !important;
    }
}

/* WordPress.org requirement: links in body content must be underlined.
   Covers block content, comments, and text widgets.
   Navigation-like contexts (menus, buttons, post titles) remain exempt. */
.wp-block-post-content a:not(.wp-element-button),
.comment-content a:not(.wp-element-button),
.widget a:not(.wp-element-button) {
    text-decoration: underline;
}

/* ========================================================================
   Comment Form Spacing
   ======================================================================== */

.wp-block-post-comments-form #submit {
    margin-top: 1rem;
}

/* ========================================================================
   Legal Hero Split Layout - Mobile Ordering
   ======================================================================== */

/* On mobile, show image first, then content, then reviews */
@media (max-width: 782px) {
    .legal-hero-split-grid {
        display: flex !important;
        flex-direction: column;
    }

    .legal-hero-split-content {
        order: 2;
    }

    .legal-hero-split-image {
        order: 1;
    }

    .legal-hero-split-reviews {
        order: 3;
    }
}

/* On desktop, stack image and reviews in the right column */
@media (min-width: 783px) {
    .legal-hero-split-grid {
        grid-template-columns: 1fr 1fr !important; /* Force 2 columns */
        grid-auto-flow: dense; /* Allow items to fill available space */
    }

    .legal-hero-split-content {
        grid-column: 1; /* First column */
        grid-row: 1 / 3; /* Span both rows */
    }

    .legal-hero-split-image {
        grid-column: 2; /* Second column */
        grid-row: 1; /* First row */
    }

    .legal-hero-split-reviews {
        grid-column: 2; /* Second column */
        grid-row: 2; /* Second row */
    }
}

/* ========================================================================
   Diagonal Hero Section - Editable Overlay Effect
   ======================================================================== */

/* Diagonal overlay hero section with WordPress Cover block overlay */
.diagonal-hero-section {
    position: relative;
    overflow: hidden;
}

/* Create the diagonal clip-path on BOTH Cover block overlay elements (solid colors AND gradients) */
.diagonal-hero-section .wp-block-cover__background,
.diagonal-hero-section .wp-block-cover__gradient-background {
    clip-path: polygon(0 0, 65% 0, 55% 100%, 0 100%);
}

/* Ensure content stays above overlay */
.diagonal-hero-section .wp-block-cover__inner-container {
    position: relative;
    z-index: 2;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .diagonal-hero-section .wp-block-cover__background,
    .diagonal-hero-section .wp-block-cover__gradient-background {
        clip-path: polygon(0 0, 70% 0, 60% 100%, 0 100%);
    }
}

@media (max-width: 768px) {
    .diagonal-hero-section {
        min-height: 500px !important;
    }

    /* Full overlay on mobile for better readability */
    .diagonal-hero-section .wp-block-cover__background,
    .diagonal-hero-section .wp-block-cover__gradient-background {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

@media (max-width: 480px) {
    .diagonal-hero-section {
        min-height: 450px !important;
    }
}

/* ========================================================================
   Diagonal Banner Section - Editable Overlay Effect
   ======================================================================== */

/* Diagonal overlay banner section with WordPress Cover block overlay */
.diagonal-banner-section {
    position: relative;
    overflow: hidden;
}

/* Create the diagonal clip-path on BOTH Cover block overlay elements (solid colors AND gradients) */
.diagonal-banner-section .wp-block-cover__background,
.diagonal-banner-section .wp-block-cover__gradient-background {
    clip-path: polygon(0 0, 65% 0, 55% 100%, 0 100%);
}

/* Ensure content stays above overlay */
.diagonal-banner-section .wp-block-cover__inner-container {
    position: relative;
    z-index: 2;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .diagonal-banner-section .wp-block-cover__background,
    .diagonal-banner-section .wp-block-cover__gradient-background {
        clip-path: polygon(0 0, 70% 0, 60% 100%, 0 100%);
    }
}

@media (max-width: 768px) {
    /* Full overlay on mobile for better readability */
    .diagonal-banner-section .wp-block-cover__background,
    .diagonal-banner-section .wp-block-cover__gradient-background {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* ========================================================================
   Layout Utilities
   Reusable structural classes, not tied to any style variation.
   ======================================================================== */

/* Thin vertical divider between stat items */
.stats-divider {
	display: block;
	width: 1px;
	height: 36px;
	background: rgba( 255, 255, 255, 0.1 );
	align-self: center;
}

/* CSS Grid overlay — stack all children in the same cell (hero/image compositions) */
.overlay-grid-wrap {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
	overflow: visible;
}

.overlay-grid-wrap > .wp-block-group {
	grid-column: 1;
	grid-row: 1;
}

/* Floating stat/social-proof badge overlaid on an image */
.floating-badge {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: #112240;
	border: 1px solid rgba( 255, 255, 255, 0.08 );
	border-left: 3px solid #E67E22;
	padding: 0.55rem 0.9rem;
	border-radius: 10px;
	z-index: 2;
	white-space: nowrap;
	width: fit-content;
}

/* Bottom-left badge position */
.floating-badge--bl {
	align-self: end;
	justify-self: start;
	margin-bottom: 1.5rem;
	margin-left: -0.75rem;
}

/* Top-right badge position */
.floating-badge--tr {
	align-self: start;
	justify-self: end;
	margin-top: 1.5rem;
	margin-right: -0.75rem;
}

/* Icon sizing inside floating badges */
.floating-badge .wp-block-image {
	margin: 0;
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.floating-badge .wp-block-image img {
	width: 16px;
	height: 16px;
	display: block;
}

/* Pulsing icon — use on any "live" or "urgent" indicator */
@keyframes icon-pulse {
	0%,
	100% {
		transform: scale( 1 );
	}

	50% {
		transform: scale( 1.1 );
	}
}

.icon-pulse {
	animation: icon-pulse 2s ease-in-out infinite;
	display: inline-block;
}


/* ============================================
   Skip Link Accessibility Improvements
   ============================================ */

/* Skip link - hidden by default, visible on focus */
.skip-link.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px); /* Legacy browsers */
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Skip link focus state - highly visible */
.skip-link.screen-reader-text:focus,
#wp-skip-link:focus {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 100000;
    display: inline-block;
    width: auto;
    height: auto;
    clip: auto;
    clip-path: none;
    padding: 15px 20px;
    background-color: var(--wp--preset--color--primary, #0073aa);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    border-radius: 3px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    outline: 3px solid var(--wp--preset--color--primary-alt, #005a87);
    outline-offset: 2px;
}

/* Ensure skip link target is visible */
#wp--skip-link--target {
    scroll-margin-top: 20px;
}

/* Remove global blockGap spacing for template parts (header/footer)
 * theme.json sets blockGap: "1.2rem" which adds margin-block-start: 1.2rem to all direct children of .wp-site-blocks
 * This creates unwanted gaps between full-width patterns and footer/header template parts
 * Introduced in v2.0.0 pattern refactor (commit b08fd39c) for vertical rhythm between content sections
 * This override allows full-width patterns with background colors to be flush with template parts
 */
.wp-site-blocks > .wp-block-template-part {
    margin-block-start: 0;
}

/* ========================================================================
   Safari Scrollbar Visibility Fix (Gutenberg Editor)
   ======================================================================== */

/* Safari renders overlay scrollbars with near-invisible light gray thumb on
   white/light backgrounds. This makes the thumb visible in the block editor
   canvas (style.css is enqueued via add_editor_style for the editor iframe). */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.55);
}
