/*
Theme Name: Twenty Twenty Five Child
Template: twentytwentyfive
*/

/* Gallery captions that appear by default and fade out on hover. */

.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image {
	overflow: hidden; /* Clips the scaling image within its frame */
}

.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image img {
	filter: grayscale(0%) brightness(1.05);
	transition: transform 0.3s ease, filter 0.3s ease;
	will-change: transform, filter;
}

.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image:has(figcaption)::before {
	display: none;
}

.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image figcaption {
	max-height: none;
	margin: 0;
	padding: 0.6rem 0.8rem;
	background: rgb(58 58 60 / 0.85);
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	color: var(--color-white, #ffffff);
	font-size: 1rem;
	line-height: 1.3;
	text-align: left;
	text-shadow: none;
	pointer-events: none;
}

@media (hover: hover) {
	/* Image behavior: Starts dimmed/desaturated, pops into full color/scale on hover */
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image img {
		filter: grayscale(30%) brightness(0.9);
	}

	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image:hover img,
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image:focus-within img {
		filter: grayscale(0%) brightness(1.05);
		transform: scale(1.03);
	}

	/* Caption Base State: VISIBLE by default */
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image figcaption {
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 1rem;
		font-size: 1.78rem;
		color: #ffffff;
		text-align: left;
		opacity: 1; /* Visible by default */
		position: absolute; /* Ensures pseudo-element positions relative to the caption */
		background: linear-gradient(#000000, #00000000); /* Gradient Overlay */
		
		transition: opacity 0.25s ease;
	}

	/* Dedicated Underline Element using ::after */
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image figcaption::after {
		content: '';
		position: absolute;
		bottom: 1.5rem;
		left: 1rem;
		width: calc(100% - 2rem);
		height: 2px;
		background-color: #ffffff; /* Underline Color (Hex) */
		transition: width 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease;
	}

	/* Caption Hover State: FADES OUT on hover */
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image:hover figcaption,
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image:focus-within figcaption {
		opacity: 0.3; /* Fades out on hover */
	}

	/* Underline shrinks away on hover */
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image:hover figcaption::after,
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image:focus-within figcaption::after {
		width: 0%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image img,
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image figcaption,
	.wp-block-gallery.hover-captions.has-nested-images figure.wp-block-image figcaption::after {
		transition: none;
	}
}

/* 1. Remove underlines and set up the smooth hover transition */
.navigation a, 
.nav-menu a, 
.wp-block-navigation a, 
.wp-block-navigation-item__content, 
#site-navigation-wrap .menu-item a {
    text-decoration: none !important;
    border-bottom: none !important;
    display: inline-block !important; /* Required to let the text lift up */
    transition: transform 0.2s ease, text-shadow 0.2s ease !important; /* Makes it smooth */
}

/* 2. Apply the Lift Up & Shadow effect on hover */
.navigation a:hover, 
.nav-menu a:hover, 
.wp-block-navigation a:hover, 
.wp-block-navigation-item__content:hover, 
#site-navigation-wrap .menu-item:hover a {
    text-decoration: none !important;
    border-bottom: none !important;
    transform: translateY(-2px) !important; /* Lifts the text up 2 pixels */
    text-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15) !important; /* Adds the soft shadow */
}

/* Removes the outline only when clicked with a mouse */
a:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

.truncate-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 782px) {
  .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
    padding-right: 2rem;
  }
}

/* Target mobile devices only */
@media (max-width: 767px) {
  .your-row-container-class {
    display: flex;
    flex-direction: column !important;
  }
}