/*
Theme Name: Tama Tnabar
Theme URI: http://localhost:8888/tamatnabar
Description: Block theme for Malta Tama Tnabar Association — warm drum colours, flowing rhythm sections. Child of Twenty Twenty-Five; edit everything in Appearance → Editor.
Author: Malta Tama Tnabar Association
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: tamatnabar
*/

/* ---------- Rhythm wave dividers (add class "has-wave-top" / "has-wave-bottom" to a Group) ---------- */
.has-wave-top,
.has-wave-bottom { position: relative; }
.has-wave-top::before,
.has-wave-bottom::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: clamp(28px, 4vw, 56px);
	background-color: inherit;
	-webkit-mask: url("assets/wave.svg") repeat-x center / auto 100%;
	mask: url("assets/wave.svg") repeat-x center / auto 100%;
	pointer-events: none;
}
.has-wave-top::before { bottom: calc(100% - 1px); }
.has-wave-bottom::after { top: calc(100% - 1px); z-index: 1; transform: scaleY(-1); }

/* ---------- Header ---------- */
.tt-header { backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.tt-header .wp-block-site-title a { text-decoration: none; }
.tt-header .tt-logo img { border-radius: 50%; box-shadow: 0 4px 14px rgb(0 0 0 / 12%); transition: transform .4s ease; }
.tt-header .tt-logo:hover img { transform: rotate(-8deg) scale(1.05); }
.wp-block-navigation .wp-block-navigation-item__content { position: relative; }
.wp-block-navigation .wp-block-navigation-item__content::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; border-radius: 3px;
	background: var(--wp--preset--color--accent-1); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.wp-block-navigation .wp-block-navigation-item__content:hover::after,
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after { transform: scaleX(1); }

/* ---------- Cards ("is-style-tt-card" on Group / Column) ---------- */
.is-style-tt-card {
	background: var(--wp--preset--color--base);
	border-radius: 22px;
	box-shadow: 0 10px 30px -12px rgb(60 30 0 / 25%);
	overflow: hidden;
	transition: transform .3s ease, box-shadow .3s ease;
}
.is-style-tt-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px -14px rgb(60 30 0 / 35%); }
.is-style-tt-card > .wp-block-image:first-child img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Beat dots: decorative row under headings ("is-style-tt-beat") ---------- */
.is-style-tt-beat::after {
	content: ""; display: block; width: 88px; height: 10px; margin-top: .6em;
	background:
		radial-gradient(circle, var(--wp--preset--color--accent-1) 4px, transparent 5px) 0 50% / 22px 10px repeat-x;
	animation: tt-beat 1.6s ease-in-out infinite;
}
.has-text-align-center.is-style-tt-beat::after { margin-inline: auto; }
@keyframes tt-beat { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- Images & media ---------- */
.wp-block-image.is-style-rounded img,
.wp-block-gallery .wp-block-image img { border-radius: 16px; }
.wp-block-gallery .wp-block-image img { transition: transform .35s ease; }
.wp-block-gallery .wp-block-image:hover img { transform: scale(1.03); }
.wp-block-video video, .wp-block-embed iframe { border-radius: 16px; }
.wp-block-embed__wrapper iframe { width: 100%; }

/* ---------- Buttons get a little "hit" ---------- */
.wp-block-button__link { transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease; }
.wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px rgb(0 0 0 / 40%); }
.wp-block-button__link:active { transform: translateY(1px) scale(.98); }

/* ---------- Gentle reveal on scroll (respects reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
	.tt-js .tt-reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
	.tt-js .tt-reveal.is-visible { opacity: 1; transform: none; }
	.tt-hero-drum { animation: tt-bounce 3.2s ease-in-out infinite; }
	@keyframes tt-bounce { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
}
@media (prefers-reduced-motion: reduce) {
	.is-style-tt-beat::after { animation: none; }
	.is-style-tt-card:hover { transform: none; }
}

/* ---------- Timeline of moments (Group with class "tt-moments") ---------- */
.tt-moments > .wp-block-group,
.tt-moments > .wp-block-columns { position: relative; }
@media (min-width: 782px) {
	.tt-moments > .wp-block-columns:nth-child(even) { flex-direction: row-reverse; }
}

