/* ==========================================================================
   In Loving Memory — shared design tokens
   Font pairing: Playfair Display (name/headings) + Lato (body/UI)
   Transition: 1.2s crossfade between slides — calm and unobtrusive
   ========================================================================== */

:root {
	--ilm-serif: 'Playfair Display', Georgia, serif;
	--ilm-sans: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
	--ilm-bg: #14151a;
	--ilm-cream: #f7f3ec;
	--ilm-gold: #c9a86a;
	--ilm-transition: 1.2s ease;
}

/* --------------------------------------------------------------------
   Upload form
   -------------------------------------------------------------------- */

.ilm-form-wrap {
	max-width: 600px;
	margin: 0 auto;
	font-family: var(--ilm-sans);
	color: #333;
}

.ilm-form-title {
	font-family: var(--ilm-serif);
	font-weight: 600;
	font-size: 28px;
	margin-bottom: 4px;
}

.ilm-form-subtitle {
	color: #666;
	margin-bottom: 24px;
}

.ilm-field {
	display: block;
	margin-bottom: 18px;
}

.ilm-field span {
	display: block;
	font-weight: 700;
	margin-bottom: 6px;
	font-size: 14px;
}

.ilm-field input[type="text"],
.ilm-field textarea,
.ilm-field input[type="file"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-family: var(--ilm-sans);
	font-size: 15px;
	box-sizing: border-box;
}

.ilm-field small {
	display: block;
	color: #888;
	margin-top: 4px;
}

.ilm-field-row {
	display: flex;
	gap: 16px;
}

.ilm-field-row .ilm-field {
	flex: 1;
}

.ilm-file-list {
	margin-top: 8px;
	font-size: 13px;
	color: #555;
}

.ilm-file-warning {
	color: #b33;
	font-weight: 700;
}

.ilm-radio,
.ilm-checkbox {
	display: block;
	font-weight: 400;
	margin-bottom: 8px;
	cursor: pointer;
}

.ilm-url-preview {
	color: #666;
	background: #f5f5f5;
	padding: 6px 10px;
	border-radius: 4px;
	margin-top: 6px !important;
}

.ilm-url-preview-slug {
	font-weight: 700;
	color: #2f3336;
	word-break: break-all;
}

.ilm-music-hint {
	font-size: 13px;
	color: #888;
	margin: 0 0 12px;
}

.ilm-radio-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.ilm-radio-row .ilm-radio {
	margin-bottom: 0;
	flex: 1;
}

.ilm-preview-btn {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid #ccc;
	background: #fff;
	font-size: 11px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #2f3336;
}

.ilm-preview-btn:hover {
	background: #f0f0f0;
}

.ilm-preview-btn.is-playing {
	background: #2f3336;
	color: #fff;
	border-color: #2f3336;
}

.ilm-url-box,
.ilm-edit-link-box {
	margin-top: 12px;
	padding: 14px;
	background: #f5f5f5;
	border-radius: 6px;
	font-size: 13px;
}

.ilm-url-box {
	background: #eef7ee;
	border: 1px solid #cfe8cf;
}

.ilm-url-box-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 6px;
}

.ilm-url-box-row a {
	word-break: break-all;
	flex: 1;
	min-width: 0;
}

.ilm-copy-btn {
	flex-shrink: 0;
	background: #2f3336;
	color: #fff;
	border: none;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}

.ilm-url-box small {
	display: block;
	margin-top: 8px;
	color: #666;
}

#ilm-custom-music-wrap {
	margin-top: 10px;
	padding: 12px;
	background: #f5f5f5;
	border-radius: 6px;
}

.ilm-submit-btn {
	background: #2f3336;
	color: #fff;
	border: none;
	padding: 14px 28px;
	border-radius: 6px;
	font-family: var(--ilm-sans);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	width: 100%;
}

.ilm-submit-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.ilm-form-message {
	margin-top: 14px;
	font-size: 14px;
}

.ilm-form-message.ilm-error {
	color: #b33;
	font-weight: 700;
}

/* --------------------------------------------------------------------
   Slideshow page
   -------------------------------------------------------------------- */

/* Full-bleed lock for the slideshow page ONLY. Scoped to body.ilm-memorial-body
   (added by WordPress's body_class() only on single ilm_memorial posts) so this
   never affects the submission form page or any other page that loads this
   shared stylesheet. */
body.ilm-memorial-body {
	margin: 0;
	padding: 0;
	background: var(--ilm-bg);
	height: 100%;
	overflow: hidden;
}

.ilm-slideshow {
	position: relative;
	width: 100vw;
	height: 100vh;
	background: var(--ilm-bg);
}

.ilm-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity var(--ilm-transition);
	pointer-events: none;
}

.ilm-slide.is-active {
	opacity: 1;
	pointer-events: auto;
}

