/*
Theme Name: rosemaries
Theme URI: https://rosemaries.ch
Author: dineo gmbh
Description: Block-Theme fuer das Keramikatelier «rosemaries» von Rosemarie Bill, Wiler bei Utzenstorf.
Version: 0.2.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rosemaries
*/

/* ---------------------------------------------------------------
   Ergaenzungen zu theme.json
   --------------------------------------------------------------- */

:root {
	--rm-shadow: 0 1px 2px rgba(29, 29, 27, 0.05), 0 14px 32px -14px rgba(29, 29, 27, 0.18);
	--rm-radius: 16px;
}

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

::selection {
	background: var(--wp--preset--color--accent-soft);
}

/* Header und Logo */
.rm-header {
	background: var(--wp--preset--color--white);
}

.rm-logo {
	display: inline-block;
	line-height: 0;
}

.rm-logo svg {
	display: block;
	height: clamp(2.4rem, 5vw, 3rem);
	width: auto;
	overflow: visible;
}

.rm-logo__rose {
	transform-box: fill-box;
	transform-origin: center;
	animation: rm-spin 12s linear infinite;
}

.rm-logo:hover .rm-logo__rose,
.rm-logo:focus-visible .rm-logo__rose {
	animation-duration: 6s;
}

@keyframes rm-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

.rm-header .wp-block-navigation a {
	text-decoration: none;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.01em;
	padding-block: 0.35em;
	border-bottom: 3px solid transparent;
	transition: border-color 0.2s ease;
}

.rm-header .wp-block-navigation a:hover,
.rm-header .wp-block-navigation .current-menu-item > a {
	border-bottom-color: var(--wp--preset--color--accent);
}

.rm-header .wp-block-navigation__responsive-container-open,
.rm-header .wp-block-navigation__responsive-container-close {
	color: var(--wp--preset--color--contrast);
}

/* Abschnittstitel im Inhalt: mehr Luft nach oben, einheitlicher Abstand nach unten */
.wp-block-post-content h2.wp-block-heading:not(:first-child) {
	margin-block-start: var(--wp--preset--spacing--50);
}

.wp-block-post-content h2.wp-block-heading {
	margin-block-end: var(--wp--preset--spacing--20);
}

.wp-block-post-content h2.wp-block-heading + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

/* Typo-Helfer */
.rm-eyebrow {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-dark);
	margin-bottom: var(--wp--preset--spacing--10);
}

.rm-lead {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
	line-height: 1.45;
}

/* Hero */
.rm-hero {
	position: relative;
	padding-top: var(--wp--preset--spacing--30);
	padding-bottom: var(--wp--preset--spacing--50);
}

.rm-hero__media {
	display: block;
	max-width: 1120px;
	margin-inline: auto;
	border-radius: var(--rm-radius);
	overflow: hidden;
	box-shadow: var(--rm-shadow);
	animation: rm-rise 1s ease-out both;
}

.rm-hero__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1920 / 870;
	object-fit: cover;
}

@media (max-width: 700px) {
	.rm-hero__media img {
		aspect-ratio: 4 / 3;
	}
}

.rm-hero__text {
	margin-top: var(--wp--preset--spacing--40);
}

.rm-hero__text h1 {
	margin-top: 0;
}

@keyframes rm-rise {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.rm-hero__media { animation: none; }
	.rm-logo__rose { animation: none; }
}

/* Abschnitte */
.rm-section--surface {
	border-top: 1px solid var(--wp--preset--color--line);
	border-bottom: 1px solid var(--wp--preset--color--line);
}

/* Objekt-Kacheln */
.rm-tiles {
	list-style: none;
	margin: var(--wp--preset--spacing--30) 0 0;
	padding: 0;
	display: grid;
	gap: var(--wp--preset--spacing--30);
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
	.rm-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
	.rm-tiles { gap: var(--wp--preset--spacing--40); }
}

.rm-tile {
	margin: 0;
}

.rm-tile > a,
.rm-tile > img,
.rm-tile {
	text-decoration: none;
	color: inherit;
}

.rm-tile > a,
.rm-tile {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--10);
}

.rm-tile img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: var(--rm-radius);
	box-shadow: var(--rm-shadow);
	background: var(--wp--preset--color--surface);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rm-tile--wide img {
	aspect-ratio: 4 / 3;
}

.rm-tile--square img {
	aspect-ratio: 1;
}

.rm-tile a:hover img {
	transform: translateY(-3px);
	box-shadow: 0 2px 4px rgba(29, 29, 27, 0.06), 0 22px 40px -16px rgba(29, 29, 27, 0.28);
}

/* Masonry-Galerie (CSS-Spalten, ohne JavaScript) */
.rm-masonry {
	--rm-masonry-gap: var(--wp--preset--spacing--20);
	columns: 2;
	column-gap: var(--rm-masonry-gap);
	margin-top: var(--wp--preset--spacing--20);
}

@media (min-width: 720px) {
	.rm-masonry {
		--rm-masonry-gap: var(--wp--preset--spacing--30);
		columns: 3;
	}
}

.rm-masonry__item {
	break-inside: avoid;
	margin: 0 0 var(--rm-masonry-gap);
}

.rm-masonry__item img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--rm-radius);
	box-shadow: var(--rm-shadow);
	background: var(--wp--preset--color--surface);
}

.rm-tile__label {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--muted);
	padding-left: 0.25em;
}

