/* === GRID – 5 Spalten, gleiche Höhe === */
.kirchen-grid-c {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: stretch;
}

/* === KACHEL BASIS === */
.kirchen-kachel-c {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(6px);
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.10);
    overflow: hidden;
    text-align: center;
    transition: transform .35s ease, box-shadow .35s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    cursor: pointer;
    height: 100%;          /* wichtig für gleiche Höhe */
}

/* Hover-Hub */
.kirchen-kachel-c:hover {
    transform: translateY(-10px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.22);
}

/* Farbverläufe oben/unten */
.kirchen-kachel-c::before,
.kirchen-kachel-c::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 14px;
    z-index: 1;
    opacity: .9;
    transition: opacity .35s ease, height .35s ease;
}
.kirchen-kachel-c::before { top: 0; border-radius: 18px 18px 0 0; }
.kirchen-kachel-c::after  { bottom: 0; border-radius: 0 0 18px 18px; }

/* === Farben pro Kachel === */
.kirchen-kachel-c:nth-child(1)::before { background: linear-gradient(to bottom, #A8C65F, transparent); }
.kirchen-kachel-c:nth-child(1)::after  { background: linear-gradient(to top,    #A8C65F, transparent); }

.kirchen-kachel-c:nth-child(2)::before { background: linear-gradient(to bottom, #E14242, transparent); }
.kirchen-kachel-c:nth-child(2)::after  { background: linear-gradient(to top,    #E14242, transparent); }

.kirchen-kachel-c:nth-child(3)::before { background: linear-gradient(to bottom, #457BBD, transparent); }
.kirchen-kachel-c:nth-child(3)::after  { background: linear-gradient(to top,    #457BBD, transparent); }

.kirchen-kachel-c:nth-child(4)::before { background: linear-gradient(to bottom, #F2C94C, transparent); }
.kirchen-kachel-c:nth-child(4)::after  { background: linear-gradient(to top,    #F2C94C, transparent); }

.kirchen-kachel-c:nth-child(5)::before { background: linear-gradient(to bottom, #B7B7B7, transparent); }
.kirchen-kachel-c:nth-child(5)::after  { background: linear-gradient(to top,    #B7B7B7, transparent); }

.kirchen-kachel-c:hover::before,
.kirchen-kachel-c:hover::after {
    opacity: 1;
    height: 18px;
}

/* === Bild === */
.kirchen-kachel-c img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform .5s ease, filter .35s ease;
    border-radius: 18px 18px 0 0;
}
.kirchen-kachel-c:hover img {
    transform: scale(1.10);
    filter: brightness(.75);
}

/* === Titel === */
.kirchen-kachel-c h3 {
    font-family: "Open Sans", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1rem 0 .25rem 0;
    color: #333;
    position: relative;
    z-index: 2;
    display: inline-block;
    padding-bottom: .25rem;
}

/* farbiger Balken unter dem Titel */
.kirchen-kachel-c h3::after {
    content: "";
    display: block;
    height: 3px;
    width: 60%;
    margin: .4rem auto 0;
    border-radius: 2px;
}
.kirchen-kachel-c:nth-child(1) h3::after { background-color: #A8C65F; }
.kirchen-kachel-c:nth-child(2) h3::after { background-color: #E14242; }
.kirchen-kachel-c:nth-child(3) h3::after { background-color: #457BBD; }
.kirchen-kachel-c:nth-child(4) h3::after { background-color: #F2C94C; }
.kirchen-kachel-c:nth-child(5) h3::after { background-color: #B7B7B7; }

/* === Text === */
.kirchen-kachel-c p {
    font-family: "Open Sans", sans-serif;
    color: #333;
    font-weight: 400;
    margin: .75rem 0 .75rem;
    padding: 0 .75rem;
    line-height: 1.5;
    font-size: .95rem;
    position: relative;
    z-index: 2;
    flex-grow: 1;           /* sorgt dafür, dass der Button nach unten gedrückt wird */
}

/* === Button === */
.kirchen-kachel-c .button {
    display: inline-block;
    margin: .75rem 0 1rem;
    padding: .5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-family: "Open Sans", sans-serif;
    font-size: .9rem;
    transition: background .3s ease, transform .3s ease, box-shadow .3s ease;
    position: relative;
    z-index: 2;
    color: #fff;
}

/* Button-Farbe je Kachel */
.kirchen-kachel-c:nth-child(1) .button { background: #A8C65F; }
.kirchen-kachel-c:nth-child(2) .button { background: #E14242; }
.kirchen-kachel-c:nth-child(3) .button { background: #457BBD; }
.kirchen-kachel-c:nth-child(4) .button { background: #F2C94C; color:#333; }
.kirchen-kachel-c:nth-child(5) .button { background: #B7B7B7; }

/* Hover-States Buttons */
.kirchen-kachel-c:nth-child(1) .button:hover { background: #8EB74A; }
.kirchen-kachel-c:nth-child(2) .button:hover { background: #C22F2F; }
.kirchen-kachel-c:nth-child(3) .button:hover { background: #3367A1; }
.kirchen-kachel-c:nth-child(4) .button:hover { background: #E5BB2E; color:#333; }
.kirchen-kachel-c:nth-child(5) .button:hover { background: #999999; transform: scale(1.05); }

/* Extra-Schatten in der passenden Farbe */
.kirchen-kachel-c:nth-child(1):hover { box-shadow: 0 14px 32px rgba(0,0,0,.22), inset 0 0 0 6px rgba(168,198,95,.28); }
.kirchen-kachel-c:nth-child(2):hover { box-shadow: 0 14px 32px rgba(0,0,0,.22), inset 0 0 0 6px rgba(225,66,66,.28); }
.kirchen-kachel-c:nth-child(3):hover { box-shadow: 0 14px 32px rgba(0,0,0,.22), inset 0 0 0 6px rgba(69,123,189,.28); }
.kirchen-kachel-c:nth-child(4):hover { box-shadow: 0 14px 32px rgba(0,0,0,.22), inset 0 0 0 6px rgba(242,201,76,.28); }
.kirchen-kachel-c:nth-child(5):hover { box-shadow: 0 14px 32px rgba(0,0,0,.22), inset 0 0 0 6px rgba(183,183,183,.30); }

/* Modal-Styles bleiben wie in deiner aktuellen Datei – NICHT angefasst */
/* ============================
   MODAL FÜR KIRCHENKACHELN
   ============================ */
.kirchen-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;              /* JS setzt auf "flex" */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.kirchen-modal {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    max-width: 720px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.kirchen-modal-topbar {
    height: 6px;
    width: 100%;
    background: #4a6741; /* wird per JS überschrieben */
}

.kirchen-modal-close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 26px;
    cursor: pointer;
    color: #777;
    z-index: 2;
}
.kirchen-modal-close:hover {
    color: #333;
}

.kirchen-modal img#km-img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
}

.kirchen-modal h2#km-title {
    font-size: 1.5rem;
    margin: 1.2rem 1.5rem 0.3rem;
    text-align: left;
}

.kirchen-modal-place {
    margin: 0 1.5rem 0.8rem;
    color: #666;
    font-size: 0.95rem;
}

.kirchen-modal p#km-text,
.kirchen-modal textarea#km-editor {
    margin: 0 1.5rem 1rem;
    font-size: 0.96rem;
    line-height: 1.6;
}

.kirchen-modal textarea#km-editor {
    width: calc(100% - 3rem);
    min-height: 140px;
    padding: .75rem;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-family: inherit;
    resize: vertical;
}

.kirchen-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0 1.5rem 1.5rem;
    justify-content: flex-end;
}

.kirchen-modal-actions a.km-nav,
.kirchen-modal-actions a.km-page,
.kirchen-modal-actions button#km-edit,
.kirchen-modal-actions button#km-save {
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.kirchen-modal-actions a.km-nav {
    background: #4a6741;   /* wird per JS eingefärbt */
    color: #fff;
}

.kirchen-modal-actions a.km-page {
    background: #e5e7eb;
    color: #333;
}

.kirchen-modal-actions button#km-edit {
    background: #2563eb;
    color: #fff;
}

.kirchen-modal-actions button#km-save {
    background: #16a34a;
    color: #fff;
}

/* etwas Mobile-Feintuning */
@media (max-width: 600px) {
    .kirchen-modal {
        max-height: 95vh;
    }
    .kirchen-modal-actions {
        justify-content: center;
    }
}
/* Oberer Bildbereich im Modal */
.kirchen-modal img#km-img {
    width: 100%;
    height: 260px;               /* Höhe des Bildrahmens – kannst du anpassen */
    object-fit: contain;         /* zeigt das ganze Bild ohne Beschnitt */
    background: #f5f5f5;         /* dezenter Hintergrund für leere Bereiche */
    border-radius: 12px 12px 0 0;/* runde obere Ecken */
    padding: 0.75rem;            /* Abstand, damit es edel wirkt */
    box-sizing: border-box;
}
/* 16:9 Bildfläche im Modal */
.kirchen-modal img#km-img {
    width: 100%;
    aspect-ratio: 16 / 9;        /* zwingt das Bild in 16:9 */
    object-fit: contain;         /* Bild vollständig sichtbar */
    background: #f5f5f5;         /* dezente Fläche wenn Seitenränder entstehen */
    border-radius: 12px 12px 0 0;
    padding: 0.75rem;
    box-sizing: border-box;
}
