/* Audio/video category browser */
.rm-media .rm-category{border-bottom:3px solid #F6C37E;padding-bottom:20px;margin-bottom:30px}
    .rm-media .rm-category-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px}
    .rm-media .rm-category-header h2{color:#F6C37E}
    .rm-media button{background:#6B0046;color:white;padding:6px 16px;border:0;border-radius:6px;cursor:pointer}
    .rm-media button:focus-visible,.rm-media a:focus-visible{outline:3px solid #6B0046;outline-offset:4px}
    .rm-media button:disabled{opacity:.6;cursor:wait}
    .rm-media [hidden]{display:none!important}
    .rm-media .rm-overlay{position:fixed;inset:0;background:rgba(0,0,0,.8);z-index:99999;overflow:auto;padding:20px}
    .rm-media .rm-dialog{background:white;color:#222;max-width:1000px;margin:20px auto;padding:20px;border-radius:12px;max-height:85vh;overflow:auto}
    .rm-media .rm-close{float:left;font-size:24px}
    .rm-media .latest-category-posts{display:flex;flex-wrap:wrap;gap:20px;justify-content:center}
    .rm-media .latest-card{width:calc(33.333% - 14px);background:white;border:1px solid #ddd;border-radius:12px;overflow:hidden;text-decoration:none!important;color:inherit}
    .rm-media .thumbnail{position:relative}
    .rm-media .thumbnail img,.rm-media .no-thumbnail{width:100%;height:200px;object-fit:cover;display:block;background:#f3f3f3}
    .rm-media .no-thumbnail{text-align:center;font-size:40px;padding-top:60px}
    .rm-media .post-type-label{position:absolute;top:10px;right:10px;left:auto;width:max-content;max-width:calc(100% - 20px);display:inline-flex;align-items:center;gap:5px;background:#6B0046;color:white;padding:4px 10px;font-size:12px;border-radius:20px}
    .rm-media .card-content{text-align:center;padding:15px}
    .rm-media .post-title{color:#6B0046;font-size:18px;font-weight:bold}
    .rm-media .post-date{font-size:14px;color:#666}
    .rm-media .rm-audio-card{margin:15px 0;width:100%}
    .rm-media .rm-audio-embed iframe{max-width:100%;border:0}
	.rm-media .rm-audio-embed {
		position: relative;
		min-height: 166px;
	}

	.rm-media .rm-player-loading {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		background: #fff;
		color: #6B0046;
		pointer-events: none;
	}

	.rm-media .rm-player-spinner {
		width: 24px;
		height: 24px;
		border: 3px solid #eee;
		border-top-color: #6B0046;
		border-radius: 50%;
		animation: rm-player-spin 0.8s linear infinite;
	}

	@keyframes rm-player-spin {
		to { transform: rotate(360deg); }
	}

	@media (prefers-reduced-motion: reduce) {
		.rm-media .rm-player-spinner {
			animation: none;
		}
	}

    @media(max-width:1024px){.rm-media .latest-card{width:calc(50% - 10px)}}
    @media(max-width:767px){.rm-media .latest-card{width:100%}.rm-media .rm-overlay{padding:8px}}

/* Legacy category video grid */
.category-video-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
        margin-top: 10px;
    }
    .single-video {
        text-align: center;
    }
    .video-title {
        margin-top: 8px;
        font-size: 15px;
        font-weight: 500;
    }

/* Latest mixed-content cards */
.latest-category-posts {
		display: flex;
		flex-wrap: wrap;
		gap: 20px;
		justify-content: center;
		align-items: stretch;
	}

	.latest-card {
		flex: 1 1 calc(33.33% - 20px);
		max-width: 350px;
		background: #fff;
		border: 1px solid #ddd;
		border-radius: 12px;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		text-decoration: none !important;
		color: inherit;
		transition: all 0.3s ease-in-out;
	}

	.latest-card:hover {
		transform: translateY(-5px);
		box-shadow: 0 6px 12px rgba(0,0,0,0.15);
	}

	.thumbnail {
		position: relative;
	}

	.thumbnail img,
	.no-thumbnail {
		width: 100%;
		height: 200px;
		object-fit: cover;
	}

	.no-thumbnail {
		background: #f2f2f2;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 40px;
		color: #aaa;
	}

	.post-type-label {
		position: absolute;
		top: 10px;
		right: 10px;
		background: rgba(107, 0, 70, 0.85);
		color: #fff;
		padding: 5px 10px;
		font-size: 13px;
		border-radius: 6px;
		z-index: 5;
	}

	.card-content {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		flex-grow: 1;
		padding: 15px;
		text-align: center;
	}

	.post-title {
		color: #F6C37E;
		font-size: 18px;
		font-weight: bold;
		margin-bottom: 10px;
	}

	.post-date {
		font-size: 14px;
		color: #777;
		margin-bottom: auto;
	}

	.no-thumbnail {
		background: #f2f2f2;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 200px;
	}
	.no-thumbnail img {
		width: 60px;
		height: 60px;
		opacity: 0.7;
	}

	@media (max-width: 768px) {
		.latest-category-posts {
			flex-direction: column;
			align-items: center;
		}
		.latest-card {
			width: 90%;
			max-width: 400px;
		}
	}

/* Audio cards: title contrast and consistent spacing. */
.rm-media .rm-audio-card{box-sizing:border-box;width:100%;margin:18px 0;padding:22px;background:#fff;border:1px solid #eadfe6;border-radius:18px;box-shadow:0 4px 18px rgba(65,20,48,.06);text-align:start;overflow:hidden}
.rm-media .rm-audio-card h3{margin:0 0 18px;padding-inline-start:12px;border-inline-start:4px solid #f6c37e;font-size:clamp(18px,2vw,22px);font-weight:700;line-height:1.7}
.rm-media .rm-audio-card h3 a,.rm-media .rm-audio-card h3 a:visited{color:#6b0046;text-decoration:none;border-bottom:0;box-shadow:none}
.rm-media .rm-audio-card h3 a:hover{color:#42002b;text-decoration:none}
.rm-media .rm-audio-card h3 a:focus-visible{outline:2px solid #6b0046;outline-offset:4px;border-radius:3px}
.rm-media .rm-audio-embed{border-radius:12px;overflow:hidden;background:#faf7f9}
.rm-media .rm-audio-embed iframe{display:block;width:100%;border:0}
@media(max-width:767px){.rm-media .rm-audio-card{padding:16px;border-radius:14px}}
/* Published CV record. */
.rm-cv{box-sizing:border-box;max-width:1000px;width:100%;margin:40px auto;padding:clamp(20px,4vw,40px);background:#fff;color:#29232a;border:1px solid #eadfe6;border-radius:18px;text-align:start}
.rm-cv__header{display:flex;align-items:center;justify-content:space-between;gap:28px;margin-bottom:28px}
.rm-cv .rm-cv__title{margin:0 0 12px;color:#F6C37E;font-size:clamp(26px,4vw,38px);line-height:1.5}
.rm-cv__subtitle{margin:0 0 12px;color:#6b0046;font-size:20px}
.rm-cv__description{white-space:pre-line;line-height:1.9}
.rm-cv__portrait{flex:0 0 220px;max-width:35%;margin:0}
.rm-cv__portrait img{display:block;width:100%;height:auto;border-radius:14px}
.rm-cv__content{line-height:1.95;overflow-wrap:anywhere}
.rm-cv__content img{max-width:100%;height:auto}
.rm-cv__content h2,.rm-cv__content h3{color:#6b0046}
.rm-cv__content iframe{max-width:100%}
.rm-cv__page{width:100%;min-width:0}
.rm-cv__extra{max-width:1000px;margin:0 auto}
@media(max-width:600px){.rm-cv{margin:24px auto}.rm-cv__header{flex-direction:column;align-items:stretch}.rm-cv__portrait{flex-basis:auto;max-width:220px;align-self:center}}


/* Full-width CV landing page; only the biography card is constrained. */
body.page-template-page-cv #content > .ast-container {
    width:100%; max-width:none; padding-inline:0; display:flex; flex-direction:column;
}
body.page-template-page-cv #primary.rm-cv__page {width:100%; margin:0; padding:0; float:none;}
body.page-template-page-cv .rm-cv__extra {width:100%; max-width:none; margin:0;}
body.page-template-page-cv .rm-cv {width:calc(100% - 32px);}
/* A flexible page shell keeps the footer below short content without overlap. */
body:not(.elementor-editor-active) #page {
    min-height:100vh; min-height:100dvh; display:flex; flex-direction:column;
}
body.admin-bar:not(.elementor-editor-active) #page {min-height:calc(100dvh - 32px);}
body:not(.elementor-editor-active) #page > #content {flex:1 0 auto; display:flex; flex-direction:column;}
body:not(.elementor-editor-active) #content > .ast-container {flex:1 0 auto; width:100%;}
body:not(.elementor-editor-active) #content #primary {display:flex; flex-direction:column;}
body:not(.elementor-editor-active) #primary > #main,
body:not(.elementor-editor-active) #main > article,
body:not(.elementor-editor-active) #main > article > .entry-content {
    flex:1 0 auto; display:flex; flex-direction:column;
}
body:not(.elementor-editor-active) #main > .elementor,
body:not(.elementor-editor-active) .entry-content > .elementor {
    flex:1 0 auto; display:flex; flex-direction:column;
}
/* Existing Elementor pages include their footer as the final top-level section. */
body:not(.elementor-editor-active) #main > .elementor > :last-child,
body:not(.elementor-editor-active) .entry-content > .elementor > :last-child {margin-block-start:auto;}
body:not(.elementor-editor-active) #page > footer {margin-block-start:auto; flex-shrink:0;}
@media(max-width:782px){body.admin-bar:not(.elementor-editor-active) #page{min-height:calc(100dvh - 46px);}}
body:not(.elementor-editor-active) .rm-cv__page .rm-cv__extra {margin-block-start:auto;}
/* Elementor Full Width templates can render directly inside Astra's container. */
body:not(.elementor-editor-active) #content > .ast-container {display:flex;flex-wrap:wrap;align-items:stretch;}
body:not(.elementor-editor-active) #content > .ast-container > .elementor,
body:not(.elementor-editor-active) #content > .elementor {flex:1 0 100%;display:flex;flex-direction:column;}
body:not(.elementor-editor-active) #content > .ast-container > .elementor > :last-child,
body:not(.elementor-editor-active) #content > .elementor > :last-child {margin-block-start:auto;}
