/* ==========================================================================
   Art Data Model — Exhibition Archive Styles
   All selectors are prefixed adm- to avoid conflicts with Divi or other plugins.

   CSS custom properties are defined here and used across all three plugin
   stylesheets. Override them via Settings > Art Gallery > Appearance,
   or target :root {} in the Custom CSS textarea.
   See STYLES.md in the plugin folder for a full selector reference.
   ========================================================================== */

/* ── CSS custom properties (design tokens) ───────────────────────────────── */

:root {
	/* Backgrounds */
	--adm-bg:              #ffffff;
	--adm-card-bg:         #ffffff;

	/* Borders */
	--adm-card-border:     #e4e4e4;
	--adm-meta-border:     #eeeeee;

	/* Text */
	--adm-text:            #1a1a1a;
	--adm-text-h1:         #ff0000;
	--adm-text-h2:         #cc0000;
	--adm-text-h3:         #990000;
	--adm-text-secondary:  #444444;
	--adm-text-muted:      #666666;
	--adm-text-light:      #888888;

	/* Buttons */
	--adm-btn-bg:         #1a1a1a;
	--adm-btn-text:       #ffffff;
	--adm-btn-hover-bg:   #444444;

	/* Status / sale badges */
	--adm-badge-available: #27ae60;
	--adm-badge-reserved:  #e67e22;
	--adm-badge-sold:      #c0392b;
	--adm-badge-nfs:       #7f8c8d;

	/* Date / exhibition badges */
	--adm-badge-now-on:   #27ae60;
	--adm-badge-upcoming: #2980b9;
	--adm-badge-past:     #7f8c8d;
	--adm-badge-archived: #95a5a6;

	/* Filter bar */
	--adm-filter-bg:       #f7f7f7;
	--adm-filter-border:   #e0e0e0;
	--adm-filter-fg:       #e4e4e4;
	--adm-input-bg:        #ffffff;
	--adm-input-border:    #cccccc;

	/* Admin badge background (edit button) */
	--adm-badge-bg:        #1d6fa4;

	/* Fluid heading sizes — used by plugin templates and
	   available to Divi via var(--adm-font-h1) etc. in Custom CSS */
	/* --adm-font-h1: clamp(1.6rem,  4vw,   2.4rem); */
	/* --adm-font-h2: clamp(1.1rem,  2.5vw, 1.35rem); */
	/* --adm-font-h3: clamp(0.95rem, 2vw,   1.05rem); */
	--adm-font-h1: 30px;   /* matches Divi h1 default */
	--adm-font-h2: 26px;   /* matches Divi h2 default */
	--adm-font-h3: 22px;   /* matches Divi h3 default */
}

/* ── Hero banner ─────────────────────────────────────────────────────────── */

.adm-exhibition-hero {
	width: 100%;
	height: clamp(220px, 35vw, 480px);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	margin-bottom: 0;
}

/* ── Archive wrapper (shared with artwork/artist archives via filter-bar.css)
   Duplicated here so /exhibitions/ renders correctly even when filter-bar.css
   is not enqueued. ──────────────────────────────────────────────────────── */

.adm-archive-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2.5rem 1.5rem 4rem;
}

.adm-archive-header {
	margin-bottom: 1.5rem;
}

.adm-archive-title {
	font-size: var(--adm-font-h1);
	margin: 0 0 0.6rem;
	line-height: 1.2;
	color: var(--adm-text-h1);
}

/* ── Page wrapper ────────────────────────────────────────────────────────── */

.adm-exhibition-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2.5rem 1.5rem 4rem;
}

/* ── Exhibition header ───────────────────────────────────────────────────── */

.adm-exhibition-header {
	margin-bottom: 2.5rem;
}

.adm-exhibition-title {
	font-size: var(--adm-font-h1);
	margin: 0 0 0.6rem;
	line-height: 1.2;
	color: var(--adm-text-h1);
}

.adm-exhibition-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.5rem;
	margin-bottom: 1rem;
}

.adm-exhibition-dates,
.adm-exhibition-location {
	font-size: 0.9rem;
	color: var(--adm-text-muted);
	margin: 0;
}

