/*
 * Kerzenlicht: the site design on top of the Kadence theme.
 * Fonts are served from this repo (no requests to Google). The page sections use the kz-* classes
 * that the page content sets on core blocks.
 */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("fonts/cormorant-garamond.woff2") format("woff2");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/cormorant-garamond-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-sans-3.woff2") format("woff2");
}

body {
  --kz-bg: #fbf8f3;
  --kz-ink: #2a2420;
  --kz-muted: #6b5f55;
  --kz-line: #e6ddd2;
  --kz-soft: #f3ebe0;
  --kz-accent: #c56c21;
  --kz-accent-strong: #a24e10;
  --kz-gutter: max(64px, calc((100% - 1152px) / 2));
  --kz-space: 88px;
  --global-body-font-family: "Source Sans 3", sans-serif;
  --global-heading-font-family: "Cormorant Garamond", serif;
  background: var(--kz-bg);
  color: var(--kz-ink);
  font-size: 17px;
  line-height: 1.65;
}

@media (max-width: 781px) {
  body {
    --kz-gutter: 20px;
    --kz-space: 48px;
    font-size: 16px;
  }
}

/* Headings: serif, the theme sets their colour itself */
body h1, body h2, body h3,
.editor-styles-wrapper :is(h1, h2, h3) {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  line-height: 1.1;
  color: var(--kz-ink);
  text-wrap: balance;
}

:is(.entry-content, .editor-styles-wrapper) p {
  text-wrap: pretty;
}

/* Kadence has no theme.json, so WordPress wraps the content of each group in an inner container.
   Inside the kz-* groups that wrapper steps aside, so the grid and flex rules reach the blocks. */
:is(.entry-content, .editor-styles-wrapper) [class*="kz-"] > .wp-block-group__inner-container {
  display: contents;
}

/* Header and navigation */
.site-header {
  border-bottom: 1px solid var(--kz-line);
}

.main-navigation .primary-menu-container > ul > li.menu-item > a {
  color: var(--kz-muted);
  font-size: 14px;
}

.main-navigation .primary-menu-container > ul > li.current-menu-item > a {
  color: var(--kz-ink);
  box-shadow: inset 0 -2px 0 var(--kz-accent);
}

.mobile-navigation ul li > a {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 30px;
  line-height: 1.2;
  padding: 12px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--kz-line);
  color: var(--kz-muted);
  font-size: 13px;
}

/* Buttons, including the Kadence form button */
:is(.entry-content, .editor-styles-wrapper) .wp-block-button__link,
:is(.entry-content, .editor-styles-wrapper) .kb-adv-form-submit-button {
  background: var(--kz-accent-strong);
  color: #fff;
  border-radius: 999px;
  padding: 14px 26px;
  font-weight: 600;
  font-size: 15px;
}

/* Sections: full width bands with the content centred inside */
:is(.entry-content, .editor-styles-wrapper) .kz-section {
  margin: 0;
  padding: var(--kz-space) var(--kz-gutter);
}

:is(.entry-content, .editor-styles-wrapper) .kz-soft {
  background: var(--kz-soft);
}

/* Photo bands: the hero on Home and the page title bands */
:is(.entry-content, .editor-styles-wrapper) .kz-hero,
:is(.entry-content, .editor-styles-wrapper) .kz-band {
  margin: 0;
  padding: 0 var(--kz-gutter) 64px;
  align-items: flex-end;
  justify-content: flex-start;
}

:is(.entry-content, .editor-styles-wrapper) .kz-hero .wp-block-cover__background,
:is(.entry-content, .editor-styles-wrapper) .kz-band .wp-block-cover__background {
  background: linear-gradient(90deg, rgba(30, 22, 16, 0.78) 0%, rgba(30, 22, 16, 0.4) 60%, rgba(30, 22, 16, 0.1) 100%);
  /* the block sets dimRatio 0, which hides this layer: the shade here replaces it */
  opacity: 1 !important;
}

:is(.entry-content, .editor-styles-wrapper) .kz-hero .wp-block-cover__inner-container,
:is(.entry-content, .editor-styles-wrapper) .kz-band .wp-block-cover__inner-container {
  max-width: 600px;
  margin: 0;
  color: #fbf8f3;
}

