/*
Theme Name: CityLead
Theme URI: https://example.com
Author:
Description: A simple, reusable WordPress theme for local lead-generation "satellite" websites. Visitors fill in an offer/quote form (no checkout), then see a popup pointing them to a product page on the main website. Every site-specific detail — city name, main site link, product link, phone, colors, popup text, form shortcode — is set from the Customizer, so the same theme package can be relaunched on a new domain in minutes.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: citylead
*/

/* -----------------------------------------------------------
   0. Variables & reset
----------------------------------------------------------- */
:root {
  --citylead-accent: #2563eb;
  --citylead-ink: #0b0b0c;
  --citylead-ink-soft: #242428;
  --citylead-text: #0b0b0c;
  --citylead-text-muted: #6b7280;
  --citylead-text-on-dark-muted: #a3a3ad;
  --citylead-bg: #ffffff;
  --citylead-bg-alt: #f4f4f5;
  --citylead-border: #e5e5e8;
  --citylead-radius-card: 20px;
  --citylead-radius-input: 10px;
  --citylead-radius-pill: 999px;
  --citylead-max-width: 1120px;
  --citylead-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --citylead-font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .citylead-popup-overlay,
  .citylead-popup-overlay .citylead-popup {
    transition-duration: 0.001s !important;
  }
}

body {
  margin: 0;
  font-family: var(--citylead-font-body);
  color: var(--citylead-text);
  background: var(--citylead-bg);
  line-height: 1.55;
  font-size: 16px;
}

/* Display font: headings, the domain wordmark, buttons and other bold
   uppercase UI chrome. Body copy stays on the system stack for the
   clearest possible reading experience. */
h1, h2, h3, h4,
.btn,
.site-wordmark,
.usp-item p,
.product-card-name,
.announcement-bar,
.primary-nav ul a,
.footer-col h3 {
  font-family: var(--citylead-font-display);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--citylead-text); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.1; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.25rem); }
p { margin: 0 0 1em; }

.container {
  max-width: var(--citylead-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
}

/* -----------------------------------------------------------
   1. Buttons
----------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: var(--citylead-radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-dark {
  background: var(--citylead-ink);
  color: #fff;
}
.btn-dark:hover { background: var(--citylead-ink-soft); }
.btn-primary {
  background: var(--citylead-accent);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border-color: var(--citylead-ink);
  color: var(--citylead-ink);
}
.btn-outline:hover { background: var(--citylead-ink); color: #fff; }
.btn-lg { padding: 17px 38px; font-size: 1rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* -----------------------------------------------------------
   2. Announcement bar + header
----------------------------------------------------------- */
.announcement-bar {
  background: var(--citylead-ink);
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
}

.site-header {
  border-bottom: 1px solid var(--citylead-border);
  background: var(--citylead-bg);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.site-logo img { max-height: 44px; width: auto; }
.site-logo-icon { height: 36px; width: 36px; flex-shrink: 0; }
.site-wordmark {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--citylead-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-wordmark-tld {
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--citylead-text-muted);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--citylead-text);
}
/* Logo and header-actions take only the space they need; the nav in
   between gets the rest and centers its own links, so the header reads
   as three balanced zones instead of two with a dead gap in the middle. */
.header-actions { flex-shrink: 0; }
.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
}
.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}
.primary-nav ul a {
  color: var(--citylead-text);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.primary-nav ul a:hover { text-decoration: none; opacity: 0.6; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn-phone {
  padding: 10px 22px;
  font-size: 0.85rem;
  white-space: nowrap;
}

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--citylead-bg);
    border-bottom: 1px solid var(--citylead-border);
    padding: 16px 20px 24px;
    display: none;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: 14px; width: 100%; }
  .header-actions { gap: 10px; }
  .btn-phone { padding: 8px 14px; font-size: 0.78rem; }
  .site-logo { gap: 8px; }
  .site-logo-icon { width: 28px; height: 28px; }
  .site-wordmark { font-size: 1.05rem; }
}

