/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* Keep archive cards in a stable grid to avoid broken masonry-like gaps. */
body.blog .entries[data-layout="grid"],
body.archive .entries[data-layout="grid"] {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

body.blog .entries[data-layout="grid"] > article,
body.archive .entries[data-layout="grid"] > article {
  margin: 0 !important;
}

@media (max-width: 1024px) {
  body.blog .entries[data-layout="grid"],
  body.archive .entries[data-layout="grid"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  body.blog .entries[data-layout="grid"],
  body.archive .entries[data-layout="grid"] {
    grid-template-columns: 1fr;
  }
}

/* Archive "Einsatzberichte" visual polish with subtle red accents */
body.post-type-archive-cs4ek_operation {
  --hfw-accent: #be272e;
}

body.post-type-archive-cs4ek_operation main.cs4ek-archive-wrap > h1,
body.post-type-archive-cs4ek_operation .entry-content > h1:first-child,
body.post-type-archive-cs4ek_operation h1:first-child {
  position: relative;
  padding-bottom: 0.45rem;
}

body.post-type-archive-cs4ek_operation main.cs4ek-archive-wrap > h1::after,
body.post-type-archive-cs4ek_operation .entry-content > h1:first-child::after,
body.post-type-archive-cs4ek_operation h1:first-child::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 0.55rem;
  background: var(--hfw-accent);
  border-radius: 999px;
}

body.post-type-archive-cs4ek_operation article {
  border-left: 4px solid rgba(190, 39, 46, 0.3);
  padding-left: 1rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

body.post-type-archive-cs4ek_operation article:hover {
  border-left-color: var(--hfw-accent);
  transform: translateY(-1px);
}

body.post-type-archive-cs4ek_operation a:hover {
  color: var(--hfw-accent);
}

body.post-type-archive-cs4ek_operation .more-link,
body.post-type-archive-cs4ek_operation a[href*="weiterlesen"] {
  color: var(--hfw-accent);
  font-weight: 700;
}

body.post-type-archive-cs4ek_operation .hfw-einsatz-filter {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin: 1.25rem 0 1.75rem;
  padding: 0.85rem;
  border: 1px solid #e4e4e4;
  border-left: 4px solid var(--hfw-accent);
  border-radius: 8px;
  background: #fff;
}

body.post-type-archive-cs4ek_operation .hfw-einsatz-filter label {
  display: grid;
  gap: 0.35rem;
  min-width: 180px;
  flex: 1 1 220px;
}

body.post-type-archive-cs4ek_operation .hfw-einsatz-filter .hfw-einsatz-filter-search {
  flex: 2 1 320px;
}

body.post-type-archive-cs4ek_operation .hfw-einsatz-filter span {
  font-size: 0.82rem;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

body.post-type-archive-cs4ek_operation .hfw-einsatz-filter input,
body.post-type-archive-cs4ek_operation .hfw-einsatz-filter select {
  height: 40px;
  border: 1px solid #d7d7d7;
  border-radius: 6px;
  padding: 0 0.7rem;
  font-size: 0.92rem;
  background: #fff;
}

body.post-type-archive-cs4ek_operation .hfw-einsatz-filter button {
  height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 0.9rem;
  font-weight: 700;
  color: #fff;
  background: var(--hfw-accent);
  cursor: pointer;
}

body.post-type-archive-cs4ek_operation .hfw-einsatz-filter-reset {
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  border-radius: 6px;
  color: #666;
  background: #f4f4f4;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 980px) {
  body.post-type-archive-cs4ek_operation .hfw-einsatz-filter {
    gap: 0.55rem;
  }

  body.post-type-archive-cs4ek_operation .hfw-einsatz-filter label,
  body.post-type-archive-cs4ek_operation .hfw-einsatz-filter .hfw-einsatz-filter-search {
    flex: 1 1 100%;
    min-width: 0;
  }

  body.post-type-archive-cs4ek_operation .hfw-einsatz-filter button,
  body.post-type-archive-cs4ek_operation .hfw-einsatz-filter-reset {
    height: 38px;
  }
}

/* Date is already part of the Einsatz details table, so hide duplicate left subtitle. */
body.post-type-archive-cs4ek_operation .cs4ek-archive .cs4ek-subtitle {
  display: none !important;
}

/* Subtle brand-red separator below desktop main menu/header */
@media (min-width: 1000px) {
  #header [data-device="desktop"] [data-row="middle"] {
    box-shadow: inset 0 -1px 0 rgba(190, 39, 46, 0.55);
  }
}

/* ===== UI Pass 1: Cards, Hero, Color, Typography ===== */
:root {
  --hfw-ui-accent: #be272e;
  --hfw-ui-text: #2f3440;
  --hfw-ui-muted: #666b76;
  --hfw-ui-card-radius: 12px;
  --hfw-ui-card-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

body {
  color: var(--hfw-ui-text);
  line-height: 1.58;
}

h1,
.page-title {
  letter-spacing: -0.01em;
}

h1,
.hero-section .page-title {
  font-size: clamp(2rem, 3.3vw, 3rem);
  line-height: 1.12;
}

h2,
.entry-title {
  font-size: clamp(1.28rem, 1.6vw, 1.9rem);
  line-height: 1.2;
}

p,
.entry-excerpt {
  color: var(--hfw-ui-text);
}

a,
.ct-link,
.entry-title a:hover,
.entry-excerpt a:hover {
  transition: color 0.18s ease;
}

a:hover,
.ct-link:hover {
  color: var(--hfw-ui-accent);
}

.menu .current-menu-item > a,
.menu .current_page_item > a,
.menu a:hover {
  color: var(--hfw-ui-accent) !important;
}

/* 1) Unified cards across posts + Einsatz + legal */
body.blog .entry-card,
body.archive .entry-card,
body.post-type-archive-cs4ek_operation .entry-card,
.hfw-legal-card {
  border-radius: var(--hfw-ui-card-radius);
  box-shadow: var(--hfw-ui-card-shadow);
  overflow: hidden;
}

body.blog .entry-card .ct-image-container img,
body.archive .entry-card .ct-image-container img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

body.blog .entry-card .entry-excerpt,
body.archive .entry-card .entry-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.8em;
}

/* 2) Hero strategy: keep home strong, make inner pages calmer */
body:not(.home) .hero-section[data-type="type-2"] {
  min-height: 44vh;
  max-height: 560px;
  display: flex;
  align-items: center;
}

body:not(.home) .hero-section[data-type="type-2"] .entry-header {
  padding-top: clamp(72px, 8vh, 108px);
  padding-bottom: clamp(72px, 8vh, 108px);
}

/* 3) Accent usage: only interaction and key signals */
.ct-button,
button[type="submit"],
input[type="submit"],
.hfw-einsatz-filter-submit {
  background: var(--hfw-ui-accent);
}

.hfw-einsatz-filter {
  border-left-color: var(--hfw-ui-accent) !important;
}

/* 4) Typographic hierarchy + spacing */
body.blog .entries,
body.archive .entries {
  gap: 1.7rem;
}

body.blog .entry-meta,
body.archive .entry-meta {
  color: var(--hfw-ui-muted);
  font-size: 0.86rem;
}

@media (max-width: 1024px) {
  body:not(.home) .hero-section[data-type="type-2"] {
    min-height: 40vh;
    max-height: 470px;
  }
}

@media (max-width: 767px) {
  body.blog .entries,
  body.archive .entries {
    gap: 1.05rem;
  }

  body.blog .entry-card .entry-excerpt,
  body.archive .entry-card .entry-excerpt {
    min-height: 0;
  }
}
