/* Elf Factory catalog (design: ElfFactory.dc.html, catalog view) */

/* Hero */
.ef-hero { position: relative; background: var(--scs-green); color: var(--scs-on-dark); overflow: hidden; }
.ef-hero__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding-block: clamp(40px, 5vw, 64px) clamp(48px, 5vw, 72px); }
.ef-hero__copy { flex: 1 1 520px; display: flex; flex-direction: column; gap: 18px; position: relative; z-index: 2; min-width: 0; }
.ef-hero__title { font-size: clamp(2.75rem, 1.6rem + 4.2vw, 4.5rem); line-height: 1; }
.ef-hero__lead { font-size: clamp(17px, 1rem + .3vw, 19px); line-height: 1.6; max-width: 560px; color: var(--scs-on-dark-muted); }
.ef-hero__note { font-size: 16px; line-height: 1.55; max-width: 560px; color: #F4E7C9; font-style: italic; }
.ef-hero__art { flex: 1 1 520px; position: relative; aspect-ratio: 560 / 330; max-height: 330px; min-width: 0; }
.ef-hero__art > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ef-hero__elf { position: absolute; left: 34%; bottom: 20%; width: 12.1%; }
.ef-hero__bunny { position: absolute; left: 51%; bottom: 20%; width: 5.7%; }
@media (max-width: 640px) {
	.ef-hero__copy, .ef-hero__art { flex-basis: 100%; }
	.ef-hero__inner { gap: 24px; }
}

/* Find */
.ef-find { display: flex; flex-direction: column; gap: 20px; padding-top: 48px; padding-bottom: 24px; }
.ef-form { display: flex; flex-direction: column; gap: 20px; }
.ef-search { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.ef-search__box { position: relative; }
.ef-search__icon { position: absolute; left: 18px; top: 16px; pointer-events: none; }
.ef-search__input {
	width: 100%; box-sizing: border-box; min-height: 54px; padding: 0 18px 0 52px;
	border-radius: var(--scs-pill); border: var(--scs-border); background: var(--scs-paper);
	font: inherit; font-size: 17px; color: var(--scs-ink);
}
.ef-search__input:focus { outline: 3px solid var(--scs-teal); outline-offset: 2px; }
.ef-search__input::placeholder { color: #5E6766; }

.ef-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ef-group__label { font-weight: 700; font-size: 15px; min-width: 84px; }
.ef-group__note { font-size: 14px; color: var(--scs-ink-soft); }
.ef-pill { position: relative; font-weight: 600; }
.ef-pill.is-active { border-color: var(--scs-ink); }
.ef-pill__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ef-pill:has(.ef-pill__input:focus-visible) { outline: 3px solid var(--scs-teal); outline-offset: 3px; }
.ef-pill:has(.ef-pill__input:checked) { background: var(--scs-green); color: var(--scs-on-dark); border-color: var(--scs-ink); }

.ef-form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.ef-reset { font-weight: 700; font-size: 16px; min-height: 44px; display: inline-flex; align-items: center; }
.ef-count { font-size: 15px; color: var(--scs-ink-soft); }

/* Results */
.ef-results { padding-bottom: 64px; }
.ef-results h2:focus { outline: none; }
.ef-region { transition: opacity .15s ease; }
.ef-region[aria-busy="true"] { opacity: .5; pointer-events: none; }
.ef-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 28px; }

/* Card */
.ef-card { position: relative; display: flex; flex-direction: column; background: var(--scs-paper); border: var(--scs-border); border-radius: 20px; overflow: hidden; box-shadow: 4px 6px 0 var(--scs-ink); transition: transform .15s ease; }
.ef-card:hover { transform: translateY(-3px); }
.ef-card__media { position: relative; aspect-ratio: 4 / 3; border-bottom: var(--scs-border); background: var(--scs-ph-bg); overflow: hidden; }
.ef-card__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ef-card__chip { position: absolute; left: 12px; bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--scs-ph-ink); background: var(--scs-cream); padding: 2px 8px; border-radius: var(--scs-pill); }
.ef-card__badge { position: absolute; right: 12px; top: 12px; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: var(--scs-pill); }
.ef-card__badge--in { background: var(--scs-green); color: var(--scs-on-dark); }
.ef-card__badge--rest { background: var(--scs-ink); color: var(--scs-cream); }
.ef-card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ef-card__meta { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--scs-green); }
.ef-card__title { font-size: 23px; line-height: 1.15; }
.ef-card__link { color: var(--scs-ink); text-decoration: none; }
.ef-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 18px; }
.ef-card__link:hover { color: var(--scs-ink); text-decoration: underline; text-decoration-thickness: 2px; }
.ef-card__link:focus-visible { outline: none; }
.ef-card__link:focus-visible::after { outline: 3px solid var(--scs-teal); outline-offset: -6px; }
.ef-card__summary { font-size: 16px; line-height: 1.5; color: var(--scs-ink-soft); }
.ef-card__actions { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.ef-card__add { position: relative; z-index: 2; }
.ef-card__add > span { display: inline-flex; align-items: center; gap: 8px; }
.ef-card__add.is-in { background: #E3F0EA; border-color: var(--scs-green); color: var(--scs-green-deep); }
.ef-card__remove-hint { font-family: var(--scs-font-body); font-weight: 700; font-size: 14px; text-decoration: underline; color: var(--scs-red-text); }
.ef-card__look { display: inline-flex; align-items: center; gap: 6px; font-family: var(--scs-font-display); font-weight: 600; font-size: 16px; color: var(--scs-red-text); }
.ef-card__resting-note { font-size: 15px; color: var(--scs-ink-soft); font-style: italic; }
.ef-card.is-resting .ef-card__media { filter: saturate(.6); }

/* Empty / resting */
.ef-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 32px; padding: clamp(24px, 4vw, 48px); border: 2px dashed var(--scs-rule); border-radius: var(--scs-radius-lg); }
.ef-empty__art { width: 120px; flex: none; }
.ef-empty__copy { flex: 1 1 360px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ef-empty__title { font-size: clamp(24px, 1.2rem + 1vw, 30px); line-height: 1.15; }
.ef-empty__copy p { font-size: 17px; line-height: 1.55; }
.ef-resting { padding-block: 48px 72px; }

.ef-error { flex-wrap: wrap; align-items: center; }
.ef-error p { flex: 1 1 260px; }

/* Pagination */
.ef-pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 40px; }
.ef-pages__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ef-pages__num { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border-radius: var(--scs-pill); border: var(--scs-border); background: var(--scs-paper); color: var(--scs-ink); font-family: var(--scs-font-display); font-weight: 600; font-size: 17px; text-decoration: none; box-sizing: border-box; }
.ef-pages__num:hover { background: #FFF0D6; color: var(--scs-ink); }
.ef-pages__num.is-current { background: var(--scs-green); color: var(--scs-on-dark); }
.ef-pages__gap { display: inline-flex; align-items: flex-end; justify-content: center; min-width: 20px; min-height: 48px; padding-bottom: 10px; box-sizing: border-box; font-family: var(--scs-font-display); font-weight: 600; font-size: 18px; color: var(--scs-ink-soft); }
.ef-pages__list--narrow { display: none; }

@media (max-width: 640px) {
	.ef-find { padding-top: 32px; }
	.ef-group__label { flex-basis: 100%; min-width: 0; }
	.ef-empty__art { width: 88px; }

	/* Pager: a tighter number window on one row; Previous and Next become arrows. */
	.ef-pages { flex-wrap: nowrap; gap: 6px; }
	.ef-pages__list--wide { display: none; }
	.ef-pages__list--narrow { display: flex; flex-wrap: nowrap; gap: 4px; }
	.ef-pages__num { min-width: 40px; min-height: 40px; font-size: 16px; }
	.ef-pages__gap { min-width: 12px; min-height: 40px; padding-bottom: 8px; }
	.ef-pages .scs-btn--sm { padding: 0; width: 40px; min-height: 40px; justify-content: center; flex: none; }
	.ef-pages__word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

	/* Ideas as a list: a small picture on the left, details on the right. */
	.ef-grid { grid-template-columns: 1fr; gap: 14px; }
	.ef-grid > .ef-card { flex-direction: row; align-items: stretch; border-radius: 16px; box-shadow: 3px 4px 0 var(--scs-ink); }
	.ef-grid .ef-card__media { flex: none; width: 96px; aspect-ratio: auto; border-bottom: 0; border-right: var(--scs-border); }
	.ef-grid .ef-card__chip, .ef-grid .ef-card__look { display: none; }
	.ef-grid .ef-card__badge { left: 6px; right: 6px; top: auto; bottom: 6px; font-size: 11px; padding: 2px 6px; text-align: center; }
	.ef-grid .ef-card__body { padding: 12px 14px; gap: 4px; min-width: 0; }
	.ef-grid .ef-card__meta { font-size: 11px; }
	.ef-grid .ef-card__title { font-size: 18px; }
	.ef-grid .ef-card__summary { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
	.ef-grid .ef-card__actions { padding-top: 6px; }
	.ef-grid .ef-card__link::after { border-radius: 14px; }
}

/* Chimney smoke: the three puffs drift up, swell and fade, one after another. */
.ef-hero__art > svg { overflow: visible; }
.ef-smoke circle { transform-box: fill-box; transform-origin: 50% 50%; animation: ef-puff 3.6s ease-out infinite; }
.ef-smoke circle:nth-child(2) { animation-delay: 1.2s; }
.ef-smoke circle:nth-child(3) { animation-delay: 2.4s; }
@keyframes ef-puff {
	0% { transform: translate(0, 10px) scale(.5); opacity: 0; }
	20% { opacity: 1; }
	100% { transform: translate(6px, -22px) scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .ef-smoke circle { animation: none; } }
