/*
 * KP Pullquote — floated quote that pokes into the page margin.
 *
 * Alignment: default (no align chosen) floats RIGHT; the block's own
 * "Ausrichtung: links" flips it. Layout tiers:
 *   ≤640px          full width in the text column, no float
 *   641–1299px      normal float inside the column (~50% wide)
 *   ≥1300px         float + continuous poke into the outer margin,
 *                   capped at half the quote's width (−13rem)
 * Right-poke only on sidebar-none layouts — on posts the sidebar sits
 * flush right of the content column and would collide.
 *
 * Selector strength is deliberate: Trawell colors blockquotes in its
 * teal accent, hides pullquote :before pseudo-elements, and caps
 * pullquote blockquotes at 350px inside a media query with (0,3,1)
 * specificity — the doubled .is-style-kp-pullquote class outranks all
 * of that without !important.
 */

figure.wp-block-pullquote.is-style-kp-pullquote {
  border: none;
  padding: 0;
  margin: 0 0 1em 25px;
  float: right;
  width: min(50%, 26rem);
  text-align: left;
}

figure.wp-block-pullquote.is-style-kp-pullquote.alignleft {
  float: left;
  margin: 0 25px 1em 0;
}

/*
 * Colors are PINNED (#333 body / #000 glyph), not inherited: Trawell's
 * customizer injects `blockquote, blockquote p {color:#006699}` as an
 * inline <style> — explicit values leave nothing to the inherit chain.
 */
figure.is-style-kp-pullquote.is-style-kp-pullquote blockquote {
  border: none;
  margin: 0;
  padding: 0;
  max-width: none;
  color: #333333;
}

/* oversized " as an inline initial — first lines wrap beside it */
figure.is-style-kp-pullquote.is-style-kp-pullquote blockquote::before {
  content: "\201C";
  display: block; /* must contest Trawell's blockquote:before {display:none} */
  float: left;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.9em;
  font-style: normal;
  line-height: 0.62;
  padding-right: 0.08em;
  margin-top: 0.05em;
  color: #000;
}

figure.is-style-kp-pullquote.is-style-kp-pullquote blockquote p {
  color: #333333;
  font-family: inherit;
  font-style: italic;
  font-size: 1.15em;
  line-height: 1.55;
  margin: 0 0 0.4em;
}

figure.is-style-kp-pullquote.is-style-kp-pullquote cite {
  display: block;
  margin-top: 0.5em;
  color: #333333;
  font-style: normal;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

/* wide viewports: poke into the outer margin, growing with the viewport */
@media (min-width: 1300px) {
  figure.wp-block-pullquote.is-style-kp-pullquote.alignleft {
    margin-left: clamp(-13rem, calc((1280px - 100vw) / 2), 0rem);
  }

  .trawell-sidebar-none figure.wp-block-pullquote.is-style-kp-pullquote:not(.alignleft) {
    margin-right: clamp(-13rem, calc((1280px - 100vw) / 2), 0rem);
  }
}

/* phones: give up the float, span the column */
@media (max-width: 640px) {
  figure.wp-block-pullquote.is-style-kp-pullquote,
  figure.wp-block-pullquote.is-style-kp-pullquote.alignleft {
    float: none;
    width: 100%;
    margin: 1.6em 0;
  }
}

/*
 * ===== [kp_grid] hand-picked posts/pages grid =====
 * .entry-content twins pin link color/decoration against Trawell's
 * customizer-injected content-link styles (same lesson as the pullquote).
 */

.kp-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(var(--kp-spalten, 3), 1fr);
  gap: 1.5rem;
  margin: 2em 0;
}

.kp-grid-item,
.entry-content .kp-grid-item {
  display: flex;
  flex-direction: column;
  background: #f7f5f0;
  border-radius: 0.7rem;
  overflow: hidden;
  color: #333333;
  text-decoration: none;
  border-bottom: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s ease;
}

.kp-grid-item:hover,
.entry-content .kp-grid-item:hover {
  color: #333333;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.kp-grid-bild {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.kp-grid-bild img,
.entry-content .kp-grid-bild img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
}

.kp-grid-titel {
  display: block;
  padding: 0.9rem 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}

.kp-grid-item:hover .kp-grid-titel {
  color: #bf1c23;
}

.kp-grid-text {
  display: block;
  padding: 0 1.1rem 1rem;
  margin-top: -0.35rem;
  font-size: 0.85em;
  line-height: 1.55;
  opacity: 0.75;
}

@media (max-width: 900px) {
  .kp-grid {
    grid-template-columns: repeat(min(var(--kp-spalten, 3), 2), 1fr);
  }
}

@media (max-width: 560px) {
  .kp-grid {
    grid-template-columns: 1fr;
  }
}
