/* Marriage101 — small custom layer on top of Bootstrap 5. */

:root {
    --parish: #5b2333;        /* deep liturgical burgundy */
    --parish-light: #7d3145;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-navbar {
    background: linear-gradient(90deg, var(--parish), var(--parish-light));
}
.app-navbar .navbar-brand,
.app-navbar .navbar-brand:hover {
    color: #fff;
}

.navbar-tagline {
    font-size: .8rem;
    font-weight: 400;
    opacity: .7;
    margin-left: .35rem;
}

/* Collapsible left navigation (offcanvas) */
.app-sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--parish), #2c1019);
    color: #fff;
}
.app-sidebar .offcanvas-title { color: #fff; }
.app-sidebar .sidebar-brand { border-bottom: 1px solid rgba(255, 255, 255, .2); padding-bottom: 12px; }
.sidebar-logo { max-width: 140px; max-height: 90px; }
.sidebar-logo-icon { font-size: 2rem; color: rgba(255, 255, 255, .85); }
.brand-logo-sm { max-height: 28px; vertical-align: middle; border-radius: 3px; background: #fff; padding: 1px; }
.app-sidebar hr { border-color: rgba(255, 255, 255, .3); }
.app-sidebar .nav-link {
    color: rgba(255, 255, 255, .85);
    border-radius: 6px;
    padding: .5rem .75rem;
}
.app-sidebar .nav-link:hover,
.app-sidebar .nav-link:focus {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}
.app-sidebar .nav-link.active {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}
/* Nested "Admin" submenu: indent children and shrink them slightly */
.app-sidebar .nav-submenu { padding-left: .75rem; }
.app-sidebar .nav-submenu .nav-link { font-size: .925rem; padding: .4rem .75rem; }
/* Chevron flips when the Admin group is expanded */
.app-sidebar .nav-link[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.app-sidebar .nav-link .bi-chevron-down { transition: transform .15s ease; }

/* Month calendar */
.cal-table { table-layout: fixed; }
.cal-table th { text-align: center; font-size: .8rem; color: #666; }
.cal-table td { height: 104px; width: 14.28%; vertical-align: top; padding: 4px; }
.cal-daynum { font-size: .85rem; font-weight: 600; color: #777; }
.cal-other { background: #fafafa; }
.cal-today { box-shadow: inset 0 0 0 2px var(--parish); }
.cal-blocked { background: repeating-linear-gradient(45deg, #f7eef1, #f7eef1 7px, #efdfe4 7px, #efdfe4 14px); }
.cal-block-tag { color: var(--parish); font-size: .8rem; }
.cal-block-reason { font-size: .68rem; color: var(--parish); line-height: 1.05; margin-bottom: 2px; }
.cal-evt {
    display: block;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    margin-top: 2px;
    font-weight: 500;
}

/* Large screens: pin the sidebar open as a fixed left column and
   offset the page content (and footer) so they sit beside it. */
@media (min-width: 992px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 250px;
        z-index: 1030;
    }
    .app-offset {
        margin-left: 250px;
    }
    /* Navigation hidden: the column goes away and the content reclaims it.
       Only the pinned sidebar hides — below lg it is an offcanvas that is
       already closed, and the top bar's hamburger still opens it. */
    body.nav-hidden .app-sidebar {
        display: none;
    }
    body.nav-hidden .app-offset {
        margin-left: 0;
    }
    body.nav-hidden .nav-show-btn {
        display: inline-flex;
    }
}

/* The control inside the sidebar that hides it. */
.nav-hide-btn {
    color: rgba(255, 255, 255, .75);
    border: 0;
    padding: 0 .25rem;
    line-height: 1;
}
.nav-hide-btn:hover,
.nav-hide-btn:focus {
    color: #fff;
}
/* The control that brings it back: parked top-left, over the reclaimed space,
   and rendered only while the navigation is hidden on a large screen. */
.nav-show-btn {
    display: none;
    position: fixed;
    top: .5rem;
    left: .5rem;
    z-index: 1040;
    align-items: center;
    background: var(--parish);
    border-color: var(--parish);
    color: #fff;
    opacity: .75;
}
.nav-show-btn:hover,
.nav-show-btn:focus {
    background: var(--parish);
    border-color: var(--parish);
    color: #fff;
    opacity: 1;
}

/* Login screen */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--parish), #2c1019);
}
/* Configured parish logo on the login / password entry pages. */
.login-logo { max-width: 200px; max-height: 120px; }

/* Stage cards on the dashboard */
.stage-card .stage-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: var(--parish);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
}

/* Task-template cards — the template name is the landmark you scan for,
   so it gets a tinted header, an accent rule and parish-coloured text. */
.tmpl-header {
    background: #f7eef1;
    border-left: 4px solid var(--parish);
}
.tmpl-name {
    color: var(--parish);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.btn-primary {
    --bs-btn-bg: var(--parish);
    --bs-btn-border-color: var(--parish);
    --bs-btn-hover-bg: var(--parish-light);
    --bs-btn-hover-border-color: var(--parish-light);
    --bs-btn-active-bg: var(--parish-light);
    --bs-btn-active-border-color: var(--parish-light);
}

.text-primary {
    color: var(--parish) !important;
}

/* Horizontal stage stepper on the case detail page */
.stepper {
    display: flex;
    gap: .25rem;
    overflow-x: auto;
}
.step {
    flex: 1 1 0;
    min-width: 78px;
    text-align: center;
    position: relative;
}
.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}
.step-dot {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    margin: 0 auto .35rem;
    background: #dee2e6;
    color: #6c757d;
    font-weight: 600;
    font-size: .85rem;
}
.step-label {
    font-size: .68rem;
    line-height: 1.1;
    color: #6c757d;
}
.step-done .step-dot    { background: #198754; color: #fff; }
.step-done::after       { background: #198754; }
.step-current .step-dot { background: var(--parish); color: #fff; box-shadow: 0 0 0 3px rgba(91,35,51,.2); }
.step-current .step-label { color: var(--parish); font-weight: 600; }
.step-muted .step-dot   { background: #f1f1f1; }

/* ------------------------------------------------------------------
 * Rich-text field — see rich_text_editor() and assets/js/richtext.js.
 * Styled to sit in a Bootstrap form like the .form-control it replaced.
 * ---------------------------------------------------------------- */
.rt {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    background: #fff;
}
.rt-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .15rem;
    padding: .25rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: .375rem .375rem 0 0;
}
.rt-btn {
    border: 0;
    background: transparent;
    color: #495057;
    border-radius: .25rem;
    padding: .2rem .45rem;
    line-height: 1;
    font-size: .95rem;
}
.rt-btn:hover  { background: #e9ecef; color: #212529; }
.rt-btn:active { background: #dee2e6; }
.rt-linkbar {
    display: flex;
    gap: .35rem;
    padding: .35rem;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
}
.rt-area {
    padding: .5rem .75rem;
    outline: 0;
    overflow-wrap: anywhere;
}
.rt:focus-within { border-color: #86b7fe; box-shadow: 0 0 0 .25rem rgba(13,110,253,.25); }
.rt-area.rt-invalid { box-shadow: inset 0 0 0 2px #dc3545; border-radius: 0 0 .375rem .375rem; }
/* Placeholder: only shown while the box holds no words. */
.rt-area.rt-empty::before {
    content: attr(data-rt-placeholder);
    color: #adb5bd;
    pointer-events: none;
    display: block;
}
/* Tighten the default paragraph spacing inside both the editor and the
   read-only view, so a short suggestion doesn't sprawl. */
.rt-area p, .rt-view p          { margin-bottom: .5rem; }
.rt-area p:last-child,
.rt-view p:last-child           { margin-bottom: 0; }
.rt-area ul, .rt-area ol,
.rt-view ul, .rt-view ol        { margin-bottom: .5rem; padding-left: 1.4rem; }
.rt-view blockquote, .rt-area blockquote {
    border-left: 3px solid #dee2e6;
    padding-left: .75rem;
    margin-left: 0;
    color: #6c757d;
}
.rt-view { overflow-wrap: anywhere; }
/* The link bar hides via Bootstrap's .d-none; spell it out so the field works
   on any page, and so a stale value can never block form submission. */
.rt-linkbar.d-none { display: none; }
