/**
 * Card grid, posts and gallery widgets.
 * --sd-cols is set inline by each widget from its Columns control.
 */

/* ------------------------------------------------------------ Card grid */

.sd-grid__list,
.sd-posts__list,
.sd-gal__grid {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
	gap: 28px;
	grid-template-columns: repeat(var(--sd-cols, 3), minmax(0, 1fr));
}

.sd-gcard {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sd-gcard:hover {
	transform: translateY(-3px);
	box-shadow: var(--sd-shadow-raised);
}

.sd-gcard__whole {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.sd-gcard__media {
	overflow: hidden;
	border-bottom: 1px solid var(--sd-border-default);
}

.sd-gcard__media img,
.sd-gcard__media .sd-card__img--placeholder {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sd-grid--person .sd-gcard__media {
	aspect-ratio: 1 / 1;
}

.sd-grid--text .sd-gcard__media,
.sd-grid--icon .sd-gcard__media {
	aspect-ratio: 16 / 9;
}

/* Sponsor logos must sit inside the tile, not be cropped by it. */
.sd-grid--logo .sd-gcard__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 3 / 2;
	padding: 20px;
	border-bottom: 0;
	background-color: var(--sd-surface-white);
}

.sd-grid--logo .sd-gcard__media img {
	width: auto;
	max-height: 100%;
	object-fit: contain;
}

.sd-gcard__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	padding: 22px 24px 24px;
}

.sd-grid--person .sd-gcard__body,
.sd-grid--logo .sd-gcard__body {
	text-align: center;
	padding-top: 16px;
}

.sd-gcard__title {
	margin: 0;
	color: var(--sd-text-primary);
}

.sd-gcard__subtitle {
	margin: 4px 0 0;
	font-family: var(--sd-font-body);
	font-size: var(--sd-fs-small);
	font-weight: 600;
	color: var(--sd-primary-maroon);
}

.sd-gcard__text {
	margin: 12px 0 0;
	font-family: var(--sd-font-body);
	font-size: var(--sd-fs-body);
	line-height: 1.6;
	color: var(--sd-text-muted);
}

/* Pushes the link to the bottom so cards of unequal text still align. */
.sd-gcard__more {
	margin: 18px 0 0;
	padding-top: 4px;
	margin-top: auto;
}

.sd-gcard__more a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--sd-font-body);
	font-size: var(--sd-fs-small);
	font-weight: 600;
	color: var(--sd-primary-maroon);
	text-decoration: none;
}

.sd-gcard__more a::after {
	content: "→";
	transition: transform 0.2s ease;
}

.sd-gcard__more a:hover::after {
	transform: translateX(3px);
}

/* ---------------------------------------------------------------- Posts */

