/* SW Podcast Episodes — Spiritual Way palette, centred layouts. */
.swpe,
.swpe-episode {
	--swpe-paper: #FAF6F1;
	--swpe-sky: #D7E6E6;
	--swpe-blush: #F1D9CE;
	--swpe-sage: #C7CDB0;
	--swpe-gold: #D9A664;
	--swpe-rose: #C98F8A;
	--swpe-ink: #423244;
	--swpe-accent: var(--swpe-gold);
	--swpe-surface: var(--swpe-paper);
	color: var(--swpe-ink);
	font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.swpe-accent-gold { --swpe-accent: var(--swpe-gold); }
.swpe-accent-sage { --swpe-accent: #9AA57C; }
.swpe-accent-rose { --swpe-accent: var(--swpe-rose); }

.swpe-skin-paper { --swpe-surface: var(--swpe-paper); }
.swpe-skin-sky   { --swpe-surface: var(--swpe-sky); }
.swpe-skin-blush { --swpe-surface: var(--swpe-blush); }
.swpe-skin-sage  { --swpe-surface: var(--swpe-sage); }

/* Shared pieces */
.swpe-meta {
	margin: 0 0 .6em;
	font-size: .85rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	opacity: .75;
	text-align: center;
}

.swpe-button {
	display: inline-block;
	padding: .7em 1.5em;
	border-radius: 999px;
	border: 2px solid var(--swpe-accent);
	background: var(--swpe-accent);
	color: var(--swpe-ink);
	font-weight: 600;
	font-size: .95rem;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .2s ease, transform .2s ease;
}
.swpe-button:hover,
.swpe-button:focus-visible {
	background: transparent;
	color: var(--swpe-ink);
	transform: translateY(-1px);
}
.swpe-button--ghost { background: transparent; }
.swpe-button--ghost:hover,
.swpe-button--ghost:focus-visible { background: var(--swpe-accent); }

.swpe-player { margin: 1.2em auto; max-width: 720px; }
.swpe-player audio { display: block; width: 100%; }
.swpe-player iframe { display: block; width: 100%; border: 0; border-radius: 12px; }

.swpe-cover {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 14px;
}

.swpe-empty { text-align: center; font-style: italic; opacity: .8; }

/* Grid */
.swpe-grid {
	display: grid;
	gap: 28px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.swpe-cols-1 { grid-template-columns: minmax(0, 520px); justify-content: center; }
.swpe-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.swpe-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
	.swpe-cols-3,
	.swpe-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.swpe-grid { grid-template-columns: minmax(0, 1fr); }
}

.swpe-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 22px;
	background: var(--swpe-surface);
	border-radius: 18px;
	border-top: 4px solid var(--swpe-accent);
	box-shadow: 0 6px 22px rgba(66, 50, 68, .08);
}
.swpe-card-image { display: block; width: 100%; margin-bottom: 16px; }
.swpe-card-title,
.swpe-latest-title {
	margin: 0 0 .5em;
	font-family: "Newsreader", Georgia, "Times New Roman", serif;
	font-weight: 500;
	line-height: 1.25;
}
.swpe-card-title { font-size: 1.35rem; }
.swpe-card-title a,
.swpe-latest-title a { color: inherit; text-decoration: none; }
.swpe-card-title a:hover,
.swpe-latest-title a:hover { text-decoration: underline; text-decoration-color: var(--swpe-accent); }
.swpe-card-excerpt { margin: 0 0 1.1em; line-height: 1.6; }
.swpe-card-action { margin: auto 0 0; }

.swpe-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
	justify-content: center;
	margin-top: 32px;
}
.swpe-page-count { font-size: .9rem; opacity: .75; }

/* Latest episode */
.swpe-latest {
	max-width: 760px;
	margin: 0 auto;
	padding: 32px 28px;
	text-align: center;
	background: var(--swpe-surface);
	border-radius: 22px;
	border-top: 4px solid var(--swpe-accent);
	box-shadow: 0 8px 28px rgba(66, 50, 68, .1);
}
.swpe-eyebrow {
	margin: 0 0 1em;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--swpe-ink);
}
.swpe-latest-image { display: block; max-width: 300px; margin: 0 auto 20px; }
.swpe-latest-title { font-size: 1.9rem; }

