/*
Theme Name: Walter Aberger Photography
Theme URI: https://wp.aberger.cloud
Author: Walter Aberger
Description: Block-Theme nach der Corporate Identity von Walter Aberger Photography – dunkel, eckig, ein Signalorange. Display: Bebas Neue, Text: Barlow (über die Schriftenbibliothek installieren).
Version: 1.8.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: walter-aberger
*/

/* Horizontlinie: Trenner-Stil „Horizont“
   Der Block nimmt die volle Rasterbreite ein (bleibt so im Layout),
   gezeichnet werden nur 48px an der linken Rasterkante. */
.wp-block-separator.is-style-horizon {
	border: 0;
	height: var(--wp--custom--line--horizon);
	width: 100% !important;
	background: linear-gradient(var(--wp--preset--color--signal), var(--wp--preset--color--signal)) left center / 48px 100% no-repeat !important;
	opacity: 1;
}
.wp-block-separator.is-style-horizon.aligncenter { background-position: center center !important; }

/* Ein Raster: alles 1280px breit; Fließtext auf 720px begrenzt,
   aber an der linken Rasterkante (Logo-Kante) statt mittig. */
.is-layout-constrained > :is(p, ul, ol, blockquote, .wp-block-quote) {
	max-width: 720px;
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
	margin-right: auto !important;
}
.is-layout-constrained > :is(p, ul, ol).has-text-align-center {
	margin-left: auto !important;
}

/* Titelbild (Cover) mit Inhalt links: Inhalt ins Raster statt an den Bildschirmrand */
.wp-block-cover:is(.is-position-bottom-left, .is-position-center-left, .is-position-top-left) > .wp-block-cover__inner-container {
	width: 100% !important;
	max-width: var(--wp--style--global--content-size) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* Bilddaten-Zeile */
.is-style-caption-data,
.wp-block-image figcaption,
.wp-block-gallery figcaption {
	font-family: var(--wp--preset--font-family--text);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-muted);
}

/* Galerie: randlos, 4px Fuge, keine Rundungen */
.wp-block-gallery.has-nested-images figure.wp-block-image img { border-radius: 0; }

/* Bilddaten auf Galeriebildern: hell auf dunklem Verlauf, linksbündig */
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	color: var(--wp--preset--color--paper);
	text-align: left;
	font-size: 11px;
	padding: 32px 12px 10px;
	background: linear-gradient(0deg, rgba(18,18,18,.75) 0%, rgba(18,18,18,0) 100%);
}

/* Leere Galerie-Platzhalter im Frontend ausblenden */
.wp-block-gallery:not(:has(figure)) { display: none; }

/* Navigation: gesperrte Bebas-Versalien */
.wp-block-navigation a { text-decoration: none; }
.wp-block-navigation .wp-block-navigation-item__content { color: var(--wp--preset--color--ink-muted); }
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--ink); }

/* Fokus sichtbar */
a:focus-visible, button:focus-visible, .wp-element-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
}

/* Sekundär-Button als Kontur */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--ink);
}

/* Hero-Karussell – nur aktiv mit JavaScript (.is-ready);
   im Editor und ohne JS stehen die Folien untereinander. */
.wa-carousel-wrap {
	position: relative;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}