/* -----------------------------------------------------------
   3. Hero
----------------------------------------------------------- */
.hero {
  background: var(--citylead-bg-alt);
  padding: 88px 0 76px;
  text-align: center;
}
.hero .hero-inner { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { text-transform: uppercase; }
.hero p.hero-subheading {
  font-size: 1.15rem;
  color: var(--citylead-text-muted);
  margin-bottom: 1.9em;
}

.hero.has-image {
  position: relative;
  overflow: hidden;
  padding: 140px 0 110px;
  isolation: isolate;
}
/* Each tile is 1920px wide (one full 1080p screen = a single image, only a
   ~11% enlargement of the 1731px source). Smaller screens crop the sides;
   screens wider than 1920px get alternately mirrored neighbours so the seams
   line up. */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.hero-tile {
  flex: 0 0 1920px;
  width: 1920px;
  height: 100%;
  overflow: hidden; /* clips the blur's soft edge so tiles meet cleanly */
  display: block;
}
.hero-row {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
}
/* Blurred rows fade in smoothly with distance from the centre of the screen */
.hero-row[data-masked] {
  -webkit-mask-image: linear-gradient(to right, #000, #000 calc(50% - var(--b)), transparent calc(50% - var(--a)), transparent calc(50% + var(--a)), #000 calc(50% + var(--b)), #000);
          mask-image: linear-gradient(to right, #000, #000 calc(50% - var(--b)), transparent calc(50% - var(--a)), transparent calc(50% + var(--a)), #000 calc(50% + var(--b)), #000);
}
.hero-tile.is-flipped { transform: scaleX(-1); }
.hero-tile img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  /* Blur strength comes from the row (see front-page.php) */
  filter: blur(var(--blur, 0));
  transform: scale(1.04);
}

.hero.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(11,11,12,0.45), rgba(11,11,12,0.7));
}
.hero.has-image h1,
.hero.has-image p.hero-subheading { color: #fff; }
.hero.has-image p.hero-subheading { color: rgba(255,255,255,0.85); }

.btn-light {
  background: #fff;
  color: var(--citylead-ink);
}
.btn-light:hover { background: #e5e5e8; }

/* -----------------------------------------------------------
   4. USP band (dark)
----------------------------------------------------------- */
.usp-band {
  background: var(--citylead-ink);
  color: #fff;
  padding: 56px 0;
}
.usp-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
}
.usp-item {
  text-align: center;
  padding: 12px;
  flex: 0 1 auto;
  max-width: 100%;
}
.usp-item .usp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  color: #fff;
  font-weight: 700;
  margin-bottom: 14px;
}
.usp-item p {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .usp-grid { gap: 28px; }
}

/* -----------------------------------------------------------
   5. Page content (from the block editor)
----------------------------------------------------------- */
.page-content { padding: 20px 20px 10px; }
.page-content :is(h1,h2,h3) { margin-top: 1em; }