.sd-post {
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sd-post:hover {
	transform: translateY(-3px);
	box-shadow: var(--sd-shadow-raised);
}

.sd-post__link {
	display: block;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.sd-post__media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.sd-post__body {
	padding: 20px 22px 24px;
}

.sd-post__date {
	margin: 0 0 6px;
	font-family: var(--sd-font-body);
	font-size: var(--sd-fs-caption);
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: var(--sd-secondary-saffron);
}

.sd-post__title {
	margin: 0;
	color: var(--sd-text-primary);
}

.sd-post__meta {
	margin: 6px 0 0;
	font-family: var(--sd-font-body);
	font-size: var(--sd-fs-small);
	color: var(--sd-text-muted);
}

.sd-post__excerpt {
	margin: 10px 0 0;
	font-family: var(--sd-font-body);
	font-size: var(--sd-fs-body);
	line-height: 1.6;
	color: var(--sd-text-muted);
}

/* The lead item spans the full row and lays out side-by-side. */
.sd-posts--featured .sd-post--lead {
	grid-column: 1 / -1;
}

.sd-posts--featured .sd-post--lead .sd-post__link {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	align-items: stretch;
}

.sd-posts--featured .sd-post--lead .sd-post__media {
	aspect-ratio: auto;
	min-height: 300px;
}

.sd-posts--featured .sd-post--lead .sd-post__body {
	align-self: center;
	padding: 32px 34px;
}

.sd-posts--compact .sd-posts__list {
	grid-template-columns: 1fr;
	gap: 0;
}

.sd-posts--compact .sd-post {
	border: 0;
	border-bottom: 1px solid var(--sd-border-default);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.sd-posts--compact .sd-post:hover {
	transform: none;
	box-shadow: none;
}

.sd-posts--compact .sd-post__body {
	padding: 16px 0;
}

/* -------------------------------------------------------------- Gallery */
/*
 * Figma 76:1157 / 76:14498. The widget root carries --sd-cols; the head row
 * comes from samuday_lhead_html (listings.css) and the chips from .sd-chips.
 */

.sd-gal .sd-lhead { margin-bottom: 48px; }
.sd-gal .sd-gal__filters { margin: 0 0 48px; }
.sd-gal .sd-lhead + .sd-gal__filters { margin-top: 0; }

.sd-gal__album {
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sd-gal__album:hover {
	transform: translateY(-3px);
	box-shadow: var(--sd-shadow-raised);
}

.sd-gal__album a {
	display: block;
	color: inherit;
	text-decoration: none;
}

.sd-gal__media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.sd-gal__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sd-gal__caption {
	padding: 16px 18px 20px;
}

.sd-gal__caption h3 {
	margin: 0;
}

.sd-gal__count {
	margin: 4px 0 0;
	font-family: var(--sd-font-body);
	font-size: var(--sd-fs-caption);
	color: var(--sd-text-muted);
}

/* Masonry: N columns of tiles; other.js re-balances the columns per breakpoint. */
.sd-gal__masonry {
	display: flex;
	align-items: flex-start;
	gap: 24px;
}

.sd-gal__col {
	display: flex;
	flex: 1 1 0;
	min-width: 0;
	flex-direction: column;
	gap: 24px;
}

.sd-gal__photos {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat(var(--sd-cols, 4), minmax(0, 1fr));
}

/* Tile shapes follow the frame: 292x365, 292x292, 292x321, 292x263 by index. */
.sd-gal__item {
	position: relative;
	display: block;
	width: 100%;
	overflow: hidden;
	border: 1px solid var(--sd-border-default);
	border-radius: 16px;
	background-color: var(--sd-bg-cream-deep);
	aspect-ratio: 292 / 365;
	color: var(--sd-text-on-dark);
	text-decoration: none;
	cursor: zoom-in;
}

.sd-gal__item[data-shape="2"] { aspect-ratio: 1 / 1; }
.sd-gal__item[data-shape="3"] { aspect-ratio: 292 / 321; }
.sd-gal__item[data-shape="4"] { aspect-ratio: 292 / 263; }

.sd-gal .sd-gal__item img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.sd-gal__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(43, 20, 16, 0) 0%, rgba(43, 20, 16, 0.55) 100%);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.sd-gal__zoom {
	position: absolute;
	right: 13px;
	bottom: 13px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	background-color: var(--sd-surface-white);
	color: var(--sd-primary-maroon);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.sd-gal__zoom .sd-ico { width: 18px; height: 18px; }

.sd-gal__cap {
	position: absolute;
	left: 13px;
	right: 60px;
	bottom: 13px;
	overflow: hidden;
	font-family: var(--sd-font-body);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
	color: var(--sd-text-on-dark);
	white-space: nowrap;
	text-overflow: ellipsis;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.sd-gal__item:hover img,
.sd-gal__item:focus-visible img { transform: scale(1.05); }

.sd-gal__item:hover .sd-gal__shade,
.sd-gal__item:focus-visible .sd-gal__shade { opacity: 1; }

.sd-gal__item:hover .sd-gal__zoom,
.sd-gal__item:hover .sd-gal__cap,
.sd-gal__item:focus-visible .sd-gal__zoom,
.sd-gal__item:focus-visible .sd-gal__cap { opacity: 1; transform: none; }

.sd-gal__item:focus-visible {
	outline: 2px solid var(--sd-secondary-saffron);
	outline-offset: 2px;
}

.sd-gal__item.is-filtered { display: none; }

/* ------------------------------------------------------------- Lightbox */
/* Figma 76:14691 (desktop) / 76:23888 (mobile). */

.sd-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 80px 100px 40px;
	background-color: rgba(18, 8, 6, 0.92);
	font-family: var(--sd-font-body);
}

.sd-lightbox[hidden] { display: none; }

.sd-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(720px, 100%);
	max-height: calc(100vh - 260px);
	flex: 0 1 auto;
	min-height: 0;
}

.sd-lightbox__img {
	display: block;
	box-sizing: border-box;
	max-width: 100%;
	max-height: calc(100vh - 260px);
	border: 2px solid var(--sd-accent-gold);
	border-radius: 16px;
	object-fit: contain;
	background-color: var(--sd-bg-dark);
}

.sd-lightbox__meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin: 0;
	text-align: center;
}

.sd-lightbox__caption {
	margin: 0;
	font-family: var(--sd-font-heading);
	font-size: 22px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--sd-text-on-dark);
}

.sd-lightbox__count {
	margin: 0;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.3px;
	color: var(--sd-text-on-dark-muted);
}

.sd-lightbox__thumbs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sd-lightbox__thumbs button {
	display: block;
	box-sizing: border-box;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	background: none;
	opacity: 0.5;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.sd-lightbox__thumbs button img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 6px;
}

.sd-lightbox__thumbs button:hover { opacity: 0.85; }
.sd-lightbox__thumbs button.is-active { border-color: var(--sd-accent-gold); opacity: 1; }

.sd-lightbox .sd-lightbox__btn {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: var(--sd-surface-white);
	color: var(--sd-bg-dark);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.sd-lightbox .sd-lightbox__btn:hover,
.sd-lightbox .sd-lightbox__btn:focus-visible {
	background-color: var(--sd-secondary-saffron-soft);
	transform: scale(1.04);
}

.sd-lightbox .sd-lightbox__btn .sd-ico { width: 22px; height: 22px; }
.sd-lightbox .sd-lightbox__close { top: 58px; inset-inline-end: 58px; width: 44px; height: 44px; }
.sd-lightbox .sd-lightbox__close .sd-ico { width: 20px; height: 20px; }
.sd-lightbox .sd-lightbox__prev { top: 50%; inset-inline-start: 280px; transform: translateY(-50%); }
.sd-lightbox .sd-lightbox__next { top: 50%; inset-inline-end: 280px; transform: translateY(-50%); }
.sd-lightbox .sd-lightbox__prev:hover,
.sd-lightbox .sd-lightbox__next:hover { transform: translateY(-50%) scale(1.04); }

@media (max-width: 1280px) {
	.sd-lightbox .sd-lightbox__prev { inset-inline-start: 40px; }
	.sd-lightbox .sd-lightbox__next { inset-inline-end: 40px; }
}

/* ----------------------------------------------------------- Responsive */

@media (max-width: 1024px) {

	.sd-grid__list,
	.sd-posts__list,
	.sd-gal__grid {
		grid-template-columns: repeat(min(var(--sd-cols, 3), 3), minmax(0, 1fr));
		gap: 22px;
	}

	.sd-gal .sd-lhead,
	.sd-gal .sd-gal__filters { margin-bottom: 40px; }

	.sd-gal__masonry,
	.sd-gal__col { gap: 20px; }

	.sd-gal__photos {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 20px;
	}
}

@media (max-width: 860px) {

	.sd-grid__list,
	.sd-posts__list,
	.sd-gal__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* Side-by-side lead card has no room left for two columns. */
	.sd-posts--featured .sd-post--lead .sd-post__link {
		grid-template-columns: 1fr;
	}

	.sd-posts--featured .sd-post--lead .sd-post__media {
		aspect-ratio: 16 / 10;
		min-height: 0;
	}

	.sd-posts--featured .sd-post--lead .sd-post__body {
		padding: 22px;
	}
}

@media (max-width: 767px) {

	.sd-gal .sd-lhead,
	.sd-gal .sd-gal__filters { margin-bottom: 32px; }

	.sd-gal__masonry,
	.sd-gal__col { gap: 16px; }

	.sd-gal__photos {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}

	.sd-gal .sd-lhead__right,
	.sd-gal .sd-lhead__right .sd-btn { width: 100%; }
	.sd-gal__zoom { width: 32px; height: 32px; right: 10px; bottom: 10px; }
	.sd-gal__cap { left: 10px; bottom: 10px; right: 50px; font-size: 13px; }

	.sd-lightbox { padding: 72px 16px 24px; gap: 14px; }
	.sd-lightbox__stage,
	.sd-lightbox__img { max-height: calc(100vh - 240px); }
	.sd-lightbox .sd-lightbox__close { top: 16px; inset-inline-end: 16px; }
	.sd-lightbox .sd-lightbox__prev,
	.sd-lightbox .sd-lightbox__next { width: 44px; height: 44px; }
	.sd-lightbox .sd-lightbox__prev { inset-inline-start: 12px; }
	.sd-lightbox .sd-lightbox__next { inset-inline-end: 12px; }
	.sd-lightbox__thumbs button { width: 40px; height: 40px; }
	.sd-lightbox__caption { font-size: 19px; }
}

@media (max-width: 560px) {

	.sd-grid__list,
	.sd-posts__list {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.sd-gal__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.sd-gcard__body { padding: 18px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {

	.sd-gcard,
	.sd-post,
	.sd-gal__album,
	.sd-gal__item img,
	.sd-gal__shade,
	.sd-gal__zoom,
	.sd-gal__cap,
	.sd-gcard__more a::after {
		transition: none;
	}

	.sd-gcard:hover,
	.sd-post:hover,
	.sd-gal__album:hover {
		transform: none;
	}

	.sd-gal__item:hover img {
		transform: none;
	}
}

/* ----------------------------------------------------------------- Forms */
/*
 * Figma "Contact form" 76:15154: label Small/Medium 15, field 12px radius,
 * 13/16 padding, Body 17 placeholder muted, textarea 120px, full-width
 * primary button with send icon. The shortcode output is self-contained —
 * the card around it comes from the page (Elementor container).
 */

.sd-form,
.sd-form * { box-sizing: border-box; }

.sd-form form {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin: 0;
}

.sd-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 16px;
}

.sd-form p.sd-form__field,
.sd-form__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	min-width: 0;
}

.sd-form .sd-form__field label {
	margin: 0;
	font-family: var(--sd-font-body);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
	color: var(--sd-text-primary);
}

.sd-form .sd-form__field input,
.sd-form .sd-form__field textarea,
.sd-form .sd-form__field select {
	display: block;
	width: 100%;
	min-height: 53px;
	margin: 0;
	border: 1px solid var(--sd-border-default);
	border-radius: 12px;
	padding: 13px 16px;
	font-family: var(--sd-font-body);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.6;
	color: var(--sd-text-primary);
	background-color: var(--sd-surface-white);
	box-shadow: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sd-form .sd-form__field input::placeholder,
.sd-form .sd-form__field textarea::placeholder { color: var(--sd-text-muted); opacity: 1; }

.sd-form .sd-form__field select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a6656' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 16px 16px;
	cursor: pointer;
}

.sd-form .sd-form__field select:invalid,
.sd-form .sd-form__field select.is-placeholder { color: var(--sd-text-muted); }

.sd-form .sd-form__field textarea {
	resize: vertical;
	min-height: 120px;
	padding: 14px 16px;
}

.sd-form .sd-form__field input:focus-visible,
.sd-form .sd-form__field textarea:focus-visible,
.sd-form .sd-form__field select:focus-visible {
	outline: none;
	border-color: var(--sd-secondary-saffron);
	box-shadow: 0 0 0 3px rgba(224, 138, 30, 0.18);
}

.sd-form p.sd-form__actions,
.sd-form__actions { margin: 0; }

.sd-form button.sd-form__submit,
.sd-form .sd-form__submit {
	width: 100%;
	gap: 10px;
}

.sd-form .sd-form__submit .sd-ico { width: 18px; height: 18px; }

/* Honeypot: off-screen rather than display:none, which bots detect. */
.sd-form__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.sd-form p.sd-form__note,
.sd-form__note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 18px;
	border: 1px solid var(--sd-border-default);
	border-radius: 12px;
	padding: 14px 16px;
	font-family: var(--sd-font-body);
	font-size: 15px;
	line-height: 1.5;
}

.sd-form__note .sd-ico { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; }

.sd-form__note--ok {
	border-color: rgba(46, 125, 79, 0.45);
	background-color: #eef7e9;
	color: #2e7d4f;
}

.sd-form__note--bad {
	border-color: rgba(163, 35, 31, 0.4);
	background-color: var(--sd-secondary-saffron-soft);
	color: var(--sd-primary-maroon-dark);
}

@media (max-width: 767px) {
	.sd-form__grid { grid-template-columns: 1fr; }
	.sd-form form { gap: 16px; }
}