/* Old builder leftovers: keep legacy markup readable */
.entry-content table { width: 100%; }

/* ---------- Header: no wrapping, burger menu below 1100px ---------- */
.tt-header .wp-block-button__link { white-space: nowrap; }
.tt-header .wp-block-site-title { white-space: nowrap; }
@media (max-width: 1320px) {
	.tt-header .wp-block-navigation__responsive-container-open { display: flex !important; }
	.tt-header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
	.tt-header .wp-block-site-tagline { display: none; }
}
@media (max-width: 600px) {
	.tt-header .tt-header-cta { display: none; }
	.tt-header .wp-block-site-title { font-size: 1.05rem; white-space: normal; }
}
/* Archive section: keep old small photos at a sensible size */
.tt-archive .wp-block-image img { max-width: min(100%, 520px); height: auto; }
.tt-archive .wp-block-video, .tt-archive .wp-block-embed { margin-block: 1.5rem; }
/* Make galleries breathe on phones */
@media (max-width: 600px) { .wp-block-gallery.columns-4, .wp-block-gallery.columns-3 { --wp--style--unstable-gallery-gap: 8px; } }

/* Footer link list */
footer .wp-block-list { list-style: none; }
/* Keep the desktop menu on one line */
.tt-header .wp-block-navigation__container { flex-wrap: nowrap; gap: 1.3em; }
.tt-header .wp-block-navigation-item__content { white-space: nowrap; }
.tt-header > .wp-block-group > .wp-block-group:last-child { flex-shrink: 0; }

/* ---------- Contact page ---------- */
.tt-email-address a { text-decoration: none; overflow-wrap: anywhere; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 3px no-repeat; padding-bottom: 2px; }
.tt-email-address a:hover { background-size: 100% 100%; color: var(--wp--preset--color--accent-1) !important; }
.tt-check-list { list-style: none; padding-left: 0; }
.tt-check-list li { position: relative; padding: .55em 0 .55em 2.2em; border-bottom: 1px dashed var(--wp--preset--color--accent-6); }
.tt-check-list li:last-child { border-bottom: 0; }
.tt-check-list li::before {
	content: "✓"; position: absolute; left: 0; top: .5em; width: 1.5em; height: 1.5em; border-radius: 50%;
	display: grid; place-items: center; font-weight: 800; font-size: .85em;
	background: var(--wp--preset--color--accent-1); color: var(--wp--preset--color--contrast);
}
.tt-step-num {
	width: 2.6em; height: 2.6em; border-radius: 50%; display: grid; place-items: center; margin: 0;
	font-family: var(--wp--preset--font-family--fira-sans); font-weight: 900; font-size: 1.3rem;
	background: var(--wp--preset--color--accent-2); color: var(--wp--preset--color--base);
	box-shadow: 0 0 0 6px var(--wp--preset--color--accent-6);
}
.tt-steps .is-style-tt-card:hover .tt-step-num { animation: tt-hit .35s ease; }
@keyframes tt-hit { 40% { transform: scale(1.18); } }
@media (max-width: 600px) { .tt-email-address { font-size: clamp(1.15rem, 6.2vw, 1.6rem) !important; } .tt-email-address a { overflow-wrap: normal; } }
@media (max-width: 600px) { .tt-email-card { padding-left: 22px !important; padding-right: 22px !important; } .tt-email-address { font-size: clamp(1.05rem, 5.4vw, 1.5rem) !important; } }

