/* banner.css */
/* =============================================================================
 * Homepage component: Newsletter banner (.kunst-newsletter-ad*)
 * Split from homepage.css (Issue #5). Homepage-only; enqueued after km-global.
 * ========================================================================== */

/* -----------------------------------------
   3. Newsletter banner
   ----------------------------------------- */
.kunst-newsletter-ad {
  margin: 30px 0;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--kunst-lines);
}
.kunst-newsletter-ad-container {
  width: 100%;
}
.kunst-newsletter-ad-container img,
.kunst-newsletter-ad-container .advads-container {
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* popular.css */
/* =============================================================================
 * Homepage component: Most-read / popular section (.kunst-popular-*)
 * Split from homepage.css (Issue #5). Homepage-only; enqueued after km-global.
 * ========================================================================== */

/* -----------------------------------------
   5. Popular / Most-read section
   ----------------------------------------- */
.kunst-popular-section {
  margin: 40px 0;
}
/* NOTE: the former `.kunst-popular-section .kunst-section-title` rule was removed
   in Phase C. The live Meistgelesen heading emits `.kunst-popular-title` (see
   render_homepage_popular_section), which is styled by its own rule below — the
   `.kunst-section-title` class is only emitted by the dead theme shortcodes that
   the plugin overrides at runtime via Kunstmag_Legacy_Home_Shortcodes
   ::register_shortcodes() on `init` priority 100 (remove_shortcode +
   add_shortcode), so no live element matched the deleted rule. */
.kunst-popular-header {
  margin-bottom: 25px;
}
.kunst-popular-title {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--km-accent);
  margin: 0;
}
.kunst-popular-content {
  background: var(--km-bg-light);
  border-top: 2px solid var(--km-accent); /* thin red accent, unified with the other red section lines (was 3px) */
  padding: 25px 30px;
}
.kunst-popular-grid {
  display: flex;
  gap: 30px;
}
.kunst-popular-item {
  flex: 1;
  position: relative;
  cursor: pointer;
}
.kunst-popular-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0;
  right: -15px;
  width: 1px;
  height: 100%;
  background-color: var(--kunst-lines);
  z-index: 0;
}
.kunst-popular-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--km-accent);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.kunst-popular-item-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--kunst-text-dark);
  position: relative;
  z-index: 1;
}
.kunst-popular-item-author {
  font-size: 12px;
  color: #999;
  position: relative;
  z-index: 1;
}


/* Stack the 5 ranked items from <=1024px so iPad landscape (1024) no longer
   squeezes them into narrow columns (was <=1000px). */
@media screen and (max-width: 1024px) {
  .kunst-popular-content {
    padding: 20px;
  }
  .kunst-popular-grid {
    flex-direction: column;
    gap: 0;
  }
  .kunst-popular-item::after {
    display: none;
  }
  .kunst-popular-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--kunst-lines);
  }
  .kunst-popular-item:first-child {
    padding-top: 0;
  }
  .kunst-popular-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }
}


@media screen and (max-width: 400px) {
  .kunst-popular-content {
    padding: 15px;
  }
}

/* ads.css */
/* =============================================================================
 * Homepage component: Homepage ad-slots responsive overrides (.kunst-ad-slots-container). Base rule lives in global.css — do NOT add an ad base rule here.
 * Split from homepage.css (Issue #5). Homepage-only; enqueued after km-global.
 * ========================================================================== */


@media screen and (max-width: 1000px) {
  .kunst-ad-slots-container {
    flex-direction: row;
    gap: 20px;
  }
  .kunst-ad-slots-container .advads-container, .kunst-ad-slots-container > div {
    flex: 1;
    width: auto;
  }
}


@media screen and (max-width: 650px) {
  .kunst-ad-slots-container {
    flex-direction: column;
    gap: 15px;
  }
  .kunst-ad-slots-container .advads-container, .kunst-ad-slots-container > div {
    width: 100%;
    flex: none;
  }
}

/* kunstart-news.css */
/* =============================================================================
 * Homepage component: kunst:art + news block (.ka-*)
 * Split from homepage.css (Issue #5). Homepage-only; enqueued after km-global.
 * ========================================================================== */

