/*
Theme Name: Mattigtal Alpaka
Description: Eigenes Theme für Mattigtal Alpaka: Alpakabetten nach Maß und Alpakaverkauf.
Version: 1.4.0
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: mattigtal-alpaka
*/

:root {
	--green: #2c4632;
	--green-soft: #436549;
	--wool: #f4eee2;
	--paper: #fcfaf5;
	--fawn: #8a5a32;
	--line: #ddd2bf;
	--ink: #2a2620;
	--muted: #5e564a;
	--serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", P052, Georgia, serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.65;
}

img, video { display: block; max-width: 100%; height: auto; }
.wp-block-image, .wp-block-video, .wp-block-table { margin: 0; }

h1, h2, h3 {
	font-family: var(--serif);
	font-weight: 700;
	line-height: 1.15;
	color: var(--green);
	margin: 0 0 .5em;
	text-wrap: balance;
	hyphens: auto;
}
h1 { font-size: clamp(2rem, 1.45rem + 2.1vw, 3.25rem); letter-spacing: -.01em; hyphens: manual; }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.625rem); }
h3 { font-size: 1.25rem; line-height: 1.3; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--green-soft); }
a:hover { color: var(--green); }
:focus-visible { outline: 3px solid var(--fawn); outline-offset: 2px; }

.wrap { width: min(100% - 2.5rem, 1200px); margin-inline: auto; }
.wrap--text { width: min(100% - 2.5rem, 760px); }
.center { text-align: center; margin-top: 2.5rem; }

.eyebrow {
	margin-bottom: .75rem;
	font-size: .875rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--fawn);
}
.lead { font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3125rem); line-height: 1.55; color: var(--muted); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 100; padding: .75rem 1rem; background: #fff; }

/* Buttons and links */
.btn, .wp-block-button .wp-block-button__link {
	display: inline-block;
	padding: .8rem 1.5rem;
	border: 2px solid var(--green);
	border-radius: var(--radius);
	background: var(--green);
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover, .wp-block-button .wp-block-button__link:hover { background: var(--green-soft); border-color: var(--green-soft); color: #fff; }
.btn--small { padding: .45rem 1rem; }
.btn--ghost .wp-block-button__link.wp-block-button__link { background: transparent; color: var(--green); }
.btn--ghost .wp-block-button__link.wp-block-button__link:hover { background: var(--green); border-color: var(--green); color: #fff; }
.btn--light .wp-block-button__link.wp-block-button__link { background: var(--wool); border-color: var(--wool); color: var(--green); }
.btn--light .wp-block-button__link.wp-block-button__link:hover { background: #fff; border-color: #fff; color: var(--green); }
.wp-block-buttons.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.wp-block-buttons.center { justify-content: center; margin-top: 2.5rem; }
.more a { font-weight: 600; text-underline-offset: .2em; }
.more a::after { content: " \2192"; }

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--paper);
	border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; line-height: 1.2; }
.brand__logo { height: 56px; width: auto; flex: none; }
.brand__text { display: flex; flex-direction: column; }
.brand__name { font-family: var(--serif); font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem); font-weight: 700; color: var(--green); white-space: nowrap; }
.brand__place { font-size: .75rem; letter-spacing: .06em; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a:not(.btn) { color: var(--ink); font-weight: 500; text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover, .site-nav a:not(.btn)[aria-current="page"] { color: var(--green); border-bottom-color: var(--fawn); }
.nav-toggle { display: none; padding: .45rem .9rem; border: 2px solid var(--green); border-radius: var(--radius); background: transparent; color: var(--green); font: inherit; font-weight: 600; cursor: pointer; }

@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.site-nav {
		display: none;
		position: absolute;
		inset: 100% 0 auto;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: .5rem 1.25rem 1.25rem;
		background: var(--paper);
		border-bottom: 1px solid var(--line);
	}
	.site-nav.is-open { display: flex; }
	.site-nav a:not(.btn) { padding: .75rem 0; border-bottom: 1px solid var(--line); }
	.site-nav .btn { margin-top: 1rem; text-align: center; }
}

/* Home hero */
.hero { padding: clamp(2.5rem, 5vw, 4.5rem) 0; }
.hero__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 4vw, 4rem); align-items: center; }
.wp-block-video.film { position: relative; margin: 0; }
.film video { width: 100%; border-radius: var(--radius); background: var(--green); }
.film figcaption { margin: .6rem 0 0; font-size: .875rem; color: var(--muted); text-align: left; }
.orf-video video { width: 100%; border-radius: var(--radius); background: var(--green); }
.orf-video figcaption { margin: .6rem 0 0; font-size: .875rem; color: var(--muted); text-align: left; }
.prose .orf-video { margin: 1.5rem 0; }
.film__stage { position: relative; }
.film__full, .film__pause {
	position: absolute;
	bottom: .75rem;
	border: 0;
	border-radius: var(--radius);
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color .15s;
}
.film__full { left: .75rem; padding: .6rem 1rem; background: var(--green); font-size: .9375rem; }
.film__full::before {
	content: "";
	display: inline-block;
	margin-right: .55rem;
	border-style: solid;
	border-width: .4em 0 .4em .65em;
	border-color: transparent transparent transparent #fff;
}
.film__full:hover { background: var(--fawn); }
.film__pause { right: .75rem; padding: .4rem .7rem; background: rgba(20, 18, 15, .65); font-size: .8125rem; }
.film__pause:hover { background: rgba(20, 18, 15, .85); }
.film__full[hidden], .film__pause[hidden] { display: none; }

