/*
Theme Name: Fisio
Theme URI: https://github.com/pasc4le/2026-fisio-iacono
Author: Giuseppe Pascale
Author URI: https://github.com/pasc4le
Description: Block theme for Fisioterapia Iacono — Full Site Editing.
Version: 1.2.0
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fisio
Tags: full-site-editing, block-patterns, custom-colors, custom-logo
*/

/* Block themes rely on theme.json + block styles.
   Keep this file almost empty — add only overrides here. */

/* Box alignwide blocks at the root level (e.g. header & hero). */
.alignwide {
	max-width: var(--wp--style--global--wide-size);
	margin-left: auto !important;
	margin-right: auto !important;
}

/* Header: equalize logo and button heights for symmetric vertical padding. */
.fisio-header-logo img {
	height: 50px;
	width: auto;
}

/* Homepage header floats as a transparent bar over the hero image, so its logo must be the light variant. */
.fisio-header-transparent {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 20;
}

/* Reserve space below the floating header so hero content isn't hidden underneath it. */
.fisio-hero {
	padding-top: calc(var(--wp--preset--spacing--80) + 88px) !important;
}

/* Hero badge: vertically center star with text. */
.fisio-hero-badge-icon {
	display: flex;
	align-items: center;
	margin: 0;
}

.fisio-hero .has-badge-background-color p {
	margin: 0;
	line-height: 1;
}

/* Hero title: keep the two lines tight. */
.fisio-hero-title {
	margin-top: 0;
	margin-bottom: 0.1em;
	line-height: 0.7;
}

.fisio-hero-title-accent {
	color: var(--wp--preset--color--primary);
}

/* Keep the hero description readable and allow it to wrap. */
.fisio-hero-description {
	max-width: 44rem;
}

/* Match the hero content container to the boxed navbar's wide layout. */
.fisio-hero-content {
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	margin-right: auto !important;
	margin-left: auto !important;
}

/* Card & review shadows (Group block shadow support is not always available). */
.fisio-card-shadow {
	box-shadow: 0 2px 8px rgba(25, 28, 29, 0.03);
}

.fisio-review-shadow {
	box-shadow: 0 12px 40px rgba(25, 28, 29, 0.05);
}

/* Hero badge star size. */
.fisio-hero-badge-icon img {
	width: 18px;
	height: 18px;
}

/* Fixed WhatsApp button. */
.fisio-whatsapp-fixed {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 9999;
}

.fisio-whatsapp-fixed figure {
	margin: 0;
	line-height: 0;
}

.fisio-whatsapp-fixed a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background: #25d366;
	border-radius: 50%;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fisio-whatsapp-fixed img {
	width: 28px;
	height: 28px;
}

/* Ensure specialization cards fill the grid cell height. */
.fisio-specialization-card {
	height: 100%;
	box-sizing: border-box;
}

/* Icon images inside cards keep their intrinsic size. */
.fisio-card-icon img {
	width: 30px;
	height: 30px;
}

.fisio-card-icon-small img {
	width: 12px;
	height: 12px;
}

/* Contact card: match the info-card layout, chip icons, and link-free values from the design. */
.fisio-contact-card {
	box-sizing: border-box;
	width: 100%;
	height: 100%;
}

.fisio-cta-box {
	box-sizing: border-box;
	height: 100%;
	align-items: center !important;
	justify-content: center !important;
	text-align: center;
}

.fisio-contact-columns {
	column-gap: 24px !important;
}

.fisio-contact-icon-chip {
	margin: 0;
	flex: 0 0 auto;
}

.fisio-contact-icon-chip img {
	display: block;
}

.fisio-contact-value {
	color: var(--wp--preset--color--foreground);
}

.fisio-contact-value a {
	color: inherit;
	text-decoration: none;
}

.fisio-contact-value a:hover,
.fisio-contact-value a:focus-visible {
	text-decoration: underline;
}

/* Star icons in review cards. */
.fisio-star-icon img {
	width: 12px;
	height: 12px;
}

/* Dynamic specialization cards, populated from WordPress categories. */
.wp-block-fisio-specializations {
	padding: var(--wp--preset--spacing--80) var(--wp--preset--spacing--50) var(--wp--preset--spacing--70);
	background: var(--wp--preset--color--surface);
}

.fisio-specializations__intro {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--60);
}

.fisio-specializations__intro h2,
.fisio-specializations__intro p {
	margin: 0;
}

.fisio-specializations__intro p {
	color: var(--wp--preset--color--muted);
	font-size: 18px;
}

.fisio-specializations__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40);
}