/* -----------------------------------------
   7. kunst:art + News block
   ----------------------------------------- */
.ka-news-block {
  display: flex;
  gap: 0;
  margin: 40px 0;
  clear: both;
  width: 100%;
}
/* Left column: 40% */
.ka-news-left {
  flex: 0 0 40%;
  /* This site has no global border-box reset, so the column must include its own
     padding + border in the 40% basis — otherwise the 30px padding + 1px border are
     ADDED to 40%, the row sums to >100% and the right column overflows the page. */
  box-sizing: border-box;
  padding-right: 30px;
  border-right: 1px solid var(--kunst-lines);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.ka-cover-image {
  width: 100%;
  margin-bottom: 20px;
}
.ka-cover-image a {
  display: block;
  width: 100%;
}
.ka-cover-image img {
  width: 100%;
  height: auto;
  display: block;
}
.ka-info {
  text-align: center;
}
.ka-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--kunst-text-dark);
  margin: 0 0 5px 0;
  letter-spacing: -0.5px;
}
.ka-subtitle {
  font-size: 15px;
  color: #666;
  margin: 0 0 20px 0;
  font-style: italic;
}
.ka-button {
  display: inline-block;
  background: var(--km-accent);
  color: #fff;
  padding: 12px 25px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
  transition: background 0.2s ease;
}
.ka-button:hover {
  background: var(--km-accent-hover);
  color: #fff;
}
/* Right column: 60% */
.ka-news-right {
  flex: 1 1 0; /* take the remaining width after the 40% left column; with border-box
                  below it can never overflow the row on sub-pixel rounding. */
  box-sizing: border-box;
  padding-left: 30px;
  min-width: 0;
}
.ka-news-right .mh-widget-title {
  margin-bottom: 20px;
}
.ka-news-right .mh-widget-title a {
  color: #333;
  text-decoration: none;
}
.ka-news-right .mh-widget-title a:hover {
  color: var(--km-accent);
}
.ka-news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ka-news-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--kunst-lines);
}
.ka-news-item:last-child {
  border-bottom: none;
}
.ka-news-item a {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: #333;
  text-decoration: none;
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
.ka-news-item a:hover {
  color: var(--km-accent);
}


/* Stack on tablet/iPad too (was <=767px): the 40/60 split is cramped below ~1024px.
   Consistent with the news grid + Meistgelesen tablet breakpoints. */
@media screen and (max-width: 1024px) {
  .ka-news-block {
    flex-direction: column;
  }
  .ka-news-left {
    flex: none;
    width: 100%;
    padding-right: 0;
    padding-bottom: 30px;
    margin-bottom: 30px;
    border-right: none;
    border-bottom: 1px solid var(--kunst-lines);
  }
  .ka-news-right {
    flex: none;
    width: 100%;
    padding-left: 0;
  }
  .ka-title {
    font-size: 24px;
  }
}

/* news-list.css */
/* =============================================================================
 * Homepage component: News list grid (.kunst-news-list-container, .kunst-list-*, .kunst-sub-title)
 * Split from homepage.css (Issue #5). Homepage-only; enqueued after km-global.
 * ========================================================================== */

/* -----------------------------------------
   8. News list grid (kunst-news-list-container)
   ----------------------------------------- */
.kunst-news-list-container {
  --kunst-accent: #9a1815;
  --kunst-lines: #e0e0e0;
  padding-top: 30px;
  margin-bottom: 40px;
  clear: both;
  width: 100%;
}
/* Hide duplicate widget title */
.kunst-news-list-container .mh-widget-title {
  display: none;
}
.kunst-list-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.kunst-list-item {
  background: transparent;
  border: none;
  position: relative;
  margin-bottom: 30px;
  padding-top: 5px;
  padding-left: 25px;
  padding-right: 25px;
  min-height: 120px;
  box-sizing: border-box;
  min-width: 0; /* grid item must be allowed to shrink, else long titles overflow the divider */
  overflow-wrap: break-word;
}
/* Edge alignment */
.kunst-list-item:nth-child(3n+1) {
  padding-left: 0;
  padding-right: 25px;
}
.kunst-list-item:nth-child(3n) {
  padding-left: 25px;
  padding-right: 0;
}
/* Horizontal divider (first row) */
.kunst-list-item:nth-child(-n+3) {
  border-bottom: 1px solid var(--kunst-lines);
  padding-bottom: 25px;
  margin-bottom: 25px;
}
/* Vertical dividers */
.kunst-list-item:not(:nth-child(3n))::after {
  content: "";
  position: absolute;
  right: 0;
  width: 1px;
  background-color: var(--kunst-lines);
}
/* Top row: line from top to near horizontal divider */
.kunst-list-item:nth-child(-n+3):not(:nth-child(3n))::after {
  top: 0;
  bottom: 12px;
}
/* Bottom row: line starts after horizontal divider */
.kunst-list-item:nth-child(n+4):not(:nth-child(3n))::after {
  top: -13px;
  bottom: 0;
}
a.kunst-list-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  overflow-wrap: break-word;
}
.kunst-sub-title {
  display: block;
  min-height: 18px;
  height: 18px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--kunst-accent);
  line-height: 18px;
  visibility: visible;
}
.kunst-sub-title:empty {
  visibility: hidden;
}
.kunst-list-title {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  margin: 0;
  color: #000;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kunst-list-title:hover {
  color: var(--kunst-accent);
}


