/*
Theme Name: CathAqua
Theme URI: https://cath-aquarelle.fr
Author: Alk
Author URI: https://cath-aquarelle.fr
Description: Twenty Twenty-Five fork for cath-aquarelle.fr
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.2
Version: 1.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentytwentyfive
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
*/

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

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

/* 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;
}

/*
 * 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;
}

/*
 * 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;
}

/*
 * Gallery block: Use CSS Grid instead of Flexbox to prevent last row items from stretching
 * This ensures images maintain consistent size regardless of how many are in the last row
 */
.wp-block-gallery.has-nested-images {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, min(250px, 100%));
	justify-content: center;
}

.wp-block-gallery.has-nested-images > .wp-block-image {
	width: initial !important;
}

.wp-block-gallery.has-nested-images > .wp-block-image > a {
	flex: initial !important;
	width: initial !important;
	height: initial !important;
	transition:
		transform 0.3s ease,
		box-shadow 0.3s ease;
}

.wp-block-gallery.has-nested-images > .wp-block-image > a:hover {
	transform: scale(1.05);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/*
 * PhotoSwipe white theme customization
 * Override default dark theme with light colors for better visibility
 */
body .pswp {
	--pswp-bg: #ffffff;
	--pswp-placeholder-bg: #f5f5f5;
	--pswp-icon-color: #aaa;
	--pswp-icon-color-secondary: #fff;
	--pswp-icon-stroke-color: #fff;
	--pswp-preloader-color: rgba(17, 17, 17, 0.4);
	--pswp-preloader-color-secondary: rgba(17, 17, 17, 0.9);
	--pswp-error-text-color: #111111;
}

body .wp-block-accordion-panel {
	display: grid !important;
	margin-block-start: 0 !important;
	transition: grid-template-rows 0.5s ease-in-out;
	grid-template-rows: 1fr;
}

body .wp-block-accordion-panel[inert] {
	grid-template-rows: 0fr;
}
body .wp-block-accordion-panel > * {
	overflow: hidden;
}
body .wp-block-accordion-panel > :first-child {
	margin-top: 1.2rem;
}

h1.wp-block-post-title {
	font-size: var(--wp--preset--font-size--x-large);
	text-align: center;
}
