/*
Theme Name: Ben B
Theme URI: 
Author: Sumotori Team
Author URI: 
Description: Wordpress FSE Thème for Ben B. Schwartz & Sons, Inc.
Requires at least: 6.8
Tested up to: 6.8
Requires PHP: 7.2
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ben-b
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, style-variations, accessibility-ready, blog, portfolio, news

/*
 * Progressive enhancement to reduce widows and orphans
 * https://github.com/WordPress/gutenberg/issues/55190
 */
h1,
h2,
h3,
h4,
h5,
h6,
blockquote,
caption,
figcaption,
p {
    text-wrap: pretty;
}

body,
html {
    overflow-x: clip;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
}

p:empty {
    display: none;
}

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
    text-decoration-thickness: 1px !important;
    text-underline-offset: 0.2em;
}

/* Focus styles */
:where(.wp-site-blocks *:focus) {
    outline-width: 2px;
    outline-style: solid;
}

/* Remove the margin on the first child of the page, so that the header is not cut off. */
.wp-site-blocks > * {
    margin-block-start: 0;
}

/*
 * Header styles
 */
.wp-site-blocks > header {
    position: absolute;
    z-index: 1;
    inset-inline: 0;
}

.wp-block-heading {
    font-weight: normal !important;
    letter-spacing: 0 !important;
    line-height: 0.8 !important;
}

/*
 * Navigation
 * ------
 */

/* Increase the bottom margin on submenus, so that the outline is visible. */
.wp-block-navigation
    .wp-block-navigation-submenu
    .wp-block-navigation-item:not(:last-child) {
    margin-bottom: 3px;
}

/* Increase the outline offset on the parent menu items, so that the outline does not touch the text. */
.wp-block-navigation
    .wp-block-navigation-item
    .wp-block-navigation-item__content {
    outline-offset: 4px;
}

/* Remove outline offset from the submenus, otherwise the outline is visible outside the submenu container. */
.wp-block-navigation
    .wp-block-navigation-item
    ul.wp-block-navigation__submenu-container
    .wp-block-navigation-item__content {
    outline-offset: 0;
}

.wp-block-navigation
    .wp-block-navigation-item.current-menu-item
    > .wp-block-navigation-item__content {
    color: var(--wp--preset--color--base-1);
}

/*
 * Change the direction of the columns on mobile, so that the columns are displayed in reverse order.
*/
.wp-block-columns.is-style-mobile-reversed {
    @media (width < 782px) {
        flex-direction: column-reverse;
    }
}

/*
 * Limit the width of the text in the alignwide group.
*/
.wp-block-group.alignwide > p.is-style-text-subtitle {
    max-width: 55ch;
}

/*
 * Change the height of the hero banner on the page, so that the text is not cut off.
*/
.page-hero-banner .wp-block-cover {
    min-height: 35dvh;
    @media (width > 782px) {
        min-height: 66dvh;
    }
}

/*
 * Change the position of the more block on the front, by making it a block level element.
 * https://github.com/WordPress/gutenberg/issues/65934
*/
.more-link {
    display: block;
}

/*
 * Change the text alignment on the right on mobile, so that the text is not cut off.
 * https://github.com/WordPress/gutenberg/issues/65934
*/
.has-text-align-right {
    @media (width < 782px) {
        text-align: left;
    }
}

/*
 * Parallax styles for wp-block-cover
 */
.wp-block-cover {
    overflow: hidden;
    position: relative;
}

.wp-block-cover__image-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    will-change: transform; /* Optimisation pour les animations */
}

.wp-block-cover__inner-container {
    position: relative;
    z-index: 2;
}

/* Amélioration de l'effet parallax sur mobile */
@media (max-width: 768px) {
    .wp-block-cover__image-background {
        height: 110%; /* Moins d'effet sur mobile pour éviter les problèmes de performance */
    }
}

/**
 * Button styles
 */
.wp-block-button__link {
    position: relative;
    isolation: isolate;
}

.wp-block-button__link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-color: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.wp-block-button__link:hover::before {
    opacity: 1;
}
