/*
Theme Name: Marticolomer
Theme URI: https://marticolomer.com
Author: Marti Colomer
Description: Tema personalitzat per a Marti Colomer. Requereix Elementor.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: marticolomer
Tags: elementor, custom-post-types, portfolio
*/

/* ─── RESET ──────────────────────────────────────────────────────────────────── */

*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	min-height: 100vh;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
	display: block;
	max-width: 100%;
}

input, button, textarea, select {
	font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
	overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
	font-size: inherit;
	font-weight: inherit;
}

ul, ol {
	list-style: none;
}

a {
	color: inherit;
	text-decoration: none;
}

table {
	border-collapse: collapse;
	border-spacing: 0;
}

button {
	background: none;
	border: none;
	cursor: pointer;
}

/* ─── HEADER ─────────────────────────────────────────────────────────────────── */

.site-header {
	border-bottom: 1px solid currentColor;
	height: 64px;
	position:sticky;
	top:0;
	z-index:99;
	background:white;
}

.header-inner {
	display: flex;
	align-items: center;
	height: 100%;
	padding: 0 32px;
	gap: 48px;
}

/* Navegació */
.main-nav {
	display: flex;
	align-items: center;
	gap: 0;
	margin-left: auto;
	height: 100%;
}

.nav-filters,
.nav-pages {
	display: flex;
	align-items: center;
	gap: 32px;
}

.nav-filters li,
.nav-pages li {
	display: flex;
}

/* Botons de filtre */
.nav-filter-btn {
	font-size: inherit;
	font-family: inherit;
	font-weight: 600;
	color: #999;
	transition: color .2s ease;
	padding: 0;
	letter-spacing: -.01em;
}

.nav-filter-btn:hover {
	color: #000;
}

.nav-filter-btn.is-active {
	color: #000;
	font-weight: 700;
}

/* Pàgines del menú */
.nav-pages a {
	font-weight: 600;
	color: #999;
	transition: color .2s ease;
	letter-spacing: -.01em;
}

.nav-pages a:hover,
.nav-pages .current-menu-item a {
	color: #000;
}

/* Separador vertical */
.nav-separator {
	display: block;
	width: 1px;
	align-self: stretch;
	background: #000;
	margin: 0 32px;
	flex-shrink: 0;
}

/* Hamburger — ocult per defecte (desktop) */
.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	margin-left: auto;
	flex-shrink: 0;
}

.nav-toggle__bar {
	display: block;
	width: 100%;
	height: 2px;
	background: currentColor;
	transition: transform .25s ease, opacity .25s ease;
	transform-origin: center;
}

/* X quan obert */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
	opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {

	.nav-toggle {
		display: flex;
	}

	.main-nav {
		display: none;
		position: fixed;
		top: 64px;
		left: 0;
		right: 0;
		bottom: 0;
		flex-direction: column;
		align-items: flex-start;
		background: #fff;
		padding: 32px;
		gap: 0;
		overflow-y: auto;
		margin-left: 0;
		height: auto;
		z-index: 999;
	}

	.main-nav.is-open {
		display: flex;
	}

	.nav-filters,
	.nav-pages {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
		width: 100%;
	}

	.nav-separator {
		width: 100%;
		height: 1px;
		align-self: auto;
		margin: 28px 0;
	}
}

/* ─── LOGO TEXT FALLBACK ─────────────────────────────────────────────────────── */

.site-logo--text a {
	font-size: 30px;
	font-weight: 800;
	text-decoration: none;
	color: inherit;
	line-height: 1;
}

/* ─── FOOTER ─────────────────────────────────────────────────────────────────── */

.site-footer {
	padding: 20px 32px;
	border-top: 1px solid currentColor;
}

.footer-inner {
	display: flex;
	align-items: center;
	gap: 0;
}
@media screen and (max-width:767px){
    .site-footer .footer-inner {
        display:flex;
        flex-wrap:wrap;
    
    }
     .site-footer .footer-inner > * {
         width:100%;
     }
     .footer-inner .site-info{
         text-align:center;
     }
     .social-links {
         justify-content:center;
         margin-bottom:10px;
     }
     .footer-separator {
         display:none!important;
         opacity:0;
     }
     section.sp-hero{
         grid-template-columns: 1fr!important;
         min-height: calc(50dvh - 64px);
     }
     section.sp-hero > div{
         width:100%;
     }
     section .sp-video{
        aspect-ratio: 16 / 9;
     }
     section h1{
         font-size:20px;
         font-weight:600;
     }
}