/* Tablet (incl. iPad, 601–1024px): 2 columns — the 3-column divider grid is too
   cramped here. The 3-column nth-child(3n)/(-n+3) edge + divider rules are
   neutralised; rows are separated by a bottom border, no vertical grid lines.
   Phones (<=600px) drop to a single column below. */
@media screen and (min-width: 601px) and (max-width: 1024px) {
  .kunst-list-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
  .kunst-list-item,
  .kunst-list-item:nth-child(3n+1),
  .kunst-list-item:nth-child(3n) {
    padding: 0 25px 20px 25px;
    margin-bottom: 20px;
    min-height: auto;
    border-bottom: 1px solid var(--kunst-lines);
  }
  .kunst-list-item:nth-child(-n+3) {
    padding-bottom: 20px;
    margin-bottom: 20px;
  }
  .kunst-list-item:nth-child(odd) {
    padding-left: 0;
  }
  .kunst-list-item:nth-child(even) {
    padding-right: 0;
  }
  .kunst-list-item::after {
    display: none;
  }
}

@media screen and (max-width: 600px) {
  .kunst-list-wrapper {
    grid-template-columns: 1fr;
  }
  .kunst-news-list-container {
    padding-top: 20px;
  }
  .kunst-list-item,
  .kunst-list-item:nth-child(3n+1),
  .kunst-list-item:nth-child(3n) {
    border-bottom: 1px solid var(--kunst-lines);
    margin-bottom: 20px;
    padding-bottom: 20px;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
    min-height: auto;
  }
  .kunst-list-item:last-child {
    border-bottom: none;
  }
  .kunst-list-item::after {
    display: none;
  }
  .kunst-sub-title {
    min-height: auto;
    height: auto;
  }
}

/* article-lists.css */
/* =============================================================================
 * Homepage component: Article list widgets / "Weitere Ausstellungen" (.sza1-*)
 * Split from homepage.css (Issue #5). Homepage-only; enqueued after km-global.
 * ========================================================================== */

/* -----------------------------------------
   10. Article list widgets (sza1-widget)
   ----------------------------------------- */
