body {
    font-family: 'Abel', sans-serif;
}

/* Reduce container max-width by 100px */
.container {
    max-width: 1220px;
}

/* Wider content area for admin pages only */
.admin-main-container {
    max-width: none;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* Full-width line with centered admin tabs */
.admin-tabs {
    position: relative;
}
.admin-tabs::before,
.admin-tabs::after {
    content: "";
    position: absolute;
    top: 50%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.15);
}
.admin-tabs::before {
    right: 100%;
    margin-right: 0;
}
.admin-tabs::after {
    left: 100%;
    margin-left: 0;
}

/* Image layouts for alinea's with images */
.alinea-image-right {
    display: flex;
    gap: 70px;
    align-items: flex-start;
}

.alinea-image-right .text-content {
    flex: 1;
    min-width: 0;
}

.alinea-image-right .image-wrapper {
    width: 340px;
    flex-shrink: 0;
    margin-left: auto;
}

.alinea-image-left {
    display: flex;
    gap: 70px;
    align-items: flex-start;
}

.alinea-image-left .text-content {
    flex: 1;
    min-width: 0;
}

.alinea-image-left .image-wrapper {
    width: 340px;
    flex-shrink: 0;
    order: -1;
}

.alinea-image-right img,
.alinea-image-left img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 8px;
}

/* Responsive alinea image layouts for mobile */
@media (max-width: 991.98px) {
    .alinea-image-right,
    .alinea-image-left {
        flex-direction: column;
        gap: 20px;
    }

    .alinea-image-right .image-wrapper,
    .alinea-image-left .image-wrapper {
        width: 100%;
        order: 0;
    }

    /* Image on left: show above text on mobile */
    .alinea-image-left .image-wrapper {
        order: -1;
    }

    /* Image on right: show below text on mobile */
    .alinea-image-right .image-wrapper {
        order: 1;
    }

    .alinea-image-right .text-content,
    .alinea-image-left .text-content {
        order: 0;
    }
}

/* All buttons use system font with emoji support for colored icons */
.btn,
button {
    font-family: "Segoe UI", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", system-ui, -apple-system, sans-serif;
}

.login-page {
    min-height: 60vh;
    padding: 28px 16px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 350px;
}

.login-form .form-control-lg {
    font-size: 1rem;
    padding: 0.65rem 0.85rem;
}

/* Hover-expand label for edit (pencil) buttons */
.btn-icon-label {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
}
.btn-icon-label .btn-label {
    max-width: 0;
    opacity: 0;
    margin-left: 6px;
    white-space: nowrap;
    transition: max-width 280ms ease, opacity 280ms ease;
}
.btn-icon-label:hover .btn-label,
.btn-icon-label:focus .btn-label {
    max-width: 160px;
    opacity: 1;
}

/* Hover and edit mode background for content cards */
.toggle-card {
    transition: background-color 160ms ease;
}

/* Template cards on PageTemplates page */
.template-card {
    cursor: pointer;
    transition: all 200ms ease;
}

.template-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
    border-color: #0d6efd !important;
}

.template-card:active {
    transform: translateY(-2px);
}

/* Hide move buttons when card is in edit mode */
.card-editing .action-group form {
    display: none !important;
}
.toggle-card:hover {
    background-color: #f8f9fa;
}
.toggle-card.card-editing {
    background-color: #f8f9fa;
}

.toggle-card .card-body {
    padding-top: 24px;
    overflow: visible !important;
}

/* Extra spacing for view mode content so toolbar doesn't overlap */
.toggle-card:not(.card-editing) .content-view {
    padding-top: 24px;
}

/* Extra spacing for edit mode content so toolbar doesn't overlap */
.toggle-card.card-editing .content-edit {
    padding-top: 24px;
}

/* Ensure action buttons have proper z-index */
.toggle-card .position-absolute {
    z-index: 10;
}

/* Spacing for edit forms from toolbar buttons */
.content-edit {
    margin-top: 10px;
    overflow: hidden;
    width: 100%;
}

/* Rich text editor styling */
.rich-text {
    width: 100% !important;
    max-width: 100% !important;
}

.ql-toolbar {
    border: 1px solid #dee2e6 !important;
    border-bottom: none !important;
    background-color: #f8f9fa !important;
}

.ql-container {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

.ql-editor {
    background-color: #ffffff !important;
    min-height: 220px;
    color: #212529;
    box-sizing: border-box;
}

/* Ensure alinea layouts work inside forms */
.content-edit .alinea-image-right,
.content-edit .alinea-image-left {
    display: flex;
    gap: 20px;
}

.content-edit .alinea-image-right .text-content,
.content-edit .alinea-image-left .text-content {
    flex: 1;
    min-width: 0;
}

.content-edit .alinea-image-right .image-wrapper,
.content-edit .alinea-image-left .image-wrapper {
    width: 300px;
    flex-shrink: 0;
}

/* Content placeholder images in edit mode - clickable with hover effect */
.content-placeholder-img {
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 8px;
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}
.content-placeholder-img:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* Match content text style to page description (lead) */
.content-item,
.content-view {
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1.6;
}

.content-item {
    margin-top: 50px;
    margin-bottom: 80px;
}

/* Page title tweaks: smaller and centered */
.content-view h1.display-4,
.text-start h1.display-4 {
    font-size: 1.9rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: calc(1.2rem + 20px);
}

/* Banner overlay upload control */
.page-banner-wrapper {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    margin-bottom: 20px;
    overflow: hidden;
}

.page-banner-wrapper.banner-has-image {
    margin-top: 0;
    border-top: 2px rgba(0, 0, 0, 0.3) solid;
    border-bottom: 2px rgba(0, 0, 0, 0.3) solid;
}

.banner-upload-placeholder {
    text-align: center;
    padding: 10px 0;
    margin-bottom: 20px;
}

.page-banner-image {
    width: 100%;
    height: auto;
    display: block;
}

.banner-upload-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}
/* Contact form positioning for toast container */
.contact-form {
    position: relative;
}

/* Contact form responsive layout */
@media (max-width: 991.98px) {
    .contact-form .col-3,
    .contact-form .col-9 {
        width: 100% !important;
        max-width: 100% !important;
    }
    .contact-form .col-9 {
        margin-top: 1rem;
    }
    .contact-form textarea {
        min-height: 120px !important;
    }
}