﻿/* Public pages (Pages/Show) and the page editor (Cms/Edit).
   Classes used in the stored page texts (Bootstrap examples "Heroes", "Features", "Custom cards"). */

.cms-page { padding: 0; }
.cms-content > :first-child:not(header):not(.container-fluid) { margin-top: 1rem; }
.cms-content img { max-width: 100%; height: auto; }

.card-cover {
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    min-height: 20rem;
}
.text-shadow-1 { text-shadow: 0 .125rem .25rem rgba(0, 0, 0, .45); }

.icon-square {
    width: 3rem;
    height: 3rem;
    border-radius: .75rem;
}

.features-icons-icon {
    height: 4.5rem;
    font-size: 3rem;
    margin-bottom: 1rem;
}
.testimonial-item { max-width: 22rem; }

.lc-team-photo {
    width: 150px;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bs-secondary-bg);
}

/* --------------------------------------------------------------------- editor */

.cms-editor { border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); background: var(--bs-body-bg); }
.cms-editor:focus-within { border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem rgba(29, 73, 153, .2); }

.cms-toolbar {
    position: sticky;
    top: 61px;                       /* below the sticky header */
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    align-items: center;
    padding: .375rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
}
.cms-toolbar .btn { --bs-btn-padding-x: .45rem; --bs-btn-padding-y: .2rem; }
.cms-toolbar .btn[aria-pressed="true"] { background: var(--bs-secondary-bg); border-color: var(--bs-border-color); }
.cms-toolbar .form-select { width: auto; }
.cms-sep { width: 1px; align-self: stretch; background: var(--bs-border-color); margin: 0 .2rem; }

.cms-area {
    min-height: 30rem;
    max-height: 75vh;
    overflow: auto;
    outline: none;
    padding-bottom: 2rem;
}
.cms-source {
    width: 100%;
    min-height: 30rem;
    max-height: 75vh;
    border: 0;
    border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
    font-family: var(--bs-font-monospace);
    font-size: .85rem;
    padding: 1rem;
    resize: vertical;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* everything editable: hidden tabs and faded elements are shown, interactive parts are inert */
.cms-area .tab-pane, .cms-area .collapse { display: block !important; opacity: 1 !important; }
.cms-area .tab-pane { border: 1px dashed var(--bs-border-color); padding: .5rem; margin-bottom: 1rem; }
.cms-area .tab-pane::before { content: "Reiter: " attr(id); display: block; font-size: .75rem; color: var(--bs-secondary-color); }
.cms-area .fade:not(.show) { opacity: 1; }
.cms-area a { cursor: text; }

/* current top-level block */
.cms-area > .cms-current { outline: 2px dashed rgba(29, 73, 153, .45); outline-offset: -2px; }
.cms-area img.cms-selected { outline: 3px solid var(--bs-primary); }

.cms-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
}
.cms-media-item {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: .4rem;
    text-align: center;
    font-size: .8rem;
    word-break: break-word;
    background: var(--bs-body-bg);
}
.cms-media-item img { width: 100%; height: 100px; object-fit: contain; display: block; margin-bottom: .3rem; }
.cms-media-item .cms-media-file { height: 100px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--bs-secondary-color); }
.cms-media-item button.cms-pick { all: unset; cursor: pointer; display: block; }
.cms-media-item button.cms-pick:focus-visible { outline: 3px solid var(--bs-primary); }
.cms-versions { max-height: 24rem; overflow: auto; }