.sza1-widget {
  margin: 40px 0;
  clear: both;
  width: 100%;
}
.sza1-liste {
  margin-top: 20px;
}
.sza1-item {
  display: flex;
  flex-direction: row-reverse; /* image LEFT, text RIGHT (DOM order is content, then image) */
  align-items: flex-start;
  gap: 30px;
  padding: 30px 0;
  border-bottom: 1px solid var(--kunst-lines);
  cursor: pointer;
  position: relative;
}
.sza1-item:first-child {
  padding-top: 0;
}
.sza1-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
/* Widget 1 and 2: last item keeps bottom border */
.sza1-widget-1 .sza1-item:last-child,
.sza1-widget-2 .sza1-item:last-child {
  border-bottom: 1px solid var(--kunst-lines);
  padding-bottom: 30px;
}
/* Invisible link overlay for right-click support */
.sza1-item-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}
.sza1-content,
.sza1-bild {
  position: relative;
  z-index: 2;
}
a.sza1-kategorie {
  position: relative;
  z-index: 3;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--km-accent);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-decoration: none;
}
a.sza1-kategorie:hover {
  text-decoration: underline;
}
.sza1-content {
  flex: 1;
  min-width: 0;
}
.sza1-titel {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px 0;
}
.sza1-titel a {
  color: #333;
  text-decoration: none;
}
.sza1-titel a:hover {
  color: var(--km-accent);
}
/* Date + author meta line — same content/format as the unified card (.km-card__meta). */
.sza1-meta {
  font-size: 14px;
  color: #999;
  margin: 0 0 12px;
}
.sza1-excerpt {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
}
.sza1-bild {
  flex-shrink: 0;
  width: 480px; /* +50% vs the former 320px — more room now that previews are longer */
}
.sza1-bild a {
  display: block;
}
.sza1-bild img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3 / 2; /* match the unified card images (km-card__img) */
  object-fit: cover;
}
/* AdSense ad with label */
.sza1-anzeige-wrapper {
  padding: 0;
  margin: 0;
  border-bottom: 1px solid var(--kunst-lines);
}
.sza1-anzeige-label {
  display: block;
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  padding-top: 20px;
}
.sza1-anzeige {
  min-height: 90px;
  padding: 0 0 20px 0;
  margin: 0;
}


@media screen and (min-width: 768px) and (max-width: 1024px) {
  .sza1-bild {
    width: 375px;
    /* +50% vs the former 250px, proportional to the desktop bump */;
  }
  .sza1-titel {
    font-size: 20px;
  }
}


@media screen and (max-width: 767px) {
  .sza1-item {
    flex-direction: column-reverse;
    gap: 15px;
    padding: 20px 0;
  }
  .sza1-bild {
    width: 100%;
  }
  .sza1-bild img {
    aspect-ratio: auto;
    object-fit: contain;
  }
  a.sza1-kategorie {
    display: none;
  }
  .sza1-titel {
    font-size: 18px;
  }
  .sza1-excerpt {
    font-size: 15px;
  }
  .sza1-anzeige-label {
    padding-top: 15px;
  }
  .sza1-anzeige {
    padding: 0 0 15px 0;
    min-height: 50px;
  }
  .sza1-widget-1 .sza1-item:last-child, .sza1-widget-2 .sza1-item:last-child {
    padding-bottom: 20px;
  }
}

/* art-fairs.css */
/* =============================================================================
 * Homepage component: Kunstmessen / art fairs (.km-sektion, .km-grid, .km-item, .km-*)
 * Split from homepage.css (Issue #5). Homepage-only; enqueued after km-global.
 * ========================================================================== */

/* -----------------------------------------
   12. Kunstmessen section
   ----------------------------------------- */
.km-sektion {
  margin: 40px 0;
  clear: both;
  width: 100%;
}
.km-sektion h3.mh-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #333;
  background: transparent;
  padding: 0 0 12px 0;
  margin: 0 0 25px 0;
  border-bottom: 2px solid var(--km-accent);
}
.km-sektion h3.mh-section-title a {
  color: #333;
  text-decoration: none;
}
.km-sektion h3.mh-section-title a:hover {
  color: var(--km-accent);
}
.km-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.km-item {
  display: flex;
  flex-direction: column;
}
.km-thumb {
  margin-bottom: 15px;
}
.km-thumb a {
  display: block;
}
.km-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.km-titel {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 8px 0;
}
.km-titel a {
  color: #333;
  text-decoration: none;
}
.km-titel a:hover {
  color: var(--km-accent);
}
.km-datum {
  font-size: 13px;
  color: #999;
  margin-bottom: 10px;
  display: block;
}
.km-excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: #666;
}


