/* ============================================================
   Custom styles — Ziba Kazemi Foundation site
   Read-more toggles + fade slideshows
   ============================================================ */

/* --- Framed / centered section titles --- */
.section-title-frame {
	text-align: center;
	margin-bottom: 8px;
}

/* Neutralise whatever margin the following element would normally have,
   so every title sits the same distance from what comes after it. */
.section-title-frame + p,
.section-title-frame + .expandable,
.section-title-frame + .tm-fade-slideshow {
	margin-top: 0;
}

.expandable > p:first-child {
	margin-top: 0;
}

/* --- Read more / read less: clean chevron --- */
.expandable {
	position: relative;
	padding-top: 30px; /* permanent space for the control; prevents layout jumps */
}

.read-more-content {
	overflow: hidden;
	clear: both;
}

.read-more-content[hidden] {
	display: none;
}

.read-more-toggle {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1000;
	width: 34px;
	height: 30px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

/* One continuous-looking V: the two strokes meet at one point. */
.read-more-toggle::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 7px;
	width: 12px;
	height: 12px;
	border-right: 2px solid #333;
	border-bottom: 2px solid #333;
	transform: translateX(-50%) rotate(45deg);
	transform-origin: center;
	transition: transform 0.22s ease, border-color 0.22s ease;
}

/* Open state: exact same chevron turned upward. */
.read-more-toggle.is-open {
	position: fixed;
	left: 50%;
	top: auto;
	bottom: 22px;
	transform: translateX(-50%);
	z-index: 2147483647;
}

.read-more-toggle.is-open::before {
	transform: translateX(-50%) rotate(225deg);
}

.read-more-toggle:hover::before,
.read-more-toggle:focus-visible::before {
	border-color: #777;
}

.read-more-toggle:focus-visible {
	outline: none;
}

@media (max-width: 767px) {
	.read-more-toggle.is-open {
		bottom: calc(18px + env(safe-area-inset-bottom));
	}
}

/* --- Fade slideshow --- */
.tm-fade-slideshow {
	position: relative;
	width: 100%;
	overflow: hidden;
	margin: 25px 0;
	background: #ffffff;
}

.tm-fade-slideshow::before {
	content: "";
	display: block;
	padding-top: 80%; /* taller box so vertical photos render bigger */
}

.tm-fade-slideshow .tm-fade-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 1.4s ease-in-out;
}

.tm-fade-slideshow .tm-fade-slide.active {
	opacity: 1;
	z-index: 1;
}

.tm-fade-slideshow .tm-fade-slide img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}
