/* Styles for archive-post features created in the admin editor (see php/classes/ContentRenderer.php) */

/* ---- Slideshow ---- */
.iyp-slideshow {
	position: relative;
	margin: 1.5em 0;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
	--h: 500px;
}
.iyp-slideshow img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.iyp-slideshow img + img { display: none; }				/* without JavaScript, show only the first image */
.iyp-slideshow.is-ready { height: var(--h); max-height: 75vh; }
.iyp-slideshow.is-ready img {
	display: block;
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: contain;
	opacity: 0;
	transition: opacity 1.2s ease-in-out;
}
.iyp-slideshow.is-ready img.is-active { opacity: 1; }
.iyp-slideshow .iyp-ss-caption {
	position: absolute; left: 0; right: 0; bottom: 0;
	padding: 8px 56px; text-align: center; color: #fff; font-size: 0.9em;
	background: linear-gradient(transparent, rgba(0,0,0,.65));
}
.iyp-slideshow .iyp-ss-caption:empty { display: none; }
.iyp-slideshow button {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 40px; height: 40px; border: 0; border-radius: 50%;
	background: rgba(0,0,0,.45); color: #fff; font-size: 22px; line-height: 40px; cursor: pointer;
	opacity: 0; transition: opacity .2s;
}
.iyp-slideshow:hover button, .iyp-slideshow button:focus-visible { opacity: 1; }
.iyp-slideshow .iyp-ss-prev { left: 10px; }
.iyp-slideshow .iyp-ss-next { right: 10px; }
.iyp-slideshow .iyp-ss-dots { position: absolute; top: 10px; right: 12px; display: flex; gap: 6px; }
.iyp-slideshow .iyp-ss-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.45); }
.iyp-slideshow .iyp-ss-dots span.is-active { background: #fff; }
@media (max-width: 700px) { .iyp-slideshow button { opacity: 1; } }

/* ---- Citations and notes ---- */
.iyp-cite-ref { line-height: 0; }
.iyp-cite-ref a { text-decoration: none; font-weight: bold; padding: 0 1px; }
.iyp-notes { margin-top: 2.5em; padding-top: 1em; border-top: 1px solid #ccc; font-size: 0.9em; }
.iyp-notes ol { padding-left: 1.8em; }
.iyp-notes li { margin-bottom: 0.6em; }
.iyp-notes li:target { background: #fff4d6; }
.iyp-notes .iyp-back { text-decoration: none; }

/* ---- Index (table of contents) ---- */
.iyp-toc { margin: 1.5em 0; padding: 0.8em 1.2em; background: #f6f3ee; border-left: 4px solid #F58025; }
.iyp-toc h4 { margin: 0 0 0.5em; }
.iyp-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.iyp-toc li { margin: 0.3em 0; text-align: left; padding-left: 1.6em; text-indent: -1.6em; }
.iyp-toc li.lvl2 { counter-increment: toc; }
.iyp-toc li.lvl2::before { content: counter(toc) "."; display: inline-block; width: 1.6em; text-indent: 0; }
.iyp-toc li.lvl3 { margin-left: 1.6em; }
.iyp-toc li.lvl4 { margin-left: 3.2em; }
.iyp-toc li.lvl3::before, .iyp-toc li.lvl4::before { content: "–"; display: inline-block; width: 1.6em; text-indent: 0; }
:target { scroll-margin-top: 20px; }

/* ---- Images and videos from the editor ---- */
.iyp-content img, figure.image img { max-width: 100%; height: auto; }
figure.image { display: table; margin: 1em auto; }
figure.image figcaption { display: table-caption; caption-side: bottom; text-align: center; font-size: 0.85em; color: #555; padding-top: 4px; }
figure.align-left { float: left; margin: 0 1em 1em 0; }
figure.align-right { float: right; margin: 0 0 1em 1em; }
.iyp-video { position: relative; max-width: 720px; margin: 1.5em auto; aspect-ratio: 16 / 9; }
.iyp-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (prefers-reduced-motion: reduce) {
	.iyp-slideshow.is-ready img { transition: none; }
}

/* ---- News page ---- */
.news-index { width: 95%; padding-left: 0; list-style: none; }
.news-index li { display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; }
.news-index .news-date { font-weight: bold; text-align: right; }
.news-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0.5em 0 1.5em; }
.news-card { display: flex; flex-direction: column; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; text-decoration: none; color: inherit; background: #fff; }
.news-card:hover { border-color: #F58025; }
.news-card img { width: 100%; height: 140px; object-fit: cover; }
.news-card-body { padding: 8px 10px; }
.news-card .news-meta { margin: 4px 0 0; }
.news-item { margin-top: 1.5em; }
.news-meta { color: #666; font-size: 0.9em; margin: 0.3em 0 0.8em; }
.news-image { float: right; max-width: 40%; max-height: 260px; margin: 0 0 1em 1.2em; border-radius: 4px; }
.news-links { margin-top: 1em; }
.news-more { font-weight: bold; margin-right: 1.5em; }
.news-clear { clear: both; }
@media (max-width: 600px) { .news-image { float: none; display: block; max-width: 100%; margin: 0 0 1em; } }
