/* =========================================
   Global — Design tokens, resets & shared components
   ========================================= */

/* -----------------------------------------
   Design Tokens (CSS Custom Properties)
   ----------------------------------------- */
:root {
  /* Brand */
  --km-accent: #9a1815;
  --km-accent-hover: #7a1210;

  /* Text */
  --km-text: #333;
  --km-text-dark: #1a1a1a;
  --km-text-light: #4a5568;
  --km-text-muted: #9ca3af;

  /* Borders */
  --km-border: #d1d5db;
  --km-border-light: #e2e8f0;

  /* Surfaces */
  --km-bg-light: #f5f5f5;
  --km-lines: #e0e0e0;
}

/* Alias set used by homepage/widget CSS */
:root {
  --kunst-accent: var(--km-accent);
  --kunst-accent-hover: var(--km-accent-hover);
  --kunst-text: var(--km-text);
  --kunst-text-dark: var(--km-text-dark);
  --kunst-text-light: #666;
  --kunst-text-muted: #999;
  --kunst-lines: var(--km-lines);
  --kunst-bg-light: var(--km-bg-light);
}

/* -----------------------------------------
   Hide MH Magazine original chrome
   (we supply our own header / footer)
   ----------------------------------------- */
.mh-preheader,
.mh-header,
.mh-main-nav-wrap,
.mh-subheader,
.mh-header-mobile-nav,
[class*="mh-header"],
[class*="mh-preheader"],
.mh-footer,
.mh-footer-widget-area,
.mh-copyright-wrap,
[class*="mh-footer"],
[class*="mh-copyright"] {
  display: none;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  opacity: 0;
  max-height: 0;
  padding: 0;
  margin: 0;
}

/* -----------------------------------------
   Typography base
   ----------------------------------------- */
body {
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  color: var(--km-text);
  line-height: 1.7;
}

.mh-content,
.mh-excerpt,
.mh-loop-content,
article,
p {
  color: var(--km-text);
}

.mh-content p,
.mh-excerpt p,
.mh-loop-content p,
article p,
.entry-content p {
  line-height: 1.8;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.4;
}

h1, h2, h3, h4, h5, h6,
.mh-posts-title,
.mh-custom-posts-xl-title a,
.mh-custom-posts-small-title a,
.kunst-list-title {
  color: var(--km-text);
}

.kunst-list-title:hover,
.mh-custom-posts-xl-title a:hover,
.mh-custom-posts-small-title a:hover {
  color: var(--km-accent);
}

/* -----------------------------------------
   Global widget tweaks
   ----------------------------------------- */

/* Thinner red widget underline */
.mh-widget-title {
  border-bottom-width: 1px !important;
}

h4.mh-widget-title::after,
.mh-section-title::after {
  height: 2px;
}

/* Remove clock icon from date meta globally */
.mh-meta-date i.fa-clock-o,
.mh-custom-posts-meta i.fa-clock-o,
.mh-meta i.fa-clock-o,
span.mh-meta-date i,
.post-date i,
.mh-meta i.fa,
.mh-custom-posts-meta i.fa {
  display: none;
}

/* -----------------------------------------
   Shared clickable-card pattern
   ----------------------------------------- */
.kunst-hover-title {
  transition: color 0.2s ease;
}

.kunst-clickable:hover .kunst-hover-title {
  color: var(--km-accent);
}

.kunst-clickable {
  position: relative;
  cursor: pointer;
}

.kunst-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.kunst-link-overlay:focus-visible {
  outline: 2px solid var(--km-accent);
  outline-offset: 2px;
}

/* -----------------------------------------
   Section headers
   ----------------------------------------- */