/* Single episode page */
.swpe-episode { max-width: 760px; margin: 0 auto; }
.swpe-notes { line-height: 1.75; }
.swpe-section {
	margin: 2.4em 0 0;
	padding: 26px 24px;
	background: var(--swpe-paper);
	border-radius: 18px;
	border-top: 4px solid var(--swpe-accent);
}
.swpe-section h2 {
	margin: 0 0 .8em;
	font-family: "Newsreader", Georgia, "Times New Roman", serif;
	font-weight: 500;
	font-size: 1.5rem;
	text-align: center;
}
.swpe-scriptures ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}
.swpe-scriptures li {
	padding: .4em 1em;
	background: var(--swpe-sky);
	border-radius: 999px;
	font-size: .95rem;
}
.swpe-qa + .swpe-qa { margin-top: 1.6em; padding-top: 1.6em; border-top: 1px solid rgba(66, 50, 68, .12); }
.swpe-q {
	margin: 0 0 .3em;
	font-family: "Newsreader", Georgia, "Times New Roman", serif;
	font-style: italic;
	font-weight: 500;
	font-size: 1.2rem;
	text-align: center;
}
.swpe-q-name { margin: 0 0 .8em; font-size: .85rem; opacity: .7; text-align: center; }
.swpe-a { line-height: 1.7; }
.swpe-transcript summary {
	cursor: pointer;
	font-family: "Newsreader", Georgia, "Times New Roman", serif;
	font-size: 1.3rem;
	text-align: center;
	list-style-position: inside;
}
.swpe-transcript-body { margin-top: 1.2em; line-height: 1.8; }
.swpe-back { margin: 2.4em 0 0; text-align: center; }

@media (prefers-reduced-motion: reduce) {
	.swpe-button { transition: none; }
}

/* Built-in layout: episode artwork */
.swpe-episode-image { max-width: 420px; margin: 0 auto 1.4em; }

/* ---------- Layout-page widgets ("SW Episode ...") ---------- */
.swpe-part { text-align: center; }
.swpe-part .swpe-section { margin-top: 0; }
.swpe-part--empty {
	padding: 14px;
	border: 1px dashed rgba(66, 50, 68, .35);
	border-radius: 10px;
	font-size: .9rem;
	font-style: italic;
	opacity: .8;
}
.swpe-episode-title {
	margin: 0;
	font-family: "Newsreader", Georgia, "Times New Roman", serif;
	font-weight: 500;
	line-height: 1.2;
}
.swpe-part--details .swpe-meta { margin: 0; }
.swpe-part--artwork .swpe-cover {
	display: block;
	max-width: 420px;
	margin: 0 auto;
	aspect-ratio: auto;
}
.swpe-square-yes .swpe-part--artwork .swpe-cover { aspect-ratio: 1 / 1; object-fit: cover; }
.swpe-part--player .swpe-player { margin-top: 0; margin-bottom: 0; }
.swpe-part--notes .swpe-notes > :first-child { margin-top: 0; }
.swpe-part--notes .swpe-notes > :last-child { margin-bottom: 0; }

/* Alignment control */
.swpe-align-left .swpe-part,
.swpe-align-left .swpe-part h2,
.swpe-align-left .swpe-part summary,
.swpe-align-left .swpe-part .swpe-meta,
.swpe-align-left .swpe-part .swpe-q,
.swpe-align-left .swpe-part .swpe-q-name { text-align: left; }
.swpe-align-center .swpe-part,
.swpe-align-center .swpe-part h2,
.swpe-align-center .swpe-part summary,
.swpe-align-center .swpe-part .swpe-meta,
.swpe-align-center .swpe-part .swpe-q,
.swpe-align-center .swpe-part .swpe-q-name { text-align: center; }
.swpe-align-right .swpe-part,
.swpe-align-right .swpe-part h2,
.swpe-align-right .swpe-part summary,
.swpe-align-right .swpe-part .swpe-meta,
.swpe-align-right .swpe-part .swpe-q,
.swpe-align-right .swpe-part .swpe-q-name { text-align: right; }

.swpe-align-left .swpe-scriptures ul { justify-content: flex-start; }
.swpe-align-right .swpe-scriptures ul { justify-content: flex-end; }
.swpe-align-left .swpe-part--artwork .swpe-cover { margin-left: 0; margin-right: auto; }
.swpe-align-right .swpe-part--artwork .swpe-cover { margin-left: auto; margin-right: 0; }

/* Episode widgets always take the full width of their container, even when the
   container's Align Items is set to Start/Center/End (which would otherwise
   shrink them to the width of their content and collapse the audio player). */
.elementor-widget[class*="elementor-widget-swpe_part_"] {
	width: 100%;
	max-width: 100%;
}

/* ---------- Episode guide link ---------- */
.swpe-part--guide { text-align: center; }