/* -----------------------------------------------------------
   6. Products section (white)
----------------------------------------------------------- */
.products-section {
  background: var(--citylead-bg);
  padding: 72px 0;
  scroll-margin-top: 90px;
}
.products-note {
  text-align: center;
  color: var(--citylead-text-muted);
  font-size: 0.85rem;
  max-width: 520px;
  margin: 0 auto 2em;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.product-card {
  display: block;
  color: var(--citylead-text);
}
.product-card:hover { text-decoration: none; }
.product-card-image {
  background: var(--citylead-bg-alt);
  border-radius: var(--citylead-radius-card);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card-image .product-card-placeholder-icon {
  width: 30%;
  height: 30%;
  object-fit: contain;
  opacity: 0.25;
}
.product-card-name {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
  margin: 0;
}
.product-card-price {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: var(--citylead-text-muted);
}
@media (max-width: 900px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .products-grid { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------
   7. Offer form section (black)
----------------------------------------------------------- */
.offer-form-section {
  background: var(--citylead-ink-soft);
  padding: 72px 0;
  scroll-margin-top: 90px;
}
.offer-form-section h2 {
  text-align: center;
  margin-bottom: 0.3em;
  text-transform: uppercase;
  color: #fff;
}
.offer-form-section .section-intro {
  text-align: center;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  margin: 0 auto 2em;
}
.offer-form-wrapper {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--citylead-radius-card);
  padding: 36px;
}
.offer-form-wrapper form input,
.offer-form-wrapper form textarea,
.offer-form-wrapper form select {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--citylead-border);
  background: #fff;
  border-radius: var(--citylead-radius-input);
  font-size: 1rem;
  margin-bottom: 14px;
  font-family: inherit;
}
.offer-form-wrapper form input[type="submit"],
.offer-form-wrapper form button[type="submit"] {
  width: auto;
  background: var(--citylead-ink);
  color: #fff;
  border: none;
  border-radius: var(--citylead-radius-pill);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 14px 32px;
  cursor: pointer;
}
.offer-form-wrapper form input[type="submit"]:hover,
.offer-form-wrapper form button[type="submit"]:hover {
  background: var(--citylead-ink-soft);
}
.citylead-form-message {
  padding: 12px 14px;
  border-radius: var(--citylead-radius-input);
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 600;
}
.citylead-form-message.is-success {
  background: #eafbe7;
  color: #1a7f37;
}
.citylead-form-message.is-error {
  background: #fdeaea;
  color: #b32d2e;
}

.kundtyp-toggle {
  display: flex;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}
.kundtyp-toggle legend { margin: 0; padding: 0; }
.kundtyp-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  border: 2px solid var(--citylead-border);
  border-radius: var(--citylead-radius-pill);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.offer-form-wrapper .kundtyp-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: 0;
  pointer-events: none;
}
.kundtyp-option.is-selected {
  background: var(--citylead-ink);
  border-color: var(--citylead-ink);
  color: #fff;
}

.citylead-field { display: block; margin-bottom: 14px; }
.citylead-field[hidden] { display: none; }
.citylead-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--citylead-text-muted);
  margin-bottom: 6px;
}
.offer-form-wrapper .citylead-field input,
.offer-form-wrapper .citylead-field textarea {
  margin-bottom: 0;
}
.citylead-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--citylead-text-muted);
  cursor: pointer;
}
.offer-form-wrapper .citylead-consent input {
  width: auto;
  flex: 0 0 auto;
  margin: 3px 0 0;
}

/* -----------------------------------------------------------
   8. Contact page
----------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 56px 0;
  align-items: start;
}
.contact-details h1 { text-transform: uppercase; margin-bottom: 0.5em; }
.contact-phone {
  display: inline-block;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--citylead-ink);
  margin: 0.3em 0 0.2em;
}
.contact-phone-note {
  color: var(--citylead-text-muted);
  font-size: 0.9rem;
}
.contact-map iframe {
  width: 100%;
  height: 280px;
  border: 0;
  border-radius: var(--citylead-radius-card);
}
@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------
   9. Thank-you page
----------------------------------------------------------- */
.thank-you-page {
  padding: 100px 20px;
  text-align: center;
  max-width: 640px;
}
.thank-you-page h1 { text-transform: uppercase; }

/* -----------------------------------------------------------
   10. Footer
----------------------------------------------------------- */
.site-footer {
  background: var(--citylead-ink);
  color: var(--citylead-text-on-dark-muted);
  padding: 56px 0 24px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
}
.footer-col h3 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.footer-col ul a { color: var(--citylead-text-on-dark-muted); }
.footer-col ul a:hover { color: #fff; }
.footer-phone { font-weight: 700; font-size: 1.1rem; color: #fff; display: inline-block; }
.footer-phone:hover { color: #fff; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-copy {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 18px;
  font-size: 0.8rem;
  color: #77777f;
  margin: 0;
}
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------
   11. 404
----------------------------------------------------------- */
.error-404 {
  padding: 100px 20px;
  text-align: center;
  max-width: 560px;
}
.error-404 h1 { text-transform: uppercase; }

/* -----------------------------------------------------------
   12. Popup modal
----------------------------------------------------------- */
.citylead-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 12, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.citylead-popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}
.citylead-popup {
  background: #fff;
  border-radius: var(--citylead-radius-card);
  max-width: 440px;
  width: 100%;
  padding: 40px 36px 32px;
  position: relative;
  text-align: center;
  transform: translateY(36px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.citylead-popup-overlay.is-open .citylead-popup { transform: translateY(0); }
.citylead-popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--citylead-text-muted);
}
.citylead-popup h3 {
  margin-bottom: 0.4em;
  text-transform: uppercase;
}
.citylead-popup p { color: var(--citylead-text-muted); }
.citylead-popup-dismiss {
  display: block;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--citylead-text-muted);
  text-decoration: underline;
}