/* Fact strip */
.facts {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	border-block: 1px solid var(--line);
	color: var(--muted);
	font-size: .9375rem;
}
.facts li { padding: 1.1rem 1rem; line-height: 1.3; border-left: 1px solid var(--line); }
.facts li:first-child { border-left: 0; padding-left: 0; }
.facts strong { display: block; font-family: var(--serif); font-size: 1.25rem; color: var(--green); }

/* Sections */
.section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.section--tight { padding: clamp(1.5rem, 3vw, 2.5rem) 0; }
.section--tight + .section--tight { padding-top: clamp(2rem, 4vw, 4rem); }
.section--tight:last-of-type { padding-bottom: clamp(3.5rem, 7vw, 6rem); }
.section--wool { background: var(--wool); }
.section__head { max-width: 720px; margin-bottom: clamp(2rem, 4vw, 3.5rem); }

/* Scalloped edge, taken from the quilting seam on the blankets */
.scallop { position: relative; }
.scallop::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -14px;
	height: 14px;
	background: radial-gradient(circle at 14px 14px, var(--wool) 13.5px, transparent 14px) 0 0 / 28px 14px repeat-x;
}

.wp-block-image.banner { margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.banner img { width: 100%; border-radius: var(--radius); }
.section--tight .wp-block-image.banner { margin-bottom: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split > .wp-block-image img { width: 100%; max-height: 640px; object-fit: cover; border-radius: var(--radius); }
.split--text-first { align-items: start; }
.split--text-first > .wp-block-image, .split--text-first > .benefits { align-self: center; }
/* Klasse „bild-oben“ im Bild-Block: beim Zuschneiden bleibt der obere Bildteil sichtbar */
.wp-block-image.bild-oben img { object-position: 50% 20%; }

.benefits { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem 2rem; }
.benefits > * { border-top: 2px solid var(--fawn); padding-top: .75rem; }
.benefits h3 { margin-bottom: .25rem; font-size: 1.125rem; }
.benefits p { margin: 0; font-size: .9375rem; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); counter-reset: step; }
.steps > * { counter-increment: step; }
.steps img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); margin-bottom: 1.1rem; }
.steps h3::before { content: counter(step) ". "; color: var(--fawn); }
.steps p { margin: 0; color: var(--muted); }

/* Dark quote band */
.quote-band { background: var(--green); color: var(--wool); padding: clamp(3rem, 6vw, 5.5rem) 0; }
.quote-band__grid { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.quote-band img { width: 100%; max-height: 560px; object-fit: cover; object-position: top; border-radius: var(--radius); }
.quote-band blockquote { margin: 0 0 1.5rem; }
.quote-band blockquote p { font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.5rem); line-height: 1.25; color: #fff; margin: 0; }
.quote-band p { max-width: 58ch; }
.quote-band .wp-block-buttons { margin-top: .5rem; }

/* Sale cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 2.5vw, 2rem); }
.card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); margin-bottom: 1rem; transition: opacity .15s; }
.card:hover img { opacity: .88; }
.card h3 { margin-bottom: .25rem; font-size: 1.5rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card:hover h3 a { text-decoration: underline; text-underline-offset: .15em; }
.card p { margin: 0; color: var(--muted); }

/* Gallery */
.wp-block-gallery.has-nested-images.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; grid-auto-flow: dense; }
.gallery.wp-block-gallery figure.wp-block-image { width: auto !important; margin: 0 !important; overflow: hidden; border-radius: var(--radius); background: var(--line); }
.gallery.wp-block-gallery figure.wp-block-image a { display: block; height: 100%; }
.gallery.wp-block-gallery figure.wp-block-image img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .3s; }
.gallery.wp-block-gallery figure.wp-block-image:hover img { transform: scale(1.04); }
.gallery.wp-block-gallery figure.gallery-item--wide { grid-column: span 2; }
.gallery.wp-block-gallery figure.gallery-item--wide img { aspect-ratio: auto; }

