/*
Theme Name: PetraS – Heart of Gold
Description: Komplettes Theme für Heart of Gold – Kurpfalz: Design, Menüpunkt „PetraS“ mit Einstellungen, Claude-Assistent, Seitenvorlagen, Neuigkeiten/Blog, Bild-Metadaten (GPS-Entfernung) und lokale Schriften. Empfohlen zusammen mit den Plugins „Heart of Gold Extras“ und „PetraS Edition“.
Version: 3.0.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: petras-heart-of-gold
License: GPL-2.0-or-later
*/

/* ---------- Kopfbereich ---------- */
.hog-kopf{position:sticky;top:0;z-index:50;box-shadow:0 1px 0 rgba(255,255,255,.08)}
.admin-bar .hog-kopf{top:32px}
@media (max-width:782px){.admin-bar .hog-kopf{top:46px}}
@media (max-width:600px){.admin-bar .hog-kopf{top:0;position:relative}}
.hog-kopf>.wp-block-group{min-height:76px}
.hog-logo{margin:0!important;line-height:0}
.hog-logo img{border-radius:0!important;display:block}
.hog-kopf .hog-logo img{height:62px!important;width:auto!important}
.hog-fuss .hog-logo{margin-bottom:1rem!important}
.hog-fuss .hog-logo img{height:84px!important;width:auto!important}
.hog-fuss .hog-logo a{border:0}
@media (max-width:600px){.hog-kopf .hog-logo img{height:46px!important}}
.hog-kopf .wp-block-navigation-item__content{padding:22px 12px;font-size:.98rem;font-weight:500;position:relative}
.hog-kopf .wp-block-navigation-item__content::after{content:"";position:absolute;left:12px;right:12px;bottom:14px;height:2px;background:var(--wp--preset--color--gold);transform:scaleX(0);transform-origin:left;transition:transform .2s ease}
.hog-kopf .wp-block-navigation-item__content:hover::after,
.hog-kopf .current-menu-item>.wp-block-navigation-item__content::after{transform:scaleX(1)}
.hog-kopf .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content{padding:10px 0;font-size:1.25rem;font-family:var(--wp--preset--font-family--ueberschrift)}
.hog-kopf .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content::after{display:none}
.hog-kopf .wp-block-navigation__responsive-container.is-menu-open{padding:24px}
@media (prefers-reduced-motion:reduce){.hog-kopf .wp-block-navigation-item__content::after{transition:none}}

/* Keine Lücken zwischen Kopf, Inhalt und Fuß */
.wp-site-blocks>*+*{margin-block-start:0}

