/**
 * Portfólio — alinhado ao sistema visual da home e da loja.
 * Mesmo max-width, tipografia, grid e cards (sem layout “especial”).
 */

/* Container = home (.ep-home) */
body.ashe-wc-no-blog-sidebars:has(.ep-portfolio) .post-content {
	max-width: var(--ashe-wc-max, 1320px);
	padding-left: 0;
	padding-right: 0;
}

body.ashe-wc-no-blog-sidebars:has(.ep-portfolio) .post-header {
	border-bottom: 0;
	margin-bottom: 0;
	padding-bottom: 0;
	text-align: center;
}

body.ashe-wc-no-blog-sidebars:has(.ep-portfolio) .page-title {
	display: none !important; /* título editorial no hero, como a home */
}

.ep-portfolio {
	max-width: var(--ashe-wc-max, 1320px);
	margin: 0 auto;
	padding: 0 0 2.5rem;
}

/* Hero = .ep-home-hero */
.ep-portfolio__hero {
	position: relative;
	text-align: center;
	max-width: 42rem;
	margin: 0 auto 2.75rem;
	padding: clamp(1.75rem, 4vw, 2.75rem) 1.25rem clamp(1.25rem, 2.5vw, 1.75rem);
	background: transparent !important;
}

.ep-portfolio__eyebrow {
	display: inline-block;
	margin: 0 0 1.15rem;
	font-family: var(--ashe-wc-font-sans, "Open Sans", system-ui, sans-serif);
	font-size: 0.72rem;
	font-weight: 650;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--ashe-wc-moss, #3d5c52);
	line-height: 1.3;
}