/* ---------- Front-end episode manager ---------- */
.swpe-manager { max-width: 760px; margin: 0 auto; }
.swpe-manager-heading {
	margin: 0 0 1em;
	font-family: "Newsreader", Georgia, "Times New Roman", serif;
	font-weight: 500;
	text-align: center;
}
.swpe-manager-signin { text-align: center; }
.swpe-manager-field {
	margin: 0 0 22px;
	padding: 20px;
	background: var(--swpe-paper);
	border-radius: 16px;
	border-top: 4px solid var(--swpe-accent);
}
.swpe-manager-label {
	display: block;
	margin: 0 0 8px;
	font-weight: 600;
	font-size: 1rem;
	text-align: center;
}
.swpe-manager-hint { margin: 8px 0 0; font-size: .88rem; opacity: .8; text-align: center; }
.swpe-manager-input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid rgba(66, 50, 68, .3);
	border-radius: 10px;
	background: #fff;
	color: var(--swpe-ink);
	font: inherit;
	line-height: 1.5;
}
.swpe-manager-input:focus-visible { outline: 2px solid var(--swpe-accent); outline-offset: 2px; }
.swpe-manager-input--short { max-width: 140px; margin: 0 auto; text-align: center; }
textarea.swpe-manager-input { resize: vertical; }
.swpe-manager-qa { margin: 12px 0 0; padding: 12px; background: var(--swpe-sky); border-radius: 12px; }
.swpe-manager-qa .swpe-manager-input + .swpe-manager-input { margin-top: 8px; }
.swpe-manager-question { margin: 0 0 8px; font-style: italic; text-align: center; }
.swpe-manager-link {
	display: block;
	margin: 10px auto 0;
	padding: 4px 8px;
	border: 0;
	background: none;
	color: var(--swpe-ink);
	font: inherit;
	font-size: .9rem;
	text-decoration: underline;
	cursor: pointer;
}
.swpe-manager-small { display: block; margin: 14px auto 0; font-size: .9rem; cursor: pointer; }
.swpe-manager-actions { text-align: center; }
.swpe-manager-actions .swpe-button { cursor: pointer; font-family: inherit; }
.swpe-manager-actions .swpe-button[disabled] { opacity: .6; cursor: default; }
.swpe-manager-view { text-align: center; margin: 0 0 18px; }
.swpe-manager-status { min-height: 1.4em; margin: 12px 0; text-align: center; font-weight: 600; }
.swpe-manager-status.is-ok { color: #4f6b3a; }
.swpe-manager-status.is-error { color: #a33a3a; }

/* Episode guide link used as a section */
.swpe-guide-title {
	margin: 0 0 .5em;
	font-family: "Newsreader", Georgia, "Times New Roman", serif;
	font-weight: 500;
	line-height: 1.25;
}
.swpe-guide-text { margin: 0 0 1.1em; line-height: 1.6; }
.swpe-guide-action { margin: 0; }
.swpe-align-left .swpe-part--guide .swpe-guide-title,
.swpe-align-left .swpe-part--guide p { text-align: left; }
.swpe-align-right .swpe-part--guide .swpe-guide-title,
.swpe-align-right .swpe-part--guide p { text-align: right; }

/* Rich show-notes box in the episode manager */
.swpe-rich { border: 1px solid rgba(66, 50, 68, .3); border-radius: 10px; background: #fff; overflow: hidden; }
.swpe-rich-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	padding: 8px;
	background: var(--swpe-sky);
	border-bottom: 1px solid rgba(66, 50, 68, .18);
}
.swpe-rich-button {
	padding: 6px 12px;
	border: 1px solid rgba(66, 50, 68, .3);
	border-radius: 999px;
	background: #fff;
	color: var(--swpe-ink);
	font: inherit;
	font-size: .85rem;
	line-height: 1.2;
	cursor: pointer;
}
.swpe-rich-button:hover,
.swpe-rich-button:focus-visible { background: var(--swpe-accent); border-color: var(--swpe-accent); }
.swpe-rich-button.is-bold { font-weight: 700; }
.swpe-rich-button.is-italic { font-style: italic; }
.swpe-rich-box {
	min-height: 200px;
	max-height: 520px;
	overflow-y: auto;
	padding: 14px 16px;
	text-align: left;
	line-height: 1.65;
	color: var(--swpe-ink);
}
.swpe-rich-box:focus-visible { outline: 2px solid var(--swpe-accent); outline-offset: -2px; }
.swpe-rich-box p { margin: 0 0 1em; }
.swpe-rich-box > :last-child { margin-bottom: 0; }
.swpe-rich-box ul,
.swpe-rich-box ol { margin: 0 0 1em 1.4em; padding: 0; }
.swpe-rich-box a { text-decoration: underline; }

/* Result of saving, shown under the Save button */
.swpe-manager-save-note {
	margin: 14px auto 0;
	text-align: center;
	font-weight: 600;
}
.swpe-manager-save-note:empty { display: none; }
.swpe-manager-save-note.is-ok,
.swpe-manager-save-note.is-error,
.swpe-manager-save-note.is-busy {
	max-width: 520px;
	padding: 12px 16px;
	border-radius: 12px;
}
.swpe-manager-save-note.is-busy { background: var(--swpe-sky); }
.swpe-manager-save-note.is-ok { background: #E4EBD6; color: #3F5A2C; }
.swpe-manager-save-note.is-error { background: #F6DEDA; color: #8A2E2E; }

/* ---------- Scriptures shown with their words ---------- */
.swpe-verses { display: grid; gap: 30px; }
.swpe-verses + .swpe-refs { margin-top: 26px; }
.swpe-verse {
	--swpe-verse-mark: var(--swpe-accent, #D9A664);
	position: relative;
	margin: 0;
	padding: 34px 0 0;
	text-align: center;
}
/* Opening quotation mark above each verse */
.swpe-verse::before {
	content: "\201C";
	position: absolute;
	top: -6px;
	left: 50%;
	transform: translateX(-50%);
	font-family: "Newsreader", Georgia, "Times New Roman", serif;
	font-size: 3.4rem;
	line-height: 1;
	color: var(--swpe-verse-mark);
}
.swpe-verse-text {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	quotes: none;
	font-family: "Newsreader", Georgia, "Times New Roman", serif;
	font-style: italic;
	font-size: 1.3rem;
	line-height: 1.6;
	color: var(--swpe-ink, #423244);
}
.swpe-verse-text::before,
.swpe-verse-text::after { content: none; }
.swpe-verse-text p { margin: 0; font: inherit; color: inherit; }
.swpe-verse-ref {
	display: block;
	margin: 14px 0 0;
	font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: .82rem;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--swpe-ink, #423244);
}
/* Short rule between the verse and its reference */
.swpe-verse-ref::before {
	content: "";
	display: block;
	width: 44px;
	height: 2px;
	margin: 0 auto 12px;
	background: var(--swpe-verse-mark);
}
.swpe-align-left .swpe-verse { text-align: left; }
.swpe-align-left .swpe-verse::before { left: 0; transform: none; }
.swpe-align-left .swpe-verse-ref::before { margin-left: 0; }
.swpe-align-right .swpe-verse { text-align: right; }
.swpe-align-right .swpe-verse::before { left: auto; right: 0; transform: none; }
.swpe-align-right .swpe-verse-ref::before { margin-right: 0; }
@media (max-width: 640px) {
	.swpe-verse-text { font-size: 1.15rem; }
}

/* Manager: scripture rows */
.swpe-manager-hint--top { margin: 0 0 4px; }

/* ---------- Image frame ----------
   The frame sets the shape: its height is a percentage of its own width, so the layout
   never depends on the image file's pixel size. (Safari on phones was reserving the
   image's full pixel height inside Elementor's flexbox containers.) */
.swpe-art-frame {
	position: relative;
	display: block;
	width: 100%;
	overflow: hidden;
	border-radius: 14px;
	line-height: 0;
}
.swpe-art-frame::before {
	content: "";
	display: block;
	padding-top: var(--swpe-art-ratio, 100%);
}
.swpe-art-frame > img,
.swpe-art-frame > img.swpe-cover {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	min-height: 0 !important;
	margin: 0 !important;
	aspect-ratio: auto;
	object-fit: cover;
	border-radius: 0 !important;
}
/* Episode page artwork: whole image shown, at most 420px wide unless changed in the widget. */
.swpe-part--artwork .swpe-art-frame { max-width: 420px; margin: 0 auto; }
.swpe-part--artwork .swpe-art-frame > img { object-fit: contain; }
.swpe-square-yes .swpe-part--artwork .swpe-art-frame::before { padding-top: 100%; }
.swpe-square-yes .swpe-part--artwork .swpe-art-frame > img { object-fit: cover; }
.swpe-align-left .swpe-part--artwork .swpe-art-frame { margin-left: 0; margin-right: auto; }
.swpe-align-right .swpe-part--artwork .swpe-art-frame { margin-left: auto; margin-right: 0; }

.swpe-part--artwork,
.swpe-part--player { max-width: 100%; min-width: 0; }
.swpe-player audio,
.swpe-player iframe { max-width: 100%; }

/* Safety net for an episode image that is not inside a frame (for example a page served
   from cache with older markup). WordPress lazy-loads images with sizes="auto"; browsers
   then ignore the file's own proportions and fall back to a very tall placeholder size
   unless the image is given a definite shape. An earlier rule here set the shape to
   "auto", which removed it. Give it a definite square instead. */
.swpe-part--artwork > img.swpe-cover,
.swpe-episode-image > img.swpe-cover {
	aspect-ratio: 1 / 1 !important;
	width: 100%;
	height: auto !important;
	max-width: 420px;
	object-fit: contain;
}