/* ---------- Titelbild Startseite ---------- */
.hog-titelbild .hog-titelbild-zeile{font-size:1.05rem;font-weight:500;margin:0}
.hog-titelbild .hog-titelbild-name{line-height:.95;margin:.15em 0 .1em;letter-spacing:-.02em}
.hog-titelbild .hog-titelbild-zuchtname{font-family:var(--wp--preset--font-family--ueberschrift);font-size:clamp(1.15rem,2.2vw,1.45rem);margin:0 0 1.4rem;padding-bottom:1.4rem;border-bottom:2px solid var(--wp--preset--color--gold);display:inline-block}
.hog-titelbild p{max-width:34em}
.hog-titelbild .wp-block-button.is-style-outline .wp-block-button__link{color:#fff;border:2px solid rgba(255,255,255,.85);background:transparent;padding:calc(.8em - 2px) calc(1.6em - 2px)}
.hog-titelbild .wp-block-button.is-style-outline .wp-block-button__link:hover{background:#fff;color:var(--wp--preset--color--menue)}
@media (max-width:781px){
 .hog-titelbild{min-height:88vh!important;align-items:flex-end!important;padding-bottom:2.5rem!important}
 .hog-titelbild{min-height:0!important;padding-top:56vw!important}
 .hog-titelbild .wp-block-cover__background{background:linear-gradient(180deg,rgba(18,36,28,0) 0,rgba(18,36,28,0) 30vw,rgba(18,36,28,.96) 56vw,#12241C 100%)!important}
 .hog-titelbild .wp-block-cover__image-background{object-fit:cover;height:62vw!important;bottom:auto!important;object-position:70% 50%!important}
 .hog-titelbild,.hog-titelbild::before{background-color:#12241C}
}

/* ---------- Inhalte ---------- */
.wp-block-post-content>h1:first-child,.wp-block-post-content>.wp-block-heading:first-child{margin-top:0}
.wp-block-image img{border-radius:6px}
.wp-block-separator{border-top-width:1px}
p{max-width:72ch}
.has-text-align-center{margin-left:auto;margin-right:auto}
.wp-block-button.is-style-outline .wp-block-button__link{border:2px solid currentColor;padding:calc(.8em - 2px) calc(1.6em - 2px);background:transparent;color:var(--wp--preset--color--gold-dunkel)}
.wp-block-button.is-style-outline .wp-block-button__link:hover{background:var(--wp--preset--color--menue);border-color:var(--wp--preset--color--menue);color:#fff}
:where(a,button,input,textarea,summary):focus-visible{outline:3px solid var(--wp--preset--color--gold);outline-offset:2px}

/* Startseite: drei Wegweiser mit Foto */
.hog-karten{gap:2rem!important}
.hog-karten .wp-block-image{margin-bottom:1rem}
.hog-karten .wp-block-image img{width:100%!important;aspect-ratio:4/5;object-fit:cover}
.hog-karten h3{margin:0 0 .4rem}
.hog-karten p{margin:0 0 1rem}

/* Startseite: Verbände */
.hog-verbaende{align-items:center!important;justify-content:center;gap:3rem!important;border-top:1px solid var(--wp--preset--color--linie);padding-top:3rem;margin-top:4rem!important}
.hog-verbaende .wp-block-image img{max-width:120px;width:120px!important;border-radius:0}
.hog-verbaende>.wp-block-column{text-align:center}
.hog-verbaende .wp-block-image img{margin:0 auto}
.hog-verbaende p{max-width:none;color:var(--wp--preset--color--grau);font-size:.95rem;margin:.4rem 0 0}
@media (max-width:781px){.hog-verbaende{flex-direction:row!important;flex-wrap:wrap!important}.hog-verbaende>.wp-block-column{flex-basis:40%!important}}

/* Steckbrief (Tabellen-Stil „Steckbrief“) */
.wp-block-table.is-style-steckbrief{background:var(--wp--preset--color--hell);border-top:3px solid var(--wp--preset--color--gold);padding:1.5rem 1.75rem;margin:1.5rem auto 2rem;max-width:760px}
.wp-block-table.is-style-steckbrief table{border-collapse:collapse;width:100%}
.wp-block-table.is-style-steckbrief td{border:0;border-bottom:1px solid rgba(31,58,46,.14);padding:.7rem 0;vertical-align:top}
.wp-block-table.is-style-steckbrief tr:last-child td{border-bottom:0}
.wp-block-table.is-style-steckbrief td:first-child{width:34%;color:var(--wp--preset--color--grau);font-size:.95rem;padding-right:1rem}
.wp-block-table.is-style-steckbrief td:last-child{font-weight:500;color:var(--wp--preset--color--menue)}
@media (max-width:600px){.wp-block-table.is-style-steckbrief td{display:block;width:100%!important;padding:.15rem 0}.wp-block-table.is-style-steckbrief td:first-child{padding-top:.7rem;border-bottom:0}}

/* ---------- Fußbereich ---------- */
.hog-fuss .hog-fuss-titel{color:var(--wp--preset--color--hell);font-size:1.15rem;margin:0 0 .6rem}
.hog-fuss p{line-height:1.8}
.hog-fuss a{text-decoration:none;border-bottom:1px solid rgba(255,255,255,.35)}
.hog-fuss a:hover{border-bottom-color:var(--wp--preset--color--gold)}
.hog-fuss .hog-fuss-copy{border-top:1px solid rgba(255,255,255,.14);padding-top:1.25rem;color:rgba(255,255,255,.7)}

/* ---------- Externer Inhalt / Kontaktformular ---------- */
.hog-extern{background:var(--wp--preset--color--hell);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;gap:12px;font-size:.92rem;color:var(--wp--preset--color--text);border-radius:3px}
.hog-extern p{max-width:42ch}
.hog-extern.ist-geladen{padding:0;background:none}
.hog-extern iframe{width:100%;border:0;display:block;border-radius:3px}
.hog-form{display:grid;gap:16px;max-width:560px}
.hog-form label{display:grid;gap:6px;font-size:.95rem;font-weight:500}
.hog-form input[type=text],.hog-form input[type=email],.hog-form textarea{font:inherit;font-weight:400;padding:12px 14px;border:1px solid #CFC8BA;border-radius:3px;width:100%;box-sizing:border-box;background:#fff;color:inherit}
.hog-form input:focus,.hog-form textarea:focus{outline:3px solid var(--wp--preset--color--gold);outline-offset:0;border-color:var(--wp--preset--color--gold)}
.hog-form .hog-check{display:flex;gap:10px;align-items:flex-start;font-size:.9rem;font-weight:400;color:var(--wp--preset--color--grau)}
.hog-form .hog-check input{margin-top:5px;width:18px;height:18px;accent-color:var(--wp--preset--color--gold-dunkel)}
.hog-form .hog-hp{position:absolute;left:-9999px}
.hog-form button{justify-self:start;cursor:pointer}
.hog-meldung{padding:12px 16px;border-radius:3px;background:#E8F0E8;color:#1F3A2E;border-left:3px solid #2E5242}
.hog-meldung.fehler{background:#FBECEA;color:#7A2418;border-left-color:#7A2418}

@media (max-width:781px){.wp-block-columns{gap:1.25rem}}

/* ---------- Call to Action: Deckanfrage ---------- */
.hog-cta .wp-block-button__link{font-size:1.05rem;padding:.95em 1.9em;box-shadow:0 8px 18px -8px rgba(143,97,32,.65);transition:transform .15s ease,box-shadow .15s ease,background-color .15s ease}
.hog-cta .wp-block-button__link:hover{transform:translateY(-1px);box-shadow:0 12px 22px -10px rgba(31,58,46,.6)}
@media (prefers-reduced-motion:reduce){.hog-cta .wp-block-button__link{transition:none}.hog-cta .wp-block-button__link:hover{transform:none}}
/* Kopfleiste */
.hog-kopf-rechts{min-width:0}
.hog-kopf-cta .wp-block-button__link{background:#D9A54F!important;color:var(--wp--preset--color--menue)!important;font-size:.95rem;font-weight:700;padding:.6em 1.2em;box-shadow:none;white-space:nowrap}
.hog-kopf-cta .wp-block-button__link:hover{background:#fff!important;transform:none}
@media (max-width:600px){.hog-kopf-cta .wp-block-button__link{font-size:.85rem;padding:.55em .9em}}
@media (max-width:781px){.hog-kopf-cta{order:-1}}
/* Aufruf-Band */
.hog-cta-band h2{margin-top:0}
.hog-cta-band p{margin-left:auto;margin-right:auto}
.hog-cta-band .is-style-outline .wp-block-button__link{color:var(--wp--preset--color--menue)}
/* Handy-Leiste unten */
.hog-mobil-leiste{display:none!important}
@media (max-width:781px){
 .hog-mobil-leiste{display:flex!important;position:fixed;left:0;right:0;bottom:0;z-index:60;background:var(--wp--preset--color--menue);padding:10px 14px calc(10px + env(safe-area-inset-bottom));box-shadow:0 -6px 18px -8px rgba(0,0,0,.35);margin:0!important}
 .hog-mobil-leiste .wp-block-buttons{width:100%;gap:10px}
 .hog-mobil-leiste .hog-cta{flex:1}
 .hog-mobil-leiste .wp-block-button__link{width:100%;padding:.8em .6em;font-size:1rem;box-shadow:none}
 .hog-mobil-leiste .hog-cta .wp-block-button__link{background:#D9A54F;color:var(--wp--preset--color--menue)}
 .hog-mobil-leiste .hog-anrufen .wp-block-button__link{color:#fff;border-color:rgba(255,255,255,.8)}
 body:not(.hog-ohne-aufruf){padding-bottom:74px}
}
/* Auf Kontakt, Impressum, Datenschutz kein Aufruf */
.hog-ohne-aufruf .hog-cta-band,.hog-ohne-aufruf .hog-mobil-leiste{display:none!important}
.hog-formular-hinweis{background:var(--wp--preset--color--hell);border-left:3px solid var(--wp--preset--color--gold);padding:12px 16px;border-radius:3px;margin:0}

/* ---------- Galerien: Blocksatz wie bei Fotografen ----------
   Gleich hohe Reihen, jedes Foto in seinem echten Format (nichts abgeschnitten).
   --r = Seitenverhältnis des Fotos (wird automatisch gesetzt). */
.wp-block-gallery.has-nested-images{display:flex!important;flex-wrap:wrap;gap:6px!important;margin-top:1rem}
/* Letzte Reihe füllt die Breite wie die übrigen (bündiger rechter Rand) */
.wp-block-gallery.has-nested-images::after{display:none}
.wp-block-gallery.has-nested-images figure.wp-block-image{flex:var(--r,1.333) 1 calc(var(--r,1.333) * 230px)!important;width:auto!important;max-width:100%;margin:0!important;border-radius:4px;overflow:hidden;position:relative;background:var(--wp--preset--color--hell)}
.wp-block-gallery.has-nested-images figure.wp-block-image img{width:100%!important;height:auto!important;aspect-ratio:var(--r,1.333);object-fit:cover;display:block;border-radius:0!important;transition:filter .2s ease}
.wp-block-gallery.has-nested-images figure.wp-block-image:hover img{filter:brightness(1.06)}
.wp-block-gallery.has-nested-images figure.wp-block-image img:focus-visible{outline:3px solid var(--wp--preset--color--gold);outline-offset:-3px}
@media (max-width:781px){.wp-block-gallery.has-nested-images{gap:4px!important}.wp-block-gallery.has-nested-images figure.wp-block-image{flex-basis:calc(var(--r,1.333) * 130px)!important;border-radius:3px}}
@media (prefers-reduced-motion:reduce){.wp-block-gallery.has-nested-images figure.wp-block-image img{transition:none}}
/* Kleine Galerien (1–3 Fotos) größer zeigen */
.wp-block-gallery.has-nested-images:not(:has(> figure.wp-block-image:nth-child(4))) figure.wp-block-image{flex-basis:calc(var(--r,1.333) * 300px)!important;max-width:calc(var(--r,1.333) * 380px)}
@media (max-width:781px){.wp-block-gallery.has-nested-images:not(:has(> figure.wp-block-image:nth-child(4))) figure.wp-block-image{flex-basis:calc(var(--r,1.333) * 200px)!important;max-width:none}}

/* Abschnitte (Hund / Familie / Verpaarung) */
.wp-block-post-content>h2.wp-block-heading{margin-top:4.5rem;padding-top:2.25rem;border-top:1px solid var(--wp--preset--color--linie)}
.wp-block-post-content>h1+h2.wp-block-heading{border-top:0;padding-top:0;margin-top:2.5rem}
.wp-block-post-content>h3.wp-block-heading{margin-top:2.5rem;font-size:1.15rem;color:var(--wp--preset--color--text)}
.hog-galerie-info{color:var(--wp--preset--color--grau);font-size:.98rem;margin-top:.25rem!important}
.wp-block-post-content>h2+.wp-block-gallery,.wp-block-post-content>.hog-galerie-info+.wp-block-gallery{margin-top:1.25rem}
.hog-galerie-geordnet{display:none}

/* Großansicht: dunkler Hintergrund, weiße Bedienelemente */
.wp-lightbox-overlay .scrim{background-color:#0E1B15!important;opacity:.97!important}
.wp-lightbox-overlay .wp-lightbox-close-button,.wp-lightbox-overlay .wp-lightbox-navigation-button{color:#fff!important;fill:#fff!important}
.wp-lightbox-overlay .wp-lightbox-close-button svg,.wp-lightbox-overlay .wp-lightbox-navigation-button svg{fill:#fff!important}
.wp-lightbox-overlay .lightbox-image-container img{border-radius:2px}

/* Optionale Stile (im Editor wählbar): Fotoalbum und Bogen mit Goldrahmen */
.wp-block-gallery.has-nested-images.is-style-fotoalbum,.wp-block-gallery.has-nested-images.is-style-bogen{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))}
.wp-block-gallery.has-nested-images.is-style-fotoalbum::after,.wp-block-gallery.has-nested-images.is-style-bogen::after{display:none}
.wp-block-gallery.has-nested-images.is-style-fotoalbum figure.wp-block-image,.wp-block-gallery.has-nested-images.is-style-bogen figure.wp-block-image{flex:none!important}
.wp-block-gallery.has-nested-images.is-style-fotoalbum{background:var(--wp--preset--color--hell);padding:clamp(18px,4vw,38px) clamp(16px,3.5vw,34px);gap:30px 26px!important;border-radius:6px}
.wp-block-gallery.has-nested-images.is-style-fotoalbum figure.wp-block-image{background:#fff;padding:10px 10px 34px!important;border-radius:3px;overflow:visible;box-shadow:0 1px 2px rgba(31,58,46,.12),0 8px 20px -8px rgba(31,58,46,.28)}
.wp-block-gallery.has-nested-images.is-style-fotoalbum figure.wp-block-image img{aspect-ratio:1}
.wp-block-gallery.has-nested-images.is-style-fotoalbum figure.wp-block-image:nth-child(3n+1){transform:rotate(-1.4deg)}
.wp-block-gallery.has-nested-images.is-style-fotoalbum figure.wp-block-image:nth-child(3n+2){transform:rotate(.9deg)}
.wp-block-gallery.has-nested-images.is-style-bogen{grid-template-columns:repeat(4,minmax(0,1fr));gap:24px 20px!important;padding:7px}
.wp-block-gallery.has-nested-images.is-style-bogen figure.wp-block-image{border-radius:999px 999px 14px 14px;outline:2px solid var(--wp--preset--color--gold);outline-offset:5px}
.wp-block-gallery.has-nested-images.is-style-bogen figure.wp-block-image img{aspect-ratio:3/4;height:100%!important}
@media (max-width:781px){.wp-block-gallery.has-nested-images.is-style-fotoalbum,.wp-block-gallery.has-nested-images.is-style-bogen{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px!important}}

/* ---------- Neuigkeiten / Blog ---------- */
.hog-news .wp-block-post-template{gap:2.25rem 1.75rem}
.hog-news .wp-block-post-featured-image{margin-bottom:.9rem;overflow:hidden;border-radius:6px}
.hog-news .wp-block-post-featured-image img{transition:transform .6s cubic-bezier(.2,.7,.2,1)}
.hog-news li:hover .wp-block-post-featured-image img{transform:scale(1.04)}
.hog-news .wp-block-post-title{margin:.25rem 0 .4rem}
.hog-news .wp-block-post-title a{text-decoration:none;color:var(--wp--preset--color--menue)}
.hog-news .wp-block-post-excerpt__more-link{font-weight:600}
.hog-news .wp-block-post-date{margin:0}
@media (max-width:781px){.hog-news .wp-block-post-template{grid-template-columns:1fr!important}}
.wp-block-post-navigation-link a{font-weight:600}
/* Seite mit Titelbild */
.hog-seiten-titelbild .wp-block-post-title{font-size:var(--wp--preset--font-size--riesig);margin:0}
/* Landingpage */
.hog-kopf-schlicht{position:relative}
.hog-kopf-schlicht>.wp-block-group{min-height:76px}
/* Menü mit vielen Punkten: enger, damit es in eine Zeile passt */
@media (min-width:600px) and (max-width:1400px){.hog-kopf .wp-block-navigation-item__content{padding:22px 7px;font-size:.9rem}.hog-kopf .wp-block-navigation-item__content::after{left:7px;right:7px}}
.hog-kopf-rechts .wp-block-navigation__container{flex-wrap:nowrap}
.hog-seiten-titelbild{padding-left:max(20px,calc((100vw - 1080px) / 2))!important;padding-right:20px!important;padding-bottom:3rem!important}
/* Tablet: Menü-Symbol statt zweizeiligem Menü */
@media (min-width:600px) and (max-width:1180px){
 .hog-kopf .wp-block-navigation__responsive-container-open:not(.always-shown){display:flex!important}
 .hog-kopf .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open){display:none!important}
 .hog-kopf-cta{order:-1}
}

/* 2.2.1: Galerie am Handy höchstens 2 Bilder je Zeile (einzelnes letztes Bild füllt die Breite) */
@media (max-width:781px){
	.wp-block-gallery.has-nested-images figure.wp-block-image{flex:1 1 calc(50% - var(--wp--style--unstable-gallery-gap,16px)/2)!important;width:auto!important;max-width:none!important;}
}

/* 2.2.2: Schutz gegen seitlichen Scroll (lange Wörter, breite Bilder in Galerien) */
.wp-site-blocks{overflow-x:clip;}
.wp-block-post-content p,.wp-block-post-content li,.hog-fuss p,.hog-fuss a{overflow-wrap:anywhere;}
.wp-block-gallery.has-nested-images{max-width:100%;}
.wp-block-gallery.has-nested-images figure.wp-block-image{min-width:0;max-width:100%;}
