/*
Theme Name: QR Galeria
Theme URI: https://wordpress.org/
Author: QR Galeria
Description: Tema de bloques para compartir y moderar fotos de eventos mediante un enlace QR.
Requires at least: 6.7
Requires PHP: 7.2
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: qr-galeria
Tags: full-site-editing, photography, portfolio, accessibility-ready
*/

:root {
	--qrg-ink: #17191f;
	--qrg-muted: #6d7078;
	--qrg-paper: #f7f6f2;
	--qrg-card: #ffffff;
	--qrg-line: #e4e2dc;
	--qrg-accent: #e85d3f;
	--qrg-accent-dark: #b83d27;
	--qrg-radius: 18px;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	background: var(--qrg-paper);
	color: var(--qrg-ink);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.55;
	margin: 0;
}

a {
	color: inherit;
}

button,
input {
	font: inherit;
}

.qrg-shell {
	margin: 0 auto;
	max-width: 1240px;
	padding: 0 28px;
}

.qrg-header {
	align-items: center;
	display: flex;
	justify-content: space-between;
	padding: 24px 0;
}

.qrg-brand {
	align-items: center;
	display: inline-flex;
	font-size: 14px;
	font-weight: 800;
	gap: 10px;
	letter-spacing: .08em;
	text-decoration: none;
	text-transform: uppercase;
}

.qrg-brand-mark {
	background: var(--qrg-accent);
	border-radius: 50%;
	display: inline-block;
	height: 12px;
	width: 12px;
}

.qrg-header-link {
	color: var(--qrg-muted);
	font-size: 14px;
	text-decoration: none;
}

.qrg-header-link:hover {
	color: var(--qrg-ink);
}

.qrg-hero {
	align-items: end;
	display: grid;
	gap: 24px;
	grid-template-columns: minmax(0, 1fr) auto;
	padding: clamp(60px, 11vw, 132px) 0 54px;
}

.qrg-kicker {
	color: var(--qrg-accent-dark);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .16em;
	margin: 0 0 18px;
	text-transform: uppercase;
}

.qrg-hero h1 {
	font-size: clamp(44px, 8vw, 104px);
	font-weight: 800;
	letter-spacing: -.075em;
	line-height: .92;
	margin: 0;
	max-width: 840px;
}

.qrg-hero-copy {
	color: var(--qrg-muted);
	font-size: 17px;
	margin: 24px 0 0;
	max-width: 550px;
}

.qrg-hero-badge {
	border: 1px solid var(--qrg-line);
	border-radius: 50%;
	display: grid;
	height: 120px;
	place-items: center;
	transform: rotate(8deg);
	width: 120px;
}

.qrg-hero-badge span {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .12em;
	text-align: center;
	text-transform: uppercase;
}

.qrg-share-card {
	align-items: center;
	background: #ebe8e0;
	border-radius: 24px;
	display: grid;
	gap: 28px;
	grid-template-columns: 180px minmax(0, 1fr);
	margin: 0 0 42px;
	padding: 24px;
}

.qrg-share-qr {
	background: #fff;
	border-radius: 14px;
	display: grid;
	min-height: 180px;
	place-items: center;
	padding: 8px;
	width: 180px;
}

.qrg-share-qr img {
	display: block;
	height: 164px;
	max-width: 100%;
	width: 164px;
}

.qrg-share-content h2 {
	font-size: clamp(26px, 4vw, 42px);
	letter-spacing: -.06em;
	line-height: 1;
	margin: 0 0 10px;
}

.qrg-share-content > p:not(.qrg-kicker) {
	color: var(--qrg-muted);
	margin: 0 0 18px;
	max-width: 560px;
}

.qrg-share-link-row {
	display: flex;
	gap: 8px;
	max-width: 680px;
}

.qrg-share-link-row input {
	background: #fff;
	border: 1px solid var(--qrg-line);
	border-radius: 999px;
	color: var(--qrg-muted);
	min-width: 0;
	padding: 11px 15px;
	width: 100%;
}

.qrg-copy-button {
	flex: 0 0 auto;
	font-size: 13px;
	padding: 11px 16px;
}

.qrg-copy-status {
	color: var(--qrg-accent-dark);
	display: block;
	font-size: 12px;
	min-height: 18px;
	padding-top: 6px;
}

.qrg-toolbar {
	align-items: center;
	border-bottom: 1px solid var(--qrg-line);
	display: flex;
	gap: 18px;
	justify-content: space-between;
	padding: 0 0 20px;
}

.qrg-photo-count {
	color: var(--qrg-muted);
	font-size: 14px;
	margin: 0;
}

.qrg-view-switcher {
	display: flex;
	gap: 6px;
}

.qrg-view-button,
.qrg-carousel-button {
	background: transparent;
	border: 1px solid var(--qrg-line);
	border-radius: 999px;
	color: var(--qrg-muted);
	cursor: pointer;
	font-size: 13px;
	padding: 8px 14px;
}

.qrg-view-button:hover,
.qrg-view-button.is-active,
.qrg-carousel-button:hover {
	background: var(--qrg-ink);
	border-color: var(--qrg-ink);
	color: #fff;
}

.qrg-gallery {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	padding: 28px 0 70px;
}

.qrg-gallery.is-mosaic {
	grid-auto-rows: 150px;
	grid-template-columns: repeat(12, minmax(0, 1fr));
}

.qrg-gallery.is-mosaic .qrg-photo:nth-child(5n + 1) {
	grid-column: span 6;
	grid-row: span 3;
}

