/*
Theme Name: Similimum Publishing
Theme URI: https://similimum-publishing.test-umgebung.de
Description: Block-Theme für Similimum Publishing – Look & Feel von similimum.de, rein mit Gutenberg und Standard-Blöcken. Verkauf von eBooks (EPUB).
Author: Similimum Verlag
Author URI: https://similimum.de
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: similimum-publishing
*/

/* Basis-Styles werden über theme.json gesteuert. Zusätzliche Anpassungen: */

/* = Fullwidth-Block: 100vw, Inhalt bündig 1200px = */
.wp-block-similimum-fullwidth.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	box-sizing: border-box;
	padding-top: 12px;
	padding-bottom: 12px;
}
@media (min-width: 600px) {
	.wp-block-similimum-fullwidth.alignfull {
		padding-top: 36px;
		padding-bottom: 36px;
	}
}
.similimum-fullwidth__inner {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

/* = Content-Bereich: max 1200px, zentriert = */
.wp-block-group.is-layout-constrained > .wp-block-group__inner-container,
main.wp-block-group.is-layout-constrained {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

/* Alle Seiten außer Startseite: Abstand oben im Hauptbereich */
body:not(.home) main {
	padding-top: 24px;
}

/* = Header: ein Root (.header-wrapper), Bar (.header-inner) max 1200px = */
header .header-wrapper {
	width: 100%;
}

header .header-inner {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	box-sizing: border-box;
}

/* Desktop: Header max 100px hoch */
@media (min-width: 782px) {
	header .header-inner {
		min-height: 60px;
		max-height: 100px;
	}
}

header .header-inner > *:nth-child(1) {
	flex: 0 0 auto; /* Logo links */
}

header .header-inner > .header-nav-desktop {
	flex: 1;
	display: flex;
	justify-content: center; /* Nav mittig */
	min-width: 0;
}

/* Core-Navigation: Burger ausblenden, wir nutzen eigenen Burger + .nav-overlay */
header .header-nav-desktop .wp-block-navigation__responsive-container-open,
header .nav-overlay .wp-block-navigation__responsive-container-open {
	display: none !important;
}
/* Desktop: Responsive-Container als normale Zeile (Menü sichtbar), kein Modal */
@media (min-width: 782px) {
	header .header-nav-desktop .wp-block-navigation__responsive-container {
		display: block !important;
		position: static !important;
		width: auto !important;
		height: auto !important;
	}
	header .header-nav-desktop .wp-block-navigation__responsive-container-close {
		display: none !important;
	}
	header .header-nav-desktop .wp-block-navigation__responsive-dialog {
		position: static !important;
	}
	header .header-nav-desktop .wp-block-navigation__container {
		display: flex !important;
	}
}

header .header-inner > .header-actions {
	flex: 0 0 auto; /* Icons rechts */
}

/* WooCommerce Customer Account + Mini-Cart im Header: immer als Icons, Account links vom Cart */
.header-actions .wp-block-woocommerce-customer-account {
	display: block;
}
.header-actions .wp-block-woocommerce-customer-account a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--wp--preset--color--gray, #333);
	text-decoration: none;
	box-sizing: border-box;
}
.header-actions .wp-block-woocommerce-customer-account a:hover {
	color: var(--wp--preset--color--primary, #0062a1);
}
.header-actions .wp-block-woocommerce-customer-account svg,
.header-actions .wc-block-customer-account__account-icon {
	width: 24px;
	height: 24px;
	display: block;
	flex-shrink: 0;
}

/* Mobil: Block-Abstände + Main-Padding */
@media (max-width: 781px) {
	main {
		padding: 0 24px 24px 24px;
	}
	:root :where(.is-layout-flow) > * {
		margin-block-start: 0;
		margin-block-end: 0;
	}
	:where(.wp-site-blocks) > * {
		margin-block-start: 0;
	}
}

/* Header mobil: 65px Höhe, sticky, alles top-aligned */
@media (max-width: 781px) {
	header.wp-block-template-part {
		position: sticky;
		top: 0;
		z-index: 100;
		box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
	}
	header .header-wrapper {
		align-items: flex-start;
	}
	header .header-inner {
		height: 65px;
		min-height: 65px;
		max-height: 65px;
		padding-top: 0.5rem !important;
		padding-bottom: 0.5rem !important;
		align-items: flex-start;
	}
	header .header-inner > *:nth-child(1),
	header .header-inner > .header-actions {
		align-self: flex-start;
	}
	header .wp-block-site-logo {
		max-height: 44px !important;
	}
	header .wp-block-site-logo a.custom-logo-link {
		display: block;
		max-height: 44px !important;
		line-height: 0;
	}
	header .wp-block-site-logo a.custom-logo-link img,
	header .wp-block-site-logo img.custom-logo,
	header .wp-block-site-logo img {
		max-height: 44px !important;
		height: auto !important;
		width: auto !important;
		object-fit: contain;
		display: block;
	}
	.header-nav-desktop {
		display: none !important;
	}
	.header-actions {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		gap: 0.25rem !important;
		margin-left: auto;
	}
	/* Burger rechts, Cart links (Position getauscht) */
	.header-actions .header-burger {
		order: 2;
	}
	.header-actions .wc-block-mini-cart {
		order: 1;
	}
	/* My-Account-Icon mobil ausblenden, wird im Menü-Overlay angezeigt */
	.header-actions .wp-block-woocommerce-customer-account {
		display: none !important;
	}
	/* WooCommerce Icons in header-actions: Account links vom Cart, beide gleich groß */
	.header-actions .wp-block-woocommerce-customer-account a,
	.header-actions .wc-block-customer-account__account-icon,
	.header-actions .wc-block-mini-cart__button {
		width: 44px;
		height: 44px;
		padding: 0;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
	}
	.header-actions .wp-block-woocommerce-customer-account a {
		color: var(--wp--preset--color--gray, #333);
		text-decoration: none;
	}
	.header-actions .wp-block-woocommerce-customer-account a:hover {
		color: var(--wp--preset--color--primary, #0062a1);
	}
	.header-actions .wc-block-customer-account__account-icon,
	.header-actions .wp-block-woocommerce-customer-account svg,
	.header-actions .wc-block-mini-cart__icon {
		width: 24px;
		height: 24px;
		flex-shrink: 0;
	}
	.header-burger {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: none;
		background: transparent;
		cursor: pointer;
		color: var(--wp--preset--color--gray, #333);
	}
	.header-burger-icon {
		display: block;
		width: 24px;
		height: 2px;
		background: currentColor;
		box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
	}
	.header-icon {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		font-size: 0.875rem;
		color: var(--wp--preset--color--gray, #333);
		text-decoration: none;
	}
	.header-icon:hover {
		color: var(--wp--preset--color--primary, #0062a1);
	}
}
@media (min-width: 782px) {
	.header-burger {
		display: none !important;
	}
	.header-actions .header-icon {
		display: inline-flex;
	}
}

/* Off-Canvas Overlay (von rechts) – Hintergrund Similimum-Blau, Text weiß */
.nav-overlay {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	background: rgb(0, 98, 161);
	color: #fff;
	visibility: hidden;
	opacity: 0;
	transform: translateX(100%);
	transition: visibility 0.3s ease, opacity 0.3s ease, transform 0.35s ease-out;
	overflow: auto;
}
.nav-overlay a {
	color: #fff;
}
.nav-overlay a:hover {
	color: rgba(255, 255, 255, 0.9);
}
body.nav-overlay-open .nav-overlay {
	visibility: visible;
	opacity: 1;
	transform: translateX(0);
}
body.nav-overlay-open {
	overflow: hidden;
}
.nav-overlay-close {
	position: absolute;
	top: 0.75rem;
	right: 1rem;
	z-index: 10;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	appearance: none;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
}
.nav-overlay-close:hover,
.nav-overlay-close:focus {
	color: rgba(255, 255, 255, 0.85);
}

/* Mit Admin-Leiste: Schließen-Button unter der Bar (32px Desktop, 46px Mobil) */
body.admin-bar .nav-overlay-close {
	top: calc(32px + 0.5rem);
}
@media (max-width: 782px) {
	body.admin-bar .nav-overlay-close {
		top: calc(46px + 0.5rem);
	}
}

.nav-overlay-close::after {
	content: "×";
	display: block;
	font-size: 2rem;
	line-height: 1;
	font-weight: 300;
	color: inherit;
}
.nav-overlay-inner {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 4rem 1.5rem 2rem;
}
/* Im Overlay: Core-Navigation als Liste anzeigen (kein eigenes Modal) */
.nav-overlay .wp-block-navigation__responsive-container {
	display: block !important;
	position: static !important;
	width: auto !important;
}
.nav-overlay .wp-block-navigation__responsive-container-close {
	display: none !important;
}
.nav-overlay .wp-block-navigation__responsive-dialog {
	position: static !important;
}
.nav-overlay-menu {
	flex-direction: column !important;
}
.nav-overlay .wp-block-navigation__container {
	flex-direction: column !important;
}
.nav-overlay-menu .wp-block-navigation__container {
	flex-direction: column;
	gap: 0.5rem;
}
.nav-overlay-menu a {
	font-size: 1.25rem;
	padding: 0.5rem 0;
}

/* My-Account im Overlay (nur mobil sichtbar, per JS eingefügt) */
.nav-overlay-account {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.nav-overlay-account a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 1.25rem;
	padding: 0.5rem 0;
	color: #fff;
	text-decoration: none;
}
.nav-overlay-account a:hover {
	color: rgba(255, 255, 255, 0.9);
}
.nav-overlay-account .wc-block-customer-account__account-icon,
.nav-overlay-account svg {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}
/* My-Account im Overlay nur mobil anzeigen */
@media (min-width: 782px) {
	.nav-overlay-account {
		display: none !important;
	}
}

/* Logo im Header: Desktop max. 100px, Mobil wird in @media (max-width: 781px) auf 44px gesetzt */
@media (min-width: 782px) {
	header .wp-block-site-logo {
		max-height: 100px;
	}
	header .wp-block-site-logo a.custom-logo-link {
		display: block;
		max-height: 100px;
		line-height: 0;
	}
	header .wp-block-site-logo a.custom-logo-link img,
	header .wp-block-site-logo img.custom-logo,
	header .wp-block-site-logo img {
		max-height: 100px !important;
		height: 100px !important;
		width: auto !important;
		display: block;
		object-fit: contain;
	}
}

/* Site-Titel im Header – gleiche Optik wie similimum.de */
.wp-block-site-title a {
	text-decoration: none;
	font-weight: 700;
}

.wp-block-site-title a:hover {
	text-decoration: underline;
}

/* Buttons – Similimum-Blau, abgerundet wie auf similimum.de */
.wp-block-button__link,
.wp-element-button {
	border-radius: 25px;
}

.is-style-outline .wp-block-button__link {
	border-width: 2px;
}

/* = Home-Head-Bereich (wie similimum.de Hero) = */

/* Columns-Container für Bild links, Text rechts */
.home-head-columns {
	align-items: center;
}

/* Mobil (Portrait): eine Spalte, rechte Spalte über der linken (column-reverse) */
@media (max-width: 639px) {
	.home-head-columns {
		flex-direction: column-reverse;
	}
}

/* Ab Mobil-Landscape (640px): bereits 2 Spalten */
@media (min-width: 640px) {
	.home-head-columns {
		flex-direction: row;
	}
	.home-head-columns .wp-block-column {
		flex-basis: 0;
		flex-grow: 1;
	}
}

/* Rechte Spalte: vertikale Anordnung wie similimum.de */
.home-head-columns .wp-block-column:last-child {
	display: flex;
	flex-direction: column;
	padding-top: 24px;
}

/* Erster Block (p-like-h1) – direkt über dem zweiten, nicht ganz oben; durch auto mittig gehalten */
.home-head-columns .wp-block-column:last-child > *:first-child {
	margin-top: auto;
	margin-bottom: 0.5em;
}

/* Zweiter Block (Homöopathische Literatur / h1-like-heading) – ca. vertikal mittig */
.home-head-columns .wp-block-column:last-child > *:nth-child(2) {
	margin-top: 0;
	margin-bottom: auto;
}

/* Dritter Block (p-heading) – mehr Abstand nach oben, etwa Mitte der unteren Hälfte */
.home-head-columns .wp-block-column:last-child > *:nth-child(3) {
	margin-top: 2rem;
	margin-bottom: auto;
}

/* Paragraph wie der große Titel auf similimum.de (z. B. „SIMILIMUM VERLAG“) */
/* Großer Titel (Verhältnis zu Tagline/Autor mobil wie Desktop) */
.p-like-h1 {
	font-family: var(--wp--preset--font-family--open-sans, 'Open Sans', sans-serif);
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--wp--preset--color--gray, #333);
	margin: 0 0 0.5em;
	text-transform: uppercase;
}

h1.h1-like-heading {
	font-family: var(--wp--preset--font-family--open-sans, 'Open Sans', sans-serif);
	font-size: clamp(1.1rem, 2.25vw, 1.35rem);
	font-weight: 500 !important;
	line-height: 1.3;
	color: var(--wp--preset--color--primary, #0062a1);
	margin: 0 0 0.5em;
}

/* Autor/Unterzeile (proportional) */
.p-heading {
	font-family: var(--wp--preset--font-family--open-sans, 'Open Sans', sans-serif);
	font-size: 1.2rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--wp--preset--color--gray-light, #666);
	margin: 0;
}

@media (min-width: 782px) {
	.p-like-h1 {
		font-size: clamp(1.75rem, 4vw, 60px);
	}
	.p-heading {
		font-size: clamp(0.875rem, 1.2vw, 1rem);
	}
	h1.h1-like-heading {
		font-weight: 700;
	}
}

/* Buchcover: Ecken oben rechts und unten rechts abgerundet (35px) */
.wp-block-image.book-cover {
	overflow: hidden;
	border-radius: 0 35px 35px 0;
}

.wp-block-image.book-cover img {
	border-radius: 0 35px 35px 0;
	display: block;
}

/* Einzelprodukt: Kein Zoom, keine Lightbox, keine Lupe, Bild nicht klickbar */
.woocommerce-product-gallery__trigger {
	display: none !important;
}
.woocommerce .woocommerce-product-gallery .flex-viewport a,
.woocommerce .woocommerce-product-gallery .woocommerce-product-gallery__image a {
	pointer-events: none;
	cursor: default;
}
.woocommerce div.product div.images .woocommerce-product-gallery__image a {
	pointer-events: none;
	cursor: default;
}
/* Block-basierte Einzelproduktseite (WooCommerce Blocks) */
.wc-block-product-gallery-large-image a,
.wp-block-woocommerce-product-gallery-large-image a {
	pointer-events: none;
	cursor: default;
}
.wc-block-product-gallery-large-image .wc-block-product-gallery-large-image__zoom,
.wc-block-product-gallery-large-image [class*="zoom"] {
	display: none !important;
}