.ep-portfolio__title {
	margin: 0 auto 0.95rem !important;
	padding: 0 !important;
	max-width: 14ch;
	font-family: var(--ashe-wc-font-serif, "Playfair Display", Georgia, serif) !important;
	font-size: clamp(2.2rem, 5.2vw, 3.1rem) !important;
	font-weight: 400 !important;
	color: var(--ashe-wc-ink, #1a1c1b) !important;
	line-height: 1.1 !important;
	letter-spacing: -0.02em !important;
	text-align: center !important;
}

.ep-portfolio__title::after {
	display: none !important;
}

.ep-portfolio__rule {
	width: 2.5rem;
	height: 2px;
	margin: 0 auto 1.35rem;
	border-radius: 2px;
	background: var(--ashe-wc-moss, #3d5c52);
	opacity: 0.55;
}

.ep-portfolio__lead {
	max-width: 32rem;
	margin: 0 auto;
	font-family: var(--ashe-wc-font-sans, "Open Sans", system-ui, sans-serif);
	font-size: clamp(1rem, 1.8vw, 1.12rem);
	font-weight: 400;
	line-height: 1.7;
	color: var(--ashe-wc-muted, #6f736f);
	text-align: center;
}

/* Mobile: ritmo de página portfólio (social + editorial) */
@media screen and (max-width: 720px) {
	body.ashe-wc-no-blog-sidebars:has(.ep-portfolio) .main-content {
		padding-top: 0.75rem !important;
		padding-bottom: 2rem !important;
	}

	body.ashe-wc-no-blog-sidebars:has(.ep-portfolio) .post-content {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	.ep-portfolio {
		padding-bottom: 1.5rem;
	}

	.ep-portfolio__hero {
		margin-bottom: 1.35rem;
		padding: 1.25rem 1rem 1rem;
	}

	.ep-portfolio__nav {
		gap: 0.35rem;
		margin-bottom: 1.5rem;
		padding: 0 0.75rem;
		justify-content: flex-start;
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.ep-portfolio__nav::-webkit-scrollbar {
		display: none;
	}

	.ep-portfolio__nav a {
		flex: 0 0 auto;
		min-height: 40px;
		padding: 0.45rem 0.85rem;
		font-size: 0.78rem;
	}

	.ep-portfolio-grid,
	.ep-pinterest__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 0.65rem 0.55rem !important;
		padding: 0 0.75rem !important;
	}

	.ep-portfolio__section,
	.ep-portfolio__featured,
	.ep-pinterest {
		padding: 0 0.15rem;
		margin-bottom: 2rem;
	}

	.ep-portfolio-cta {
		padding: 2rem 1rem 0.25rem;
	}
}

/* Nav chips — discretos, mesma linguagem de filtros leves do site */
.ep-portfolio__nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.45rem 0.55rem;
	list-style: none;
	margin: 0 auto 2.75rem;
	padding: 0 1rem;
}

.ep-portfolio__nav a {
	display: inline-flex;
	align-items: center;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--ashe-wc-line, #e5e1db);
	border-radius: var(--ashe-wc-radius-pill, 999px);
	background: #fff;
	color: var(--ashe-wc-muted, #6f736f) !important;
	font-size: 0.8rem;
	font-weight: 500;
	font-family: var(--ashe-wc-font-sans, "Open Sans", sans-serif);
	text-decoration: none !important;
	line-height: 1.3;
	transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.ep-portfolio__nav a:hover,
.ep-portfolio__nav a:focus-visible {
	border-color: #c5d5ce;
	background: var(--ashe-wc-moss-soft, #e8f0ed);
	color: var(--ashe-wc-moss-deep, #2f4840) !important;
}

/* Secções = .ep-home-section */
.ep-portfolio__section,
.ep-portfolio__featured,
.ep-pinterest {
	margin-bottom: var(--ashe-wc-space-section, 3.25rem);
	padding: 0 1rem;
}

.ep-portfolio__section-head,
.ep-portfolio__featured-head,
.ep-pinterest__head {
	text-align: center;
	margin-bottom: 2rem;
}

.ep-portfolio__section-title,
.ep-portfolio__featured-head h2,
.ep-pinterest__title {
	margin: 0 0 0.55rem !important;
	padding: 0 !important;
	border: 0 !important;
	font-family: var(--ashe-wc-font-serif, "Playfair Display", Georgia, serif) !important;
	font-size: clamp(1.5rem, 2.5vw, 1.85rem) !important;
	font-weight: 400 !important;
	color: var(--ashe-wc-ink, #1a1c1b) !important;
	letter-spacing: -0.015em;
	text-align: center !important;
	line-height: 1.25 !important;
}

.ep-portfolio__section-title::after,
.ep-portfolio__featured-head h2::after,
.ep-pinterest__title::after {
	display: none !important;
}

.ep-portfolio__section-note,
.ep-portfolio__featured-head p,
.ep-pinterest__intro {
	margin: 0 auto;
	max-width: 28rem;
	color: var(--ashe-wc-muted, #6f736f);
	font-size: 0.95rem;
	line-height: 1.6;
	text-align: center;
}

.ep-pinterest__eyebrow {
	display: block;
	margin: 0 0 0.65rem;
	font-size: 0.65rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ashe-wc-moss, #3d5c52);
	font-weight: 650;
	font-family: var(--ashe-wc-font-sans, "Open Sans", sans-serif);
}

.ep-pinterest__cta {
	margin: 1.15rem 0 0;
}

/* Grid = loja (4 colunas desktop) */
.ep-portfolio-grid,
.ep-pinterest__grid {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: 1.1rem 1rem !important;
	margin: 0 0 0.5rem !important;
	padding: 0 !important;
	list-style: none !important;
	width: 100% !important;
	columns: auto !important; /* anula masonry anterior */
}

/* Cards = produto da loja (borda sutil, raio token, sem sombra pesada) */
.ep-portfolio-item,
.ep-pin-item {
	grid-column: auto !important; /* sem span wide/feature */
	margin: 0;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: #fff;
	border: 1px solid var(--ashe-wc-line, #e5e1db);
	border-radius: var(--ashe-wc-radius, 8px);
	overflow: hidden;
	box-shadow: var(--ashe-wc-shadow-soft, 0 1px 2px rgba(23, 25, 26, 0.03), 0 8px 20px rgba(23, 25, 26, 0.05));
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	cursor: zoom-in;
}

.ep-portfolio-item:hover,
.ep-pin-item:hover,
.ep-portfolio-item:focus-within,
.ep-pin-item:focus-within {
	border-color: #d4dbd7;
	box-shadow: var(--ashe-wc-shadow, 0 1px 2px rgba(23, 25, 26, 0.04), 0 12px 32px rgba(23, 25, 26, 0.06));
}

.ep-portfolio-item__media,
.ep-pin-item__media {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--ashe-wc-paper, #f7f4ef);
}

.ep-portfolio-item img,
.ep-pin-item__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.ep-portfolio-item:hover img,
.ep-pin-item:hover img {
	transform: scale(1.02);
}

.ep-portfolio-item__tag,
.ep-pin-item__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	padding: 0.28rem 0.5rem;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.94);
	border: 1px solid rgba(61, 92, 82, 0.12);
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ashe-wc-moss-deep, #2f4840);
	line-height: 1.2;
}

.ep-pin-item__badge {
	left: auto;
	right: 10px;
	width: auto;
	height: auto;
	border-radius: 3px;
	color: #c41e3a;
	box-shadow: none;
}

.ep-portfolio-item figcaption,
.ep-pin-item__title {
	padding: 0.85rem 0.95rem 1rem;
	border-top: 1px solid #f2f0ec;
	text-align: left;
}

.ep-portfolio-item figcaption strong {
	display: block;
	font-family: var(--ashe-wc-font-serif, "Playfair Display", Georgia, serif);
	font-size: 1rem;
	font-weight: 400;
	color: var(--ashe-wc-ink, #1f1f1f);
	line-height: 1.3;
	margin-bottom: 0.2rem;
}

.ep-portfolio-item figcaption span,
.ep-pin-item__title {
	display: block;
	font-size: 0.8rem;
	color: var(--ashe-wc-muted, #7a7a7a);
	line-height: 1.4;
	font-family: var(--ashe-wc-font-sans, "Open Sans", sans-serif);
}

.ep-pin-item__link {
	display: flex;
	flex-direction: column;
	flex: 1;
	text-decoration: none !important;
	color: inherit !important;
	height: 100%;
}

/* Anula classes de destaque antigas */
.ep-portfolio-item--wide,
.ep-portfolio-item--feature,
.ep-portfolio__section .ep-portfolio-grid > .ep-portfolio-item:first-child {
	grid-column: auto !important;
}

.ep-portfolio-item--wide .ep-portfolio-item__media,
.ep-portfolio-item--feature .ep-portfolio-item__media,
.ep-portfolio__section .ep-portfolio-grid > .ep-portfolio-item:first-child .ep-portfolio-item__media {
	aspect-ratio: 1 !important;
}

/* CTA = .ep-home-final */
.ep-portfolio-cta {
	text-align: center;
	padding: 3.25rem 1rem 0.5rem;
	margin: 0;
	border: 0;
	background: transparent;
	border-radius: 0;
}

.ep-portfolio-cta h2 {
	margin: 0 0 0.6rem !important;
	padding: 0 !important;
	font-family: var(--ashe-wc-font-serif, "Playfair Display", Georgia, serif) !important;
	font-size: 1.7rem !important;
	font-weight: 400 !important;
	color: var(--ashe-wc-ink, #1a1c1b) !important;
	text-align: center !important;
}

.ep-portfolio-cta h2::after {
	display: none !important;
}

.ep-portfolio-cta p {
	margin: 0 auto 1.5rem;
	max-width: 26rem;
	color: var(--ashe-wc-muted, #6f736f);
	line-height: 1.6;
	font-size: 0.95rem;
}

.ep-portfolio-cta__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
}

/* Pinterest fallback card — mesmo tom de bloco discreto */
.ep-pinterest__fallback {
	max-width: 28rem;
	margin: 0 auto;
	padding: 1.75rem 1.35rem;
	border: 1px solid var(--ashe-wc-line, #e5e1db);
	border-radius: var(--ashe-wc-radius, 8px);
	background: #fff;
	text-align: center;
	box-shadow: var(--ashe-wc-shadow-soft);
}

.ep-pinterest__fallback-icon {
	display: inline-flex;
	color: #c41e3a;
	margin-bottom: 0.75rem;
	opacity: 0.85;
}

.ep-pinterest__fallback-text {
	margin: 0 0 1.1rem;
	font-family: var(--ashe-wc-font-serif, "Playfair Display", Georgia, serif);
	font-size: 1.15rem;
	font-weight: 400;
	color: var(--ashe-wc-ink, #1a1c1b);
	line-height: 1.4;
}

.ep-pinterest__profile-link {
	display: inline-block;
	margin-top: 0.75rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ashe-wc-moss-deep, #2a4039) !important;
	text-decoration: none;
	border-bottom: 1px solid rgba(61, 92, 82, 0.28);
	padding-bottom: 1px;
}

.ep-pinterest__more-wrap {
	text-align: center;
	margin-top: 1.5rem;
}

/* Dark mode — tokens do site */
body.ashe-dark-mode .ep-portfolio-item,
body.ashe-dark-mode .ep-pin-item,
body.ashe-dark-mode .ep-pinterest__fallback {
	background: var(--ashe-dm-surface, #16181c);
	border-color: var(--ashe-dm-border, #2e3238);
}

body.ashe-dark-mode .ep-portfolio-item__media,
body.ashe-dark-mode .ep-pin-item__media {
	background: var(--ashe-dm-elevated, #1f2228);
}

body.ashe-dark-mode .ep-portfolio-item figcaption,
body.ashe-dark-mode .ep-pin-item__title {
	border-top-color: var(--ashe-dm-border, #2e3238);
}

body.ashe-dark-mode .ep-portfolio-item figcaption strong,
body.ashe-dark-mode .ep-portfolio__title,
body.ashe-dark-mode .ep-portfolio__section-title,
body.ashe-dark-mode .ep-pinterest__title,
body.ashe-dark-mode .ep-portfolio-cta h2,
body.ashe-dark-mode .ep-pinterest__fallback-text {
	color: var(--ashe-dm-text, #f3f0ec) !important;
}

body.ashe-dark-mode .ep-portfolio__nav a {
	background: var(--ashe-dm-elevated, #1f2228);
	border-color: var(--ashe-dm-border, #2e3238);
	color: var(--ashe-dm-text-2, #b8b4ae) !important;
}

body.ashe-dark-mode .ep-portfolio__nav a:hover {
	border-color: var(--ashe-dm-accent, #cbb79c);
	color: var(--ashe-dm-accent, #cbb79c) !important;
	background: var(--ashe-wc-accent-soft, rgba(203, 183, 156, 0.12));
}

body.ashe-dark-mode .ep-portfolio-item__tag {
	background: rgba(22, 24, 28, 0.92);
	border-color: rgba(203, 183, 156, 0.15);
	color: var(--ashe-dm-accent, #cbb79c);
}

body.ashe-dark-mode .ep-portfolio__eyebrow,
body.ashe-dark-mode .ep-pinterest__eyebrow {
	color: var(--ashe-dm-accent, #cbb79c);
}

body.ashe-dark-mode .ep-portfolio__rule {
	background: var(--ashe-dm-accent, #cbb79c);
}

/* Responsive = loja */
@media (max-width: 1200px) {
	.ep-portfolio-grid,
	.ep-pinterest__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		gap: 1rem 0.85rem !important;
	}
}

@media (max-width: 900px) {
	.ep-portfolio-grid,
	.ep-pinterest__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 0.85rem 0.7rem !important;
	}

	.ep-portfolio__section,
	.ep-portfolio__featured,
	.ep-pinterest {
		padding: 0 0.5rem;
	}
}

@media (max-width: 768px) {
	.ep-portfolio__hero {
		margin-bottom: 2rem;
		padding: 1.75rem 0.85rem 1.5rem;
	}

	.ep-portfolio__nav {
		justify-content: flex-start;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 0.35rem;
		scrollbar-width: none;
	}

	.ep-portfolio__nav::-webkit-scrollbar {
		display: none;
	}

	.ep-portfolio__nav a {
		flex: 0 0 auto;
		white-space: nowrap;
	}
}

@media (max-width: 480px) {
	.ep-portfolio-grid,
	.ep-pinterest__grid {
		grid-template-columns: 1fr !important;
	}

	.ep-portfolio-cta__actions .button {
		min-width: 0;
		flex: 1 1 auto;
		max-width: 16rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ep-portfolio-item img,
	.ep-pin-item img,
	.ep-portfolio-item,
	.ep-pin-item {
		transition: none;
	}

	.ep-portfolio-item:hover img,
	.ep-pin-item:hover img {
		transform: none;
	}
}
