/* A2Z Photo Stories - frontend */
.a2zps {
	--a2zps-accent: #e11d2e;
	--a2zps-ink: #111827;
	--a2zps-muted: #6b7280;
	--a2zps-line: #e5e7eb;
	--a2zps-radius: 14px;
	--a2zps-width: 760px;
	--a2zps-cwidth: 560px;
	width: 100%;
	margin: 1.5em auto;
	box-sizing: border-box;
	color: inherit;
	font-family: inherit;
}
.a2zps *, .a2zps *::before, .a2zps *::after { box-sizing: border-box; }
.a2zps img { max-width: 100%; }
.a2zps button { font-family: inherit; }
.a2zps-notice { padding: 12px 16px; border: 1px dashed #c3c4c7; border-radius: 8px; color: #6b7280; }

/* ---------- Share bar ---------- */
.a2zps-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 20px; }
.a2zps--carousel .a2zps-share { margin: 14px 0 0; }
.a2zps-share__label { font-weight: 700; font-size: 14px; margin-right: 2px; }
.a2zps-share__btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 7px 14px; border: 0; border-radius: 999px; cursor: pointer;
	font-size: 13px; font-weight: 600; line-height: 1.2; text-decoration: none !important;
	color: #fff !important; background: #374151; transition: transform .15s ease, opacity .15s ease;
}
.a2zps-share__btn:hover, .a2zps-share__btn:focus-visible { opacity: .88; transform: translateY(-1px); }
.a2zps-share__btn--wa { background: #25d366; }
.a2zps-share__btn--fb { background: #1877f2; }
.a2zps-share__btn--x { background: #111; }
.a2zps-share__btn--copy { background: var(--a2zps-accent); }
.a2zps-toast { font-size: 13px; color: #15803d; font-weight: 600; min-height: 1em; }

/* ---------- Layout 1: photo story ---------- */
.a2zps--story { max-width: var(--a2zps-width); }
.a2zps-slide { margin: 0 0 2em; padding: 0 0 1.6em; border-bottom: 1px solid var(--a2zps-line); }
.a2zps-slide:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.a2zps-slide__media { position: relative; overflow: hidden; border-radius: var(--a2zps-radius); background: #f3f4f6; line-height: 0; }
.a2zps .a2zps-slide__media img { display: block !important; width: 100% !important; height: auto !important; margin: 0 !important; max-width: 100% !important; border-radius: 0 !important; float: none !important; }
.a2zps-badge {
	position: absolute; left: 12px; top: 12px; z-index: 2;
	background: rgba(17, 24, 39, .72); color: #fff; font-size: 13px; font-weight: 700; line-height: 1.4;
	padding: 4px 11px; border-radius: 999px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.a2zps-slide__body { padding: 14px 2px 0; }
.a2zps-slide__title { margin: 0 0 .4em; font-size: 1.28em; line-height: 1.35; font-weight: 700; color: var(--a2zps-ink); }
.a2zps-slide__desc { font-size: 1.04em; line-height: 1.75; }
.a2zps-slide__desc p { margin: 0 0 .85em; }
.a2zps-slide__desc > :last-child { margin-bottom: 0; }
.a2zps-credit { display: block; margin-top: .6em; font-size: .85em; color: var(--a2zps-muted); font-style: italic; }

/* ---------- Layout 2: Instagram-style carousel ---------- */
.a2zps--carousel { max-width: var(--a2zps-cwidth); }
.a2zps-card { background: #fff; color: var(--a2zps-ink); border: 1px solid var(--a2zps-line); border-radius: var(--a2zps-radius); overflow: hidden; box-shadow: 0 8px 28px rgba(17, 24, 39, .08); }

.a2zps-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.a2zps-avatar {
	display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%;
	background: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); padding: 3px;
}
.a2zps-avatar img, .a2zps-avatar__ch {
	display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%;
	background: #fff; border: 2px solid #fff; object-fit: cover; font-weight: 700; font-size: 15px; color: var(--a2zps-accent);
}
.a2zps-head__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.a2zps-head__text strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a2zps-head__text span { font-size: 12px; color: var(--a2zps-muted); }

.a2zps-viewport { position: relative; background: #0b0b0c; }
.a2zps-track {
	display: flex; overflow-x: auto; overflow-y: hidden; aspect-ratio: var(--a2zps-ratio, 4 / 5);
	scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none;
	outline-offset: -3px;
}
.a2zps-track::-webkit-scrollbar { display: none; }
.a2zps-item { position: relative; flex: 0 0 100%; min-width: 0; overflow: hidden; scroll-snap-align: center; scroll-snap-stop: always; }
.a2zps-blur { position: absolute; inset: -24px; background-size: cover; background-position: center; filter: blur(22px) brightness(.62); }
.a2zps .a2zps-item img.a2zps-img {
	position: absolute !important; inset: 0 !important; display: block !important; width: 100% !important; height: 100% !important;
	max-width: none !important; margin: 0 !important; padding: 0 !important; float: none !important; border-radius: 0 !important;
	object-fit: contain !important; -webkit-user-drag: none; user-select: none;
}
.a2zps-count {
	position: absolute; top: 12px; right: 12px; z-index: 3; pointer-events: none;
	background: rgba(17, 24, 39, .72); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.a2zps-nav {
	position: absolute; top: 50%; z-index: 3; width: 38px; height: 38px; margin: -19px 0 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
	display: flex; align-items: center; justify-content: center; color: #111; background: rgba(255, 255, 255, .88);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .3); transition: opacity .2s ease, transform .15s ease;
}
.a2zps-nav:hover { background: #fff; transform: scale(1.06); }
.a2zps-prev { left: 10px; }
.a2zps-next { right: 10px; }
.a2zps-nav:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) { .a2zps-nav { display: none; } }

.a2zps-dots { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 12px 10px 4px; }
.a2zps-dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: #cbd5e1; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.a2zps-dot.is-active { background: var(--a2zps-accent); transform: scale(1.25); }

.a2zps-caps { padding: 8px 16px 16px; }
.a2zps-dots + .a2zps-caps { padding-top: 6px; }
.a2zps-cap__title { margin: 6px 0 4px; font-size: 1.05em; line-height: 1.35; font-weight: 700; color: var(--a2zps-ink); }
.a2zps-cap__text { font-size: .98em; line-height: 1.65; }
.a2zps-cap__text p { margin: 0 0 .7em; }
.a2zps-cap__text > :last-child { margin-bottom: 0; }
.a2zps-more { display: inline-block; margin: 4px 0 0; padding: 0; border: 0; background: none; color: var(--a2zps-muted); font-size: .9em; cursor: pointer; }
.a2zps-more:hover { color: var(--a2zps-ink); text-decoration: underline; }
.a2zps-more[hidden] { display: none; }

/* Script on: show only the caption of the visible photo, clamp long ones. */
.a2zps-js .a2zps-cap { display: none; }
.a2zps-js .a2zps-cap.is-active { display: block; }
.a2zps-js .a2zps-cap__text { max-height: 6.6em; overflow: hidden; }
.a2zps-js .a2zps-cap.is-open .a2zps-cap__text { max-height: none; overflow: visible; }
/* Script off: every caption is listed under the photos. */
.a2zps--carousel:not(.a2zps-js) .a2zps-cap + .a2zps-cap { margin-top: 14px; border-top: 1px solid var(--a2zps-line); padding-top: 10px; }

/* ---------- Grid of galleries ---------- */
.a2zps-grid { --a2zps-cols: 3; display: grid; grid-template-columns: repeat(var(--a2zps-cols), minmax(0, 1fr)); gap: 22px; max-width: none; }
.a2zps-gcard { display: block; text-decoration: none !important; color: inherit; }
.a2zps-gcard__media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--a2zps-radius); background: #e5e7eb; }
.a2zps .a2zps-gcard__media img { display: block !important; width: 100% !important; height: 100% !important; object-fit: cover !important; margin: 0 !important; transition: transform .35s ease; }
.a2zps-gcard:hover .a2zps-gcard__media img { transform: scale(1.05); }
.a2zps-gcard__noimg { display: block; width: 100%; height: 100%; }
.a2zps-gcard__badge {
	position: absolute; left: 10px; bottom: 10px; background: rgba(17, 24, 39, .75); color: #fff; font-size: 12px; font-weight: 700;
	padding: 4px 10px; border-radius: 999px;
}
.a2zps-gcard__title { display: block; margin-top: 10px; font-weight: 700; line-height: 1.4; }
.a2zps-gcard:hover .a2zps-gcard__title { color: var(--a2zps-accent); }

@media (max-width: 900px) { .a2zps-grid { grid-template-columns: repeat(min(var(--a2zps-cols), 2), minmax(0, 1fr)); } }
@media (max-width: 480px) {
	.a2zps-grid { grid-template-columns: minmax(0, 1fr); }
	.a2zps-slide__media, .a2zps-card { border-radius: 10px; }
}

:where(.a2zps) :focus-visible { outline: 2px solid var(--a2zps-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.a2zps * { transition: none !important; scroll-behavior: auto !important; }
}