:is(.entry-content, .editor-styles-wrapper) .kz-hero h1,
:is(.entry-content, .editor-styles-wrapper) .kz-band h1 {
  color: #fbf8f3;
  font-size: 62px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-band h1 {
  font-size: 60px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-hero p {
  font-size: 18px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-band .kz-cross {
  font: 600 28px/1 "Cormorant Garamond", serif;
}

:is(.entry-content, .editor-styles-wrapper) .kz-band-plain {
  margin: 0;
  padding: 72px var(--kz-gutter) 56px;
  background: var(--kz-soft);
}

:is(.entry-content, .editor-styles-wrapper) .kz-band-plain h1 {
  font-size: 60px;
  margin: 0;
}

@media (max-width: 781px) {
  :is(.entry-content, .editor-styles-wrapper) .kz-hero,
  :is(.entry-content, .editor-styles-wrapper) .kz-band {
    padding-bottom: 28px;
    background-position: center;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-hero .wp-block-cover__background,
  :is(.entry-content, .editor-styles-wrapper) .kz-band .wp-block-cover__background {
    background: linear-gradient(180deg, rgba(30, 22, 16, 0.15) 0%, rgba(30, 22, 16, 0.78) 100%);
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-hero h1 {
    font-size: 40px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-hero p {
    font-size: 16px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-band {
    min-height: 200px !important;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-band h1,
  :is(.entry-content, .editor-styles-wrapper) .kz-band-plain h1 {
    font-size: 36px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-band-plain {
    padding: 44px 20px 32px;
  }
}

/* Image frame: a soft panel around a freestanding product photo */
:is(.entry-content, .editor-styles-wrapper) .kz-frame {
  background: var(--kz-soft);
  border-radius: 18px;
  padding: 24px;
  margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .kz-soft .kz-frame {
  background: var(--kz-bg);
}

:is(.entry-content, .editor-styles-wrapper) .kz-frame img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

/* Two columns with a wide gap: features, stories, map and form */
:is(.entry-content, .editor-styles-wrapper) .kz-columns {
  gap: 72px;
  align-items: center;
  margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .kz-top {
  align-items: flex-start;
}

/* A large photo with round corners, next to a frame */
:is(.entry-content, .editor-styles-wrapper) .kz-photo {
  margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .kz-photo img {
  display: block;
  width: 100%;
  height: 520px;
  object-fit: cover;
  border-radius: 18px;
}

@media (max-width: 781px) {
  :is(.entry-content, .editor-styles-wrapper) .kz-columns {
    gap: 28px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-photo img {
    height: 260px;
  }

  /* On a phone the image comes before the text, also in the reversed story */
  :is(.entry-content, .editor-styles-wrapper) .kz-reverse > .wp-block-column:last-child {
    order: -1;
  }
}

/* Home features, numbered by CSS so the content keeps its words */
:is(.entry-content, .editor-styles-wrapper) .kz-features {
  counter-reset: kz-feature;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-feature {
  counter-increment: kz-feature;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 4px 20px;
  border-top: 1px solid var(--kz-line);
  padding-top: 24px;
  margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .kz-feature::before {
  content: counter(kz-feature, decimal-leading-zero);
  grid-row: span 2;
  font: 600 34px/1 "Cormorant Garamond", serif;
  color: var(--kz-accent-strong);
}

:is(.entry-content, .editor-styles-wrapper) .kz-feature h3 {
  font-size: 30px;
  margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .kz-feature p {
  color: var(--kz-muted);
  margin: 0;
}

@media (max-width: 781px) {
  :is(.entry-content, .editor-styles-wrapper) .kz-feature {
    grid-template-columns: 40px 1fr;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-feature::before {
    font-size: 26px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-feature h3 {
    font-size: 26px;
  }
}

/* Running text of the Kerzenautomat stories */
:is(.entry-content, .editor-styles-wrapper) .kz-story {
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-size: 19px;
  line-height: 1.6;
}

:is(.entry-content, .editor-styles-wrapper) .kz-story p {
  margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .kz-lead {
  font: 600 28px/1.3 "Cormorant Garamond", serif;
}

@media (max-width: 781px) {
  :is(.entry-content, .editor-styles-wrapper) .kz-story {
    font-size: 17px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-lead {
    font-size: 24px;
  }
}

/* Product, partner and document grids */
:is(.entry-content, .editor-styles-wrapper) .kz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 781px) {
  :is(.entry-content, .editor-styles-wrapper) .kz-grid,
  :is(.entry-content, .editor-styles-wrapper) .kz-grid-3 {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}

:is(.entry-content, .editor-styles-wrapper) .kz-card {
  background: #fff;
  border: 1px solid var(--kz-line);
  border-radius: 18px;
  overflow: hidden;
  margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .kz-card .wp-block-image {
  margin: 0;
  background: var(--kz-soft);
}

:is(.entry-content, .editor-styles-wrapper) .kz-card .wp-block-image img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
}

:is(.entry-content, .editor-styles-wrapper) .kz-card-body {
  padding: 26px 30px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-card-body h3 {
  font-size: 30px;
  margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .kz-variants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-variant-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 4px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-specs {
  list-style: none;
  margin: 0;
  padding: 0;
}

:is(.entry-content, .editor-styles-wrapper) .kz-specs li {
  border-top: 1px solid var(--kz-line);
  padding: 7px 0;
  font-size: 15px;
  margin: 0;
}

@media (max-width: 781px) {
  :is(.entry-content, .editor-styles-wrapper) .kz-card .wp-block-image img {
    height: 220px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-card-body {
    padding: 20px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-card-body h3 {
    font-size: 26px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-variants {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Automatenkerzen gallery */
:is(.entry-content, .editor-styles-wrapper) .kz-gallery {
  margin: 32px 0 0;
  gap: 16px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-gallery.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
  width: calc(25% - 12px);
}

:is(.entry-content, .editor-styles-wrapper) .kz-gallery .wp-block-image img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
}

@media (max-width: 781px) {
  :is(.entry-content, .editor-styles-wrapper) .kz-gallery {
    gap: 10px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-gallery.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
    width: calc(50% - 5px);
  }
}

/* Partner cards */
:is(.entry-content, .editor-styles-wrapper) .kz-partner {
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-partner .wp-block-image {
  background: none;
  height: 120px;
  display: flex;
  align-items: center;
}

:is(.entry-content, .editor-styles-wrapper) .kz-partner .wp-block-image img {
  height: auto;
  max-height: 120px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

:is(.entry-content, .editor-styles-wrapper) .kz-partner h2 {
  font-size: 32px;
  border-top: 1px solid var(--kz-line);
  padding-top: 22px;
  margin: 0;
}

/* Map */
:is(.entry-content, .editor-styles-wrapper) .kz-map iframe {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
  border-radius: 18px;
  filter: sepia(0.15) saturate(0.85);
}

:is(.entry-content, .editor-styles-wrapper) .kz-map-flat iframe {
  height: 380px;
  border-radius: 0;
}

@media (max-width: 781px) {
  :is(.entry-content, .editor-styles-wrapper) .kz-map iframe {
    height: 240px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kz-map-flat iframe {
    height: 260px;
  }
}

/* Contact form and company details */
:is(.entry-content, .editor-styles-wrapper) .kz-section h2 {
  font-size: 42px;
}

:is(.entry-content, .editor-styles-wrapper) .kz-address {
  color: var(--kz-muted);
  font-size: 16px;
  line-height: 1.75;
}

:is(.entry-content, .editor-styles-wrapper) .kb-adv-form-field input,
:is(.entry-content, .editor-styles-wrapper) .kb-adv-form-field textarea {
  background: #fff;
  border: 1px solid var(--kz-line);
  border-radius: 10px;
  min-height: 46px;
}

@media (max-width: 781px) {
  :is(.entry-content, .editor-styles-wrapper) .kz-section h2 {
    font-size: 34px;
  }

  :is(.entry-content, .editor-styles-wrapper) .kb-adv-form-submit-button {
    width: 100%;
  }
}

/* Zertifikate: the PDF links as tiles, the PDF tag comes from CSS */
:is(.entry-content, .editor-styles-wrapper) .kz-doc {
  margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .kz-doc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  background: #fff;
  border: 1px solid var(--kz-line);
  border-radius: 18px;
  padding: 28px 32px;
  text-decoration: none;
  color: var(--kz-ink);
  font: 600 30px/1.1 "Cormorant Garamond", serif;
}

:is(.entry-content, .editor-styles-wrapper) .kz-doc a::after {
  content: "PDF";
  font: 600 12px/1 "Source Sans 3", sans-serif;
  letter-spacing: 0.14em;
  color: var(--kz-accent-strong);
  border: 1px solid var(--kz-accent);
  border-radius: 999px;
  padding: 8px 12px;
}

@media (max-width: 781px) {
  :is(.entry-content, .editor-styles-wrapper) .kz-doc a {
    padding: 22px;
    font-size: 26px;
  }
}
