/*
 * Profile redesign (Variant E) — two-column single listing with sidebar.
 * Loaded only on listings enabled in di_profile_redesign_config() (functions.php).
 * Everything is scoped to .di-profile.
 */

.di-profile {
	--di-ink: #263943;
	--di-muted: #68777F;
	--di-accent: #A1415D;
	--di-accent-hover: #7d3148;
	--di-blue: #5E90AB;
	--di-blue-hover: #4A7A94;
	--di-line: #C7DCE7;
	--di-divider: #ECECE7;
	--di-soft: #F5F9FB;
	--di-sticky-top: 124px; /* Woodmart sticky header (~102px) + gap */

	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 40px;
	max-width: 1280px;
	margin: 0 auto;
	color: var(--di-ink);
}

@media (min-width: 1025px) {
	.di-profile {
		grid-template-columns: 336px minmax(0, 1fr);
		gap: 56px;
		align-items: start;
	}
}

/* --di-sticky-top is recalculated by the script in di-profile-sidebar.php:
   negative when the sidebar is taller than the screen, so its bottom stays reachable. */
@media (min-width: 1025px) {
	.di-profile__sidebar {
		position: sticky;
		top: var(--di-sticky-top);
	}
}

.di-profile__sidebar {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.di-profile__main {
	min-width: 0;
}

/* ── Portrait ─────────────────────────────── */
.di-profile__portrait {
	width: 100%;
	aspect-ratio: 3 / 4; /* phone portrait ratio — portraits fit without cropping (mockup had 4:5) */
	border-radius: 18px;
	overflow: hidden;
	background: #eee;
}

.di-profile__portrait img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ── Name ─────────────────────────────────── */
.di-profile .di-profile__name {
	margin: 22px 0 14px;
	font-family: 'Poiret One', sans-serif;
	font-weight: 400;
	font-size: 34px;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--di-ink);
}

.di-profile__handle {
	font-size: 19px;
	color: var(--di-muted);
}

/* ── Pills (category, location, tags) ─────── */
.di-profile__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
}

.di-profile .di-profile__pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 13px;
	border: 1px solid var(--di-line);
	border-radius: 999px;
	background: #fff;
	color: var(--di-ink);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.di-profile .di-profile__pill--accent {
	background: var(--di-blue); /* brand blue, as the JOIN / search buttons in the header */
	border-color: var(--di-blue);
	color: #fff;
}

.di-profile a.di-profile__pill:hover {
	border-color: var(--di-blue);
}

.di-profile a.di-profile__pill--accent:hover {
	background: var(--di-blue-hover);
	border-color: var(--di-blue-hover);
	color: #fff;
}

.di-profile__pill svg {
	flex: none;
	width: 14px;
	height: 14px;
}

/* ── Specialization ───────────────────────── */
.di-profile__specialization {
	margin: 6px 0 26px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--di-divider);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.55;
}

.di-profile__kicker {
	display: block;
	margin-bottom: 8px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--di-accent);
}

/* ── Contacts ─────────────────────────────── */
.di-profile .di-profile__contact {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 0;
	border-bottom: 1px solid var(--di-divider);
	color: var(--di-ink);
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.di-profile .di-profile__contact:hover {
	color: var(--di-accent);
}

.di-profile__contact svg {
	flex: none;
	width: 18px;
	height: 18px;
	color: var(--di-blue);
}

/* ── Buttons ──────────────────────────────── */
.di-profile .di-profile__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 13px 20px;
	border-radius: 999px;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	box-shadow: none;
}

.di-profile__btn svg {
	flex: none;
	width: 16px;
	height: 16px;
}

.di-profile .di-profile__btn--file {
	margin-top: 22px;
	background: var(--di-soft);
	border: 1px solid var(--di-line);
	color: var(--di-ink);
}

.di-profile .di-profile__btn--file svg,
.di-profile .di-profile__btn--share svg {
	color: var(--di-blue);
}

