/*
Theme Name: Mazza
Theme URI: https://mazza.com.ar
Author: Marcelo Mazza
Author URI: https://mazza.com.ar
Description: Child theme of Twenty Twenty-Five for mazza.com.ar — custom home, blog, and brand.
Template: twentytwentyfive
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 7.2
Version: 0.4.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mazza
Tags: full-site-editing, blog, block-patterns, custom-colors
*/

/* -------------------------------------------------------------------------
   Calendar-style post grid + top brand bar
   ------------------------------------------------------------------------- */

.mazza-squares-page {
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	padding: 0;
	background: #fff;
	color: #111;
	box-sizing: border-box;
}

.mazza-squares-page *,
.mazza-squares-page *::before,
.mazza-squares-page *::after {
	box-sizing: border-box;
}

/* —— Header / logo + name —— */
.mazza-squares-header {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: 3.25rem;
	margin: 0 !important;
	padding: 0.65rem clamp(0.75rem, 2.5vw, 1.5rem) !important;
	background: #fff;
	border-bottom: 1px solid #111;
}

.mazza-squares-branding {
	display: flex !important;
	align-items: center;
	gap: 0.65rem;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
}

.mazza-squares-logo {
	flex-shrink: 0;
	line-height: 0;
}

.mazza-squares-logo .custom-logo-link,
.mazza-squares-logo img {
	display: block;
	width: auto;
	height: clamp(28px, 6vw, 40px);
	max-width: 48px;
	object-fit: contain;
}

/* Hide empty logo wrapper when no custom logo is set */
.mazza-squares-logo:not(:has(img)) {
	display: none;
}

.mazza-squares-brand {
	margin: 0 !important;
	font-size: clamp(0.8rem, 2.2vw, 1.05rem) !important;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #111;
}

.mazza-squares-brand a {
	color: inherit;
	text-decoration: none;
}

.mazza-squares-brand a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* —— Query / calendar frame —— */
.mazza-squares-query {
	margin: 0;
	border-left: 1px solid #111;
}

/*
 * Dense calendar grid.
 * WP core forces 1 column under 600px on .wp-block-post-template-is-layout-grid
 * (4× class specificity). We match that and always keep a multi-column grid.
 */
ul.mazza-squares-grid.wp-block-post-template,
.mazza-squares-grid.wp-block-post-template.is-layout-grid,
.mazza-squares-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	width: 100%;
	max-width: none !important;
}

/* Kill WP’s mobile single-column override (max-width: 600px → 1fr) */
@media (max-width: 600px) {
	.mazza-squares-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid,
	ul.mazza-squares-grid.wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	}
}

.mazza-squares-grid > .wp-block-post,
.mazza-squares-grid > li {
	margin: 0 !important;
	min-width: 0 !important;
	max-width: none !important;
	width: auto !important;
	border-right: 1px solid #111;
	border-bottom: 1px solid #111;
}

.mazza-square {
	/* Keep cells square even when grid tracks stretch */
	aspect-ratio: 1 / 1;
	width: 100%;
	height: auto;
	margin: 0 !important;
	padding: 0.4rem 0.45rem 0.45rem !important;
	overflow: hidden;
	background: #fff;
	display: flex !important;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 0.12rem;
	transition: background 0.12s ease;
}

.mazza-square:hover,
.mazza-square:focus-within {
	background: #f4f4f4;
}

/* Day number — rem-based so it stays readable on phones */
.mazza-square__day {
	margin: 0 !important;
	font-size: 1.25rem !important;
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.02em;
	color: #111;
}

.mazza-square__day a {
	color: inherit;
	text-decoration: none;
}

.mazza-square__month {
	margin: 0 !important;
	font-size: 0.65rem !important;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1;
	color: #666;
}

.mazza-square__title {
	margin: 0 !important;
	margin-top: auto !important;
	padding: 0;
	font-size: 0.7rem !important;
	font-weight: 500;
	line-height: 1.25;
	color: #222;
	max-height: 42%;
	overflow: hidden;
}

.mazza-square__title a {
	color: inherit;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.mazza-square__title a:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.mazza-squares-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.5rem 0.75rem;
	padding: clamp(1rem, 3vw, 1.75rem) clamp(0.75rem, 2vw, 1.25rem)
		clamp(1.5rem, 4vw, 2.5rem);
	color: #333;
	font-size: clamp(0.85rem, 2vw, 1rem);
}

.mazza-squares-pagination a {
	color: inherit;
}

.mazza-squares-pagination .wp-block-query-pagination-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem;
}

/* —— Breakpoints: more columns as viewport grows —— */
@media (min-width: 400px) {
	.mazza-squares-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid,
	ul.mazza-squares-grid.wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
	}
}

@media (min-width: 560px) {
	.mazza-squares-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid,
	ul.mazza-squares-grid.wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
	}

	.mazza-square__day {
		font-size: 1.35rem !important;
	}

	.mazza-square__title {
		font-size: 0.72rem !important;
	}
}

@media (min-width: 768px) {
	.mazza-squares-header {
		min-height: 3.75rem;
		padding: 0.75rem clamp(1rem, 3vw, 2rem) !important;
	}

	.mazza-squares-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid,
	ul.mazza-squares-grid.wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
	}

	.mazza-square {
		padding: 0.45rem 0.5rem !important;
	}

	.mazza-square__day {
		font-size: 1.45rem !important;
	}

	.mazza-square__month {
		font-size: 0.68rem !important;
	}

	.mazza-square__title {
		font-size: 0.75rem !important;
	}
}

@media (min-width: 1100px) {
	.mazza-squares-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid,
	ul.mazza-squares-grid.wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
	}

	.mazza-square__day {
		font-size: 1.5rem !important;
	}
}

@media (min-width: 1400px) {
	.mazza-squares-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid,
	ul.mazza-squares-grid.wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
	}
}

/* Narrow phones: 4 cols, readable type, 2-line titles */
@media (max-width: 399px) {
	.mazza-squares-header {
		min-height: 3rem;
		padding: 0.5rem 0.75rem !important;
	}

	.mazza-squares-branding {
		gap: 0.45rem;
	}

	.mazza-square {
		padding: 0.35rem 0.4rem !important;
		gap: 0.08rem;
	}

	.mazza-square__day {
		font-size: 1.15rem !important;
	}

	.mazza-square__month {
		font-size: 0.62rem !important;
	}

	.mazza-square__title {
		font-size: 0.68rem !important;
	}

	.mazza-square__title a {
		-webkit-line-clamp: 2;
	}
}

/* Bump version note in header comment handled via Version field */

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
	.mazza-square {
		transition: none;
	}
}
