html {
  font-size: 16px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* site.css */
@media (max-width: 767.98px) {
    .container, .container-fluid {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (min-width: 768px) {
    .container, .container-fluid {
        max-width: 100rem !important; /* or your preferred width */
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    #searchForm input[type="search"] {
        width: 40ch;
    }
}

.nav-link,
.btn-link.nav-link {
    border: 1.5px solid transparent;
    border-radius: 0.25rem;
}
.nav-link:hover, .nav-link:focus,
.btn-link.nav-link:hover, .btn-link.nav-link:focus {
    filter: brightness(0.90);
    border-radius: 0.25rem;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    border: 1.5px solid rgba(0,0,0,0.10);
    background-color: rgba(0,0,0,0.10); /* subtle primary-tinted background */
}

.accordion-button, .form-check-input {
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease, filter .15s ease;
}
    .accordion-button:hover, .form-check-input:hover {
        filter: brightness(0.90);
    }

.form-check {
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    margin: 0;
}

.form-check-label {
    padding: 0.2rem 0.75rem;
    cursor: pointer;
    width: 100%;
    margin: 0;
    transition: background 0.15s;
}
    .form-check-label:hover, .form-check-label:focus {
        filter: brightness(0.90);
        border-radius: 0.25rem;
    }

.description-cell {
    line-height: 1.4em;
    max-height: 5.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

html, body {
    height: 100%;
    margin: 0;
}

main {
    flex: 1;
    margin-bottom: 10rem;
}

.img-avatar, .img-recipe, .img-recipe-sm, .img-collection, .img-attribute, img-ingredient, img-group, .img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.img-collection, .img-group, .img-attribute, .img-ingredient {
    max-width: 6rem;
    max-height: 6rem;
}

.img-avatar {
    max-width: 3.5rem;
    max-height: 3.5rem;
}
.img-recipe {
    max-width: 8rem;
    max-height: 8rem;
}
.img-recipe-sm {
    max-width: 4rem;
    max-height: 4rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Pivot the chevron on expand/collapse */
.collapse-toggle .bi {
    transition: transform .2s ease;
}

.collapse-toggle[aria-expanded="true"] .bi {
    transform: rotate(180deg);
}

.card-horizontal {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.card-body-horizontal {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    padding: 0.5rem;
}

.card-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-link-unstyled:hover .card,
.card-link-unstyled:focus .card {
    box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 1.5px 6px rgba(0,0,0,0.10);
    transform: translateY(-2px) scale(1.015);
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}

/* Calendar day hover/focus animation */
.d-grid .btn:hover,
.d-grid .btn:focus {
    box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 1.5px 6px rgba(0,0,0,0.10);
    transform: translateY(-2px) scale(1.015);
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}

/* Remove default link styles for the card */
.card-link-unstyled {
    color: inherit;
    text-decoration: none;
    display: block;
    height: 100%;
}

    .card-link-unstyled:focus,
    .card-link-unstyled:hover {
        color: inherit;
        text-decoration: none;
    }

.dropdown-item {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 1rem;
}

#calendarRoot::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.calendar-day-holiday {
    background-color: var(--bs-warning-bg-subtle, #fff3cd) !important;
    border-color: var(--bs-warning-border-subtle, #ffe066) !important;
    color: var(--bs-warning-text-emphasis, #664d03) !important;
    position: relative;
}

/* Meal: Use Bootstrap primary border and subtle background */
.calendar-day-meal {
    border: 2px solid var(--bs-primary-border-subtle, #b6d4fe) !important;
    background-color: var(--bs-primary-bg-subtle, #e7f1ff) !important;
    position: relative;
}

/* Both: Add a slight box-shadow for extra emphasis */
.calendar-day-holiday.calendar-day-meal {
    box-shadow: 0 0 0 2px var(--bs-primary, #0d6efd);
}

/* Icon positioning */
.holiday-icon, .meal-icon {
    position: absolute;
    right: 0.5em;
    font-size: 1.1em;
    bottom: 0.3em;
    pointer-events: none;
}

.calendar-day-content {
    min-height: 3.5em;
    height: 100%;
    width: 100%;
    position: relative;
    pointer-events: none;
}

.calendar-day-number {
    z-index: 2;
    font-weight: 500;
    color: var(--bs-body-color, #212529);
}

.holiday-icon, .meal-icon, .calendar-day-badge {
    z-index: 2;
    font-size: 1.1em;
    line-height: 1;
}

.calendar-day-badge {
    font-size: 1.0em;
}

button[role="gridcell"] {
    min-height: 2em;
    min-width: 2em;
    padding: 0 !important;
    overflow: visible;
}

.bubble-toast {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5em 1em;
    border-radius: 1em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
}

    .bubble-toast.show {
        opacity: 1;
        pointer-events: auto;
    }

@media (max-width: 767.98px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        padding-top: max(2rem, env(safe-area-inset-top, 0)) !important;
        padding-bottom: max(10rem, env(safe-area-inset-bottom, 0)) !important;
        z-index: 1040;
        width: 80vw;
        max-width: 320px;
        overflow-y: auto;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
        transition: transform 0.3s ease;
    }

        #sidebar.collapse:not(.show) {
            transform: translateX(-100%);
        }

        #sidebar.collapse.show {
            transform: translateX(0);
        }

    #sidebarOverlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1039;
    }

    #sidebar.show + #sidebarOverlay {
        display: block;
    }
}

/* Light Theme Overrides */
:root {
    --bs-primary: #d2691e;
    --bs-secondary: #f4a460;
    --bs-success: #228b22;
    --bs-info: #20b2aa;
    --bs-warning: #ff8c00;
    --bs-danger: #dc143c;
    --bs-light: #f8f9fa;
    --bs-dark: #343a40;
}

/* Dark Theme Overrides */
[data-bs-theme="dark"] {
    --bs-primary: #ffa07a;
    --bs-secondary: #deb887;
    --bs-success: #90ee90;
    --bs-info: #87cefa;
    --bs-warning: #ffb347;
    --bs-danger: #ff6b6b;
    --bs-light: #ced4da;
    --bs-dark: #121212;
}