.ilm-media {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* Name / title slide */

.ilm-name-slide {
	background: radial-gradient(ellipse at center, #1c1e24 0%, #0d0e11 100%);
}

.ilm-name-slide-inner {
	text-align: center;
	padding: 40px;
	color: var(--ilm-cream);
	animation: ilmFadeUp 1.8s ease both;
}

.ilm-eyebrow {
	font-family: var(--ilm-sans);
	letter-spacing: 3px;
	text-transform: uppercase;
	font-size: 14px;
	color: var(--ilm-gold);
	margin-bottom: 18px;
}

.ilm-deceased-name {
	font-family: var(--ilm-serif);
	font-weight: 700;
	font-size: clamp(32px, 6vw, 64px);
	margin: 0 0 16px;
	line-height: 1.15;
}

.ilm-dates {
	font-family: var(--ilm-sans);
	font-weight: 300;
	font-size: 18px;
	color: #cfcfcf;
	margin-bottom: 20px;
	letter-spacing: 1px;
}

.ilm-tribute {
	font-family: var(--ilm-serif);
	font-style: italic;
	font-size: 18px;
	max-width: 520px;
	margin: 0 auto;
	color: #e3ded2;
	line-height: 1.6;
}

@keyframes ilmFadeUp {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Controls */

.ilm-controls {
	position: absolute;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 14px;
	z-index: 10;
}

.ilm-btn {
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: var(--ilm-cream);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(4px);
	transition: background 0.2s ease;
}

.ilm-btn:hover {
	background: rgba(255, 255, 255, 0.25);
}

/* CSS-driven "fake" full screen — see slideshow.js for why we avoid the
   native Fullscreen API here. Promotes the slideshow to a fixed layer
   pinned to the viewport at the maximum safe z-index, so it visually
   covers any sticky/floating elements from other plugins regardless of
   their own z-index (short of another script also using the max value). */
.ilm-slideshow.is-ilm-fullscreen {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	z-index: 2147483647;
}

/* Large, clearly-labeled exit control — only shown while the slideshow is
   in full screen (toggled via .is-ilm-fullscreen on #ilm-slideshow in JS).
   Sized generously so it's readable from across a room on a TV display. */
.ilm-exit-fullscreen-btn {
	display: none;
	position: absolute;
	top: 24px;
	right: 24px;
	z-index: 20;
	align-items: center;
	gap: 8px;
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.35);
	color: var(--ilm-cream);
	font-family: var(--ilm-sans);
	font-size: 16px;
	letter-spacing: 0.5px;
	padding: 10px 20px;
	border-radius: 999px;
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition: background 0.2s ease;
}

.ilm-exit-fullscreen-btn:hover {
	background: rgba(0, 0, 0, 0.75);
}

.ilm-slideshow.is-ilm-fullscreen .ilm-exit-fullscreen-btn {
	display: flex;
}

.ilm-progress-dots {
	position: absolute;
	top: 24px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	z-index: 10;
}

.ilm-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	cursor: pointer;
	transition: background 0.3s ease;
}

.ilm-dot.is-active {
	background: var(--ilm-gold);
}

/* --------------------------------------------------------------------
   "Add more photos/videos" panel (shown only to holders of the private
   edit link on an existing memorial page)
   -------------------------------------------------------------------- */

.ilm-add-media-fab {
	position: absolute;
	top: 24px;
	right: 24px;
	z-index: 20;
	background: rgba(201, 168, 106, 0.9);
	color: #1c1e24;
	border: none;
	border-radius: 999px;
	padding: 10px 18px;
	font-family: var(--ilm-sans);
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
}

.ilm-add-media-panel {
	position: absolute;
	inset: 0;
	z-index: 30;
	background: rgba(10, 10, 12, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
}

.ilm-add-media-panel form {
	background: var(--ilm-cream);
	color: #222;
	padding: 28px;
	border-radius: 10px;
	width: 90%;
	max-width: 420px;
	font-family: var(--ilm-sans);
}

.ilm-add-media-panel h3 {
	font-family: var(--ilm-serif);
	margin: 0 0 6px;
}

.ilm-add-media-panel input[type="file"] {
	width: 100%;
	margin: 14px 0;
}

.ilm-add-media-actions {
	display: flex;
	gap: 10px;
}

.ilm-add-media-actions button {
	flex: 1;
	padding: 10px;
	border-radius: 6px;
	border: none;
	font-weight: 700;
	cursor: pointer;
}

.ilm-add-media-actions button[type="submit"] {
	background: #2f3336;
	color: #fff;
}

.ilm-add-media-actions button[type="button"] {
	background: #e4e0d6;
}

#ilm-add-media-message {
	margin-top: 10px;
	font-size: 13px;
}

.ilm-edit-link-box {
	margin-top: 12px;
	padding: 12px;
	background: #f5f5f5;
	border-radius: 6px;
	font-size: 13px;
	word-break: break-all;
}

.ilm-manage-media-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 10px 0 18px;
}

.ilm-manage-item {
	position: relative;
	width: 90px;
	height: 90px;
	border-radius: 6px;
	overflow: hidden;
	background: #000;
}

.ilm-manage-item img,
.ilm-manage-item video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ilm-manage-item-actions {
	position: absolute;
	inset: auto 0 0 0;
	display: flex;
	justify-content: center;
	gap: 4px;
	padding: 3px 0;
	background: rgba(0, 0, 0, 0.55);
}

.ilm-manage-item-actions button {
	width: 22px;
	height: 22px;
	line-height: 18px;
	padding: 0;
	border: none;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 12px;
	cursor: pointer;
}

.ilm-manage-item-actions button:hover {
	background: rgba(255, 255, 255, 0.3);
}