.qrg-gallery.is-mosaic .qrg-photo:nth-child(5n + 2),
.qrg-gallery.is-mosaic .qrg-photo:nth-child(5n + 4) {
	grid-column: span 3;
	grid-row: span 2;
}

.qrg-gallery.is-mosaic .qrg-photo:nth-child(5n + 3),
.qrg-gallery.is-mosaic .qrg-photo:nth-child(5n + 5) {
	grid-column: span 3;
	grid-row: span 3;
}

.qrg-gallery.is-carousel {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.qrg-gallery.is-carousel .qrg-photo {
	flex: 0 0 min(72vw, 560px);
	scroll-snap-align: start;
}

.qrg-photo {
	background: #ddd;
	border-radius: var(--qrg-radius);
	overflow: hidden;
	position: relative;
}

.qrg-photo-button {
	background: none;
	border: 0;
	cursor: zoom-in;
	display: block;
	height: 100%;
	padding: 0;
	width: 100%;
}

.qrg-photo img {
	display: block;
	height: 290px;
	object-fit: cover;
	transition: transform .4s ease;
	width: 100%;
}

.qrg-gallery.is-mosaic .qrg-photo img,
.qrg-gallery.is-carousel .qrg-photo img {
	height: 100%;
	min-height: 290px;
}

.qrg-photo:hover img {
	transform: scale(1.04);
}

.qrg-upload-panel {
	background: var(--qrg-ink);
	border-radius: 24px;
	color: #fff;
	display: grid;
	gap: 34px;
	grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
	margin: 0 0 90px;
	overflow: hidden;
	padding: clamp(28px, 5vw, 60px);
}

.qrg-upload-panel h2 {
	font-size: clamp(30px, 4vw, 48px);
	letter-spacing: -.05em;
	line-height: 1;
	margin: 0 0 14px;
}

.qrg-upload-panel p {
	color: #b9bbc0;
	margin: 0;
	max-width: 440px;
}

.qrg-upload-form {
	align-self: center;
}

.qrg-dropzone {
	border: 1px dashed #6f727a;
	border-radius: 14px;
	cursor: pointer;
	display: block;
	padding: 26px;
	text-align: center;
}

.qrg-dropzone:hover,
.qrg-dropzone:focus-within {
	border-color: #fff;
}

.qrg-dropzone strong {
	display: block;
	font-size: 15px;
	margin-bottom: 6px;
}

.qrg-dropzone small {
	color: #b9bbc0;
	display: block;
	font-size: 12px;
}

.qrg-file-input {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.qrg-visually-hidden {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.qrg-file-list {
	color: #b9bbc0;
	font-size: 12px;
	margin: 12px 0;
}

.qrg-button {
	background: var(--qrg-accent);
	border: 0;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	display: inline-block;
	font-size: 14px;
	font-weight: 800;
	padding: 13px 20px;
	text-decoration: none;
}

.qrg-button:hover {
	background: #ff785c;
	color: #fff;
}

.qrg-button:disabled {
	cursor: wait;
	opacity: .6;
}

.qrg-notice {
	border-radius: 12px;
	font-size: 14px;
	margin: 20px 0;
	padding: 13px 16px;
}

.qrg-notice.is-success {
	background: #dff1e5;
	color: #185b30;
}

.qrg-notice.is-error {
	background: #fbe2dd;
	color: #8e2a1c;
}

.qrg-empty {
	background: #efede8;
	border-radius: var(--qrg-radius);
	color: var(--qrg-muted);
	grid-column: 1 / -1;
	padding: 70px 24px;
	text-align: center;
}

.qrg-footer {
	border-top: 1px solid var(--qrg-line);
	color: var(--qrg-muted);
	font-size: 13px;
	padding: 26px 0 40px;
}

.qrg-lightbox {
	align-items: center;
	background: rgba(10, 11, 14, .92);
	display: none;
	inset: 0;
	justify-content: center;
	padding: 30px;
	position: fixed;
	z-index: 100000;
}

.qrg-lightbox.is-open {
	display: flex;
}

.qrg-lightbox img {
	max-height: 90vh;
	max-width: 92vw;
	object-fit: contain;
}

.qrg-lightbox-close {
	background: #fff;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	font-size: 22px;
	height: 40px;
	line-height: 1;
	position: absolute;
	right: 24px;
	top: 24px;
	width: 40px;
}

@media (max-width: 760px) {
	.qrg-shell {
		padding: 0 18px;
	}

	.qrg-hero {
		display: block;
		padding: 56px 0 38px;
	}

	.qrg-hero-badge {
		display: none;
	}

	.qrg-share-card {
		display: block;
		padding: 18px;
	}

	.qrg-share-qr {
		margin-bottom: 20px;
	}

	.qrg-share-link-row {
		align-items: stretch;
		flex-direction: column;
	}

	.qrg-toolbar {
		align-items: flex-start;
		flex-direction: column;
		gap: 12px;
	}

	.qrg-gallery {
		gap: 8px;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		padding-bottom: 46px;
	}

	.qrg-gallery.is-mosaic {
		grid-auto-rows: 100px;
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.qrg-gallery.is-mosaic .qrg-photo:nth-child(n) {
		grid-column: span 3;
		grid-row: span 2;
	}

	.qrg-gallery.is-mosaic .qrg-photo:nth-child(5n + 1) {
		grid-column: span 6;
		grid-row: span 3;
	}

	.qrg-photo img {
		height: 210px;
	}

	.qrg-upload-panel {
		display: block;
		margin-bottom: 54px;
		padding: 28px 22px;
	}

	.qrg-upload-form {
		margin-top: 28px;
	}
}