/* Zeitleiste */
.rm-timeline {
	list-style: none;
	margin: var(--wp--preset--spacing--40) 0 0;
	padding: 0;
	position: relative;
}

.rm-timeline::before {
	content: "";
	position: absolute;
	left: 9px;
	top: 6px;
	bottom: 6px;
	width: 2px;
	background: var(--wp--preset--color--line);
}

.rm-timeline__item {
	position: relative;
	padding-left: 2.5rem;
	padding-bottom: var(--wp--preset--spacing--40);
}

.rm-timeline__item:last-child {
	padding-bottom: 0;
}

.rm-timeline__item::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.35em;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 4px var(--wp--preset--color--base);
}

.rm-section--surface .rm-timeline__item::before {
	box-shadow: 0 0 0 4px var(--wp--preset--color--surface);
}

.rm-footer .rm-timeline__item::before {
	box-shadow: 0 0 0 4px var(--wp--preset--color--deep);
}

.rm-timeline__year {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-dark);
}

.rm-timeline__title {
	display: block;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 800;
	line-height: 1.15;
	margin: 0.15em 0 0.4em;
}

.rm-timeline__item p {
	margin: 0;
	color: var(--wp--preset--color--muted);
}

.rm-timeline__title--small {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

.rm-timeline--compact {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--30);
}

@media (min-width: 720px) {
	.rm-timeline__title--small {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

.rm-timeline--compact {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.rm-timeline--compact::before {
		left: 9px;
		right: 9px;
		top: 9px;
		bottom: auto;
		width: auto;
		height: 2px;
	}
	.rm-timeline--compact .rm-timeline__item {
		padding-left: 0;
		padding-top: 2.2rem;
		padding-bottom: 0;
	}
}

.rm-timeline--compact .rm-timeline__title {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

/* Listen mit Signet als Aufzaehlungszeichen */
.rm-list {
	list-style: none;
	padding: 0;
	margin-bottom: 0;
}

.rm-list li {
	position: relative;
	padding-left: 1.8em;
	margin-bottom: 0.8em;
}

.rm-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.45em;
	width: 0.9em;
	height: 0.9em;
	background: url("assets/img/mark.svg") center / contain no-repeat;
}

/* Fotos */
.rm-photo img {
	border-radius: var(--rm-radius);
	box-shadow: var(--rm-shadow);
}

.rm-photo img {
	width: 100%;
	height: auto;
	object-fit: cover;
}

.rm-photo--portrait img {
	aspect-ratio: 4 / 5;
}

.rm-photo--landscape img {
	aspect-ratio: 4 / 3;
}

.rm-photo--wide img {
	aspect-ratio: 2.4 / 1;
}

.rm-photo figcaption {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* Kontaktformular (Contact Form 7) */
.wpcf7 label {
	display: block;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	margin-bottom: 0.3em;
}

.wpcf7 p {
	margin-bottom: var(--wp--preset--spacing--30);
}

.wpcf7 input:not([type="submit"]):not([type="checkbox"]),
.wpcf7 textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	padding: 0.75em 0.9em;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	background: var(--wp--preset--color--white);
	font: inherit;
	color: inherit;
}

.wpcf7 input:not([type="submit"]):not([type="checkbox"]):focus,
.wpcf7 textarea:focus {
	border-color: var(--wp--preset--color--accent);
	outline: none;
	box-shadow: 0 0 0 3px var(--wp--preset--color--accent-soft);
}

.wpcf7 textarea {
	min-height: 10em;
}

.wpcf7 .wpcf7-list-item {
	margin-left: 0;
}

.wpcf7 .wpcf7-list-item label {
	font-weight: 400;
	display: flex;
	gap: 0.6em;
	align-items: flex-start;
}

.wpcf7 input[type="submit"] {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
	border: 0;
	border-radius: 999px;
	padding: 0.9em 2em;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.wpcf7 input[type="submit"]:hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--accent);
}

.wpcf7 form .wpcf7-response-output {
	margin: var(--wp--preset--spacing--30) 0 0;
	padding: 1em 1.2em;
	border-radius: 10px;
	border: 1px solid var(--wp--preset--color--accent);
}

.wpcf7 .hidden-fields-container,
.wpcf7 label + br,
.wpcf7 form.init .wpcf7-response-output,
.wpcf7 form.resetting .wpcf7-response-output,
.wpcf7 form.submitting .wpcf7-response-output {
	display: none;
}

.wpcf7 form.sent .wpcf7-response-output {
	border-color: var(--wp--preset--color--accent-dark);
	background: var(--wp--preset--color--accent-soft);
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output,
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output {
	border-color: #a3412d;
	background: #f6e8e4;
}

.wpcf7 .wpcf7-not-valid {
	border-color: #a3412d;
}

.wpcf7 .wpcf7-not-valid-tip {
	display: block;
	color: #a3412d;
	font-size: var(--wp--preset--font-size--small);
	margin-top: 0.3em;
}

.wpcf7 .wpcf7-spinner {
	display: none;
}

.wpcf7 form.submitting input[type="submit"] {
	opacity: 0.6;
	cursor: wait;
}

/* Footer */
.rm-footer {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
}

.rm-footer a {
	color: inherit;
	text-decoration: none;
}

.rm-footer a:hover {
	color: var(--wp--preset--color--accent-dark);
}

.rm-footer__note {
	color: var(--wp--preset--color--muted);
}

.rm-footer__note {
	margin-top: var(--wp--preset--spacing--40);
	max-width: 720px;
}