@media screen and (min-width: 768px) and (max-width: 1024px) {
  .km-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


@media screen and (max-width: 767px) {
  .km-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
}

/* newsletter-widget.css */
/* =============================================================================
 * Homepage component: Newsletter home widget (#kl_home_widget + .kl-modal*)
 * Split from homepage.css (Issue #5). Enqueued homepage-only via km_enqueue_styles
 * after km-global. Namespace: #kl_home_widget, .kl-overlay, .kl-modal*.
 * ========================================================================== */

/* -----------------------------------------
   13. Newsletter home widget (kl_home_widget)
   ----------------------------------------- */
#kl_home_widget {
  background: linear-gradient(135deg, #fafafa, #f0f0f0);
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 35px 40px;
  margin: 40px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  font-family: 'Open Sans', -apple-system, sans-serif;
}

#kl_home_widget * {
  box-sizing: border-box;
}

#kl_home_widget .kl-content {
  padding-right: 20px;
}

#kl_home_widget .kl-badge {
  display: inline-block;
  background: var(--km-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 5px 12px;
  border-radius: 3px;
  margin-bottom: 15px;
}

#kl_home_widget .kl-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--kunst-text-dark);
  margin: 0 0 12px;
}

#kl_home_widget .kl-title em {
  font-style: italic;
  color: var(--km-accent);
}

#kl_home_widget .kl-desc {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
  margin: 0 0 18px;
}

#kl_home_widget .kl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: #666;
}

#kl_home_widget .kl-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

#kl_home_widget .kl-meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--km-accent);
  flex-shrink: 0;
}

#kl_home_widget .kl-meta-item strong {
  color: #333;
  font-weight: 600;
}

/* Form box */
#kl_home_widget .kl-form-box {
  background: #fff;
  border-radius: 4px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e8e8;
  max-width: 400px;
  width: 100%;
  min-width: 320px;
  margin: 0 auto;
}

#kl_home_widget .kl-form-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--kunst-text-dark);
  margin: 0 0 6px;
  text-align: center;
}

#kl_home_widget .kl-form-sub {
  font-size: 13px;
  color: #888;
  margin: 0 0 20px;
  text-align: center;
}

#kl_home_widget .kl-gender {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}

#kl_home_widget .kl-gender.hidden {
  display: none;
}

#kl_home_widget .kl-gender label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}

#kl_home_widget .kl-gender input[type="radio"] {
  accent-color: var(--km-accent);
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

#kl_home_widget .kl-names {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

#kl_home_widget .kl-names.hidden {
  display: none;
}

#kl_home_widget .kl-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
  transition: 0.2s;
}

#kl_home_widget .kl-input:focus {
  outline: none;
  border-color: var(--km-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(154, 24, 21, 0.08);
}

#kl_home_widget .kl-input._err {
  border-color: #e53935;
}

#kl_home_widget .kl-group {
  margin-bottom: 10px;
}

#kl_home_widget .kl-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--km-accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 4px;
}

#kl_home_widget .kl-btn:hover {
  background: var(--km-accent-hover);
}

#kl_home_widget .kl-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#kl_home_widget .kl-btn.loading {
  color: transparent;
  position: relative;
}

#kl_home_widget .kl-btn.loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: klSpin 0.8s linear infinite;
}

@keyframes klSpin {
  to { transform: rotate(360deg); }
}

#kl_home_widget .kl-privacy {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-top: 14px;
}

#kl_home_widget .kl-privacy a {
  color: #666;
  text-decoration: underline;
}

#kl_home_widget .kl-err {
  background: #fff5f5;
  color: #c53030;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 12px;
  display: none;
  border: 1px solid #feb2b2;
}

#kl_home_widget .kl-err.show {
  display: block;
}

#kl_home_widget.variant-b .kl-input {
  padding: 14px 16px;
  font-size: 15px;
}

/* Success modal */
.kl-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 20px;
}

.kl-overlay.show {
  display: flex;
}

.kl-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  max-width: 420px;
  width: 100%;
  position: relative;
  overflow: hidden;
  font-family: 'Open Sans', -apple-system, sans-serif;
  animation: klModalIn 0.3s ease;
}

@keyframes klModalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.kl-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  z-index: 10;
}

.kl-modal-close:hover {
  background: #e8e8e8;
  transform: rotate(90deg);
}

