/* Add padding to the anchoring */
html {
  scroll-padding-top: 13vh; /* adjust to the header height */
}

/* Make the header does not overlap with the main section */
/* main .entry-content .entry-content > *:first-child {
  margin-top: 13vh !important;
} */

/* -------- Home -------- */
.home main h1.hero-title {
  transform: translateY(150px);
}

.home main .entry-content .entry-content > *:first-child {
  margin-top: 0 !important;
}

/* [Trending Tab] */
.wp-block-easy-tabs-block-tab-content.trending-blogposts {
  padding-top: 5vh;
  padding-bottom: 5vh;
}

.wp-block-easy-tabs-block-tab-contents:has(.trending-blogposts.blog-tab) {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Reset default list styling */
.trending-blogposts .wp-block-latest-posts__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Individual blog post item */
.trending-blogposts .wp-block-latest-posts__list li {
  display: grid;
  /* grid-template-columns: 1fr 1fr; Changed from fixed 340px to flexible */
  gap: 1.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 5px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  grid-template-areas:
    "image title"
    "image date";
  grid-template-columns: 340px 1fr;
}

.trending-blogposts .wp-block-latest-posts__list li:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Featured image container */
.trending-blogposts .wp-block-latest-posts__featured-image {
  grid-area: image;
  flex-shrink: 0;
  align-self: start;
}

.trending-blogposts .wp-block-latest-posts__featured-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.trending-blogposts .wp-block-latest-posts__post-title {
  grid-area: title;
  align-self: end;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  line-height: 1.4;
  /* padding-bottom: var(--wp--preset--spacing--20); */
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 6; /* limits to 6 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trending-blogposts .wp-block-latest-posts__post-title:hover {
  color: #ffffff;
}

.trending-blogposts .wp-block-latest-posts__post-date {
  grid-area: date;
  align-self: start;
  font-size: 0.875rem;
  font-weight: 400;
}

/* -------- News -------- */
/* .other-news-section .trending-blogposts {
  padding: 0 !important;
}

.other-news-section .trending-blogposts .wp-block-latest-posts__list {
  grid-template-columns: repeat(3, 1fr);
}

.other-news-section .trending-blogposts .wp-block-latest-posts__list li {
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  padding: 1rem;
}

.other-news-section
  .trending-blogposts
  .wp-block-latest-posts__featured-image
  img {
  width: 200px;
  height: 150px;
}


.other-news-section .trending-blogposts .wp-block-latest-posts__post-title {
  font-size: 1rem;
}

.other-news-section .trending-blogposts .wp-block-latest-posts__post-date {
  font-size: 0.875rem;
  color: #1a1a1a;
} */

/* -------- 404 Page -------- */
body.error404 main {
  padding-top: 13vh !important;
  height: calc(100vh - 13vh) !important;
  background-color: #5c5078c2;
}

body.error404 main h1 {
  padding-top: 10vh;
}

body.error404 main p {
  padding-top: 5vh;
  padding-inline: 5vw;
  color: white;
}

body.error404 main form[role="search"] {
  padding-top: 5vh;
  width: 70vw;
}

body.error404 main form[role="search"] .wp-block-search__inside-wrapper input {
  border-width: 0.5px;
  border-radius: 0px;
}

body.error404 main form[role="search"] label {
  display: none;
}

body.error404 main form[role="search"] button {
  width: auto;
  margin: 0;
  border-radius: 0;
  background-color: var(--wp--preset--color--yk-primary);
  color: white;
}

/* ----- Legal Pages ----- */
.legal-page {
  background-color: #5c5078c2;
}

.legal-page p,
.legal-page li {
  color: white;
}

.legal-page h3 {
  font-size: 3rem !important;
}

.legal-page p a {
  color: var(--color-yk-secondary);
}

.legal-page ul {
  list-style: disc;
}

.legal-page li {
  font-size: 16px !important;
}

/* Desktop View */
@media screen and (min-width: 1366px) {
  .landing-section {
    height: 100vh;
    max-height: 100vh;
  }
  .home main h1.hero-title {
    transform: translateY(150px);
  }
  .product-section {
    padding-top: 100px !important;
  }
}

/* ----- Tablet and Mobile View (<1366px) ----- */
@media screen and (max-width: 1366px) {
  /* Add padding to the anchoring */
  html {
    scroll-padding-top: 90px; /* adjust to the header height */
  }

  /* Make the header does not overlap with the main section */
  /* main .entry-content .entry-content > *:first-child {
    margin-top: 90px !important;
  } */

  /* .yk-mobile-menu-item-header:has(.yk-mobile-menu-toggle)
    > a.yk-mobile-menu-link {
    padding-left: 0;
  } */

  /* -------- Team Page -------- */
  .page-id-964 .cmt-bg-group-sub-pages:has(.empty-column) {
    padding-bottom: 0 !important;
  }

  .page-id-964 .wp-block-columns:has(.empty-column) {
    gap: unset !important;
  }

  .page-id-964 .empty-column {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* -------- Blog Overview Page -------- */
  .page-id-22921 .wp-block-columns:has(.empty-column) {
    gap: unset !important;
  }
}

/* ----- Tablet View (768px - 1366px) ----- */
@media screen and (min-width: 768px) and (max-width: 1365px) {
  .landing-section {
    height: 100vh !important;
    position: relative;
  }

  .landing-section .home-buttons {
    position: absolute;
    width: 100vw;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
  }

  /* .trending-blogposts .wp-block-latest-posts__list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  } */

  .trending-blogposts .wp-block-latest-posts__list li {
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
  }

  .trending-blogposts .wp-block-latest-posts__featured-image img {
    width: 280px;
    height: 210px;
  }

  .legal-page h3 {
    font-size: 2.5rem !important;
    line-height: 2rem !important;
  }
}

@media screen and (max-width: 1049px) {
  /* Make the header does not overlap with the main section */
  main .entry-content .entry-content > *:first-child {
    margin-top: 90px !important;
  }
}

/* ----- Mobile View (<768px) ----- */
@media screen and (max-width: 767px) {
  /* Make the header does not overlap with the main section */
  /* main .entry-content .entry-content > *:first-child {
    margin-top: 90px !important;
  } */

  /* Make the header does not overlap with the main section */
  /* main .entry-content .entry-content > *:first-child {
    margin-top: 90px !important;
  } */

  .trending-blogposts .wp-block-latest-posts__list {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .trending-blogposts .wp-block-latest-posts__list li {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "title"
      "date";
    gap: 1rem;
    padding: 1rem;
  }

  .trending-blogposts .wp-block-latest-posts__featured-image {
    width: 100%;
  }

  .trending-blogposts .wp-block-latest-posts__featured-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
  }

  .trending-blogposts .wp-block-latest-posts__post-title {
    align-self: start;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
  }

  .trending-blogposts .wp-block-latest-posts__post-date {
    margin-top: 0;
  }

  .other-news-section .trending-blogposts .wp-block-latest-posts__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .other-news-section .trending-blogposts .wp-block-latest-posts__list li {
    gap: 0.75rem;
  }

  .other-news-section .trending-blogposts .wp-block-latest-posts__post-date {
    font-size: 0.875rem;
  }

  .legal-page h3 {
    font-size: 2rem !important;
    line-height: 2rem !important;
  }

  .legal-page h4 {
    font-size: 1.5rem !important;
  }

  .blog-page .wp-block-search__inside-wrapper {
    width: 80% !important;
  }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
  .trending-blogposts .wp-block-latest-posts__list {
    gap: 1rem;
  }

  .trending-blogposts .wp-block-latest-posts__list li {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .trending-blogposts .wp-block-latest-posts__post-title {
    font-size: 1rem;
  }

  .trending-blogposts .wp-block-latest-posts__post-date {
    font-size: 0.8rem;
  }

  .other-news-section .trending-blogposts .wp-block-latest-posts__list {
    grid-template-columns: repeat(1, 1fr);
    gap: 0.75rem;
  }

  .other-news-section .trending-blogposts .wp-block-latest-posts__list li {
    gap: 0.5rem;
  }

  .other-news-section .trending-blogposts .wp-block-latest-posts__post-title {
    line-height: 1.3;
  }
}

/* --- Make Cover element clickable --- */

/* Cover = click area. (Core already sets position:relative; reasserting is safe.) */
.wp-block-cover.product-box {
  position: relative;
}

/* Stretch the single heading link across the whole cover. The large negative inset
   overshoots the cover in all directions; the cover's built-in overflow:clip trims
   it back to the cover bounds. -100vmax always exceeds the cover size, so the
   top-left corner is reached regardless of where the text sits. */
.wp-block-cover.product-box .wp-block-cover__inner-container a {
  position: static; /* so ::after anchors to the inner container above the bg */
}

.wp-block-cover.product-box .wp-block-cover__inner-container a::after {
  content: "";
  position: absolute;
  inset: -100vmax;
  z-index: 1;
}

/* Safety net: if you ever add a SECOND link/button inside the cover, keep it
   clickable above the overlay. Low specificity so your theme can override it. */
.wp-block-cover.product-box
  .wp-block-cover__inner-container
  :where(a, button):not(:first-of-type) {
  position: relative;
  z-index: 2;
}

/* ----- Clickable CSS ----- */

/* Important CSS */
/* :root :where(.is-layout-constrained) > *,
:root :where(.is-layout-flow) > * {
  margin-block-start: unset;
} */

.gallery-section,
.entry-content .wp-block-group {
  margin-block-start: unset;
}

/* Important CSS */
.is-layout-flow > * {
  margin-block-start: 0;
  margin-block-end: 0;
}

.page main {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.page main .entry-content {
  margin-top: 0 !important;
}

.gallery-section {
  max-width: unset !important;
}

.contact-page.has-global-padding,
.single-post .has-global-padding {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.contact-page .map-section {
  padding-right: var(--wp--preset--spacing--50) !important;
}

.services-landing,
.steuern-landing,
.treu­hand-landing,
.wir-landing,
.team-landing,
.team-members,
.blog-page,
.blog-posts {
  max-width: unset !important;
}

h2 a,
.product-box a,
.landing-section a,
footer h4 a {
  text-decoration-thickness: 0px !important;
  text-decoration: none !important;
}

.has-global-padding > .alignfull {
  margin-left: unset;
  margin-right: unset;
}

/* .home .has-global-padding {
  padding-left: var(--wp--preset--spacing--50) !important;
  padding-right: var(--wp--preset--spacing--50) !important;
} */

/* Wrapper that fills the parent's inner width inside an alignfull section that
   has left/right padding */
/* .wp-block-group.alignfull > .alignwide.wide-flush {
  max-width: none;
} */

/* .wp-block-group.alignwide {
  max-width: calc(100vw - (var(--wp--preset--spacing--50) * 2));
  width: 100%;
} */

.entry-content.has-global-padding {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.services-page,
.cmt-bg-group-sub-pages,
.single-post .blogpost-container {
  margin-top: 0 !important;
}

.entry-content .wp-block-group.is-layout-constrained {
  max-width: unset !important;
}

/* .entry-content .wp-block-group.wp-block-group-is-layout-constrained, */
.entry-content .wp-block-group .wp-block-group.has-global-padding {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.entry-content:has(.team-landing) h6 {
  font-size: var(--wp--preset--font-size--medium) !important;
}

:where(.wp-site-blocks :focus) {
  outline: none;
}

.wp-block-button .wp-block-button__link {
  color: #000;
}

/* .services-landing h4 a,
.steuern-landing h4 a {
  color: var(--wp--preset--color--white) !important;
} */

.entry-content .cmt-bg-group-sub-pages h4 a {
  color: var(--wp--preset--color--white) !important;
}

/* ===== cmt – Suchergebnisse (Block-Template) im Design von cmt.ch ===== */
:root {
  --cmt-olive: #b3b470;
  --cmt-olive-dark: #a1a25f;
}

/* Layout: Bereich über die volle Breite (statt content-size 800px) */
body.search main.wp-block-group > .wp-block-group,
body.search main.wp-block-group > .wp-block-query {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.search main.wp-block-group > .wp-block-group {
  margin-bottom: 0 !important;
}
body.search main.wp-block-group > .wp-block-query {
  margin-top: 0 !important;
}

/* Seitentitel „Suchergebnisse für …“ */
body.search h1.wp-block-query-title {
  font-family: obvia, sans-serif;
  font-size: 2rem !important;
  font-style: italic;
  font-weight: 600;
  line-height: 1.2;
  color: #000;
  margin: 0 0 1.5rem;
}

/* Rubrik-Überschrift „Beiträge“ (auf cmt.ch Teil des Templates) */
body.search .wp-block-query::before {
  content: "Beiträge";
  display: block;
  font-family: obvia, sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: 1px;
  color: #000;
  padding: 1rem 0 0.5rem;
  margin-bottom: 1.5rem;
}

/* Karten-Grid */
body.search ul.wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  list-style: none;
  margin: 0 0 3rem;
  padding: 0;
  max-width: none !important;
  width: 100% !important;
}

/* Karte */
body.search li.wp-block-post {
  display: flex;
  margin: 0;
  padding: 0;
  width: auto;
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow:
    0 4px 8px 2px rgba(0, 0, 0, 0.1),
    0 6px 8px 0 rgba(0, 0, 0, 0.1);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
body.search li.wp-block-post:hover {
  transform: translateY(-3px);
  box-shadow:
    0 8px 16px 2px rgba(0, 0, 0, 0.14),
    0 10px 14px 0 rgba(0, 0, 0, 0.1);
}
body.search li.wp-block-post > article {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 400px;
  padding: 1.5rem;
}

/* Beitragsbild – wirkt, sobald der Block „Beitragsbild“ im Template ergänzt ist */
body.search li.wp-block-post .wp-block-post-featured-image {
  margin: -1.5rem -1.5rem 1.5rem;
  height: 200px;
  overflow: hidden;
}
body.search li.wp-block-post .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* Kopfbereich: Titel sichtbar machen, Datum/Autor ausblenden */
body.search li.wp-block-post .entry-header {
  display: block !important;
  margin: 0;
  padding: 0;
}
body.search li.wp-block-post .entry-header .post-meta {
  display: none !important;
}

body.search li.wp-block-post h2.wp-block-post-title {
  font-family: obvia, sans-serif;
  font-size: 2rem !important;
  line-height: 1.1 !important;
  font-weight: 600;
  font-style: normal !important;
  color: #000;
  margin: 0 0 1rem;
}
body.search li.wp-block-post h2.wp-block-post-title a {
  font-size: inherit !important;
  font-style: normal !important;
  color: #000;
  text-decoration: none;
}
body.search li.wp-block-post h2.wp-block-post-title a:hover {
  color: var(--cmt-olive);
}

/* Textauszug */
body.search .wp-block-post-excerpt {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  margin: 0;
}
body.search .wp-block-post-excerpt__excerpt {
  font-family: akkurat, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #000;
  flex: 1 1 auto;
  margin: 0 0 1.5rem;
}

/* „Read More“ als Button (unten ausgerichtet) */
body.search .wp-block-post-excerpt__more-text {
  margin: 0;
}
body.search .wp-block-post-excerpt__more-text a {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 5.28px;
  background: var(--cmt-olive);
  color: #fff;
  font-family: akkurat, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
body.search .wp-block-post-excerpt__more-text a:hover {
  background: var(--cmt-olive-dark);
  color: #fff;
}

.page #treuhand h2 a,
.page #treuhand h4 a {
  color: var(--wp--preset--color--white);
}

.footer-year.wp-block-yk-current-year {
  margin: 0 !important;
}

footer .wp-block-group:has(.footer-year) p {
  margin-top: 0 !important;
}

.cta-kontakt h6 {
  font-size: inherit;
  font-weight: inherit;
}