.di-profile .di-profile__btn--cta {
	margin: 0 0 8px; /* right under Specialization, above the contacts */
	padding: 15px 20px; /* brand blue (was burgundy) */
	background: var(--di-blue);
	border: 1px solid var(--di-blue);
	color: #fff;
	font-size: 14.5px;
}

.di-profile .di-profile__btn--cta svg {
	width: 20px;
	height: 20px;
}

.di-profile .di-profile__btn--cta:hover {
	background: var(--di-blue-hover);
	border-color: var(--di-blue-hover);
	color: #fff;
}

.di-profile__share {
	position: relative;
	margin-top: 12px;
}

.di-profile .di-profile__btn--share {
	background: #fff;
	border: 1.5px solid var(--di-line);
	color: var(--di-ink);
}

.di-profile .di-profile__btn--file:hover,
.di-profile .di-profile__btn--share:hover,
.di-profile .di-profile__btn--share[aria-expanded="true"] {
	border-color: var(--di-blue);
	color: var(--di-ink);
}

.di-profile__share-links {
	margin: 8px 0 0;
	padding: 6px 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--di-line);
	border-radius: 14px;
}

.di-profile__share-links[hidden] {
	display: none;
}

.di-profile .di-profile__share-links a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 18px;
	color: var(--di-ink);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
}

.di-profile .di-profile__share-links a:hover {
	color: var(--di-accent);
}

.di-profile__share-links .directorist-icon-mask::after {
	width: 16px;
	height: 16px;
	background-color: var(--di-blue);
}

/* ══ Main column ═════════════════════════════ */

/* Header (Go Back, Share, title, slider) is not rendered by single-contents.php;
   hidden here too in case an older template is still on the server */
.di-profile.directorist-single-wrapper .di-profile__main .directorist-single-listing-header {
	display: none;
}

