/* Project tweaks on top of Tabler. */

/* picture field with thumbnail crop (views/common/_image_field.php) */
.image-field-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 300px;
    overflow: hidden;
    border-radius: var(--tblr-border-radius);
    background: var(--tblr-bg-surface-secondary);
}
.image-field-thumb img {
    max-width: 100%;
    max-height: 100%;
}
.image-field-crop {
    height: 65vh;
}
.image-field-crop img {
    display: block;
    max-width: 100%;
}
.image-field-preview {
    width: 100%;
    overflow: hidden;
    border-radius: var(--tblr-border-radius);
    background: var(--tblr-bg-surface-secondary);
}
.list-thumb {
    width: 75px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--tblr-border-radius);
}
.youtube-preview {
    max-width: 480px;
    aspect-ratio: 16 / 9;
}
.youtube-preview iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--tblr-border-radius);
}
/* gallery edit page (views/photogalleries/update.php) */
.gallery-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    border: 2px dashed var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
}
.gallery-drop.is-dragover {
    border-color: var(--tblr-primary);
    background: var(--tblr-primary-lt);
}
.gallery-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--tblr-bg-surface-secondary);
}
.gallery-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.team-thumb {
    width: 45px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--tblr-border-radius);
}
tr.sortable-ghost {
    opacity: .4;
}
.slide-thumb {
    max-width: 320px;
    max-height: 120px;
    border-radius: var(--tblr-border-radius);
}
/* menu tree (views/menu/index.php) */
.menu-tree-item.sortable-ghost > .menu-tree-row {
    opacity: .4;
}
.contact-map {
    aspect-ratio: 16 / 9;
}
.contact-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--tblr-border-radius);
}
/* required fields: Yii puts .required on the field container, Tabler draws the star only on .form-label.required */
.required > .form-label::after {
    margin-inline-start: var(--tblr-form-label-required-gap);
    color: var(--tblr-red);
    content: "*";
}

/* error text of a checkbox: the input sits inside label.form-check, so the "is-invalid ~ .invalid-feedback" rule of Tabler
   does not reach the text after the label */
.form-check:has(.is-invalid) ~ .invalid-feedback {
    display: block;
}