.wa-carousel.is-ready {
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	margin: 0 !important;
}
.wa-carousel.is-ready::-webkit-scrollbar { display: none; }
.wa-carousel.is-ready > .wp-block-cover {
	flex: 0 0 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	margin: 0 !important;
}
.wa-carousel.is-ready:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: -4px;
}
.wa-carousel-nav {
	position: absolute;
	left: 0;
	right: 0;
	bottom: var(--wp--preset--spacing--6);
	padding-left: var(--wp--style--root--padding-left);
	padding-right: var(--wp--style--root--padding-right);
	pointer-events: none;
}
.wa-carousel-nav__inner {
	max-width: var(--wp--style--global--content-size);
	margin: 0 auto;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 8px;
}
.wa-carousel-nav button { pointer-events: auto; }
.wa-carousel-dot {
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	cursor: pointer;
	background: linear-gradient(rgba(255,255,255,.6), rgba(255,255,255,.6)) center / 100% 3px no-repeat;
	transition: width .3s ease;
}
.wa-carousel-dot[aria-current="true"] {
	width: 48px;
	background-image: linear-gradient(var(--wp--preset--color--signal), var(--wp--preset--color--signal));
}
.wa-carousel-arrow {
	width: 44px;
	height: 44px;
	padding: 0;
	display: grid;
	place-items: center;
	cursor: pointer;
	color: var(--wp--preset--color--paper);
	background: rgba(18,18,18,.35);
	border: 1px solid rgba(255,255,255,.6);
}
.wa-carousel-arrow--prev { margin-left: 16px; }
.wa-carousel-arrow:hover {
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ground);
}
.wa-carousel-nav button:focus-visible {
	outline: 2px solid var(--wp--preset--color--paper);
	outline-offset: 3px;
}
@media (max-width: 781px) {
	.wa-carousel-arrow { display: none; }
	.wa-carousel-nav { bottom: 8px; }
	.wa-carousel-nav__inner { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
	.wa-carousel-dot { transition: none; }
}

/* Galerie-Titelbild: ohne Beitragsbild kompakter Titelbereich statt leerer Fläche */
.wa-page-hero:not(:has(.wp-block-cover__image-background)) {
	min-height: 0 !important;
	padding-top: var(--wp--preset--spacing--6) !important;
	padding-bottom: 0 !important;
}

/* Mosaik-Galerie (aktiv mit JavaScript): Zellen 3:2, Hochformat 2 Zeilen, Panorama 2 Spalten */
.wp-block-gallery.has-nested-images.wa-mosaic {
	display: grid !important;
	grid-template-columns: repeat(var(--wa-sub, 3), minmax(0, 1fr));
	grid-template-rows: var(--wa-rows);
	align-items: stretch;
}
.wp-block-gallery.has-nested-images.wa-mosaic > figure.wp-block-image {
	width: auto !important;
	max-width: none !important;
	min-width: 0;
	height: 100%;
	margin: 0 !important;
}
.wp-block-gallery.has-nested-images.wa-mosaic > figure.wp-block-image img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
}
/* Bildunterschriften nur in der Lightbox, nicht im Mosaik */
.wp-block-gallery.has-nested-images.wa-mosaic > figure.wp-block-image figcaption { display: none; }
.wa-zoomable { cursor: zoom-in; }
.wa-zoomable:focus-visible {
	outline: 2px solid var(--wp--preset--color--signal);
	outline-offset: -2px;
}

/* Lightbox: Bild vollständig im Originalformat */
html.wa-lb-open { overflow: hidden; }
.wa-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) 64px;
	grid-template-rows: 64px minmax(0, 1fr) auto;
	background: rgba(18, 18, 18, .97);
	color: var(--wp--preset--color--paper);
	opacity: 0;
	transition: opacity .2s ease;
}
.wa-lightbox[hidden] { display: none; }
.wa-lightbox.is-open { opacity: 1; }
.wa-lb-stage {
	grid-column: 2;
	grid-row: 2;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
}
.wa-lb-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	transition: opacity .2s ease;
}
.wa-lightbox.is-loading .wa-lb-img { opacity: .35; }
.wa-lb-btn {
	width: 44px;
	height: 44px;
	padding: 0;
	display: grid;
	place-items: center;
	cursor: pointer;
	color: var(--wp--preset--color--paper);
	background: transparent;
	border: 1px solid rgba(255, 255, 255, .45);
	align-self: center;
	justify-self: center;
}
.wa-lb-btn:hover {
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ground);
}
.wa-lb-btn:focus-visible {
	outline: 2px solid var(--wp--preset--color--signal);
	outline-offset: 3px;
}
.wa-lb-btn[hidden] { display: none; }
.wa-lb-close { grid-column: 3; grid-row: 1; }
.wa-lb-prev { grid-column: 1; grid-row: 2; }
.wa-lb-next { grid-column: 3; grid-row: 2; }
.wa-lb-bar {
	grid-column: 2;
	grid-row: 3;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 24px;
	padding: 16px 0 24px;
	border-top: 0;
	position: relative;
}
.wa-lb-caption,
.wa-lb-count {
	margin: 0;
	font-family: var(--wp--preset--font-family--text);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-muted);
}
.wa-lb-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 781px) {
	.wa-lightbox { grid-template-columns: 16px minmax(0, 1fr) 16px; grid-template-rows: 64px minmax(0, 1fr) auto; }
	.wa-lb-prev, .wa-lb-next { display: none; }
	.wa-lb-close { grid-column: 2; justify-self: end; }
}
@media (prefers-reduced-motion: reduce) {
	.wa-lightbox, .wa-lb-img { transition: none; }
}