.kunst-section-title {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 3px solid var(--km-accent);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.kunst-section-title a {
  color: inherit;
  text-decoration: none;
}

/* -----------------------------------------
   Date / meta helpers
   ----------------------------------------- */
.kunst-date,
.kunst-hero-date,
.kunst-cat-hero-date,
.kunst-category-item-date {
  font-size: 12px;
  color: var(--kunst-text-muted);
}

/* -----------------------------------------
   Ad containers & labels
   ----------------------------------------- */
.kunst-ad-slots-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.kunst-ad-slots-container a,
.vkk-ad a {
  display: block;
}

.kunst-ad-slots-container img,
.vkk-ad img,
.vkk-ad--sidebar img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.kunst-ad-label {
  display: block;
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.vkk-ad--sidebar {
  margin-bottom: 20px;
}

/* -----------------------------------------
   Sticky sidebar (desktop + tablet)
   Breakpoint aligned to the MH-Magazine parent theme: the parent collapses the
   content/sidebar columns to a single column at max-width:767px, so the child's
   two-column override must begin at 768px (not 900px). Otherwise the 768-899px
   band leaves .mh-content pinned at 66% next to an empty sidebar => white gap.
   ----------------------------------------- */
@media only screen and (min-width: 768px) {
  /* Sub-pages: flexbox layout */
  body.mh-right-sb:not(.home) .mh-main {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
  }

  body.mh-right-sb:not(.home) .mh-content {
    width: 66% !important;
    margin-right: 0 !important;
    float: none !important;
  }

  body.mh-right-sb:not(.home) .mh-sidebar {
    width: 32% !important;
    float: none !important;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 80px !important;
    bottom: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Homepage: keep float, just make sidebar sticky */
  .home .mh-sidebar {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 80px !important;
    z-index: 10 !important;
  }
}

/* Allow sticky to work (parent containers must not clip) */
.mh-content,
.mh-content-inner,
.mh-widget,
.textwidget,
.widget_text {
  overflow: visible;
}

/* -----------------------------------------
   Mobile ad (full-bleed)
   ----------------------------------------- */
@media (max-width: 768px) {
  .kunst-hero-ads {
    margin-top: 20px;
  }

  .kunst-ad-slots-container img,
  .vkk-ad img {
    width: 100%;
    max-width: 100%;
  }
}

/* -----------------------------------------
   Lazy-load image intrinsic size hint
   ----------------------------------------- */
img:is([sizes="auto" i], [sizes^="auto," i]) {
  contain-intrinsic-size: 3000px 1500px;
}

/* -----------------------------------------
   Newsletter e-mail inputs — unified size (global)
   These inputs are otherwise styled per page (homepage.css, snapshot CSS,
   popup) which left them inconsistent / too small off the homepage. One global
   rule keeps them comfortable everywhere; 16px font also prevents the iOS
   focus-zoom. The homepage widget keeps its own #kl_home_widget overrides.
   ----------------------------------------- */
.kl-input,
.kl-popup-input,
.kl-form-group input[type="email"],
.km-newsletter-strip__form input[type="email"],
#km-home-newsletter-email {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.4;
  box-sizing: border-box;
}

/* -----------------------------------------
   Complianz consent banner — skinned to the kunst:mag design
   Overrides Complianz's default look using our own design tokens so the
   banner matches the site (accent #9a1815, Open Sans / Cormorant, card shadow).
   The #cmplz-cookiebanner-container ID prefix wins over Complianz's class CSS.
   ----------------------------------------- */
#cmplz-cookiebanner-container .cmplz-cookiebanner {
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  background: #fff;
  color: var(--km-text);
  border: 1px solid var(--km-lines);
  border-radius: 10px;
  box-shadow: 0 10px 34px rgba(26, 26, 26, 0.14);
}
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--km-text-dark);
  font-weight: 700;
}
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-body,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-message {
  color: var(--km-text);
}
#cmplz-cookiebanner-container .cmplz-cookiebanner a {
  color: var(--km-accent);
}
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn {
  border-radius: 6px;
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  font-weight: 600;
}
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-accept,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-accept-all {
  background: var(--km-accent);
  border-color: var(--km-accent);
  color: #fff;
}
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-accept:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-accept-all:hover {
  background: var(--km-accent-hover);
  border-color: var(--km-accent-hover);
}
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-deny,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-view-preferences,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-save-preferences {
  background: #fff;
  border: 1px solid var(--km-accent);
  color: var(--km-accent);
}
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-deny:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-btn.cmplz-view-preferences:hover {
  background: var(--km-accent);
  color: #fff;
}
/* Category toggles use the accent colour */
#cmplz-cookiebanner-container .cmplz-cookiebanner input:checked + .cmplz-label .cmplz-slider,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-banner-checkbox input:checked ~ label::before {
  background-color: var(--km-accent);
  border-color: var(--km-accent);
}