/* Xarxes socials */
.social-links {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
}

.social-link {
	display: flex;
	align-items: center;
	color: inherit;
	opacity: .85;
	transition: opacity .2s ease;
	line-height: 1;
}

.social-link:hover {
	opacity: 1;
}

/* Línia vertical separadora */
.footer-separator {
	display: block;
	width: 1px;
	height: 20px;
	background: currentColor;
	margin-left: 14px;
	opacity: .4;
	flex-shrink: 0;
}

/* Copyright */
.site-info {
	flex: 1;
	text-align: right;
}

/* ─── SINGLE PROJECTE ────────────────────────────────────────────────────────── */

/* Hero */
.sp-hero {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: calc( 80dvh - 64px );
}

/* Vídeo */
.sp-video {
	position: relative;
	background: #000;
	overflow: hidden;
}

.sp-video__wrapper {
	position: absolute;
	inset: 0;
}

.sp-video__wrapper iframe {
	width: 100%;
	height: 100%;
	display: block;
}

.sp-video__fallback {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
}

/* Fitxa tècnica */
.sp-ficha {
	padding: 48px;
	display: flex;
	flex-direction: column;
	gap: 24px;
	justify-content: center;
}
section h1{
         font-size:28px;
         font-weight:700;
     }
.sp-ficha__text {
	font-size: 15px;
	line-height: 1.8;
	white-space: pre-line;
}

/* Galeria */
.sp-gallery {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 280px, 1fr ) );
	gap: 0;
}

.sp-gallery__item {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #111;
}

.sp-gallery__item img {
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	display: block;
	transition: transform .5s ease;
}

.sp-gallery__item:hover img {
	transform: scale( 1.04 );
}

/* ─── 404 ────────────────────────────────────────────────────────────────────── */

.page-404 {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: calc( 100vh - 64px );
	text-align: center;
	padding: 32px;
}

.page-404__inner {
	max-width: 480px;
}

.page-404__code {
	font-size: clamp( 80px, 15vw, 160px );
	font-weight: 800;
	line-height: 1;
	opacity: .08;
	margin-bottom: -0.2em;
}

.page-404__title {
	font-size: clamp( 20px, 3vw, 28px );
	font-weight: 700;
	margin-bottom: 12px;
}

.page-404__text {
	color: #999;
	margin-bottom: 32px;
}

.page-404__back {
	font-weight: 500;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
	transition: opacity .2s ease;
}

.page-404__back:hover {
	opacity: .5;
}

/* ─── WIDGET: PROJECTES GRID ─────────────────────────────────────────────────── */

.pg-grid {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
}

.pg-item {
	position: relative;
	overflow: hidden;
}

.pg-item__link {
	display: block;
	position: relative;
}

/* Ratio 4:3 */
.pg-item__thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #111;
}

.pg-item__thumb .pg-item__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	display: block;
	transition: transform .5s ease;
}

.pg-item__no-thumb {
	width: 100%;
	height: 100%;
	background: #222;
}

/* Overlay amb títol */
.pg-item__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba( 0, 0, 0, .45 );
	opacity: 0;
	transition: opacity .3s ease;
}

.pg-item__title {
	color: #fff;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	transform: translateY( 6px );
	transition: transform .3s ease;
}

/* Hover */
.pg-item__link:hover .pg-item__overlay {
	opacity: 1;
}

.pg-item__link:hover .pg-item__title {
	transform: translateY( 0 );
}

.pg-item__link:hover .pg-item__img {
	transform: scale( 1.04 );
}

/* ── Animació de filtre ── */
.pg-item {
	transition: opacity .3s ease, transform .3s ease;
}

/* Fade out: tots els items desapareixen */
.pg-item.pg-out {
	opacity: 0;
	transform: scale( .97 );
	pointer-events: none;
}

/* Fade in: els items coincidents apareixen en stagger */
.pg-item.pg-in {
	animation: pgFadeIn .4s ease both;
}

@keyframes pgFadeIn {
	from {
		opacity: 0;
		transform: scale( .97 ) translateY( 8px );
	}
	to {
		opacity: 1;
		transform: scale( 1 ) translateY( 0 );
	}
}