.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(20, 18, 15, .94); color: #fff; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; padding: 1rem 4.5rem; text-align: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 6rem); margin-inline: auto; border-radius: 3px; }
.lightbox figcaption { margin-top: .6rem; font-size: .9375rem; }
.lightbox button { position: absolute; border: 0; background: transparent; color: #fff; font-size: 3rem; line-height: 1; cursor: pointer; padding: .5rem 1rem; }
.lightbox__close { top: .25rem; right: .25rem; }
.lightbox__nav--prev { left: .25rem; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: .25rem; top: 50%; transform: translateY(-50%); }

/* Inner pages */
.page-hero { padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(1rem, 2vw, 1.5rem); }
.page-hero .wrap > * { max-width: 800px; }

.checks { display: grid; gap: .35rem; margin-top: 1.25rem; }
.checks li { padding-left: 1.75rem; position: relative; font-weight: 600; color: var(--green); }
.checks li::before { content: "\2713"; position: absolute; left: 0; color: var(--fawn); font-weight: 700; }
/* Klasse „zwei-spalten“ an einer Häkchen-Liste: Punkte in zwei Spalten nebeneinander (am Handy untereinander) */
.checks.zwei-spalten { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
.label-note { padding: .85rem 1rem; background: var(--wool); border-radius: var(--radius); font-size: .9375rem; }

.mosaic { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-auto-rows: 240px; gap: .75rem; }
.mosaic .wp-block-image { height: 100%; min-height: 0; }
.mosaic .wp-block-image img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.mosaic > :nth-child(1) { grid-row: span 2; }
.mosaic > :nth-child(4) { grid-column: span 2; }
.mosaic > :nth-child(5) { grid-column: 1 / -1; }

.care { border-top: 1px solid var(--line); margin-top: 1.5rem; }
.care > * { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.care h3 { margin: 0; font-size: 1.0625rem; }
.care p { margin: 0; }
.signature { margin-top: 2.5rem; font-family: var(--serif); font-size: 1.375rem; line-height: 1.35; color: var(--fawn); text-align: center; }
.signature em { color: var(--ink); }

.prose h1 { margin-bottom: 1.5rem; }
.prose h2, .prose h3 { margin-top: 1.75em; }
.prose > :first-child, .prose .eyebrow + h2 { margin-top: 0; }
.prose ul { list-style: disc; padding-left: 1.25em; margin-bottom: 1em; }
.prose ol { list-style: decimal; padding-left: 1.25em; margin-bottom: 1em; }
.source { margin-top: 1.25rem; font-size: .875rem; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.wp-block-table table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.wp-block-table thead { border-bottom: 0; }
.wp-block-table th, .wp-block-table td { padding: .65rem .75rem; text-align: left; vertical-align: top; border: 0; border-bottom: 1px solid var(--line); }
.wp-block-table th { color: var(--green); border-bottom: 2px solid var(--fawn); }
.wp-block-table td:first-child, .wp-block-table td:nth-child(2) { white-space: nowrap; }

.offer { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); }
.offer__item { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.offer__item .wp-block-image img { width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--radius); }
/* Erstes Foto (Stuten): gleiche Höhe wie die anderen; der Ausschnitt zeigt die Ohren und möglichst viel von den Beinen (Tablet/Handy siehe unten). */
.offer__item:first-child .wp-block-image img { object-position: 50% 38.5%; }
/* Third photo (Hobbytiere): keep the legs and feet, trim from the wall above. */
.offer__item:nth-child(3) .wp-block-image img { object-position: 50% 70%; }
.offer__item:nth-child(even) > .wp-block-image { order: 2; }
/* Klasse „offer--text-first“ an der Angebotsgruppe: das erste Angebot beginnt mit dem Text links, danach abwechselnd */
.offer--text-first > .offer__item:nth-child(odd) > .wp-block-image { order: 2; }
.offer--text-first > .offer__item:nth-child(even) > .wp-block-image { order: 0; }

.numbered { counter-reset: n; margin-top: 2rem; }
.numbered > * { counter-increment: n; position: relative; padding: 0 0 1.5rem 3.5rem; }
.numbered > *::before { content: counter(n); position: absolute; left: 0; top: 0; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-family: var(--serif); font-weight: 700; }
.numbered h3 { margin-bottom: .2rem; }
.numbered p { margin: 0; color: var(--muted); }

/* Contact */
.contact { display: grid; grid-template-columns: 7fr 4fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.contact__info img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 30%; border-radius: var(--radius); margin-bottom: 1.25rem; }
.contact__info h2 { font-size: 1.5rem; }
.field { margin-bottom: 1.25rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.field label { display: block; margin-bottom: .3rem; font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select, .field textarea {
	width: 100%;
	padding: .7rem .8rem;
	border: 1px solid #a89b84;
	border-radius: var(--radius);
	background: #fff;
	color: var(--ink);
	font: inherit;
}
.field [aria-invalid="true"] { border-color: #a32a1c; }
.field__error { display: block; margin-top: .3rem; color: #a32a1c; font-size: .9375rem; }
.field--check label { display: flex; gap: .65rem; font-weight: 400; font-size: .9375rem; line-height: 1.5; }
.field--check input { width: 1.1rem; height: 1.1rem; margin-top: .2rem; flex: none; accent-color: var(--green); }
.field--trap { position: absolute; left: -9999px; }
.notice { padding: 1rem 1.25rem; border-radius: var(--radius); }
.notice--error { background: #f8e5e1; color: #7c2015; }
.notice--ok { background: #e4eee2; }
.notice--ok p { margin: 0; }

/* Call to action */
.cta { background: var(--green); color: var(--wool); padding: clamp(3rem, 6vw, 5rem) 0; }
.cta h2 { color: #fff; }
.cta .lead { color: var(--wool); margin: 0; max-width: 60ch; }
.cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem 4rem; }
.cta .wp-block-buttons.actions { margin: 0; flex: none; }

/* Footer */
.site-footer { padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem; background: #1f3024; color: #e3ddcf; font-size: .9375rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--wool); }
.site-footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr; gap: 2.5rem; }
.site-footer__brand { font-family: var(--serif); font-size: 1.375rem; font-weight: 700; color: #fff; margin-bottom: .5rem; }
.site-footer__heading { font-weight: 700; color: #fff; margin-bottom: .5rem; }
.site-footer li { margin-bottom: .3rem; }
.site-footer__azvd img { height: 64px; width: auto; border-radius: 3px; background: #fff; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .18); }

/* Smaller screens */
@media (max-width: 960px) {
	.hero__grid, .split, .quote-band__grid, .contact, .offer__item { grid-template-columns: 1fr; }
	.offer__item:nth-child(even) > .wp-block-image, .offer--text-first > .offer__item:nth-child(odd) > .wp-block-image { order: 0; }
	.split > .wp-block-image img, .offer__item .wp-block-image img { max-height: 420px; }
	.offer__item:nth-child(3) .wp-block-image img { max-height: 640px; }
	.offer__item:first-child .wp-block-image img { object-position: 50% 22%; }
	.quote-band img { max-height: 320px; }
	.steps, .cards { grid-template-columns: 1fr 1fr; }
	.steps > :last-child, .cards > :last-child { grid-column: span 2; }
	.steps > :last-child img, .cards > :last-child img { aspect-ratio: 16 / 9; }
	.wp-block-gallery.has-nested-images.gallery { grid-template-columns: repeat(3, 1fr); }
	.facts { grid-template-columns: repeat(3, 1fr); }
	.facts li:nth-child(4) { border-left: 0; padding-left: 0; }
	.facts li:nth-child(n + 4) { border-top: 1px solid var(--line); }
	.cta__inner { flex-direction: column; align-items: flex-start; }
	.site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
	.steps, .cards, .benefits, .field-row, .checks.zwei-spalten { grid-template-columns: 1fr; }
	.steps > :last-child, .cards > :last-child { grid-column: auto; }
	.steps > :last-child img { aspect-ratio: 4 / 3; }
	.cards > :last-child img { aspect-ratio: 4 / 5; }
	.wp-block-gallery.has-nested-images.gallery { grid-template-columns: 1fr 1fr; gap: .5rem; }
	.facts { grid-template-columns: 1fr 1fr; }
	.facts li { padding-inline: 0 .75rem; border-left: 0; border-top: 1px solid var(--line); }
	.facts li:nth-child(-n + 2) { border-top: 0; }
	.mosaic { grid-template-columns: 1fr 1fr; grid-auto-rows: 170px; }
	.mosaic > :nth-child(1) { grid-row: span 2; }
	.care > * { grid-template-columns: 1fr; gap: .25rem; }
	.wp-block-table th, .wp-block-table td { padding-inline: .4rem; }
	.wp-block-table td:first-child { white-space: normal; }
	.site-footer__grid { grid-template-columns: 1fr; }
	.lightbox figure { padding: 3.5rem .5rem 1rem; }
	.lightbox__nav--prev, .lightbox__nav--next { top: auto; bottom: .5rem; transform: none; }
	.actions .wp-block-button { flex: 1 1 auto; }
	.actions .wp-block-button__link { width: 100%; text-align: center; }
	.brand__logo { height: 46px; }
}

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