:root {
    --rl-dark: #14161a;
    --rl-dark-2: #1d2025;
    /* Accent defaults; overridden per page from Admin > Settings (Config\Theme::accentCss()). */
    --rl-accent: #dc2626;
    --rl-accent-dark: #b91c1c;
    --rl-accent-contrast: #fff;
    --rl-accent-text: #b91c1c;
    --rl-accent-on-dark: #f87171;
    --rl-accent-rgb: 220, 38, 38;
    --rl-light: #f4f4f5;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--rl-light);
    color: #212529;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

a {
    text-decoration: none;
}

/* Dark sections: Bootstrap's .text-muted is a dark gray meant for light backgrounds,
   so lighten muted/body text wherever the background is dark. */
.site-header,
.hero,
.page-banner,
.site-footer {
    --bs-secondary-color: #b4b7bd;
    --bs-body-color: #e9eaec;
}

.site-footer a.text-muted:hover {
    color: var(--rl-accent-on-dark) !important;
}

.btn-accent {
    background-color: var(--rl-accent);
    border: none;
    color: var(--rl-accent-contrast);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 2px;
}

.btn-accent:hover,
.btn-accent:focus-visible,
.btn-accent:active {
    background-color: var(--rl-accent-dark) !important;
    color: var(--rl-accent-contrast) !important;
}

/* Header */
.site-header {
    background-color: var(--rl-dark);
    border-bottom: 3px solid var(--rl-accent);
}

.navbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-brand span {
    color: var(--rl-accent-on-dark);
}

.navbar-dark .nav-link {
    color: #d7d7da;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active {
    color: var(--rl-accent-on-dark);
}

/* Hero */
/* Photos are managed in Admin > Content > Hero Images (hero_images table); Home::index() picks
   a random active one per request and sets --hero-img. Admin uploads go to public/uploads/hero/.
   Bundled photos in img/hero/ are from Unsplash (Unsplash License):
   hero-1.jpg: Zoshua Colah    — https://unsplash.com/photos/0B05SYbRoIk
   hero-2.jpg: Kato Blackmore  — https://unsplash.com/photos/KhF58h0hTbc
   hero-3.jpg: Dan Crile       — https://unsplash.com/photos/EJr3XkHdBm0
   hero-4.jpg: Joseph Pillado  — https://unsplash.com/photos/n99UTGfbvFQ
   hero-5.jpg: Maxim Hopman    — https://unsplash.com/photos/s4d_ESS0ylA */
.hero {
    background-color: var(--rl-dark);
    background-image:
        linear-gradient(90deg, rgba(20, 22, 26, 0.94) 0%, rgba(20, 22, 26, 0.8) 45%, rgba(20, 22, 26, 0.45) 100%),
        var(--hero-img, url('../img/hero/hero-1.jpg'));
    background-size: cover;
    background-position: center 60%;
    color: #fff;
    padding: 7rem 0;
}

@media (max-width: 991.98px) {
    .hero {
        background-image:
            linear-gradient(rgba(20, 22, 26, 0.85), rgba(20, 22, 26, 0.85)),
            var(--hero-img, url('../img/hero/hero-1.jpg'));
    }
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 700;
}

.hero p.lead {
    color: #c6c7cb;
    max-width: 560px;
}

/* Section headings */
.section-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.section-heading .eyebrow {
    color: var(--rl-accent-text);
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
}

.section-heading h2 {
    font-size: 2.2rem;
    font-weight: 700;
}

/* Cards */
.service-card {
    background: #fff;
    border-radius: 6px;
    padding: 2rem 1.5rem;
    height: 100%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    border-top: 3px solid var(--rl-accent);
    transition: transform 0.15s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

.service-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(var(--rl-accent-rgb), 0.12);
    color: var(--rl-accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-price {
    color: var(--rl-accent-text);
    font-weight: 700;
}

/* CTA band */
.cta-band {
    background-color: var(--rl-accent);
    color: var(--rl-accent-contrast);
    padding: 3rem 0;
}

/* Footer */
.site-footer {
    background-color: var(--rl-dark);
    color: #c6c7cb;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.site-footer h5, .site-footer h6 {
    color: #fff;
}

.site-footer h5 span, .site-footer .navbar-brand span {
    color: var(--rl-accent-on-dark);
}

.footer-links li {
    margin-bottom: 0.4rem;
}

.footer-links a {
    color: #c6c7cb;
}

.footer-links a:hover {
    color: var(--rl-accent-on-dark);
}

.footer-social {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #c6c7cb;
    text-decoration: none;
}

.footer-social + .footer-social {
    margin-left: 1.25rem;
}

.footer-social .bi {
    font-size: 1.5rem;
}

.footer-social:hover {
    color: var(--rl-accent-on-dark);
}

/* Forms */
.form-card {
    background: #fff;
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.page-banner {
    background-color: var(--rl-dark);
    color: #fff;
    padding: 3.5rem 0;
    margin-bottom: 3rem;
}

.page-banner h1 {
    font-size: 2.4rem;
}

.map-frame {
    border: 0;
    width: 100%;
    height: 400px;
    border-radius: 6px;
}

.hours-table td {
    padding: 0.4rem 0.75rem;
}

/* Admin portal */
body.admin .site-header .btn-link.nav-link {
    border: 0;
}

.admin-brand {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 0.03em;
}

.admin-brand span {
    color: var(--rl-accent-text);
}

.admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.admin-card .table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    background: #fafafa;
}

.admin-card .table td,
.admin-card .table th {
    padding: 0.75rem 1rem;
}

.dash-stat {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    height: 100%;
    color: inherit;
    text-decoration: none;
    border-top: 3px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s;
}

.dash-stat:hover {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.dash-stat.is-alert {
    border-top-color: #f0b400;
}

.dash-stat-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 1.2rem;
    background: rgba(var(--rl-accent-rgb), 0.1);
    color: var(--rl-accent-text);
}

.dash-stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
}

@media (max-width: 575.98px) {
    .dash-stat-icon {
        display: none;
    }

    .dash-stat-label {
        font-size: 0.7rem;
    }
}

.dash-stat-value {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    line-height: 1.1;
}

.dash-list li,
.dash-week li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.dash-list li:last-child,
.dash-week li:last-child {
    border-bottom: 0;
}

.dash-time {
    width: 5.5rem;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.9rem;
}

.dash-week-day {
    width: 5.5rem;
    flex-shrink: 0;
    font-weight: 600;
}

.dash-week .progress {
    height: 0.5rem;
}

.dash-week-count {
    width: 5.5rem;
    text-align: right;
}

.dash-facts {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 0.5rem;
}

.dash-facts dt {
    font-weight: 500;
    color: #6c757d;
}

.dash-facts dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
}

.weekday-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.weekday-picker .btn-check:checked + .btn {
    background-color: var(--rl-dark);
    color: #fff;
}

.slot-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.4rem 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid;
    font-size: 0.9rem;
    font-weight: 500;
}

