/*
Theme Name: zimplifi
Theme URI: https://zimplifi.de
Author: ServerStage GmbH
Author URI: https://serverstage.net
Description: zimplifi — local-business block theme (GaLaBau base). One shared template; each subsite/install is personalised via the zimplifi-config plugin (colors, logo, content). Demo and live render identically.
Version: 0.1.0
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 8.1
License: Proprietary — © ServerStage GmbH
Text Domain: zimplifi
*/

/* Colors come from theme.json palette as --wp--preset--color--*, so per-subsite
   global-styles overrides (and the spinner) flow through automatically. */
:root { --zf-line: rgba(0,0,0,.10); }

body { color: var(--wp--preset--color--ink); background: var(--wp--preset--color--surface); }

/* ---- header ---- */
.zf-header { position: sticky; top: 0; z-index: 20; background: #fffffff2; backdrop-filter: blur(8px); }
/* The mobile nav overlay is position:fixed and lives INSIDE .zf-header. A
   backdrop-filter creates a containing block for fixed descendants, so the
   overlay was trapped inside the ~72px header box and overflow:auto clipped it
   to just the first menu item. While the overlay is open WordPress adds
   .has-modal-open to <html>; drop the blur then so the overlay anchors to the
   viewport and every menu item shows. (Blur returns the moment it closes.) */
html.has-modal-open .zf-header { backdrop-filter: none; -webkit-backdrop-filter: none; }
.zf-header .wp-block-group { align-items: center; min-height: 72px; }
.zf-header .wp-block-navigation { margin-left: auto; font-weight: 500; }
/* Explicit horizontal gap between menu items. The inline navigation block renders
   with NO flex gap in the editor canvas (items run together) — set it here so it's
   identical in the editor and on the live site. */
.zf-header .wp-block-navigation .wp-block-navigation__container { gap: 1.6rem; column-gap: 1.6rem; }
.zf-header .wp-block-site-logo img { max-height: 46px; width: auto; }

/* ---- hero ---- */
.zf-hero { color: #fff; background-image: linear-gradient(160deg, rgba(28,58,32,.84), rgba(28,58,32,.58)), url(assets/img/galabau/hero.jpg); background-size: cover; background-position: center; padding: 5rem 1.5rem !important; }
/* Hero copy sits in a flow-layout .zf-hero-text wrapper (see build.php) so it
   left-aligns together; the wider max-widths just ease the wrapping. */
.zf-hero-text { max-width: 1120px; }
.zf-hero .zf-hero-title { font-size: clamp(2.4rem, 5vw, 4rem); max-width: 22ch; color: #fff; margin: 0; line-height: 1.07; }
.zf-hero .zf-hero-sub { font-size: 1.2rem; max-width: 48ch; color: #eef3ec; margin: 1.1rem 0 1.8rem; }
.zf-hero .wp-block-button__link { background: var(--wp--preset--color--accent); color: #fff; border-radius: .7rem; padding: .8rem 1.4rem; font-weight: 600; }
.zf-stats { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 2.6rem; }

/* hero variant: split (text left, photo right) — solid wash so the panel photo carries the imagery */
.zf-hero--split { background-image: linear-gradient(160deg, var(--wp--preset--color--primary), var(--wp--preset--color--primary-dark)); }
.zf-hero--split .zf-hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; }
.zf-hero--split .zf-hero-panel { aspect-ratio: 4/3; border-radius: 1.1rem; background: url(assets/img/galabau/panel.jpg) center/cover; box-shadow: 0 12px 40px #0005; }
@media (max-width: 900px) { .zf-hero--split .zf-hero-inner { grid-template-columns: 1fr; } .zf-hero--split .zf-hero-panel { display: none; } }

/* hero variant: kompakt (slim band) */
.zf-hero--kompakt { padding: 2.6rem 1.5rem !important; }
.zf-hero--kompakt .zf-hero-title { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
.zf-hero--kompakt .zf-hero-sub { margin: .55rem 0 1.1rem; }
.zf-stat > * { margin-block-start: 0 !important; }   /* tight label/sublabel — kill block-gap inside each stat */
.zf-stat-t { font-family: var(--wp--preset--font-family--heading); font-size: 1.9rem; margin: 0; color: #fff; line-height: 1.1; }
.zf-stat-s { color: #cfe0cd; font-size: .92rem; margin: 0; }

/* ---- sections ---- */
.zf-section { padding: 4.5rem 1.5rem !important; }
.zf-eyebrow { color: var(--wp--preset--color--accent); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; margin: 0 0 .4rem; }
.zf-section h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: 0 0 .6rem; }
.zf-lead { color: var(--wp--preset--color--sub); max-width: 54ch; }

/* ---- service cards ---- */
.zf-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 2.4rem; }
/* grid items: the grid gap handles spacing; WP's flow block-gap otherwise gives card 1
   margin-block-start:0 and cards 2/3 24px, pushing them down so row 1 looks misaligned.
   !important to beat WP's later-printed .wp-container-* > *+* layout rule (equal specificity). */
.zf-cards > * { margin-block-start: 0 !important; }
.zf-card { background: var(--wp--preset--color--surface); border: 1px solid var(--zf-line); border-radius: 1rem; padding: 1.5rem; box-shadow: 0 1px 2px #0000000a, 0 10px 30px #0000000a; }
.zf-card h3 { font-size: 1.2rem; margin: 0 0 .4rem; }
.zf-card p { color: var(--wp--preset--color--sub); font-size: .96rem; margin: 0; }

/* ---- references gallery ---- */
.zf-refs { background: var(--wp--preset--color--muted); }
/* Editable image grid (wp:group of core image blocks) — 4 across, like the old look;
   customers swap images + edit captions in place. */
.zf-refs-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 2.4rem; }
.zf-refs-gallery .wp-block-image { margin: 0; }
.zf-refs-gallery .wp-block-image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: .9rem; display: block; }
.zf-refs-gallery figcaption.wp-element-caption { margin: .5rem 0 0; font-weight: 600; font-size: .92rem; text-align: left; }
/* ---- legacy CSS-background gallery (pre-rebuild sites) ---- */
.zf-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 2.4rem; }
.zf-tile { aspect-ratio: 4/3; border-radius: .9rem; overflow: hidden; color: #fff; display: flex; align-items: flex-end; padding: 1rem; font-weight: 600; font-size: .95rem; text-shadow: 0 1px 4px #0008; position: relative; background-color: var(--wp--preset--color--primary); background-size: cover; background-position: center; }
.zf-tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, #000a, #0000 58%); }
.zf-tile > * { position: relative; z-index: 1; }
/* per-tile photography (cycles through the bundled GaLaBau set) */
.zf-gallery .zf-tile:nth-child(6n+1) { background-image: url(assets/img/galabau/ref1.jpg); }
.zf-gallery .zf-tile:nth-child(6n+2) { background-image: url(assets/img/galabau/ref2.jpg); }
.zf-gallery .zf-tile:nth-child(6n+3) { background-image: url(assets/img/galabau/ref3.jpg); }
.zf-gallery .zf-tile:nth-child(6n+4) { background-image: url(assets/img/galabau/ref4.jpg); }
.zf-gallery .zf-tile:nth-child(6n+5) { background-image: url(assets/img/galabau/ref5.jpg); }
.zf-gallery .zf-tile:nth-child(6n)   { background-image: url(assets/img/galabau/ref6.jpg); }
/* honest, unobtrusive "example photo" tag — invites the owner to swap in their own */
.zf-tile-ex { position: absolute; top: .55rem; right: .55rem; background: #0000007a; color: #fff; font-size: .68rem; font-weight: 600; letter-spacing: .03em; padding: .12rem .45rem; border-radius: .4rem; text-shadow: none; backdrop-filter: blur(2px); }

/* ---- about ---- */
.zf-about { gap: 3rem; align-items: center; }   /* wp:columns handles the side-by-side layout */
.zf-ueber .zf-photo { margin: 0; }
.zf-ueber .zf-photo img { width: 100%; aspect-ratio: 5/4; object-fit: cover; border-radius: 1.1rem; box-shadow: 0 12px 40px #0002; display: block; }

/* ---- contact ---- */
.zf-contact { color: #fff; background: linear-gradient(160deg, var(--wp--preset--color--primary-dark), #16241a); }
.zf-contact h2 { color: #fff; }
.zf-contact .zf-eyebrow { color: #e6b486; }
.zf-contact .zf-det strong { color: #cfe0cd; }
.zf-mailhook { display: inline-flex; align-items: center; gap: .55rem; background: #ffffff14; border: 1px solid #ffffff33; border-radius: 999px; padding: .35rem .95rem .35rem .4rem; margin-top: 1.1rem; font-size: .92rem; color: #eef3ec; }
.zf-mailhook::before { content: "Neu"; background: var(--wp--preset--color--accent); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .28rem .6rem; border-radius: 999px; }

/* ---- footer ---- */
.zf-footer { background: #16241a; color: #aebcab; padding: 3rem 1.5rem 2rem !important; font-size: .9rem; }
.zf-footer h4 { color: #fff; margin: 0 0 .6rem; }
.zf-footer a { color: #aebcab; }

/* buy-now / proposal banner (gated demo) */
.zf-proposal { background: var(--wp--preset--color--ink); color: #fff; font-size: .9rem; padding-top: .6rem; padding-bottom: .6rem; }
.zf-proposal-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; max-width: 1120px; margin-inline: auto; padding-inline: 1.5rem; }
.zf-proposal-inner strong { color: #e6b486; }
.zf-proposal-cta { margin-left: auto; background: #ea580c; color: #fff; padding: .45rem .95rem; border-radius: .5rem; font-weight: 700; white-space: nowrap; text-decoration: none; }

/* header button + small bits */
.zf-sitetitle a { font-family: var(--wp--preset--font-family--heading); font-weight: 700; color: var(--wp--preset--color--ink); text-decoration: none; }
.zf-header .zf-btn-primary { margin-left: .5rem; }
.zf-btn-primary .wp-block-button__link { background: var(--wp--preset--color--accent); color: #fff; border-radius: .6rem; padding: .6rem 1.1rem; font-weight: 600; white-space: nowrap; }
.zf-det { margin: 1.4rem 0; line-height: 2; }
.zf-det strong { color: #cfe0cd; }
.zf-made { color: #7e8e7c; font-size: .82rem; margin-top: 1.4rem; }

/* remove the 24px root block-gap that leaves a white line before the footer */
.wp-site-blocks > * { margin-block-start: 0; }
/* WP's constrained-layout block-gap puts margin-block-START on each section → a white strip
   between sections. Scope the zero to the SECTION level only (direct children of post-content)
   so it does NOT collapse spacing INSIDE sections (e.g. .zf-cards' margin-top, the claim
   steps). !important beats WP's later-printed layout CSS (equal specificity → source order). */
.wp-block-post-content > * { margin-block-start: 0 !important; }
/* All-in-body: sections now live inside <main class="zf-main">. Kill the block-gap
   between them too, so full-bleed coloured sections sit flush (no page-bg stripes). */
.zf-main > * { margin-block-start: 0 !important; }
/* Flow-layout block-gap: restore the 24px gap on flow children (WP otherwise zeroes the
   first child, raising the first card in some sections). !important beats WP's later-printed
   layout CSS at equal specificity (:where() = 0 specificity → source order). */
:root :where(.is-layout-flow) > * {
	margin-block-start: 24px !important;
	margin-block-end: 0;
}

/* "übernehmen" 3-step checklist band (demo chrome — removed at go-live) */
.zf-claim { background: var(--wp--preset--color--muted); text-align: center; padding: 3.5rem 1.5rem !important; border: 2px dashed #ea580c; border-radius: 1rem; margin: .5em; }
.zf-claim-h { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: .4rem 0 2.6rem; }
.zf-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; max-width: 940px; margin: 1.2rem auto 3rem; text-align: left; }
.zf-step { display: flex; gap: 1rem; align-items: flex-start; background: var(--wp--preset--color--surface); border: 1px solid var(--zf-line); border-radius: 1rem; padding: 2rem 1.6rem; box-shadow: 0 1px 2px #0000000a, 0 10px 30px #0000000a; }
.zf-step-n { flex: 0 0 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--wp--preset--color--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--wp--preset--font-family--heading); }
.zf-step b { display: block; margin-bottom: .5rem; font-size: 1.08rem; }
.zf-step p { color: var(--wp--preset--color--sub); font-size: .92rem; line-height: 1.55; margin: 0; }
.zf-claim-cta { display: inline-block; background: #ea580c; color: #fff; font-weight: 700; padding: .9rem 1.6rem; border-radius: .7rem; text-decoration: none; }
@media (max-width: 760px) { .zf-steps { grid-template-columns: 1fr; } }

/* photo-slot hints (answers "what are those boxes for?") */
.zf-ph { display: inline-flex; align-items: center; gap: .4rem; background: #00000033; border: 1px solid #ffffff66; color: #fff; padding: .4rem .7rem; border-radius: .5rem; font-size: .85rem; font-weight: 600; }
.zf-tile { flex-direction: column; align-items: flex-start; justify-content: space-between; }
.zf-tile-cap { font-weight: 600; font-size: .92rem; }
.zf-hero-panel { display: flex; align-items: center; justify-content: center; }

/* responsive */
@media (max-width: 900px) {
  .zf-cards { grid-template-columns: repeat(2, 1fr); }
  .zf-gallery, .zf-refs-gallery { grid-template-columns: repeat(2, 1fr); }
  .zf-about { grid-template-columns: 1fr; }
  .zf-header .zf-btn-primary { display: none; }   /* redundant on mobile; avoids header crunch */
}
@media (max-width: 560px) { .zf-cards { grid-template-columns: 1fr; } }

/* ---- legal pages (Impressum / Datenschutz): readable column, calmer type ---- */
.zf-legal { max-width: 860px; margin-inline: auto; padding-top: 2.5rem !important; padding-bottom: 3rem !important; }
.zf-legal > * { margin-block-start: 0 !important; }
.zf-legal h1 { font-size: clamp(1.7rem, 3vw, 2.1rem) !important; margin: 0 0 1.2rem !important; line-height: 1.15; }
.zf-legal h2 { font-size: 1.2rem !important; margin: 1.9rem 0 .35rem !important; line-height: 1.3; }
.zf-legal p { margin: 0 0 .75rem !important; line-height: 1.65; }
.zf-legal em { color: #9a6a33; font-style: italic; }
