/*!
 * entorn.css — Explorador d'entorn (shortcode [entorn_explorer]).
 * Handoff "Entorn": intro + sub-nav + filtres + graella de targetes (3 tipus)
 * + modal. Tipografia i paleta heretades del sistema (tokens.css).
 */

.er-entorn {
	--ent-paper: #F7F3EA;
	--ent-ink: var(--er-ink, #2A2520);
	--ent-ink-soft: var(--er-ink-soft, #6B6258);
	--ent-ink-mute: #9A9184;
	--ent-line: #E7E0D2;
	--ent-green: var(--er-green, #3EA534);
	--ent-green-dark: var(--er-green-fn, #03693A);
	--ent-serif: var(--er-serif);
	--ent-sans: var(--er-sans);

	font-family: var(--ent-sans);
	color: var(--ent-ink);
	-webkit-font-smoothing: antialiased;
}
.er-entorn *,
.er-entorn *::before,
.er-entorn *::after { box-sizing: border-box; }

/* ── Intro ── */
.er-entorn__intro { max-width: 760px; padding: 8px 0 26px; }
.er-entorn__kick {
	font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
	font-weight: 600; color: var(--ent-green-dark);
}
.er-entorn .er-entorn__title {
	font-family: var(--ent-serif); font-weight: 600; font-size: 30px;
	line-height: 1.16; letter-spacing: -.01em; margin: 14px 0 0; color: var(--ent-ink);
}
.er-entorn .er-entorn__lead {
	font-size: 17px; line-height: 1.62; color: var(--ent-ink-soft);
	margin: 18px 0 0; text-wrap: pretty;
}

/* ── Sub-nav (enllaços entre pàgines) ── */
.er-entorn__subnav { display: flex; gap: 34px; border-bottom: 1px solid var(--ent-line); }
.er-entorn .er-entorn__tab {
	font-family: var(--ent-sans); font-size: 15px; font-weight: 500;
	color: var(--ent-ink-soft); text-decoration: none; padding: 16px 0;
	position: relative; white-space: nowrap;
}
.er-entorn .er-entorn__tab:hover { color: var(--ent-ink); }
.er-entorn .er-entorn__tab.is-active { color: var(--ent-ink); font-weight: 600; }
.er-entorn .er-entorn__tab.is-active::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
	height: 2px; background: var(--ent-green);
}

/* ── Filtres ── */
.er-entorn__filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 28px 0 2px; }
.er-entorn .er-entorn__filter {
	font-family: var(--ent-sans); background: #fff; border: 1px solid var(--ent-line);
	border-radius: 999px; cursor: pointer; font-size: 13.5px; font-weight: 500;
	color: var(--ent-ink-soft); padding: 9px 17px; transition: all .15s; white-space: nowrap;
}
.er-entorn .er-entorn__filter:hover { border-color: var(--ent-ink-mute); color: var(--ent-ink); }
.er-entorn .er-entorn__filter.is-active {
	background: var(--ent-green-dark); border-color: var(--ent-green-dark); color: #fff;
}

/* ── Graella ── */
.er-entorn__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px 56px; padding: 46px 0 40px; }
.er-ecard { position: relative; text-decoration: none; color: inherit; }
.er-ecard.is-offset { margin-top: 72px; } /* efecte masonry; el JS el recalcula en filtrar */
.er-ecard[hidden] { display: none; }

.er-ecard__photo {
	position: relative; aspect-ratio: 4/4.6; border-radius: 4px; overflow: hidden; background: #3a4a32;
}
.er-ecard__photo[data-grad="green"] { background: linear-gradient(155deg, #8fa67a 0%, #45563a 100%); }
.er-ecard__photo[data-grad="slate"] { background: linear-gradient(155deg, #aab4bd 0%, #586872 100%); }
/* Muntanyes de placeholder (com a les captures). Substituïble per foto real. */
.er-ecard__photo::after,
.er-entorn-modal__img::after {
	content: ""; position: absolute; inset: 0;
	background: no-repeat bottom/100% auto
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 240'%3E%3Cpath d='M0 240 L150 90 L250 175 L300 130 L400 220 L400 240 Z' fill='%23000' fill-opacity='0.12'/%3E%3Cpath d='M120 240 L260 70 L400 200 L400 240 Z' fill='%23000' fill-opacity='0.10'/%3E%3C/svg%3E");
}
/* Amb foto real: cobreix i amaga les muntanyes de placeholder. */
.er-ecard__photo--img { background-size: cover; background-position: center; background-repeat: no-repeat; }
.er-ecard__photo--img::after { display: none; }

.er-ecard.is-link { cursor: pointer; }
.er-ecard.is-link:hover .er-ecard__photo { transform: none; }
.er-ecard.is-link:hover .er-ecard__photo::before {
	content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(0,0,0,.06);
}

.er-ecard__panel {
	position: relative; width: 86%; margin: -58px auto 0; background: var(--ent-paper);
	box-shadow: 0 18px 40px rgba(30,24,14,.14), 0 2px 6px rgba(30,24,14,.06);
	padding: 26px 28px 24px; border-radius: 3px;
}
.er-ecard__meta {
	font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
	font-weight: 600; color: var(--ent-green-dark); margin-bottom: 11px;
}
.er-ecard .er-ecard__t {
	font-family: var(--ent-serif); font-weight: 600; font-size: 22px;
	line-height: 1.18; letter-spacing: -.005em; margin: 0; color: var(--ent-ink);
}
.er-ecard .er-ecard__d {
	font-size: 14.5px; line-height: 1.6; color: var(--ent-ink-soft); margin: 11px 0 0; text-wrap: pretty;
}
.er-ecard__more {
	display: inline-flex; align-items: center; gap: 11px; margin-top: 18px;
	font-size: 13px; font-weight: 600; color: var(--ent-ink); letter-spacing: .01em; white-space: nowrap;
}
.er-ecard__circ {
	width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ent-green-dark);
	display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.er-ecard__circ svg { width: 14px; height: 11px; color: var(--ent-green-dark); }
.er-ecard__circ--plus svg { width: 14px; height: 14px; }
.er-ecard.is-link:hover .er-ecard__circ { background: var(--ent-green-dark); }
.er-ecard.is-link:hover .er-ecard__circ svg { color: #fff; }
.er-ecard:focus-visible { outline: 2px solid var(--ent-green-dark); outline-offset: 4px; border-radius: 4px; }

/* ── Modal ── */
.er-entorn-modal {
	position: fixed; inset: 0; z-index: 9990; display: none;
	align-items: center; justify-content: center; padding: 32px;
}
.er-entorn-modal.is-open { display: flex; }
.er-entorn-modal__bg {
	position: absolute; inset: 0; background: rgba(24,20,14,.55);
	backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.er-entorn-modal__box {
	position: relative; z-index: 1; background: #fff; max-width: 600px; width: 100%;
	max-height: 88vh; overflow: auto; border-radius: 6px; box-shadow: 0 40px 90px rgba(0,0,0,.32);
}
.er-entorn-modal__img { position: relative; width: 100%; height: 240px; overflow: hidden; background: #3a4a32; background-size: cover; background-position: center; background-repeat: no-repeat; }
.er-entorn-modal__img.has-img::after { display: none; }
.er-entorn-modal__img[data-grad="green"] { background: linear-gradient(155deg, #8fa67a 0%, #45563a 100%); }
.er-entorn-modal__img[data-grad="slate"] { background: linear-gradient(155deg, #aab4bd 0%, #586872 100%); }
.er-entorn-modal__body { padding: 30px 36px 38px; }
.er-entorn-modal__meta {
	font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
	font-weight: 600; color: var(--ent-green-dark); margin-bottom: 10px;
}
.er-entorn-modal .er-entorn-modal__t {
	font-family: var(--ent-serif); font-weight: 600; font-size: 28px; line-height: 1.14;
	letter-spacing: -.01em; margin: 0 0 16px; color: var(--ent-ink);
}
.er-entorn-modal__text { font-size: 15.5px; line-height: 1.72; color: var(--ent-ink-soft); }
.er-entorn-modal__text p { margin: 0 0 14px; }
.er-entorn-modal__text p:last-child { margin-bottom: 0; }
.er-entorn-modal__close {
	position: absolute; top: 16px; right: 16px; z-index: 2; width: 38px; height: 38px;
	border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer;
	font-size: 21px; line-height: 1; color: var(--ent-ink); display: flex;
	align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* ── Mòbil (≤820px) ── */
@media (max-width: 820px) {
	.er-entorn .er-entorn__title { font-size: 24px; }
	.er-entorn .er-entorn__lead { font-size: 15.5px; }
	.er-entorn__subnav { gap: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.er-entorn__subnav::-webkit-scrollbar { display: none; }
	.er-entorn__filters { padding: 22px 0 2px; }
	.er-entorn__grid { grid-template-columns: 1fr; gap: 40px; padding: 34px 0 30px; }
	.er-ecard.is-offset { margin-top: 0; }
	.er-ecard__photo { aspect-ratio: 4/3.4; }
	.er-ecard__panel { width: 90%; margin-top: -48px; padding: 22px 22px 22px; }
	.er-ecard .er-ecard__t { font-size: 20px; }

	/* Modal → bottom-sheet */
	.er-entorn-modal { padding: 0; align-items: flex-end; }
	.er-entorn-modal__box { max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; }
	.er-entorn-modal__img { height: 200px; }
	.er-entorn-modal__body { padding: 26px 24px 32px; }
	.er-entorn-modal .er-entorn-modal__t { font-size: 24px; }
}

/* ── Compartir per targeta (botó a la cantonada de la foto) ── */
.er-ecard__share { position: absolute; top: 14px; right: 14px; z-index: 4; }
.er-ecard--landing .er-ecard__share,
.er-ecard--text .er-ecard__share { /* sobre targetes clicables: per damunt del overlay */ z-index: 5; }

/* Ressaltat temporal en arribar via ?act=slug */
.er-ecard.is-shared-hl { box-shadow: 0 0 0 3px var(--er-green-fn, #03693A), 0 18px 40px rgba(30,24,14,.16); border-radius: 6px; }
.er-ecard.is-shared-hl .er-ecard__photo { border-radius: 6px 6px 0 0; }