/* Sections without card chrome */
.di-profile.directorist-single-wrapper .di-profile__main .directorist-card {
	margin: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-card + .directorist-card {
	margin-top: 48px;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-card__header {
	margin: 0 0 20px;
	padding: 0;
	background: none;
	border: 0;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-card__body {
	padding: 0;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-card__header__title {
	margin: 0;
	font-family: 'Poiret One', sans-serif;
	font-size: 23px;
	font-weight: 400;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--di-ink);
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-card__header-icon {
	display: none;
}

/* ── About ────────────────────────────────── */
.di-profile.directorist-single-wrapper .di-profile__main .directorist-listing-details__text {
	max-width: 640px;
	font-size: 15.5px;
	font-weight: 500;
	line-height: 1.75;
	color: #384954;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-listing-details__text a[href*="interview"] {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	padding: 12px 20px;
	border: 1.5px solid var(--di-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--di-accent);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-listing-details__text a[href*="interview"]::after {
	content: "→";
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-listing-details__text a[href*="interview"]:hover {
	background: var(--di-accent);
	color: #fff;
}

/* ── Gallery: 3 per row, rounded ──────────── */
.di-profile.directorist-single-wrapper .di-profile__main .directorist-gallery-grid-two {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-gallery-grid-two .directorist-grid-item {
	flex: none;
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-gallery-grid-two figure {
	margin: 0;
	aspect-ratio: 4 / 3.2;
	border-radius: 14px;
	overflow: hidden;
	/* thin frame: photos with white wall/frame edges don't blend into the white page
	   (same colour as the pill and button outlines; the lighter divider colour was invisible) */
	border: 1px solid var(--di-line);
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-gallery-grid-two figure img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Zoom button on hover: plugin pink (#F51957) → brand blue */
.di-profile.directorist-single-wrapper .di-profile__main .directorist-gallery-grid-two figcaption a .directorist-icon-mask::after {
	background: var(--di-blue);
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-gallery-grid-two figcaption a:hover,
.di-profile.directorist-single-wrapper .di-profile__main .directorist-gallery-grid-two figcaption a:focus {
	background: var(--di-blue) !important; /* plugin sets its pink with !important */
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-gallery-grid-two figcaption a:hover .directorist-icon-mask::after,
.di-profile.directorist-single-wrapper .di-profile__main .directorist-gallery-grid-two figcaption a:focus .directorist-icon-mask::after {
	background: #fff;
}

/* ── Detailed Information: two columns, label above value ── */
/* Specificity beats the plugin's
   .directorist-single-contents-area .directorist-single-wrapper .directorist-details-info-wrap (column) */
.di-profile.directorist-single-wrapper .di-profile__main .directorist-details-info-wrap {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 0 40px;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-details-info-wrap > * {
	flex: 1 1 100%;
	min-width: 0;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-details-info-wrap > .directorist-single-info:not(.directorist-listing-details__text) {
	display: block;
	flex: 1 1 40%; /* two per row; the odd last one spans full width */
	margin: 0;
	padding: 16px 0;
	border-bottom: 1px solid var(--di-divider);
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-single-info__label-icon {
	display: none;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-single-info__label {
	margin: 0 0 8px;
	padding: 0;
	min-width: 0;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-single-info__label__text {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--di-blue); /* brand blue; muted grey blended with the values */
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-single-info__label__text::before {
	content: none;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-single-info__value::first-letter {
	text-transform: uppercase;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-details-info-wrap > .directorist-single-info:last-child {
	border-bottom: 0;
}

.di-profile.directorist-single-wrapper .di-profile__main .directorist-single-info__value {
	margin: 0;
	padding: 0;
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.6;
	color: var(--di-ink);
}

/* ── Tablet / mobile: sidebar on top ──────── */
@media (max-width: 1024px) {
	.di-profile__portrait {
		max-width: 420px;
	}
}

@media (max-width: 767px) {
	.di-profile {
		gap: 32px;
	}

	.di-profile__portrait {
		max-width: none;
		aspect-ratio: 1 / 1;
	}

	.di-profile .di-profile__name {
		font-size: 28px;
	}

	.di-profile.directorist-single-wrapper .di-profile__main .directorist-gallery-grid-two {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.di-profile.directorist-single-wrapper .di-profile__main .directorist-details-info-wrap > .directorist-single-info:not(.directorist-listing-details__text) {
		flex-basis: 100%;
	}
}

/* ══ Lighter card levels ═══════════════════════
   di-profile--intermediate: old Basic — sidebar + content, cover photo 3:2, gallery of 4 in a 2×2 grid.
   di-profile--basic: free tier — one centered column, no content column. */

/* Cover photo from the catalogue preview, not a portrait */
.di-profile__portrait.di-profile__portrait--cover {
	aspect-ratio: 3 / 2;
}

/* Intermediate card: vertical frame like the Detailed portrait (Nadia's decision, the mockup had 3:2) */
.di-profile--intermediate .di-profile__portrait--cover,
.di-profile--light .di-profile__portrait--cover { /* "light" = unresolved level (outdated single-contents.php) */
	aspect-ratio: 3 / 4;
}

/* Without the PDF button the Share button follows the contacts directly */
.di-profile__contacts + .di-profile__share {
	margin-top: 22px;
}

/* 2×2 only while the gallery is capped at 4; showcase cards without the cap keep 3 per row */
.di-profile--intermediate.directorist-single-wrapper[data-gallery-limit="4"] .di-profile__main .directorist-gallery-grid-two,
.di-profile--light.directorist-single-wrapper[data-gallery-limit="4"] .di-profile__main .directorist-gallery-grid-two {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-width: 560px;
}

@media (min-width: 1025px) {
	.di-profile.di-profile--basic {
		grid-template-columns: minmax(0, 1fr);
		max-width: 560px;
	}

	.di-profile--basic .di-profile__sidebar {
		position: static;
	}
}

.di-profile--basic .di-profile__portrait {
	max-width: none;
}

.di-profile--basic .di-profile__name {
	margin-top: 26px;
	font-size: 32px;
}

.di-profile--basic .di-profile__specialization {
	margin-top: 0;
	margin-bottom: 22px;
	padding-bottom: 22px;
}

.di-profile--basic .di-profile__share {
	align-self: flex-start;
}

.di-profile--basic .di-profile__btn--share {
	width: auto;
	padding: 13px 22px;
}

/* ══ Company directories (Distributors, Makers & Fabricators, Organizations) ══
   Horizontal 3:2 frame on every level: logos and interior photos, not portraits.
   The extra class beats the 3:4 portrait / intermediate rules and the 1:1 mobile rule. */
.di-profile.di-profile--frame-landscape .di-profile__portrait {
	aspect-ratio: 3 / 2;
}

/* photo_fit: contain (per listing) — the whole logo on a light background, no cropping */
.di-profile .di-profile__portrait.di-profile__portrait--contain {
	background: var(--di-soft);
	border: 1px solid var(--di-line);
}

.di-profile .di-profile__portrait--contain img {
	object-fit: contain;
	padding: 8%;
}

/* ══ Extra sidebar content from the contacts block (Designers & Architects: "Live consultation") ══ */
.di-profile__extra {
	margin-top: 22px;
}

.di-profile__extra .directorist-single-info {
	display: block;
	margin: 0;
	padding: 0;
}

.di-profile__extra .directorist-single-info__label {
	display: none; /* "Custom_content" */
}

.di-profile__extra .directorist-single-info__value {
	margin: 0;
	padding: 0;
}

.di-profile .di-profile__extra button,
.di-profile .di-profile__extra a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 13px 20px;
	border: 1.5px solid var(--di-blue);
	border-radius: 999px;
	background: #fff;
	color: var(--di-ink);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
}

.di-profile .di-profile__extra button:hover,
.di-profile .di-profile__extra a:hover {
	background: var(--di-blue);
	color: #fff;
}

.di-profile__extra + .di-profile__share,
.di-profile__extra + .di-profile__btn--file {
	margin-top: 12px;
}

/* ══ Gallery lightbox (Elementor) ════════════
   The lightbox is attached to <body>, outside .di-profile — this file is loaded only on redesign pages.
   "body" prefix: Elementor loads its lightbox CSS only when the lightbox opens, i.e. after this file. */
body .elementor-lightbox {
	background-color: rgba(18, 18, 18, 0.94);
}

body .elementor-lightbox .dialog-lightbox-close-button {
	top: 14px;
	right: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	opacity: 1;
}

body .elementor-lightbox .dialog-lightbox-close-button:hover {
	background: rgba(255, 255, 255, 0.3);
}

body .elementor-lightbox .dialog-lightbox-close-button svg {
	width: 26px;
	height: 26px;
	fill: #fff;
}

body .elementor-lightbox .elementor-slideshow__header {
	padding-right: 90px; /* room for the bigger close button */
}

/* The theme resets the arrows to position: static, pushing them below the screen */
body .elementor-lightbox .elementor-swiper-button {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 12%;
	min-width: 64px;
	height: 100%;
	background: none;
	border: 0;
	cursor: pointer;
}

body .elementor-lightbox .elementor-swiper-button-prev {
	left: 0;
}

body .elementor-lightbox .elementor-swiper-button-next {
	right: 0;
}

body .elementor-lightbox .elementor-swiper-button svg {
	width: 40px;
	height: 40px;
}

/* Softer photo change: the outgoing photo fades out, the new one fades in (with the slower slide set in functions.php) */
body .elementor-lightbox .swiper-slide .elementor-lightbox-image {
	transition: opacity 0.8s ease;
}

/* Slide eases out instead of moving at a constant speed (duration is set by Swiper) */
body .elementor-lightbox .swiper-wrapper {
	transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
}

body .elementor-lightbox .swiper-slide:not(.swiper-slide-active) .elementor-lightbox-image {
	opacity: 0;
}

body .elementor-lightbox .elementor-swiper-button:hover svg {
	fill: #fff;
}
