/* DietaryPlus home refresh — warm editorial / clinic lounge */
:root {
    --home-paper: #f5f0e8;
    --home-paper-deep: #eae0d2;
    --home-ink: #252629;
    --home-gold: #c69a47;
    --home-gold-light: #ead09c;
    --home-muted: #766f65;
}

body {
    background: var(--home-paper);
}

#homePage {
    padding: 1.15rem 1rem calc(1.4rem + env(safe-area-inset-bottom));
    animation: home-enter 460ms cubic-bezier(.22,.8,.25,1) both;
}

.home-welcome {
    padding: .35rem .2rem 1.15rem;
}

.home-welcome-kicker {
    color: var(--home-gold);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .12em;
    margin-bottom: .26rem;
    text-transform: uppercase;
}

.home-welcome h1 {
    color: var(--home-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.62rem, 7vw, 2.05rem);
    font-weight: 500;
    letter-spacing: -.045em;
    line-height: 1.06;
}

.home-grid-menu {
    gap: .72rem;
    margin: 0 0 1.15rem;
    padding: 0;
}

.home-appointment-card {
    align-items: center;
    gap: .8rem;
    width: 100%;
    margin: 0 0 1rem;
    padding: 1rem;
    border: 1px solid #c8ac79;
    border-radius: 14px;
    background: #f2e7d3;
    color: #383021;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.home-appointment-card > svg { flex-shrink: 0; }
.home-appointment-card > span:first-of-type { flex: 1; min-width: 0; }
.home-appointment-card strong, .home-appointment-card time, .home-appointment-card small { display: block; }
.home-appointment-card strong { font-size: .9rem; }
.home-appointment-card time { font-size: .85rem; margin-top: .2rem; }
.home-appointment-card small { font-size: .7rem; margin-top: .3rem; }
.home-appointment-card:focus-visible { outline: 3px solid var(--home-gold); outline-offset: 3px; }
body.dark-mode .home-appointment-card { background: #363128; color: #f2e7d3; border-color: #907951; }

.home-grid-item {
    align-items: flex-start;
    background: #fbf8f2;
    border: 1px solid rgba(78, 65, 46, .1);
    border-radius: 14px;
    color: var(--home-ink);
    min-height: 128px;
    overflow: hidden;
    padding: .88rem;
    position: relative;
    text-align: left;
}

.home-grid-item::after {
    background: linear-gradient(90deg, rgba(251,248,242,.96) 4%, rgba(251,248,242,.48) 63%, transparent);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.home-grid-item:focus-visible,
.home-dark-banner:focus-visible {
    outline: 3px solid var(--home-gold);
    outline-offset: 3px;
}

.home-grid-item:hover {
    border-color: rgba(198,154,71,.7);
    box-shadow: 0 10px 22px rgba(56, 43, 25, .12);
    transform: translateY(-2px);
}

.home-tile-image {
    background-position: center;
    background-size: cover;
    filter: saturate(.72) sepia(.09);
    inset: 0;
    opacity: .92;
    position: absolute;
}

.home-tile-recipes .home-tile-image {
    background-image: url("/assets/home-recipes.jpg"), radial-gradient(circle at 64% 47%, #e2c17b 0 9%, transparent 10%), radial-gradient(circle at 73% 38%, #789353 0 7%, transparent 8%), linear-gradient(135deg, #efe8d8 0%, #c7a979 100%);
}
.home-tile-content .home-tile-image {
    background-image: url("/assets/home-content.jpg"), linear-gradient(130deg, transparent 35%, rgba(255,255,255,.75) 36% 43%, transparent 44%), repeating-linear-gradient(6deg, #d9c5a4 0 2px, #f2e9da 3px 14px);
}
.home-tile-magazines .home-tile-image {
    background-image: url("/assets/home-magazines.jpg"), linear-gradient(155deg, transparent 30%, rgba(55,47,37,.14) 31% 32%, transparent 33%), repeating-linear-gradient(15deg, #e2c69e 0 8px, #c59d6b 9px 12px, #efe5d5 13px 24px);
}
.home-tile-bonuses .home-tile-image {
    background-image: url("/assets/home-bonuses.jpg"), linear-gradient(90deg, transparent 62%, rgba(164,128,69,.55) 63% 68%, transparent 69%), linear-gradient(0deg, transparent 44%, rgba(164,128,69,.55) 45% 52%, transparent 53%), linear-gradient(135deg, #f6ede1, #ceb996);
}

.home-grid-icon,
.home-grid-label {
    position: relative;
    z-index: 1;
}
.home-grid-icon {
    color: var(--home-ink);
    height: 26px;
    margin-bottom: auto;
    width: 26px;
}
.home-grid-label {
    color: var(--home-ink);
    font-size: .88rem;
    font-weight: 750;
}

.home-dark-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    font-family: inherit;
    background-color: #27282a !important;
    background-position: right center;
    background-repeat: no-repeat;
    background-size: 55% 100%;
    border: 0 !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 20px rgba(38, 34, 28, .16) !important;
    cursor: pointer;
    margin-bottom: .75rem !important;
    overflow: hidden;
    padding: 1rem 1.1rem !important;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
}
.home-dark-banner:hover { box-shadow: 0 14px 26px rgba(38,34,28,.25) !important; transform: translateY(-2px); }
.home-course-banner {
    background-image: linear-gradient(90deg, #27282a 25%, rgba(39,40,42,.9) 55%, rgba(39,40,42,.35)), url("/assets/home-content.jpg");
    background-size: cover;
}
.home-tracking-banner {
    background-image: linear-gradient(90deg, #27282a 36%, rgba(39,40,42,.88) 58%, rgba(39,40,42,.12)), linear-gradient(135deg, #947c51 0 12%, #252a2d 13% 49%, #d0a84e 50% 54%, #343534 55%);
}

.home-section-header {
    margin: 1.45rem 0 .72rem;
}
.home-section-header .section-title {
    color: var(--home-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.28rem;
    font-weight: 600;
    letter-spacing: -.035em;
}
.home-section-header .section-link,
.home-section-header .section-link-btn {
    background: var(--home-ink);
    border: 0;
    border-radius: 999px;
    color: #f8f1e5;
    cursor: pointer;
    font-family: inherit;
    font-size: .72rem;
    font-weight: 700;
    padding: .47rem .75rem;
}
.home-section-header .section-link {
    color: var(--home-ink);
    background: transparent;
    padding-right: 0;
}
.home-section-header .section-link-btn:hover { background: #484033; }

/* Existing server-rendered recipes stay untouched, just gain the editorial frame. */
#homeRecipes .recipe-card {
    background: #fbf8f2;
    border: 1px solid rgba(78, 65, 46, .1);
    box-shadow: 0 7px 16px rgba(48, 38, 25, .09);
}

.bottom-nav {
    background: rgba(251,248,242,.94);
    backdrop-filter: blur(14px);
    border-color: rgba(72,62,49,.12);
    box-shadow: 0 -8px 26px rgba(53,40,22,.07);
}
.nav-item.active { color: #a27627; }
.nav-item.scanner-nav { background: #292a2b; box-shadow: 0 5px 14px rgba(38,34,28,.22); }

body.dark-mode { background: #1e2021; }
body.dark-mode #homePage { --home-paper: #1e2021; --home-ink: #f2eadf; --home-muted: #b4aa9d; }
body.dark-mode .home-grid-item { background: #292b2d !important; border-color: #3b3e40; }
body.dark-mode .home-grid-item::after { background: linear-gradient(90deg, rgba(41,43,45,.95), rgba(41,43,45,.4), transparent); }
body.dark-mode .home-grid-label, body.dark-mode .home-grid-icon, body.dark-mode .home-section-header .section-title { color: #f2eadf; }
body.dark-mode #homeRecipes .recipe-card { background: #292b2d !important; border-color: #3b3e40; }
body.dark-mode .bottom-nav { background: rgba(38,41,43,.94); border-color: #3b3e40; }

@keyframes home-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 350px) {
    #homePage { padding-left: .75rem; padding-right: .75rem; }
    .home-grid-item { min-height: 112px; padding: .72rem; }
    .home-grid-label { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
    #homePage { animation: none; }
    .home-dark-banner, .home-grid-item { transition: none; }
}