.adm-exhibition-location::before {
	content: '📍 ';
}

.adm-exhibition-location a {
	color: inherit;
	text-decoration: underline dotted;
}

.adm-exhibition-location a:hover {
	color: var(--adm-text);
}

.adm-exhibition-intro,
.adm-exhibition-description {
	font-size: 1rem;
	color: var(--adm-text-secondary);
	max-width: 72ch;
	line-height: 1.65;
}

.adm-exhibition-intro > *:first-child { margin-top: 0; }
.adm-exhibition-intro > *:last-child  { margin-bottom: 0; }

/* ── Artwork grid ────────────────────────────────────────────────────────── */

.adm-artwork-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.75rem;
	margin: 2rem 0;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.adm-artwork-card {
	background: var(--adm-card-bg);
	border: 1px solid var(--adm-card-border);
	border-radius: 4px;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}

.adm-artwork-card:hover {
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
}

/* ── Image area ──────────────────────────────────────────────────────────── */

.adm-artwork-card__image-wrap {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--adm-filter-bg);
}

.adm-artwork-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.adm-artwork-card:hover .adm-artwork-card__image {
	transform: scale(1.03);
}

/* Sold artworks: slight fade on the image */
.adm-artwork-status--sold .adm-artwork-card__image-wrap {
	opacity: 0.72;
}

/* ── Red dot (sold indicator, bottom-right) ──────────────────────────────── */

.adm-artwork-card__sold-dot {
	position: absolute;
	bottom: 10px;
	right: 10px;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: var(--adm-badge-sold);
	border: 2px solid rgba(255, 255, 255, 0.9);
	display: block;
	z-index: 2;
}

/* ── Status badge (top-left) ─────────────────────────────────────────────── */

.adm-artwork-card__status-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 3px 8px;
	border-radius: 3px;
	color: #fff;
	line-height: 1.5;
	z-index: 2;
}

.adm-artwork-card__status-badge--available    { background: var(--adm-badge-available); }
.adm-artwork-card__status-badge--reserved     { background: var(--adm-badge-reserved); }
.adm-artwork-card__status-badge--sold         { background: var(--adm-badge-sold); }
.adm-artwork-card__status-badge--not_for_sale { background: var(--adm-badge-nfs); }

/* ── Card text details ───────────────────────────────────────────────────── */

.adm-artwork-card__details {
	padding: 0.9rem 1rem 1rem;
}

/* Divi sets p { padding-bottom: 1em } globally — reset it inside cards. */
.adm-artwork-card__details p {
	padding-bottom: 0;
}

.adm-artwork-card__title {
	font-size: var(--adm-font-h3);
	font-weight: 600;
	margin: 0 0 0.3rem;
	line-height: 1.3;
	color: var(--adm-text-h3);
}

.adm-artwork-card__title a {
	color: inherit;
	text-decoration: none;
}

.adm-artwork-card__title a:hover {
	text-decoration: underline;
}

.adm-artwork-card__artist {
	font-size: 0.85rem;
	color: var(--adm-text-secondary);
	font-style: italic;
	margin: 0 0 0.2rem;
}

.adm-artwork-card__meta {
	font-size: 0.82rem;
	color: var(--adm-text-muted);
	margin: 0 0 0.1rem;
}

.adm-artwork-card__price {
	font-size: 1rem;
	font-weight: 700;
	color: var(--adm-text);
	margin: 0.35rem 0 0;
}

/* ── Card permalink overlay (covers image area, sits below badge/dot) ───── */

.adm-artwork-card__title-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
}

/* Badge and dot need to be above the overlay */
.adm-artwork-card__status-badge,
.adm-artwork-card__sold-dot {
	z-index: 3;
}

/* ── Buy / Enquire button ────────────────────────────────────────────────── */

.adm-artwork-card__buy-btn {
	display: inline-block;
	margin-top: 0.6rem;
	padding: 0.4rem 1rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--adm-btn-text);
	background: var(--adm-btn-bg);
	border-radius: 3px;
	text-decoration: none;
	transition: background 0.15s ease;
}