/* ---------- Lightbox (enlarged photos) ---------- */
.wp-lightbox-overlay .scrim { background-color: rgb(34 26 21 / 92%) !important; }
.wp-lightbox-overlay .close-button {
	top: 18px !important; right: 18px !important; width: 54px; height: 54px; min-width: 54px; padding: 0 !important;
	border-radius: 50%; display: grid; place-items: center; cursor: pointer; z-index: 5000000;
	background: var(--wp--preset--color--accent-1) !important; color: var(--wp--preset--color--contrast) !important;
	box-shadow: 0 6px 20px rgb(0 0 0 / 35%); transition: transform .2s ease, background-color .2s ease;
}
.wp-lightbox-overlay .close-button svg { width: 26px; height: 26px; fill: currentColor; }
.wp-lightbox-overlay .close-button:hover,
.wp-lightbox-overlay .close-button:focus-visible { transform: rotate(90deg) scale(1.08); background: var(--wp--preset--color--base) !important; outline: 3px solid var(--wp--preset--color--accent-1); outline-offset: 3px; }
.wp-lightbox-overlay .lightbox-image-container img { border-radius: 12px; }
/* Small hint that photos can be enlarged */
.wp-lightbox-container { cursor: zoom-in; }
.wp-lightbox-container button { opacity: .85; }
/* Lightbox buttons (WordPress 7 class names) */
.wp-lightbox-overlay .wp-lightbox-close-button,
.wp-lightbox-overlay .wp-lightbox-navigation-button {
	width: 54px !important; height: 54px !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important;
	display: grid !important; place-items: center; cursor: pointer; z-index: 5000000 !important;
	background: var(--wp--preset--color--accent-1) !important; color: var(--wp--preset--color--contrast) !important;
	fill: var(--wp--preset--color--contrast) !important;
	box-shadow: 0 6px 20px rgb(0 0 0 / 40%); transition: transform .2s ease, background-color .2s ease;
}
.wp-lightbox-overlay .wp-lightbox-close-button { top: 18px !important; right: 18px !important; }
.wp-lightbox-overlay .wp-lightbox-close-button svg,
.wp-lightbox-overlay .wp-lightbox-navigation-button svg { width: 26px; height: 26px; fill: var(--wp--preset--color--contrast) !important; }
.wp-lightbox-overlay .wp-lightbox-close-button:hover,
.wp-lightbox-overlay .wp-lightbox-close-button:focus-visible { transform: rotate(90deg) scale(1.08); background: var(--wp--preset--color--base) !important; }
.wp-lightbox-overlay .wp-lightbox-navigation-button:hover,
.wp-lightbox-overlay .wp-lightbox-navigation-button:focus-visible { transform: scale(1.1); background: var(--wp--preset--color--base) !important; }
.wp-lightbox-overlay button:focus-visible { outline: 3px solid var(--wp--preset--color--accent-3) !important; outline-offset: 3px; }
@media (max-width: 600px) {
	.wp-lightbox-overlay .wp-lightbox-close-button, .wp-lightbox-overlay .wp-lightbox-navigation-button { width: 46px !important; height: 46px !important; }
}

/* ---------- Frozen (sticky) header ---------- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 1000;
}
body.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { body.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; } }
/* slimmer, shadowed header once the page is scrolled */
.tt-header { transition: padding .25s ease, box-shadow .25s ease; }
.tt-scrolled .tt-header { padding-top: 6px !important; padding-bottom: 6px !important; box-shadow: 0 6px 18px -10px rgb(34 26 21 / 35%); }
.tt-header .tt-logo img { transition: width .25s ease, height .25s ease, transform .4s ease; }
.tt-scrolled .tt-header .tt-logo img { width: 48px !important; height: 48px !important; }
/* keep in-page jumps from hiding under the header */
html { scroll-padding-top: 110px; }

/* ---------- Accessibility ---------- */
/* Lightbox "enlarge" button: at least 32px target */
.wp-lightbox-container button.lightbox-trigger { width: 36px !important; height: 36px !important; padding: 8px !important; }
/* Clear focus ring on every interactive element */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-2) !important;
	outline-offset: 3px !important;
	border-radius: 4px;
}
.has-contrast-background-color :where(a, button):focus-visible,
.wp-block-cover :where(a, button):focus-visible { outline-color: var(--wp--preset--color--accent-3) !important; }
/* Visible skip link when focused */
.skip-link.screen-reader-text:focus { background: var(--wp--preset--color--contrast) !important; color: var(--wp--preset--color--base) !important; padding: 14px 22px !important; z-index: 100001 !important; border-radius: 8px; }
/* Media never wider than the screen (WCAG 1.4.10 reflow) */
.wp-block-audio audio, .wp-block-video video { width: 100%; max-width: 100%; min-width: 0; }