.kl-modal-close svg {
  width: 18px;
  height: 18px;
  color: #666;
}

.kl-modal-head {
  background: linear-gradient(135deg, #f8f8f8, #f0f0f0);
  padding: 40px 30px 30px;
  text-align: center;
  border-bottom: 1px solid #e8e8e8;
}

.kl-modal-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--kunst-text-dark);
  margin: 0;
}

.kl-modal-body {
  padding: 30px;
  text-align: center;
}

.kl-modal-text {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
  margin: 0 0 20px;
}

.kl-modal-info {
  background: #fef9e7;
  border: 1px solid #f5d76e;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.kl-modal-info svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #d4a000;
}

.kl-modal-info-text {
  font-size: 13px;
  color: #856404;
  line-height: 1.5;
}

.kl-modal-info-text strong {
  display: block;
  margin-bottom: 2px;
  color: #6d5200;
}

.kl-modal-foot {
  padding: 0 30px 30px;
  text-align: center;
}

.kl-modal-btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--km-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.kl-modal-btn:hover {
  background: var(--km-accent-hover);
  transform: translateY(-1px);
}

/* Newsletter home widget responsive */
@media (max-width: 800px) {
  #kl_home_widget {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 25px 20px;
  }
  #kl_home_widget .kl-content {
    padding: 0;
    text-align: center;
  }
  #kl_home_widget .kl-meta {
    justify-content: center;
  }
  #kl_home_widget .kl-title {
    font-size: 22px;
  }
  #kl_home_widget .kl-title br {
    display: none;
  }
  #kl_home_widget .kl-form-box {
    min-width: auto;
    max-width: 400px;
    width: 100%;
  }
}

@media (max-width: 480px) {
  #kl_home_widget .kl-names {
    grid-template-columns: 1fr;
  }
  #kl_home_widget .kl-meta {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  #kl_home_widget .kl-gender {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .kl-modal {
    margin: 10px;
    border-radius: 12px;
  }
  .kl-modal-head {
    padding: 30px 20px 25px;
  }
  .kl-modal-body, .kl-modal-foot {
    padding: 25px 20px;
  }
  .kl-modal-title {
    font-size: 24px;
  }
}

/* newsletter-popup.css */
/* =============================================================================
 * Homepage component: Newsletter popup (floating card, .kl-popup-*)
 * Split from homepage.css (Issue #5). Enqueued homepage-only via km_enqueue_styles
 * after km-global. Namespace: .kl-popup-*.
 * ========================================================================== */

/* -----------------------------------------
   14. Newsletter popup (floating card)
   ----------------------------------------- */
.kl-popup-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999998;
  opacity: 0;
  transform: translateY(100px);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
}

.kl-popup-wrap.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.kl-popup-card {
  width: 380px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  position: relative;
}

.kl-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  z-index: 10;
}

.kl-popup-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: rotate(90deg);
}

.kl-popup-close svg {
  width: 16px;
  height: 16px;
  color: #666;
}

.kl-popup-header {
  background: linear-gradient(135deg, #fafafa, #f0f0f0);
  padding: 24px 24px 20px;
  border-bottom: 1px solid #e8e8e8;
}

.kl-popup-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--kunst-text-dark);
  margin: 0 0 6px;
  padding-right: 30px;
}

.kl-popup-subtitle {
  font-size: 13px;
  color: #666;
  margin: 0;
}

.kl-popup-body {
  padding: 20px 24px 24px;
}

.kl-popup-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.kl-popup-benefits li {
  font-size: 12px;
  color: #555;
  background: #f5f5f5;
  padding: 4px 10px;
  border-radius: 12px;
}

.kl-popup-benefits li::before {
  content: "\2713 ";
  color: var(--km-accent);
  font-weight: 600;
}

.kl-popup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kl-popup-err {
  background: #fff5f5;
  color: #c53030;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  display: none;
  border: 1px solid #feb2b2;
}

.kl-popup-err.show {
  display: block;
}

.kl-popup-variant-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kl-popup-variant-fields.hidden {
  display: none;
}

.kl-popup-gender {
  display: flex;
  gap: 14px;
}