.fisio-specialization-card {
	display: flex;
	min-height: 100%;
	box-sizing: border-box;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--60);
	border-radius: 16px;
	background: var(--wp--preset--color--card);
	color: var(--wp--preset--color--foreground);
	cursor: pointer;
	text-decoration: none;
	transition: transform 160ms ease, box-shadow 160ms ease;
}

.fisio-specialization-card:hover {
	transform: translateY(-3px);
}

.fisio-specialization-card:focus-visible {
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

.fisio-specialization-card__heading {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

.fisio-specialization-card__heading h3,
.fisio-specialization-card__description,
.fisio-specialization-card__more {
	margin: 0;
}

.fisio-specialization-card__heading h3 {
	font-size: 20px;
}

.fisio-specialization-card:visited {
	color: inherit;
}

.fisio-specialization-card__description {
	color: var(--wp--preset--color--muted);
	font-size: 14px;
}

.fisio-specialization-icon {
	display: inline-flex;
	width: 30px;
	height: 30px;
	flex: 0 0 30px;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--primary);
}

.fisio-specialization-icon svg {
	width: 30px;
	height: 30px;
	fill: currentColor;
}

.fisio-specialization-featured {
	background: var(--wp--preset--color--accent-dark);
	color: var(--wp--preset--color--card);
}

.fisio-specialization-featured:visited {
	color: var(--wp--preset--color--card);
}

.fisio-specialization-featured .fisio-specialization-card__description {
	color: var(--wp--preset--color--card);
}

.fisio-specialization-featured .fisio-specialization-icon {
	color: var(--wp--preset--color--card);
}

.fisio-specialization-card__more {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	margin-top: auto;
	font-size: 15px;
	font-weight: 600;
}

/* Article pages. */
.fisio-article-hero {
	min-height: clamp(320px, 42vw, 500px) !important;
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50) !important;
	background: var(--wp--preset--color--primary-dark);
	align-items: flex-end;
	justify-content: flex-start;
}

.fisio-article-hero .wp-block-cover__background {
	background: linear-gradient(0deg, rgba(25, 28, 29, 0.84) 0%, rgba(25, 28, 29, 0.22) 70%, rgba(25, 28, 29, 0.08) 100%) !important;
	opacity: 1 !important;
}

.fisio-article-hero .wp-block-cover__inner-container,
.fisio-article-content {
	width: 100%;
	text-align: left;
}

/* Align the title with the boxed article body while keeping it at the hero's bottom. */
.fisio-article-hero__content {
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	row-gap: var(--wp--preset--spacing--40);
	margin-right: auto !important;
	margin-left: auto !important;
}

.fisio-article-hero__category {
	display: flex;
	width: fit-content;
	margin: 0;
}

.fisio-article-hero__category a {
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.9);
	color: var(--wp--preset--color--badge-text);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	line-height: 1.3;
	text-decoration: none;
	text-transform: uppercase;
}

.fisio-article-hero h1 {
	max-width: 900px;
	margin: 0;
	color: var(--wp--preset--color--card) !important;
	font-size: clamp(2rem, 5vw, 3.5rem);
	line-height: 1.12;
}

.fisio-article {
	padding: 0 var(--wp--preset--spacing--50) var(--wp--preset--spacing--80);
}

.fisio-article__meta {
	gap: var(--wp--preset--spacing--40);
	max-width: 880px;
	margin-top: 0 !important;
	margin-bottom: var(--wp--preset--spacing--70) !important;
	padding: var(--wp--preset--spacing--50) 0;
	border-bottom: 1px solid #e2e8f0;
}

.fisio-article-author {
	display: flex;
	align-items: center;
	margin: 0;
}

.fisio-article-author .wp-block-post-author__avatar {
	align-self: center;
	width: 48px;
	height: 48px;
	margin-right: var(--wp--preset--spacing--30);
	border-radius: 16px;
	object-fit: cover;
}

.fisio-article-author .wp-block-post-author__content {
	align-self: center;
}

.fisio-article-author .wp-block-post-author__name {
	margin: 0;
	color: var(--wp--preset--color--foreground);
	font-family: var(--wp--preset--font-family--manrope);
	font-size: 18px;
	font-weight: 700;
}

.fisio-article-author .wp-block-post-author__bio {
	margin: 2px 0 0;
	color: var(--wp--preset--color--muted);
	font-size: 14px;
}

.fisio-article-author__dot {
	margin: 0 6px;
}

.fisio-article.is-layout-constrained > .fisio-article-content {
	width: 100%;
	max-width: var(--wp--style--global--wide-size) !important;
	margin-right: auto !important;
	margin-left: auto !important;
}

.fisio-article-content .wp-block-post-content {
	max-width: 100%;
	color: var(--wp--preset--color--muted);
	font-size: 16px;
	line-height: 1.65;
}