/* Event-Übersicht: Kacheln der Unterseiten; ohne Events ausgeblendet (nur Frontend) */
body:not(.editor-styles-wrapper) .wa-events:not(:has(.wp-block-post)) { display: none; }
.wa-events .wp-block-post-featured-image {
	margin: 0;
	overflow: hidden;
}
.wa-events .wp-block-post-featured-image img {
	transition: transform .4s ease;
}
.wa-events .wp-block-post:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}
.wa-events .wp-block-post-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.wa-events .wp-block-post:hover .wp-block-post-title a,
.wa-events .wp-block-post-title a:focus-visible {
	color: var(--wp--preset--color--signal);
}
@media (prefers-reduced-motion: reduce) {
	.wa-events .wp-block-post-featured-image img { transition: none; }
}

/* Event-Übersicht als Zeile: max. 4 Kacheln, horizontal scrollbar (neueste links) */
.wa-events-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--wp--preset--spacing--3);
}
.wa-events-head > :is(h1, h2, h3, h4, h5, h6) { margin: 0; }
.wa-events-nav { display: flex; gap: 8px; }
.wa-events-nav[hidden] { display: none; }
.wa-events-btn {
	width: 36px;
	height: 36px;
	padding: 0;
	display: grid;
	place-items: center;
	cursor: pointer;
	color: var(--wp--preset--color--ink);
	background: transparent;
	border: 1px solid var(--wp--preset--color--ink-muted);
}
.wa-events-btn:hover:not(:disabled) {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ground);
}
.wa-events-btn:disabled { opacity: .3; cursor: default; }
.wa-events-btn:focus-visible {
	outline: 2px solid var(--wp--preset--color--signal);
	outline-offset: 3px;
}
.wa-events .wp-block-post-template.wa-events-track {
	display: flex !important;
	gap: var(--wp--preset--spacing--4);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	margin: 0;
	padding: 0;
}
.wa-events .wa-events-track::-webkit-scrollbar { display: none; }
.wa-events .wa-events-track > .wp-block-post {
	flex: 0 0 calc((100% - 3 * var(--wp--preset--spacing--4)) / 4);
	min-width: 0;
	margin: 0 !important;
	scroll-snap-align: start;
}
.wa-events .wa-events-track .wp-block-post-title { font-size: 22px; }
@media (max-width: 781px) {
	.wa-events .wa-events-track > .wp-block-post { flex-basis: calc((100% - var(--wp--preset--spacing--4)) / 2.3); }
}
@media (max-width: 480px) {
	.wa-events .wa-events-track > .wp-block-post { flex-basis: 70%; }
}

/* Kontaktliste: Icon + Link je Zeile, ganze Zeile klickbar */
.wa-contact-list {
	list-style: none;
	padding: 0;
	margin-top: var(--wp--preset--spacing--5);
	border-top: 1px solid var(--wp--preset--color--hairline);
}
.wa-contact-list > li {
	position: relative;
	display: flex;
	align-items: center;
	gap: 20px;
	min-height: 72px;
	padding: 12px 0;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.3;
}
.wa-contact-list > li::before {
	content: "";
	flex: 0 0 24px;
	height: 24px;
	background-color: var(--wp--preset--color--signal);
	-webkit-mask: var(--wa-icon) center / contain no-repeat;
	mask: var(--wa-icon) center / contain no-repeat;
}
.wa-contact-list a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	overflow-wrap: anywhere;
}
.wa-contact-list a::after { content: ""; position: absolute; inset: 0; }
.wa-contact-list > li:hover a,
.wa-contact-list a:focus-visible { color: var(--wp--preset--color--signal); }
.wa-contact-list > li:has(a:focus-visible) { outline: 2px solid var(--wp--preset--color--signal); outline-offset: 4px; }
.wa-contact-list a:focus-visible { outline: none; }
.wa-contact-list .is-phone { --wa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E"); }
.wa-contact-list .is-mail { --wa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E"); }
.wa-contact-list .is-instagram { --wa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='20' height='20' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M17.5 6.5h.01'/%3E%3C/svg%3E"); }