.kl-popup-gender-opt {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kl-popup-gender-opt input[type="radio"] {
  accent-color: var(--km-accent);
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.kl-popup-gender-opt label {
  font-size: 12px;
  color: #555;
  cursor: pointer;
}

.kl-popup-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.kl-popup-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fafafa;
  box-sizing: border-box;
  transition: 0.2s;
}

.kl-popup-input:focus {
  outline: none;
  border-color: var(--km-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(154, 24, 21, 0.08);
}

.kl-popup-input._err {
  border-color: #e53935;
}

.kl-popup-submit {
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--km-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  position: relative;
}

.kl-popup-submit:hover {
  background: var(--km-accent-hover);
}

.kl-popup-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.kl-popup-submit.loading {
  color: transparent;
}

.kl-popup-submit.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: klPopupSpin 0.8s linear infinite;
}

@keyframes klPopupSpin {
  to { transform: rotate(360deg); }
}

.kl-popup-privacy {
  font-size: 10px;
  color: #999;
  text-align: center;
  margin: 10px 0 0;
  line-height: 1.4;
}

.kl-popup-privacy a {
  color: #666;
  text-decoration: underline;
}

/* Popup success state */
.kl-popup-success {
  display: none;
}

.kl-popup-success.show {
  display: block;
}

.kl-popup-success-header {
  background: linear-gradient(135deg, #f8f8f8, #f0f0f0);
  padding: 30px 24px 24px;
  text-align: center;
  border-bottom: 1px solid #e8e8e8;
}

.kl-popup-success-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--kunst-text-dark);
  margin: 0;
}

.kl-popup-success-body {
  padding: 24px;
  text-align: center;
}

.kl-popup-success-text {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  margin: 0 0 16px;
}

.kl-popup-success-info {
  background: #fef9e7;
  border: 1px solid #f5d76e;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
}

.kl-popup-success-info svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #d4a000;
  margin-top: 1px;
}

.kl-popup-success-info-text {
  font-size: 12px;
  color: #856404;
  line-height: 1.4;
}

.kl-popup-success-info-text strong {
  display: block;
  margin-bottom: 2px;
  color: #6d5200;
}

.kl-popup-success-footer {
  padding: 0 24px 24px;
  text-align: center;
}

.kl-popup-success-btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--km-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.kl-popup-success-btn:hover {
  background: var(--km-accent-hover);
}

/* Newsletter popup — very small screens */
@media screen and (max-width: 480px) {
  .kl-popup-wrap {
    bottom: 10px;
    right: 10px;
    left: 10px;
  }
  .kl-popup-card {
    width: 100%;
    max-width: none;
  }
  .kl-popup-name-row {
    grid-template-columns: 1fr;
  }
  .kl-popup-header {
    padding: 20px 20px 16px;
  }
  .kl-popup-body {
    padding: 16px 20px 20px;
  }
  .kl-popup-title {
    font-size: 20px;
  }
  .kl-popup-success-header {
    padding: 24px 20px 20px;
  }
  .kl-popup-success-title {
    font-size: 22px;
  }
  .kl-popup-success-body, .kl-popup-success-footer {
    padding: 20px;
  }
}

/* sidebar.css */
/* =============================================================================
 * Homepage component: News widget sidebar adjustments (#mh_magazine_custom_posts-*, .mh-home-6 .mh-custom-posts-*)
 * Split from homepage.css (Issue #5). Homepage-only; enqueued after km-global.
 * ========================================================================== */

/* -----------------------------------------
   15. News widget sidebar adjustments
   ----------------------------------------- */
#mh_magazine_custom_posts-21 .mh-meta,
#mh_magazine_custom_posts-21 .mh-custom-posts-meta,
.mh-home-6 .mh-custom-posts-meta {
  display: none;
}
#mh_magazine_custom_posts-21 .mh-custom-posts-item,
.mh-home-6 .mh-custom-posts-item {
  border-bottom: 1px solid var(--kunst-lines);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
#mh_magazine_custom_posts-21 .mh-custom-posts-item:last-child,
.mh-home-6 .mh-custom-posts-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