.fisio-article-content .wp-block-post-content > :first-child {
	color: var(--wp--preset--color--foreground);
	font-size: 18px;
	font-weight: 500;
	line-height: 1.55;
}

.fisio-article-content .wp-block-post-content > * + * {
	margin-top: var(--wp--preset--spacing--50);
}

.fisio-article-content .wp-block-post-content h2 {
	margin-top: var(--wp--preset--spacing--70);
	color: var(--wp--preset--color--foreground);
	font-size: 28px;
	letter-spacing: -0.025em;
}

.fisio-article-content .wp-block-post-content h3 {
	color: var(--wp--preset--color--foreground);
	font-size: 20px;
}

.fisio-article-content .wp-block-post-content ul {
	margin-right: 0;
	margin-left: 0;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
	border-radius: 8px;
	background: var(--wp--preset--color--surface);
	list-style: none;
}

.fisio-article-content .wp-block-post-content li {
	position: relative;
	padding-left: 1.75rem;
}

.fisio-article-content .wp-block-post-content li::before {
	position: absolute;
	left: 0;
	color: #004c17;
	content: "✓";
	font-weight: 800;
}

.fisio-article-content .wp-block-post-content li + li {
	margin-top: var(--wp--preset--spacing--30);
}

.fisio-article-content .wp-block-post-content blockquote {
	margin-right: 0;
	margin-left: 0;
	padding-left: var(--wp--preset--spacing--50);
	border-left: 4px solid rgba(0, 76, 23, 0.3);
	color: var(--wp--preset--color--foreground);
	font-family: var(--wp--preset--font-family--manrope);
	font-size: 20px;
	line-height: 1.4;
}

.fisio-article-content .wp-block-post-content .wp-block-image img {
	border-radius: 12px;
}

/* Compact category archive hero. */
.wp-block-fisio-category-hero {
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50) var(--wp--preset--spacing--30);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--foreground);
}

.fisio-category-hero__content {
	width: 100%;
}

.fisio-category-hero h1 {
	max-width: 820px;
	margin: 0;
	color: inherit;
}

.fisio-category-hero__description {
	max-width: 620px;
	margin: var(--wp--preset--spacing--20) 0 0;
	font-size: 18px;
}

.wp-block-fisio-category-hero + .fisio-category-posts {
	margin-block-start: 0 !important;
}

.fisio-category-post-card {
	position: relative;
	height: 100%;
	box-sizing: border-box;
	border-radius: 12px;
	overflow: hidden;
	transition: transform 160ms ease, box-shadow 160ms ease;
}

.fisio-category-post-card:hover {
	transform: translateY(-3px);
}

/* Full-bleed cover image: flush with the card top, no border radius. */
.fisio-category-post-card .wp-block-post-featured-image {
	margin: 0;
}

.fisio-category-post-card .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.fisio-category-post-card .wp-block-post-title,
.fisio-category-post-card .wp-block-post-excerpt {
	margin: 0;
}

/* Title is black (overrides the theme's default primary link color). */
.fisio-category-post-card .wp-block-post-title a {
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
}

/* Stretch the title link over the whole card so every part is clickable. */
.fisio-category-post-card .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* Placeholder shown when a post has no featured image. */
.fisio-category-post-card .fisio-post-image-placeholder {
	display: flex;
	width: 100%;
	aspect-ratio: 16 / 9;
	margin: 0;
	align-items: center;
	justify-content: center;
	background: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--card); /* icon paths draw with currentColor */
}

.fisio-category-post-card .fisio-post-image-placeholder svg {
	width: 48px;
	height: 48px;
	fill: var(--wp--preset--color--card);
}

/* Footer: match the desktop layout, typography, and asset geometry from the design. */
.fisio-footer {
	background: var(--wp--preset--color--surface);
}

