:root {
    --cfc-beige: #b99c96;
    --cfc-blue: #20497E;
    --cfc-yellow: #FBCA41;
    --cfc-green: #2FA17F;
    --cfc-red: #E90E4C;
    --cfc-brown: #5D5050;
    --cfc-white: #fff;
    --cfc-toolbox-inset: 1rem;
}

.kachel-farbe-gruen .elementor-widget-theme-post-content { color: #2FA17F; }
.kachel-farbe-gruen .elementor-button  { background-color: #2FA17F; color: #fff; }

.kachel-farbe-rot .elementor-widget-theme-post-content { color: #E90E4C; }
.kachel-farbe-rot .elementor-button  { background-color: #E90E4C; color: #fff; }

.kachel-farbe-blau .elementor-widget-theme-post-content { color: #20497E; }
.kachel-farbe-blau .elementor-button  { background-color: #20497E; color: #fff; }

.kachel-farbe-braun .elementor-widget-theme-post-content { color: #5D5050; }
.kachel-farbe-braun .elementor-button  { background-color: #5D5050; color: #fff; }

.kachel-datum-leer .kachel-datum { display: none; }

.kachel-datum {
  font-size: 1.2rem;
  color: #373a3d !important;
  margin-top: .75rem !important;
  
  &:hover {
    color: #373a3d !important;
  }
}

a.kachel {
    transition-duration: 0.1s !important;
    
    &:active {
        transform: scale(0.99);
    }
    
    p {
      margin: 0 !important;
      margin-block-end: 0 !important;
    }
  
    .details-link {
      margin-top: auto;
      
      p {
        font-size: 1.3rem;
        line-height: 50px;
      }
    }
}

.kachel-farbe-gruen .details-link { background-color: #2FA17F; color: #fff; }
.kachel-farbe-rot .details-link { background-color: #E90E4C; color: #fff; }
.kachel-farbe-blau .details-link { background-color: #20497E; color: #fff; }
.kachel-farbe-braun .details-link { background-color: #5D5050; color: #fff; }

.elementor-459 .elementor-loop-container {
  justify-content: center;
}

.elementor-1864 {
	max-width: 320px;
}

.e-loop-item * {
  word-break: break-word;
  /*hyphens: auto;*/
}

[hidden] {
    display: none !important;
}

/* Shared button reset */
.cfc-subpage-btn,
.cfc-modal-btn,
.cfc-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    padding: 1.75rem 1.4rem !important;
    border: none;
    border-radius: 15px;
    box-sizing: border-box;
    font-size: 24px !important;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition-duration: 0.1s !important;
    color: var(--cfc-white) !important;
    white-space: normal;
    cursor: pointer;
}

.cfc-subpage-btn,
.cfc-modal-btn {
    &:active {
        transform: scale(0.98);
    }
}

/* Subpage + Tool buttons: beige */
.cfc-subpage-btn,
.cfc-tool-btn {
    background: var(--cfc-beige);
    
    &:hover {
      background: var(--cfc-red);
    }
}

/* Modal buttons: blau */
.cfc-modal-btn {
    background: var(--cfc-blue);
}

/* Button grids */
.cfc-subpages,
.cfc-modals,
.cfc-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Tools item: relative for star positioning */

.cfc-tools {
    margin-block-start: 2.5rem !important;
    margin-block-end: 2.5rem !important;
}

.cfc-tools__item {
    position: relative;
    height: 100%;
    --btn-scale: 1;
    --star-scale: 1;

    &:active {
        --btn-scale: 0.96;
        --star-scale: 0.96;
    }

    &:has(.cfc-star-btn:active) {
        --btn-scale: 1;
        --star-scale: 0.94;
    }
}

.cfc-tool-btn {
    transform: scale(var(--btn-scale));
}

.cfc-star-btn {
    position: absolute;
    top: -1.9rem;
    right: -1.5rem;
    padding: 0;
    border: none;
    background: none;
    line-height: 0;
    cursor: pointer;
    outline: none;
    transform: scale(var(--star-scale));
    
    &:focus, &:hover, &:active {
      background-color: transparent !important;
    }
}

.cfc-star-btn__icon {
    width: 4rem;
    height: 4rem;
}

/* Tool help label */
.cfc-tool-help {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cfc-tool-help__icon {
    width: 4rem;
    height: 4rem;
}

/* Modal — base (shared by all modals) */
.cfc-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.cfc-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.cfc-modal__overlay,
.cfc-toolbox-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.cfc-modal__container,
.cfc-toolbox-modal__container {
    position: relative;
    width: 90%;
    border-radius: 8px;
    background: var(--cfc-white);
    overflow-y: auto;
    transform: translateY(1rem);
    transition: transform .25s ease;
}

.cfc-modal.is-open .cfc-modal__container,
.cfc-modal.is-open .cfc-toolbox-modal__container {
    transform: translateY(0);
}

.cfc-modal__close,
.cfc-toolbox-modal__close {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: .5rem;
    right: .5rem;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    aspect-ratio: 1;
}

/* Modal — large variant */
.cfc-modal__container {
    max-width: 720px;
    max-height: 80vh;
    padding: 2rem;
}

.cfc-modal__close {
    font-size: 1.5rem;
}

/* Toolbox */
.cfc-toolbox {
    position: fixed;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Bottom positions: toggle at bottom, panel opens upward */
.cfc-toolbox[data-position="bottom-right"],
.cfc-toolbox[data-position="bottom-left"] {
    flex-direction: column-reverse;
}

.cfc-toolbox[data-position="bottom-right"] {
    bottom: var(--cfc-toolbox-inset);
    right: var(--cfc-toolbox-inset);
}

.cfc-toolbox[data-position="bottom-left"] {
    bottom: var(--cfc-toolbox-inset);
    left: var(--cfc-toolbox-inset);
    align-items: flex-start;
}

.cfc-toolbox[data-position="top-right"] {
    top: var(--cfc-toolbox-inset);
    right: var(--cfc-toolbox-inset);
}

.cfc-toolbox[data-position="top-left"] {
    top: var(--cfc-toolbox-inset);
    left: var(--cfc-toolbox-inset);
    align-items: flex-start;
}

.cfc-toolbox__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 50%;
    background: var(--cfc-red);
    font-size: 1.25rem;
    color: var(--cfc-white);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

    img {
        max-width: unset;
    }

    &:active {
        transform: scale(0.96);
    }
}

.cfc-toolbox__icon {
    width: 2rem;
    height: 2rem;
}

.cfc-toolbox__panel {
    min-width: 200px;
    margin: .5rem 0;
    padding: 1rem;
    border-radius: 8px;
    background: var(--cfc-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cfc-toolbox__heading {
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

.cfc-toolbox__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cfc-toolbox__list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 400;
}

.cfc-toolbox__list a {
    flex: 1;
    text-decoration: none;
    color: var(--cfc-blue);
}

.cfc-toolbox__list button {
    display: inline-flex
    align-items: center;
    justify-content: center;
    border: none;
    width: 35px;
    height: 35px;
    background: none;
    font-size: 20px;
    line-height: 35px;
    padding: 0;
    margin-left: 12px;
    cursor: pointer;
}

/* Modal — toolbox (small) variant overrides */
.cfc-toolbox-modal__container {
    max-width: 400px;
    max-height: 60vh;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.cfc-toolbox-modal__close {
    font-size: 1.25rem;
}

.cfc-toolbox-modal__title {
    margin: 0 0 .75rem;
}

.cfc-modal,
.cfc-toolbox-modal,
body:not([class*=elementor-page-]) .site-main .page-content { 
  h1, h2 {
    line-height: 1.1;
  }
  
  h3 {
    padding-bottom: 0 !important;
  }
  
  ul li::before {
    position: relative;
    margin-left: -1rem;
    margin-right: 8px;
    display: inline-block;
    line-height: 1;
    content: "\f111";
    font-family: "Font Awesome 6 Free";
    font-size: 0.5rem;
    font-weight: 900;
    top: 50%;
    transform: translateY(-43%);
  }
  
  ul {
    margin: 0 0 1rem 0;
  }
  
  ul, ol {
    margin-top: .25rem;
    margin-bottom: 2rem;
  }
  
  ol {
    margin-left: 20px;
  }

  ul li {
    margin: 0 0 0 0.92em;
    padding: 0;
  }
  
  ol li::marker {
    font-weight: bold;
  }
  
  ul > li > ul {
    margin-bottom: 0;
  }
  
  ol > li > ul {
    margin-bottom: .5rem;
  }
}

@media print {
    .cfc-toolbox,
    .cfc-toolbox__toggle {
        display: none !important;
    }

    body.cfc-modal-is-open .site-main, 
    body.cfc-modal-is-open .site-header,
    body.cfc-modal-is-open .mobile-navi,
    body.cfc-modal-is-open .page-title-container,
    body.cfc-modal-is-open footer,
    body.cfc-modal-is-open .top-button-container
    {
        display: none !important;
    }
    
    .cfc-modal.is-open {
        position: static !important;
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
        width: 100% !important;
    }
    
    .cfc-modal__container {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        position: static !important;
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
        max-width: none !important;
        padding: 0;
        width: 100% !important;
        transform: none  !important;
    }

    .cfc-modal__close,
    .cfc-toolbox-modal__close {
        display: none !important;
    }
}

@media(max-width:575px) {
    body:not([class*=elementor-page-]) .site-main {
      padding-inline-end: 20px !important;
      padding-inline-start: 20px !important;
    }
}

@media(min-width:1200px) {
    body:not([class*=elementor-page-]) .site-main {
       max-width: 1094px !important;
    }
}