.adm-artwork-card__buy-btn:hover {
	background: var(--adm-btn-hover-bg);
	color: var(--adm-btn-text);
}

/* ── Pagination ──────────────────────────────────────────────────────────── */

.adm-pagination {
	margin-top: 3rem;
	text-align: center;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.adm-artwork-grid__empty {
	color: var(--adm-text-muted);
	font-style: italic;
	padding: 2rem 0;
}

/* ── Responsive tweaks ───────────────────────────────────────────────────── */

@media (max-width: 600px) {
	.adm-artwork-grid {
		grid-template-columns: 1fr 1fr;
		gap: 1rem;
	}

	.adm-artwork-card__details {
		padding: 0.6rem 0.7rem 0.7rem;
	}

	.adm-exhibition-wrap {
		padding: 1.5rem 1rem 3rem;
	}
}

@media (max-width: 380px) {
	.adm-artwork-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Exhibition archive card grid ────────────────────────────────────────── */
/* Used on /exhibitions/ — mirrors the artwork grid layout exactly.          */

.adm-exhibition-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.75rem;
	margin: 2rem 0;
}

/* ── Card shell ──────────────────────────────────────────────────────────── */

.adm-exhibition-archive-card {
	background: var(--adm-card-bg);
	border: 1px solid var(--adm-card-border);
	border-radius: 4px;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}

.adm-exhibition-archive-card:hover {
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
}

/* ── Image area ──────────────────────────────────────────────────────────── */

.adm-exhibition-archive-card__image-wrap {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--adm-filter-bg);
}

.adm-exhibition-archive-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.adm-exhibition-archive-card:hover .adm-exhibition-archive-card__image {
	transform: scale(1.03);
}

.adm-exhibition-archive-card__image-placeholder {
	width: 100%;
	height: 100%;
	background: var(--adm-filter-bg);
	display: block;
}

/* ── Overlay link (covers whole image area) ──────────────────────────────── */

.adm-exhibition-archive-card__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
}

/* ── Status badge (top-left) ─────────────────────────────────────────────── */

.adm-exhibition-archive-card__badge {
	position: absolute;
	top: 8px;
	left: 8px;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 3px 8px;
	border-radius: 3px;
	color: #fff;
	line-height: 1.5;
	z-index: 2;
}

.adm-exhibition-archive-card__badge--current  { background: var(--adm-badge-now-on); }
.adm-exhibition-archive-card__badge--upcoming { background: var(--adm-badge-upcoming); }
.adm-exhibition-archive-card__badge--past     { background: var(--adm-badge-past); }
.adm-exhibition-archive-card__badge--archived { background: var(--adm-badge-archived); }

/* ── Card text details ───────────────────────────────────────────────────── */

.adm-exhibition-archive-card__details {
	padding: 0.9rem 1rem 1rem;
}

.adm-exhibition-archive-card__title {
	font-size: var(--adm-font-h3);
	font-weight: 600;
	margin: 0 0 0.3rem;
	line-height: 1.3;
	color: var(--adm-text-h3);
}

.adm-exhibition-archive-card__title a {
	color: inherit;
	text-decoration: none;
}

.adm-exhibition-archive-card__title a:hover {
	text-decoration: underline;
}

.adm-exhibition-archive-card__dates {
	font-size: 0.85rem;
	color: var(--adm-text-secondary);
	font-style: italic;
	margin: 0 0 0.25rem;
}

.adm-exhibition-archive-card__desc {
	font-size: 0.82rem;
	color: var(--adm-text-muted);
	margin: 0 0 0.15rem;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.adm-exhibition-archive-grid__empty {
	color: var(--adm-text-muted);
	font-style: italic;
	padding: 2rem 0;
}

/* ── Responsive tweaks ───────────────────────────────────────────────────── */

@media (max-width: 600px) {
	.adm-exhibition-archive-grid {
		grid-template-columns: 1fr 1fr;
		gap: 1rem;
	}

	.adm-exhibition-archive-card__details {
		padding: 0.6rem 0.7rem 0.7rem;
	}
}

@media (max-width: 380px) {
	.adm-exhibition-archive-grid {
		grid-template-columns: 1fr;
	}
}