.fisio-footer-content {
	display: grid !important;
	width: 100%;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.fisio-footer-content > .wp-block-group {
	min-width: 0;
}

.fisio-footer-details,
.fisio-footer-navigation,
.fisio-footer-brand,
.fisio-footer-hours,
.fisio-footer-nav-section,
.fisio-footer-links {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.fisio-footer .fisio-footer-content > *,
.fisio-footer .fisio-footer-details > *,
.fisio-footer .fisio-footer-navigation > *,
.fisio-footer .fisio-footer-brand > *,
.fisio-footer .fisio-footer-hours > *,
.fisio-footer .fisio-footer-nav-section > *,
.fisio-footer .fisio-footer-links > *,
.fisio-footer .fisio-footer-social > *,
.fisio-footer .fisio-footer-legal > * {
	margin-block: 0 !important;
}

.fisio-footer-details {
	gap: 20px;
}

.fisio-footer-brand {
	min-height: 134.25px;
	gap: 15.25px;
}

.fisio-footer-logo {
	width: 100px;
	height: 50px;
	margin: 0;
	flex: 0 0 50px;
	overflow: hidden;
}

.fisio-footer-logo img {
	display: block;
	width: 118.51px !important;
	max-width: none !important;
	height: 50.05px !important;
	transform: translate(-6.12px, -0.025px);
}

.fisio-footer-description,
.fisio-footer-hours-list,
.fisio-footer-link,
.fisio-footer-copyright {
	margin: 0;
	color: var(--wp--preset--color--secondary) !important;
	font-size: 14px;
	font-weight: 400;
}

.fisio-footer-description {
	line-height: 22.75px;
}

.fisio-footer-hours {
	min-height: 108px;
}

.fisio-footer-title {
	margin: 0;
	color: var(--wp--preset--color--foreground);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1.2px;
	line-height: 16px;
	text-transform: uppercase;
}

.fisio-footer-hours-list {
	margin-top: 16px;
	line-height: 20px;
}

.fisio-footer-social {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

/* Override the footer's zero-margin reset for direct children. */
.fisio-footer .fisio-footer-hours > .fisio-footer-social {
	margin-top: 20px !important;
}

.fisio-footer-social-link {
	display: inline-flex;
	width: 20px;
	height: 20px;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--foreground);
	line-height: 0;
}

.fisio-footer-social-link svg {
	display: block;
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.fisio-footer-social-link:hover {
	color: var(--wp--preset--color--primary);
}

.fisio-footer-social-link:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

.fisio-footer-navigation {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: start;
	gap: 20px;
}

.fisio-footer-nav-section {
	gap: 16px;
}

.fisio-footer-links {
	gap: 8px;
}

.fisio-footer-link {
	padding: 2.5px 0 1.5px;
	line-height: 20px;
}

.fisio-footer-link a {
	color: inherit;
	text-decoration: none;
}

.fisio-footer-link a:hover,
.fisio-footer-link a:focus-visible {
	color: var(--wp--preset--color--foreground);
	text-decoration: underline;
}

.fisio-footer-legal {
	box-sizing: border-box;
	min-height: 78.5px;
	padding-top: 31.875px;
	border-top: 1px solid #e2e8f0;
}

.fisio-footer-copyright {
	display: flex;
	width: 100%;
	height: 46px;
	align-items: center;
	justify-content: center;
	line-height: 22.75px;
	text-align: center;
}

@media (max-width: 900px) {
	.fisio-specializations__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Columns stack below WordPress's 782px breakpoint; retain the desktop card gap vertically. */
@media (max-width: 781px) {
	.fisio-contact-columns {
		row-gap: 24px !important;
	}
}

@media (max-width: 600px) {
	/* On small screens, keep the image in the upper half and fade the hero into the page background. */
	.fisio-hero .wp-block-cover__image-background {
		top: 0;
		bottom: auto;
		height: 50%;
		min-height: 0;
		object-position: top center;
	}

	.fisio-hero .wp-block-cover__background {
		background: linear-gradient(
			to bottom,
			transparent 0%,
			transparent 15%,
			var(--wp--preset--color--background) 50%,
			var(--wp--preset--color--background) 100%
		) !important;
		opacity: 1 !important;
	}

	/* The content sits above the white end of the gradient, rather than the image. */
	.fisio-hero-title:not(.fisio-hero-title-accent) {
		color: var(--wp--preset--color--foreground) !important;
	}

	.fisio-hero-description {
		color: var(--wp--preset--color--muted) !important;
	}

	.fisio-hero-content > .wp-block-group + .wp-block-group {
		margin-top: var(--wp--preset--spacing--50);
	}

	.fisio-footer {
		padding-right: 32px !important;
		padding-left: 32px !important;
	}

	.fisio-footer-content {
		display: flex !important;
		flex-direction: column;
		align-items: stretch;
		gap: 20px;
	}

	.fisio-footer-details,
	.fisio-footer-navigation {
		display: contents;
	}

	.fisio-footer-brand {
		order: 1;
	}

	.fisio-footer-clinic {
		order: 2;
	}

	.fisio-footer-studio {
		order: 3;
	}

	.fisio-footer-hours {
		order: 4;
	}

	.wp-block-fisio-specializations {
		padding-right: var(--wp--preset--spacing--40);
		padding-left: var(--wp--preset--spacing--40);
	}

	.fisio-specializations__grid {
		grid-template-columns: 1fr;
	}

	/* Keep article category badges compact without reducing their title spacing. */
	.fisio-article-hero__category a {
		padding: 0.375rem 0.625rem;
		font-size: 10px;
	}
}
