/* "Pepp" für fliesen-gatzen.de: legt sich über das Twenty-Twelve-Theme, Aufbau bleibt vertraut. */
:root {
  --fg-ink: #2b2b2b;
  --fg-muted: #5e5e5e;
  --fg-line: #dfe5dd;
  --fg-paper: #f5f8f4;
  --fg-accent: #067a06;       /* Logo-Grün, 5.5:1 auf Weiß */
  --fg-accent-dark: #055a05;
  --fg-accent-tint: #e4f1e3;
  --fg-shadow: 0 10px 30px -12px rgba(25, 40, 25, .35), 0 2px 6px -2px rgba(25, 40, 25, .12);
  --fg-ease: cubic-bezier(.16, 1, .3, 1);
}

html { scroll-behavior: smooth; scrollbar-color: #b9c6b7 var(--fg-paper); }
body, body.custom-background { background: #e8ece7; }
::selection { background: var(--fg-accent); color: #fff; }
:focus-visible { outline: 3px solid var(--fg-accent); outline-offset: 3px; border-radius: 4px; }

/* Links: Terrakotta statt WordPress-Blau, Unterstreichung wächst beim Hovern */
.entry-content a, .widget-area .widget a, .comment-content a {
  color: var(--fg-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s, text-decoration-thickness .2s;
}
.entry-content a:hover, .widget-area .widget a:hover { color: var(--fg-accent-dark); text-decoration-thickness: 2px; }
.site-header h1 a:hover { color: var(--fg-accent); }

.site { border-radius: 6px; box-shadow: var(--fg-shadow); }

/* ---------- 1. Navigation: klebt oben, aktive Seite farbig ---------- */
@media (min-width: 600px) {
  .main-navigation {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
    transition: box-shadow .3s var(--fg-ease);
  }
  .is-stuck .main-navigation { box-shadow: 0 8px 18px -12px rgba(25, 40, 25, .45); }
  .main-navigation li { margin: 0 6px 0 0; }
  .main-navigation li a {
    display: block; padding: 0 14px; border-radius: 999px;
    line-height: 2.6rem; color: var(--fg-muted);
    border: 0; transition: background-color .2s var(--fg-ease), color .2s var(--fg-ease);
  }
  .main-navigation li a:hover, .main-navigation li a:focus { background: var(--fg-accent-tint); color: var(--fg-accent-dark); }
  .main-navigation .current-menu-item > a, .main-navigation .current_page_item > a {
    background: var(--fg-accent); color: #fff; font-weight: 600;
  }
  .main-navigation .current-menu-item > a:hover { background: var(--fg-accent-dark); color: #fff; }
  .main-navigation ul.nav-menu, .main-navigation div.nav-menu > ul { padding: 8px 0; border-top-color: var(--fg-line); border-bottom-color: var(--fg-line); }
  .main-navigation li ul { top: 2.8rem; border-radius: 8px; overflow: hidden; box-shadow: var(--fg-shadow); }
  .main-navigation li ul li a { border-radius: 0; background: #fff; line-height: 2.4rem; }
}

/* ---------- 2. Kopfbild: wird beim Laden "verfliest", danach Beratungs-Plakette ---------- */
.fg-hero { position: relative; display: block; margin-top: 24px; border-radius: 8px; overflow: hidden; box-shadow: var(--fg-shadow); }
.fg-hero > a:first-child { display: block; }
.fg-hero img.header-image { display: block; width: 100%; margin: 0; border-radius: 0; aspect-ratio: 1024 / 250; object-fit: cover; }
.fg-tiles {
  position: absolute; inset: 0; display: grid; pointer-events: none;
  grid-template-columns: repeat(var(--cols, 16), 1fr); grid-template-rows: repeat(var(--rows, 4), 1fr);
}
.fg-tiles i {
  background: #f3eee7; border: 1px solid #fff;
  animation: fg-tile .7s var(--fg-ease) both;
  animation-delay: calc(var(--d) * 28ms + 150ms);
}
@keyframes fg-tile {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(.4) rotate(8deg); }
}
.fg-badge {
  position: absolute; right: 16px; bottom: 16px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 10px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: var(--fg-ink);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .45);
  font-size: 14px; line-height: 1.3; text-decoration: none;
  animation: fg-badge .6s var(--fg-ease) 1s both;
  transition: transform .25s var(--fg-ease), background-color .2s;
}
.fg-badge:hover { transform: translateY(-2px); background: #fff; }
.fg-badge .fg-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--fg-accent); color: #fff; display: grid; place-items: center; flex: none; }
.fg-badge .fg-ic svg { width: 18px; height: 18px; }
.fg-badge b { display: block; font-size: 15px; }
.fg-badge small { color: var(--fg-muted); font-size: 12.5px; }
@keyframes fg-badge { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- 3. Kontaktkasten in der Seitenleiste mit Anruf-Knopf ---------- */
.widget-area #text-2 {
  background: var(--fg-paper); border: 1px solid var(--fg-line); border-radius: 10px;
  padding: 22px 22px 20px;
}
.widget-area #text-2 .widget-title { color: var(--fg-ink); font-size: 13px; letter-spacing: .04em; }
.fg-actions { display: grid; gap: 8px; margin: 4px 0 18px; }
.fg-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; line-height: 1.2;
  text-decoration: none !important; border: 1px solid var(--fg-accent);
  transition: background-color .2s var(--fg-ease), color .2s var(--fg-ease), transform .2s var(--fg-ease), box-shadow .2s;
}
.fg-btn svg { width: 17px; height: 17px; flex: none; }
.fg-btn.fg-primary { background: var(--fg-accent); color: #fff !important; }
.fg-btn.fg-primary:hover { background: var(--fg-accent-dark); border-color: var(--fg-accent-dark); transform: translateY(-1px); box-shadow: 0 8px 16px -10px var(--fg-accent); }
.fg-btn.fg-ghost { background: #fff; color: var(--fg-accent) !important; }
.fg-btn.fg-ghost:hover { background: var(--fg-accent); color: #fff !important; }
.fg-btn:active { transform: translateY(0) scale(.98); }

/* ---------- 4. Leistungen als Fliesen-Kacheln ---------- */
.fg-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 8px 0 24px; clear: both; }
.fg-lists > div { background: var(--fg-paper); border: 1px solid var(--fg-line); border-radius: 10px; padding: 16px 18px 6px; }
.fg-lists p { margin-bottom: 8px; }
.entry-content .fg-lists ul { list-style: none; margin: 0 0 12px; }
.entry-content .fg-lists li { position: relative; padding-left: 24px; margin: 4px 0; }
.entry-content .fg-lists li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 12px; height: 12px; border-radius: 3px;
  background: var(--fg-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Zitate (Unternehmen) */
.entry-content blockquote { border-left: 0; margin: 24px 0; padding: 18px 22px; background: var(--fg-paper); border: 1px solid var(--fg-line); border-radius: 10px; font-size: 1.15rem; color: var(--fg-ink); }

/* Bilder im Text */
.entry-content .wp-caption img, .entry-content img.size-large { border-radius: 8px; box-shadow: var(--fg-shadow); }
.wp-caption .wp-caption-text { font-size: 11px; }

/* ---------- 5. Galerie: große Kacheln + Vollbild ---------- */
.gallery.fg-grid { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 24px !important; }
.gallery.fg-grid br { display: none; }
.gallery.fg-grid .gallery-item { float: none !important; width: auto !important; margin: 0 !important; }
.gallery.fg-grid .gallery-icon { padding: 0; }
.gallery.fg-grid .gallery-icon a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: var(--fg-paper); }
.gallery.fg-grid img { width: 100%; height: 100%; object-fit: cover; border: 0 !important; padding: 0 !important; box-shadow: none !important; border-radius: 0 !important; max-width: none; transition: transform .5s var(--fg-ease), filter .3s; }
.gallery.fg-grid a:hover img { transform: scale(1.06); filter: saturate(1.15); }
.gallery.fg-grid a { position: relative; }
.gallery.fg-grid a::after {
  content: ""; position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23067a06' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center/16px no-repeat;
  opacity: 0; transform: scale(.8); transition: opacity .2s, transform .25s var(--fg-ease);
}
.gallery.fg-grid a:hover::after, .gallery.fg-grid a:focus-visible::after { opacity: 1; transform: none; }

.fg-lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.fg-lightbox::backdrop { background: rgba(20, 16, 12, .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.fg-lightbox .fg-stage { position: fixed; inset: 0; display: grid; place-items: center; padding: 56px 72px; }
.fg-lightbox img { max-width: 100%; max-height: calc(100vh - 140px); border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.fg-lightbox img.fg-in { animation: fg-zoom .35s var(--fg-ease); }
@keyframes fg-zoom { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.fg-lightbox button {
  position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center;
  transition: background-color .2s;
}
.fg-lightbox button:hover { background: var(--fg-accent); }
.fg-lightbox button svg { width: 22px; height: 22px; }
.fg-lightbox .fg-close { top: 18px; right: 18px; }
.fg-lightbox .fg-prev { left: 14px; top: 50%; margin-top: -24px; }
.fg-lightbox .fg-next { right: 14px; top: 50%; margin-top: -24px; }
.fg-lightbox .fg-count { position: fixed; bottom: 22px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.8); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- 6. Handy: Anruf-Leiste unten ---------- */
.fg-callbar { display: none; }
@media (max-width: 599px) {
  .fg-callbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-top: 1px solid var(--fg-line);
    animation: fg-badge .5s var(--fg-ease) .6s both;
  }
  .fg-callbar .fg-btn { padding: 13px 10px; font-size: 15px; }
  body { padding-bottom: 76px; }
  .cookie-note { bottom: 70px !important; }
  .fg-badge { right: 10px; bottom: 10px; padding: 6px 12px 6px 6px; }
  .fg-badge small { display: none; }
  .fg-badge .fg-ic { width: 28px; height: 28px; }
  .fg-hero img.header-image { aspect-ratio: 16 / 8; }
  .gallery.fg-grid { grid-template-columns: 1fr 1fr; }
  .fg-lightbox .fg-stage { padding: 64px 12px; }
  .fg-lightbox .fg-prev, .fg-lightbox .fg-next { top: auto; bottom: 12px; margin: 0; }
  .menu-toggle { border-radius: 8px !important; padding: 10px 18px !important; font-weight: 600; background: #fff !important; border: 1px solid var(--fg-line) !important; box-shadow: none !important; color: var(--fg-ink) !important; }
  .menu-toggle.toggled-on { background: var(--fg-accent) !important; color: #fff !important; }
  .main-navigation ul.nav-menu.toggled-on li a { padding: 10px 6px; border-bottom: 1px solid var(--fg-line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .fg-tiles { display: none; }
}

/* Cookie-Hinweis im gleichen Ton */
.cookie-note button { background: var(--fg-accent) !important; border-radius: 8px !important; }
.cookie-note button:hover { background: var(--fg-accent-dark) !important; }

/* Screenshot-Modus (?shot): Endzustand ohne Animation, ohne Cookie-Hinweis */
.fg-shot *, .fg-shot *::before, .fg-shot *::after { animation: none !important; transition: none !important; }
.fg-shot .fg-tiles, .fg-shot .cookie-note { display: none !important; }

/* Logo (kommt aus der Live-Seite): kleine Drehung beim Drüberfahren */
.site-logo { transition: transform .4s var(--fg-ease); }
.site-logo-link:hover .site-logo { transform: rotate(-6deg) scale(1.04); }

/* Überschrift "Home" auf der Startseite entfällt */
body.home .entry-header .entry-title { display: none; }

/* Screenshot-Modus (?mid): Fliesen-Animation auf halbem Weg eingefroren */
.fg-mid .cookie-note { display: none !important; }
.fg-mid .fg-tiles i { animation-delay: calc(var(--d) * 28ms + 150ms - 560ms) !important; animation-play-state: paused !important; }
.fg-mid .fg-badge, .fg-mid .fg-callbar { animation: none !important; opacity: 0; }

/* Tablet: Seitenleiste ist schmal, Knöpfe einzeilig */
@media (min-width: 600px) and (max-width: 960px) {
  .widget-area .fg-btn { white-space: nowrap; font-size: 13px; padding: 10px 6px; gap: 6px; }
  .widget-area .fg-btn svg { width: 14px; height: 14px; }
  .widget-area #text-2 { padding: 16px 14px; }
}

/* Bilder neben Text (alte WordPress-Vorlage mit fester Breite): nie breiter als die halbe Spalte */
.entry-content .wp-caption.alignleft, .entry-content .wp-caption.alignright { max-width: 45%; height: auto; }
.entry-content .wp-caption img { width: 100%; height: auto; }
@media (max-width: 960px) {
  .entry-content .wp-caption.alignleft, .entry-content .wp-caption.alignright { float: none; max-width: 100%; width: auto !important; margin: 0 0 18px; }
}
