/* Lalage · blocks and paper components.
   Loaded in the front end and inside the editor canvas (enqueue_block_assets), so a
   blog entry looks the same while it is being written as when it is published. */

:root {
	--paper: #FFFDF8;
	--ink: #38312E;
	--ink-soft: #5E5550;
	--blush: #EDDFDE;
	--coral: #EA6A61;
	--mark: #B8423A;
	--rule: #B9ADA6;
	--f-type: 'Special Elite', 'Courier New', monospace;
	--f-display: 'Abril Fatface', Georgia, serif;
	--f-read: 'Newsreader', Georgia, serif;
	--paper-shadow: 0 8px 14px var(--shadow, rgba(90, 50, 30, .28));
}

/* ---------- paper components (shared by templates and blocks) ---------- */
.sh { filter: drop-shadow(0 8px 12px var(--shadow, rgba(90, 50, 30, .28))); }
.strip {
	display: inline-block; padding: 14px 20px 10px; font-family: var(--f-type); font-size: 24px; line-height: 1.15;
	text-decoration: none; border: 0; cursor: pointer; transform: rotate(var(--r, 0deg));
	clip-path: polygon(0 8%, 3% 0, 97% 4%, 100% 0, 99% 92%, 96% 100%, 4% 96%, 0 100%);
}
.pi { background: var(--ink); color: #F9F8F6; }
.pa { background: var(--paper); color: var(--ink); }
.pb { background: var(--blush); color: var(--ink); }
.pc { background: var(--accent, var(--coral)); color: var(--accent-ink, var(--ink)); }

.print { display: block; position: relative; background: var(--paper); padding: 10px; color: var(--ink); text-decoration: none; font-family: var(--f-type); font-size: 15px; line-height: 1.4; transform: rotate(var(--r, 0deg)); box-shadow: var(--paper-shadow); }
.print img { display: block; width: 100%; height: auto; }
.cap { display: block; padding: 9px 2px 1px; }
.tape, .wp-block-image.is-style-foto::before { content: ""; position: absolute; width: 104px; height: 30px; background: var(--tape, rgba(234, 106, 97, .55)); top: -15px; left: 50%; margin-left: -52px; transform: rotate(-4deg); z-index: 1; }
.note { background: var(--paper); color: var(--ink); padding: 20px 22px; margin: 0; font-family: var(--f-type); font-size: 18px; line-height: 1.55; transform: rotate(var(--r, 0deg)); max-width: 520px; box-shadow: var(--paper-shadow); }

.ticket { display: flex; align-items: stretch; background: var(--paper); color: var(--ink); font-family: var(--f-type); transform: rotate(var(--r, 0deg)); max-width: 900px; width: 100%; box-shadow: var(--paper-shadow); }
.stub { display: flex; flex-direction: column; justify-content: center; gap: 4px; margin: 0; padding: 22px 26px; border-right: 3px dashed var(--rule); font-size: 16px; min-width: 150px; text-transform: capitalize; }
.stub b { font-family: 'Bebas Neue', sans-serif; font-weight: 400; font-size: 46px; line-height: 1; color: var(--mark); text-transform: uppercase; }
/* No date yet ("A confirmar") or a date typed as text: smaller, so it stays inside the stub. */
.stub.no-date { max-width: 190px; }
.stub.no-date b { font-size: 24px; line-height: 1.05; text-wrap: balance; }
.tbody { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 22px 28px; font-size: 17px; line-height: 1.4; }
.tbody h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(24px, 2.3vw, 32px); line-height: 1.05; margin: 0; }
.tbody h3 a { text-decoration: none; color: inherit; }
.tbody p { margin: 0; }
.go { display: flex; align-items: center; padding: 0 28px; background: var(--ink); color: #F9F8F6; font-size: 20px; text-decoration: none; }
.go:hover { background: var(--mark); color: #F9F8F6; }
@media (max-width: 899px) {
	.ticket { flex-wrap: wrap; }
	.stub { min-width: 0; flex: 1 1 100%; flex-direction: row; align-items: baseline; gap: 12px; border-right: 0; border-bottom: 3px dashed var(--rule); padding: 16px 20px 12px; }
	.stub b { font-size: 34px; }
	.stub.no-date { max-width: none; }
	.tbody { padding: 16px 20px; }
	.go { flex: 1 1 100%; padding: 14px 20px; }
}

/* ---------- the reading sheet: front (.entry) and editor canvas ---------- */
:is(.entry, .editor-styles-wrapper) {
	font-family: var(--f-read); font-size: clamp(19px, 1.6vw, 23px); line-height: 1.62; color: var(--ink);
}
.entry::after { content: ""; display: table; clear: both; }
:where(.entry, .editor-styles-wrapper .is-root-container) > * { margin-block: 0 22px; }
.entry > *:last-child { margin-bottom: 0; }
:is(.entry, .editor-styles-wrapper) :is(h2, h3, h4) { font-family: var(--f-display); font-weight: 400; line-height: 1.05; margin-top: 44px; color: var(--ink); }
:is(.entry, .editor-styles-wrapper) h2 { font-size: 1.6em; }
:is(.entry, .editor-styles-wrapper) h3 { font-size: 1.3em; }
:is(.entry, .editor-styles-wrapper) h4 { font-size: 1.1em; }
:where(.entry, .editor-styles-wrapper) a { color: var(--mark); text-underline-offset: 4px; }
:is(.entry, .editor-styles-wrapper) :is(ul, ol) { padding-left: 1.2em; }
:is(.entry, .editor-styles-wrapper) li::marker { color: var(--mark); }
:is(.entry, .editor-styles-wrapper) figure { margin-inline: 0; }
:is(.entry, .editor-styles-wrapper) img { max-width: 100%; height: auto; }
:is(.entry, .editor-styles-wrapper) figcaption { font-family: var(--f-type); font-size: 15px; color: var(--ink-soft); margin-top: 8px; text-align: left; }
:is(.entry, .editor-styles-wrapper) strong { font-weight: 600; }
:is(.entry, .editor-styles-wrapper) hr:not([class*=is-style]) { border: 0; border-top: 2px dashed var(--rule); margin: 44px 0; }

/* quote: a typed strip of dark paper (default) */
:is(.entry, .editor-styles-wrapper) .wp-block-quote:not(.is-style-nota),
:is(.entry, .editor-styles-wrapper) .wp-block-pullquote blockquote {
	margin: 36px -30px 40px; padding: 26px 34px 22px; border: 0; background: var(--ink); color: #F9F8F6;
	font-family: var(--f-type); font-size: 1.2em; line-height: 1.32; text-align: left; transform: rotate(-1.5deg);
	clip-path: polygon(0 4%, 2% 0, 98% 3%, 100% 0, 99% 95%, 97% 100%, 3% 97%, 0 100%);
}
:is(.entry, .editor-styles-wrapper) .wp-block-pullquote { border: 0; padding: 0; margin: 0; }
:is(.entry, .editor-styles-wrapper) .wp-block-quote p { margin: 0 0 10px; }
:is(.entry, .editor-styles-wrapper) .wp-block-quote p:last-of-type { margin-bottom: 0; }
:is(.entry, .editor-styles-wrapper) .wp-block-quote cite,
:is(.entry, .editor-styles-wrapper) .wp-block-pullquote cite { display: block; margin-top: 12px; font-size: .68em; font-style: normal; color: #E9DCD6; }
/* quote · nota: a handwritten note on ruled paper */
:is(.entry, .editor-styles-wrapper) .wp-block-quote.is-style-nota {
	margin: 36px 0 40px; padding: 26px 32px 22px 54px; border: 0; background: var(--paper);
	background-image: linear-gradient(90deg, transparent 38px, rgba(234, 106, 97, .6) 38px 40px, transparent 40px), repeating-linear-gradient(transparent 0 36px, #DCD3CD 36px 37px);
	font-family: var(--f-read); font-style: italic; font-size: 1.1em; line-height: 37px; transform: rotate(1deg); box-shadow: var(--paper-shadow);
}
:is(.entry, .editor-styles-wrapper) .wp-block-quote.is-style-nota cite { font-family: var(--f-type); font-style: normal; font-size: .7em; color: var(--ink-soft); }

/* paragraph styles */
.is-style-maquina { font-family: var(--f-type); font-size: .9em; line-height: 1.6; }
.is-style-letra-recortada::first-letter {
	float: left; font-family: var(--f-display); font-size: 3.4em; line-height: .9; color: #F9F8F6;
	background: var(--ink); padding: .08em .14em .1em; margin: .08em .16em 0 0;
}

/* heading · etiqueta */
:is(.entry, .editor-styles-wrapper) .is-style-etiqueta {
	width: fit-content; max-width: 100%; background: var(--coral); color: var(--ink); padding: .12em .4em .16em; transform: rotate(-1.5deg);
	box-shadow: var(--paper-shadow);
}
:is(.entry, .editor-styles-wrapper) .is-style-etiqueta:nth-of-type(even) { background: var(--blush); transform: rotate(1.2deg); }

/* separators */
.wp-block-separator.is-style-tijera, .wp-block-separator.is-style-rasgado { width: auto !important; max-width: none !important; }
.wp-block-separator.is-style-tijera { border: 0; border-top: 3px dashed var(--ink-soft); height: 0; margin: 56px 0; overflow: visible; position: relative; opacity: 1; background: none; }
.wp-block-separator.is-style-tijera::before { content: "✂"; position: absolute; left: 6%; top: -.78em; font-size: 28px; line-height: 1; color: var(--ink); background: var(--paper); padding: 0 8px; }
.wp-block-separator.is-style-rasgado {
	border: 0; height: 18px; margin: 50px -20px; opacity: 1; background: var(--blush);
	clip-path: polygon(0 40%, 4% 70%, 7% 30%, 12% 80%, 16% 35%, 21% 65%, 25% 20%, 30% 75%, 35% 40%, 39% 85%, 44% 30%, 49% 70%, 53% 25%, 58% 80%, 62% 45%, 67% 75%, 71% 20%, 76% 65%, 80% 35%, 85% 85%, 89% 40%, 94% 70%, 100% 30%, 100% 100%, 0 100%);
}

/* list · tiras */
.wp-block-list.is-style-tiras { list-style: none; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.wp-block-list.is-style-tiras > li {
	font-family: var(--f-type); font-size: .85em; line-height: 1.35; background: var(--blush); padding: 10px 18px 8px; transform: rotate(-1deg);
	clip-path: polygon(0 8%, 3% 0, 97% 4%, 100% 0, 99% 92%, 96% 100%, 4% 96%, 0 100%);
}
.wp-block-list.is-style-tiras > li:nth-child(even) { background: #F1E2CF; transform: rotate(1deg); margin-left: 18px; }
.wp-block-list.is-style-tiras > li:nth-child(3n) { background: var(--coral); }
.wp-block-list.is-style-tiras > li::marker { content: none; }

/* image · foto con cinta */
.wp-block-image.is-style-foto { position: relative; background: var(--paper); padding: 12px 12px 4px; transform: rotate(-2deg); box-shadow: var(--paper-shadow); width: fit-content; max-width: 100%; }
.wp-block-image.is-style-foto:nth-of-type(even) { transform: rotate(2deg); }
.wp-block-image.is-style-foto img { display: block; }
.wp-block-image.is-style-foto figcaption { margin: 8px 2px 6px; }
.wp-block-image.is-style-foto.alignright { margin: 6px -90px 22px 34px; max-width: 52%; }
.wp-block-image.is-style-foto.alignleft { margin: 6px 34px 22px -90px; max-width: 52%; }
/* image · recorte sin fondo */
.wp-block-image.is-style-recorte img { filter: drop-shadow(0 10px 12px rgba(90, 50, 30, .3)); transform: rotate(-4deg); }

/* gallery · fotos sobre la mesa */
.wp-block-gallery.is-style-mesa { gap: 28px 22px !important; margin: 48px -40px; padding: 10px 0 20px; }
.wp-block-gallery.is-style-mesa > .wp-block-image { flex-grow: 0 !important; width: calc(33.333% - 15px) !important; background: var(--paper); padding: 9px 9px 9px !important; box-shadow: var(--paper-shadow); transform: rotate(-3deg); }
.wp-block-gallery.is-style-mesa > .wp-block-image:nth-child(3n+2) { transform: rotate(2.5deg) translateY(18px); }
.wp-block-gallery.is-style-mesa > .wp-block-image:nth-child(3n) { transform: rotate(-1deg) translateY(-6px); }
.wp-block-gallery.is-style-mesa > .wp-block-image img { border-radius: 0; }
.wp-block-gallery.is-style-mesa > .wp-block-image figcaption {
	position: static; background: none; color: var(--ink); font-family: var(--f-type); font-size: 13px; padding: 7px 2px 0; text-shadow: none; max-height: none;
}
.wp-block-gallery.is-style-mesa > .wp-block-image figcaption::before { display: none; }

/* ---------- Lalage blocks ---------- */
/* Recorte */
.lalage-recorte { margin: 0; position: relative; z-index: 2; pointer-events: none; }
.lalage-recorte img { display: block; width: 100%; }
/* On the site .cut (mesa.css) rotates it and turns it with the scroll; the editor only needs the tilt. */
.editor-styles-wrapper .lalage-recorte img { transform: rotate(var(--r, 0deg)); }
.lalage-recorte.is-size-s { width: 100px; --hang: -60px; }
.lalage-recorte.is-size-m { width: 150px; --hang: -90px; }
.lalage-recorte.is-size-l { width: 210px; --hang: -120px; }
.lalage-recorte.is-side-right { float: right; margin: 0 var(--hang, -90px) 12px 24px; }
.lalage-recorte.is-side-left { float: left; margin: 0 24px 12px var(--hang, -90px); }
.lalage-recorte.is-side-center { margin: 30px auto; }

/* Collage */
.lalage-collage { margin: 12px 0 30px; }
.lalage-collage.is-side-right { float: right; width: 48%; margin: 10px -110px 26px 34px; }
.lalage-collage.is-side-left { float: left; width: 48%; margin: 10px 34px 26px -110px; }
.lalage-collage.is-side-center { width: 72%; margin: 50px auto; }
.lalage-collage .print { font-size: 14px; }

/* Taller */
.lalage-taller { clear: both; margin: 48px -60px; }
.lalage-taller .ticket { margin: 0; }

/* Tira */
.lalage-tira { clear: both; margin: 40px -30px; text-align: left; transform: rotate(var(--r, -1.5deg)); }
.lalage-tira > span {
	display: inline; padding: .32em .55em .22em; font-family: var(--f-type); font-size: 1.12em; line-height: 1.75;
	-webkit-box-decoration-break: clone; box-decoration-break: clone;
	background: var(--ink); color: #F9F8F6;
}
.lalage-tira.is-big > span { font-size: 1.5em; line-height: 1.6; }
.lalage-tira.is-tone-coral > span { background: var(--coral); color: var(--ink); }
.lalage-tira.is-tone-papel > span { background: var(--paper); color: var(--ink); box-shadow: 0 4px 8px rgba(90, 50, 30, .2); }
.lalage-tira.is-tone-rosa > span { background: var(--blush); color: var(--ink); }
.lalage-tira.is-place-center { text-align: center; }
.lalage-tira.is-place-right { text-align: right; }
.lalage-tira a { color: inherit; }

/* Nota */
.lalage-nota { position: relative; clear: both; margin: 44px 0; padding: 30px 32px 26px; background: var(--paper); color: var(--ink); font-family: var(--f-type); font-size: .82em; line-height: 1.6; transform: rotate(var(--r, -2deg)); box-shadow: var(--paper-shadow); }
.lalage-nota > :not(.tape) { margin: 0 0 12px; }
.lalage-nota > :last-child { margin-bottom: 0; }
.lalage-nota :is(h2, h3, h4) { margin-top: 0; font-size: 1.5em; }
.lalage-nota.is-tone-rosa { background: var(--blush); }
.lalage-nota.is-tone-coral { background: var(--coral); --tape: rgba(255, 248, 232, .75); }
.lalage-nota.is-tone-cuadriculado {
	background-color: var(--paper);
	background-image: linear-gradient(rgba(184, 66, 58, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(184, 66, 58, .16) 1px, transparent 1px);
	background-size: 22px 22px;
}
.lalage-nota.is-side-right { clear: none; float: right; width: 46%; margin: 10px -90px 24px 30px; }
.lalage-nota.is-side-left { clear: none; float: left; width: 46%; margin: 10px 30px 24px -90px; }
.lalage-nota a { color: inherit; }

/* Sheets are narrower on phones: pull everything back inside. */
@media (max-width: 899px) {
	.wp-block-gallery.is-style-mesa > .wp-block-image { width: calc(50% - 11px) !important; }
	.lalage-recorte img { translate: none !important; }
	.lalage-recorte.is-side-right { margin-right: -24px; }
	.lalage-recorte.is-side-left { margin-left: -24px; }
	.lalage-recorte.is-size-l { width: 150px; }
	.lalage-recorte.is-size-m { width: 110px; }
	.lalage-recorte.is-size-s { width: 80px; }
	.lalage-collage.is-side-right, .lalage-collage.is-side-left, .lalage-collage.is-side-center { float: none; width: auto; margin: 34px 0; }
	.lalage-nota.is-side-right, .lalage-nota.is-side-left { float: none; width: auto; margin: 34px 0; }
	.lalage-taller, .lalage-tira { margin-inline: -10px; }
	.wp-block-image.is-style-foto.alignright, .wp-block-image.is-style-foto.alignleft { float: none; margin: 30px auto; max-width: 100%; }
	.wp-block-gallery.is-style-mesa { margin-inline: -8px; }
	.entry .wp-block-quote:not(.is-style-nota) { margin-inline: -10px; }
}

/* ---------- editor canvas: the post sits on the table like the published sheet ---------- */
.editor-styles-wrapper .lalage-recorte { pointer-events: auto; }
.editor-styles-wrapper .lalage-collage .lalage-collage { float: none; width: auto; margin: 0; }
.editor-styles-wrapper {
	--shadow: rgba(90, 50, 30, .28);
	--paper-shadow: 0 8px 14px var(--shadow);
	--tape: rgba(234, 106, 97, .55);
	background-color: #F4EADB;
	background-image:
		linear-gradient(rgba(184, 66, 58, .22) 1px, transparent 1px),
		linear-gradient(90deg, rgba(184, 66, 58, .22) 1px, transparent 1px),
		linear-gradient(rgba(184, 66, 58, .09) 1px, transparent 1px),
		linear-gradient(90deg, rgba(184, 66, 58, .09) 1px, transparent 1px);
	background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}
.editor-styles-wrapper .editor-post-title,
.editor-styles-wrapper .wp-block-post-title {
	font-family: var(--f-display); font-weight: 400; font-size: clamp(44px, 5vw, 84px); line-height: .95; color: var(--ink); max-width: 820px; margin-inline: auto;
}
.editor-styles-wrapper .is-root-container.is-layout-flow,
.editor-styles-wrapper .is-root-container.is-layout-constrained {
	max-width: 820px; margin: 40px auto 120px !important; padding: 64px 76px 70px; background: var(--paper); box-shadow: var(--paper-shadow);
}
.editor-styles-wrapper .is-root-container > * { max-width: none; }
