/* Studio themes gallery: tabs, cards, inline quick create section. */

.studio-themes {
	--studio-themes-radius: 14px;
	--studio-themes-focus: var(--studio-ink, #1a1a1e);
	margin: 0 0 2rem;
}

/* ---------- Tabs ---------- */
.studio-themes .studio-themes__tabs {
	display: flex;
	gap: 0.5rem;
	margin: 0 0 1.25rem;
	padding: 0.25rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.studio-themes .studio-themes__tab {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	padding: 0.5rem 1rem;
	border: 1px solid var(--studio-sand, #e8e6e1);
	border-radius: 999px;
	background: var(--studio-cream, #fff);
	color: var(--studio-text, #2d2b28);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.studio-themes .studio-themes__tab:hover {
	border-color: var(--studio-stone, #b8b5ae);
}

.studio-themes .studio-themes__tab:focus-visible {
	outline: 3px solid var(--studio-themes-focus);
	outline-offset: 2px;
}

.studio-themes .studio-themes__tab[aria-selected="true"] {
	background: var(--studio-ink, #1a1a1e);
	border-color: var(--studio-ink, #1a1a1e);
	color: #fff;
}

.studio-themes .studio-themes__tab-count {
	min-width: 1.5em;
	padding: 0 0.4em;
	border-radius: 999px;
	background: rgba(127, 127, 127, 0.18);
	font-size: 0.8em;
	text-align: center;
}

.studio-themes .studio-themes__panel:focus-visible {
	outline: 3px solid var(--studio-themes-focus);
	outline-offset: 4px;
	border-radius: var(--studio-themes-radius);
}

/* ---------- Cards ---------- */
.studio-themes .studio-themes__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
}

@media (min-width: 640px) {
	.studio-themes .studio-themes__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1rem;
	}
}

@media (min-width: 1024px) {
	.studio-themes .studio-themes__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.studio-themes .studio-theme-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--studio-sand, #e8e6e1);
	border-radius: var(--studio-themes-radius);
	background: var(--studio-cream, #fff);
	color: var(--studio-text, #2d2b28);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.studio-themes .studio-theme-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.studio-themes .studio-theme-card__open {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	width: 100%;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.studio-themes .studio-theme-card__open:focus-visible {
	outline: 3px solid var(--studio-themes-focus);
	outline-offset: -3px;
}

.studio-themes .studio-theme-card__art {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--studio-linen, #f3efe8);
}

.studio-themes .studio-theme-card__art img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.studio-themes .studio-theme-card__placeholder {
	position: absolute;
	inset: 0;
	display: block;
	background: linear-gradient(145deg, #f6e3d3, #e9c9b4);
}

.studio-themes .studio-theme-card--pets .studio-theme-card__placeholder { background: linear-gradient(145deg, #fde7c8, #f1b98a); }
.studio-themes .studio-theme-card--couples .studio-theme-card__placeholder { background: linear-gradient(145deg, #fbd9e2, #e8a6bd); }
.studio-themes .studio-theme-card--family .studio-theme-card__placeholder { background: linear-gradient(145deg, #ffeab8, #f2c76e); }
.studio-themes .studio-theme-card--kids .studio-theme-card__placeholder { background: linear-gradient(145deg, #d3ecfb, #9fd0f0); }
.studio-themes .studio-theme-card--you .studio-theme-card__placeholder { background: linear-gradient(145deg, #e3d9f7, #b9a5e6); }
.studio-themes .studio-theme-card--places .studio-theme-card__placeholder { background: linear-gradient(145deg, #d5f0e3, #94cfb2); }
.studio-themes .studio-theme-card--seasonal .studio-theme-card__placeholder { background: linear-gradient(145deg, #ffe0d0, #f4a98a); }
.studio-themes .studio-theme-card--funny .studio-theme-card__placeholder { background: linear-gradient(145deg, #fff3b0, #f7d94c); }

/* Sits inside __art (position: relative), top-left so it clears the carousel dots. */
.studio-themes .studio-theme-card__badge {
	position: absolute;
	z-index: 3;
	left: 0.5rem;
	top: 0.5rem;
	max-width: calc(100% - 1rem);
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: #1a1a1e;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
}

.studio-themes .studio-theme-card__body {
	display: block;
	padding: 0.75rem;
}

.studio-themes .studio-theme-card__name {
	display: block;
	margin: 0 0 0.25rem;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.studio-themes .studio-theme-card__desc {
	display: block;
	margin: 0;
	color: var(--studio-muted, #2d2b28);
	font-size: 0.875rem;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

/* Own idea card */
.studio-themes .studio-theme-card--own {
	border-style: dashed;
	border-width: 2px;
	border-color: var(--studio-stone, #b8b5ae);
	background: transparent;
}

.studio-themes .studio-theme-card--own .studio-theme-card__placeholder {
	background: repeating-linear-gradient(135deg, #f3efe8 0, #f3efe8 10px, #ece6db 10px, #ece6db 20px);
}

.studio-themes .studio-theme-card--own .studio-theme-card__art::after {
	content: "+";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--studio-ink, #1a1a1e);
	font-size: 3rem;
	font-weight: 300;
}

/* ---------- Quick section (inline, steps 2 and 3) ---------- */
.studio-themes .studio-quick {
	margin: 1.5rem 0 0;
	padding: 1.25rem;
	border: 1px solid var(--studio-sand, #e8e6e1);
	border-radius: 20px;
	background: var(--studio-cream, #fff);
	color: var(--studio-text, #2d2b28);
}

.studio-themes .studio-quick[hidden] {
	display: none;
}

.studio-themes .studio-quick:focus {
	outline: none;
}

.studio-themes .studio-quick__close {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 44px;
	padding: 0.4rem 0.9rem 0.4rem 0.5rem;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.studio-themes .studio-quick__close:hover {
	background: rgba(127, 127, 127, 0.15);
}

.studio-themes .studio-quick__close:focus-visible,
.studio-themes .studio-quick__form input:focus-visible,
.studio-themes .studio-quick__form textarea:focus-visible,
.studio-themes .studio-slot__remove:focus-visible {
	outline: 3px solid var(--studio-themes-focus);
	outline-offset: 2px;
}

.studio-themes .studio-quick__title {
	margin: 0.25rem 0 0.35rem;
	font-size: 1.35rem;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.studio-themes .studio-quick__desc {
	margin: 0 0 1rem;
	color: var(--studio-muted, #2d2b28);
	font-size: 0.9rem;
	line-height: 1.45;
}

.studio-themes .studio-quick__desc:empty {
	display: none;
}

.studio-themes .studio-quick__form {
	display: grid;
	gap: 1.1rem;
}

.studio-themes .studio-quick__step {
	display: grid;
	gap: 0.9rem;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.studio-themes .studio-quick__step-title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2rem 0.75rem;
	margin: 0 0 0.25rem;
	padding: 0;
}

.studio-themes .studio-quick__step-num {
	color: var(--studio-muted, #2d2b28);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.studio-themes .studio-quick__step-name {
	font-size: 1.1rem;
	font-weight: 700;
}

.studio-themes .studio-quick__step-hint {
	color: var(--studio-muted, #2d2b28);
	font-size: 0.85rem;
}

/* Photo slots */
.studio-themes .studio-quick__slots {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.75rem;
}

@media (min-width: 600px) {
	.studio-themes .studio-quick__slots {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.studio-themes .studio-slot {
	position: relative;
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	grid-template-areas: "icon label" "icon tips" "input input" "remove remove";
	gap: 0.35rem 0.75rem;
	align-content: start;
	min-width: 0;
	padding: 0.85rem;
	border: 1px solid var(--studio-sand, #e8e6e1);
	border-radius: 14px;
	background: var(--studio-linen, #f3efe8);
}

.studio-themes .studio-slot[hidden] {
	display: none;
}

.studio-themes .studio-slot__icon {
	grid-area: icon;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 80px;
	color: var(--studio-theme-color, var(--studio-ink, #1a1a1e));
}

.studio-themes .studio-slot__icon svg {
	display: block;
	width: 64px;
	height: 80px;
}

.studio-themes .studio-slot__label {
	grid-area: label;
	display: grid;
	gap: 0.1rem;
	font-size: 0.9rem;
	font-weight: 700;
}

.studio-themes .studio-slot__optional,
.studio-themes .studio-slot__frame {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--studio-muted, #2d2b28);
}

.studio-themes .studio-slot__optional[hidden] {
	display: none;
}

.studio-themes .studio-slot__tips {
	grid-area: tips;
	margin: 0;
	padding: 0 0 0 1rem;
	font-size: 0.75rem;
	line-height: 1.4;
	color: var(--studio-muted, #2d2b28);
}

.studio-themes .studio-slot__input {
	grid-area: input;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: 0.6rem;
	border: 1px dashed var(--studio-stone, #b8b5ae);
	border-radius: 12px;
	background: #fff;
	font: inherit;
	font-size: 0.85rem;
}

.studio-themes .studio-slot__preview {
	position: absolute;
	top: 0.85rem;
	left: 0.85rem;
	width: 64px;
	height: 80px;
	object-fit: cover;
	border-radius: 8px;
	background: var(--studio-linen, #f3efe8);
}

.studio-themes .studio-slot__preview[hidden],
.studio-themes .studio-slot__remove[hidden] {
	display: none;
}

.studio-themes .studio-slot__remove {
	grid-area: remove;
	justify-self: start;
	min-height: 44px;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--studio-stone, #b8b5ae);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
}

/* Do and avoid strip */
.studio-themes .studio-quick__rules {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.75rem;
}

@media (min-width: 600px) {
	.studio-themes .studio-quick__rules {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.studio-themes .studio-quick__rules-list {
	margin: 0;
	padding: 0.75rem 0.9rem;
	border-radius: 12px;
	list-style: none;
	font-size: 0.85rem;
	line-height: 1.45;
}

.studio-themes .studio-quick__rules-list--do { background: #eaf6ee; }
.studio-themes .studio-quick__rules-list--dont { background: #fdeeee; }

.studio-themes .studio-quick__rules-list li {
	display: flex;
	gap: 0.5rem;
	margin: 0 0 0.3rem;
}

.studio-themes .studio-quick__rules-list li:last-child {
	margin-bottom: 0;
}

.studio-themes .studio-quick__rules-mark {
	flex: 0 0 auto;
	font-weight: 700;
}

.studio-themes .studio-quick__rules-list--do .studio-quick__rules-mark { color: #1d7a3e; }
.studio-themes .studio-quick__rules-list--dont .studio-quick__rules-mark { color: #9b1c1c; }

.studio-themes .studio-quick__nophoto {
	margin: 0;
	color: var(--studio-muted, #2d2b28);
	font-size: 0.9rem;
}

.studio-themes .studio-quick__nophoto[hidden] {
	display: none;
}

.studio-themes .studio-quick__field {
	display: grid;
	gap: 0.35rem;
}

.studio-themes .studio-quick__form label {
	font-weight: 600;
	font-size: 0.9rem;
}

.studio-themes .studio-quick__field input,
.studio-themes .studio-quick__field textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 44px;
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--studio-stone, #b8b5ae);
	border-radius: 10px;
	background: #fff;
	color: inherit;
	font: inherit;
}

.studio-themes .studio-quick__field textarea {
	resize: vertical;
	min-height: 5.5rem;
}

.studio-themes .studio-quick__privacy,
.studio-themes .studio-quick__note {
	margin: 0;
	font-size: 0.8rem;
	line-height: 1.45;
	color: var(--studio-muted, #2d2b28);
}

.studio-themes .studio-quick__error {
	margin: 0;
	padding: 0.6rem 0.8rem;
	border-radius: 10px;
	background: #fdeaea;
	color: #9b1c1c;
	font-weight: 600;
	font-size: 0.9rem;
}

.studio-themes .studio-quick__error[hidden] {
	display: none;
}

.studio-themes .studio-quick__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.studio-themes .studio-quick__actions button {
	flex: 1 1 10rem;
	min-height: 44px;
}

@media (min-width: 900px) {
	.studio-themes .studio-quick {
		padding: 2rem;
	}
}

/* 8 of 12 columns, centred: the full 1280px section made the form lines too long. */
@media (min-width: 1024px) {
	.studio-themes .studio-quick {
		max-width: 66.667%;
		margin-inline: auto;
	}
}

/* studio.css sizes every section h2 at 0,2,1 (54px); the quick title is a sub-heading. */
.studio-themes .studio-quick .studio-quick__title {
	margin: 0.25rem 0 0.35rem;
	font-size: clamp(1.35rem, 2vw, 1.75rem);
	line-height: 1.2;
	letter-spacing: -0.01em;
}

/* Slots as white cards on the cream panel. */
.studio-themes .studio-quick .studio-slot {
	background: #fff;
	box-shadow: 0 1px 2px rgba(44, 40, 37, 0.06), 0 6px 18px rgba(44, 40, 37, 0.05);
}

.studio-themes .studio-quick .studio-slot__input {
	padding: 0.45rem;
	background: var(--studio-linen, #f3efe8);
	color: var(--studio-muted, #2d2b28);
	cursor: pointer;
}

.studio-themes .studio-slot__input::file-selector-button {
	min-height: 34px;
	margin-right: 0.6rem;
	padding: 0.35rem 1rem;
	border: 0;
	border-radius: 999px;
	background: var(--studio-ink, #1a1a1e);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.studio-themes .studio-slot__input:hover::file-selector-button {
	background: #3a3a40;
}

/* Quick ideas: one-tap briefs from the panel (studio_themes.i18n[lang].ideas). */
.studio-themes .studio-quick__ideas {
	display: grid;
	gap: 0.35rem;
}

.studio-themes .studio-quick__ideas[hidden] {
	display: none;
}

.studio-themes .studio-quick__ideas-title {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 600;
}

.studio-themes .studio-quick__ideas-hint {
	margin: 0;
	color: var(--studio-muted, #2d2b28);
	font-size: 0.8rem;
}

.studio-themes .studio-quick__ideas-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.3rem;
}

.studio-themes .studio-quick__idea {
	min-height: 40px;
	max-width: 100%;
	padding: 0.45rem 0.95rem;
	border: 1px solid var(--studio-stone, #b8b5ae);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 0.85rem;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.studio-themes .studio-quick__idea:hover {
	border-color: var(--studio-ink, #1a1a1e);
}

.studio-themes .studio-quick__idea[aria-pressed="true"] {
	border-color: var(--studio-ink, #1a1a1e);
	background: var(--studio-ink, #1a1a1e);
	color: #fff;
}

.studio-themes .studio-quick__idea:focus-visible,
.studio-themes .studio-slot__input:focus-visible {
	outline: 3px solid var(--studio-themes-focus);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.studio-themes .studio-themes__tab,
	.studio-themes .studio-theme-card {
		transition: none;
	}

	.studio-themes .studio-theme-card:hover {
		transform: none;
	}
}

/* Visually hidden text (Do / Avoid prefixes in the rules strip). */
.studio-themes .studio-quick__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