.slot-chip form {
    margin: 0;
}

.slot-chip small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.slot-open {
    background: #eaf6ee;
    border-color: #a6d8b5;
    color: #1d6b37;
}

.slot-partial {
    background: #fff6e0;
    border-color: #f0cf7c;
    color: #7a5600;
    padding-right: 0.7rem;
}

.slot-full {
    background: #fbe9e5;
    border-color: #f0b3a3;
    color: #9a2f14;
    padding-right: 0.7rem;
}

p .slot-chip {
    padding: 0.1rem 0.6rem;
    margin-right: 0.25rem;
}

.slot-remove {
    border: 0;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    line-height: 1;
    padding: 0;
}

.slot-remove:hover {
    background: #dc3545;
    color: #fff;
}

.slot-past {
    opacity: 0.55;
    padding-right: 0.7rem;
}

/* Availability calendar: week columns and month grid. */
.cal-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

.cal-day {
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    padding: 0.5rem;
    min-height: 8rem;
}

.cal-day-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.cal-dow {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
}

.cal-num {
    font-weight: 600;
}

.cal-slots {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.cal-week .slot-chip {
    font-size: 0.8rem;
    padding-left: 0.5rem;
}

.cal-today {
    border-color: var(--rl-accent);
    box-shadow: inset 0 0 0 1px var(--rl-accent);
}

.cal-today .cal-num {
    color: var(--rl-accent-text);
}

.cal-past {
    background: #f8f9fa;
}

.cal-month {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.cal-month-dow {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    text-align: center;
    padding-bottom: 0.25rem;
}

.cal-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 5.5rem;
    padding: 0.4rem;
    border: 1px solid #e5e5e5;
    border-radius: 0.4rem;
    color: inherit;
    text-decoration: none;
    font-size: 0.8rem;
}

.cal-cell:hover {
    border-color: #212529;
    color: inherit;
}

.cal-other {
    color: #adb5bd;
}

.cal-summary {
    color: #495057;
    line-height: 1.3;
}

.cal-other .cal-summary {
    color: #adb5bd;
}

.cal-bar {
    display: block;
    height: 0.35rem;
    margin: 0.2rem 0;
    border-radius: 999px;
    background: #a6d8b5;
    overflow: hidden;
}

.cal-bar > span {
    display: block;
    height: 100%;
    background: #e07a5f;
}

@media (max-width: 767.98px) {
    .cal-week {
        grid-template-columns: 1fr;
    }

    .cal-day {
        min-height: 0;
    }

    .cal-slots {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .cal-cell {
        min-height: 3.5rem;
        padding: 0.25rem;
    }
}

.accent-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
}

.accent-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.accent-option:hover {
    border-color: #adb5bd;
}

.btn-check:checked + .accent-option {
    border-color: var(--rl-dark);
    box-shadow: 0 0 0 2px rgba(20, 22, 26, 0.15);
}

.btn-check:focus-visible + .accent-option {
    outline: 2px solid var(--rl-dark);
    outline-offset: 2px;
}

.accent-swatch {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Sub-page dropdowns in the header: a light menu, so undo the dark-section text colors. */
.site-header .dropdown-menu {
    --bs-body-color: #212529;
    --bs-dropdown-link-active-bg: var(--rl-accent);
    --bs-dropdown-link-active-color: var(--rl-accent-contrast);
}

/* CMS page content (Admin > Content) */
.cms-content > :last-child {
    margin-bottom: 0;
}

.cms-content h2,
.cms-content h3 {
    margin-top: 2rem;
}

.cms-content > h2:first-child,
.cms-content > h3:first-child {
    margin-top: 0;
}

.cms-content h2 {
    font-size: 1.75rem;
}

.cms-content blockquote {
    border-left: 4px solid var(--rl-accent);
    padding-left: 1rem;
    color: #555;
}

.cms-content .component {
    margin: 2rem 0;
}

.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

/* Admin: page tree */
.page-tree-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.25rem;
    border-bottom: 1px solid #eee;
}

.page-tree-row:last-child {
    border-bottom: 0;
}

.page-tree-row.is-child {
    padding-left: 1.75rem;
}

.page-tree-main {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.page-tree-main a {
    text-decoration: none;
}

.page-tree-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.page-tree-actions form {
    margin: 0;
}

/* Admin: rich text editor */
.cms-editor.ql-container {
    min-height: 260px;
    font-size: 1rem;
    font-family: inherit;
}

.cms-editor .ql-editor {
    min-height: 260px;
}

/* Match the site's paragraph spacing so the editor looks like the published page. */
.cms-editor .ql-editor p,
.cms-editor .ql-editor ul,
.cms-editor .ql-editor ol {
    margin-bottom: 0.75rem;
}

.component-preview {
    background: #f6f7f8;
    border-radius: 6px;
    padding: 1rem;
}

/* Admin > Content > Hero Images thumbnails */
.hero-thumb {
    display: block;
    width: 160px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: #e9eaec;
}

.hero-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-thumb.is-hidden img {
    opacity: 0.4;
    filter: grayscale(1);
}

@media (max-width: 575.98px) {
    .hero-thumb {
        width: 96px;
    }
}
