/* Natural Dark Theme – no frameworks */

:root {
    --bg: #0f1110;
    /* near-black with a hint of green */
    --panel: #141816;
    /* dark moss */
    --panel-2: #1a1f1c;
    /* deeper card */
    --text: #e7ece9;
    /* soft off-white */
    --muted: #a3b0a6;
    /* muted sage */
    --accent: #7fb77e;
    /* soft sage green */
    --accent-2: #a68a64;
    /* warm earth brown */
    --link: #9fd3a8;
    /* lighter leaf */
    --ring: #2a3b31;
    /* subtle outline */
    --shadow: 0 10px 25px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 14px
}

a {
    color: var(--link);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px
}

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 17, 16, .85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--ring)
}

.nav {
    display: flex;
    align-items: center;
    gap: 18px
}

.nav a {
    padding: 10px 12px;
    border-radius: 12px
}

.nav a[aria-current="page"] {
    background: var(--panel);
    box-shadow: var(--shadow)
}

.brand {
    font-weight: 700;
    letter-spacing: .2px;
    margin-right: auto
}

.hero {
    display: grid;
    gap: 18px;
    padding: 34px;
    background: linear-gradient(180deg, rgba(127, 183, 126, .12), transparent 55%), var(--panel);
    border: 1px solid var(--ring);
    border-radius: 18px;
    box-shadow: var(--shadow)
}

.hero h1 {
    margin: 0 0 6px;
    font-size: 2rem
}

.hero p {
    margin: 0;
    color: var(--muted)
}

.grid {
    display: grid;
    gap: 18px
}

@media(min-width:720px) {
    .grid {
        grid-template-columns: repeat(3, 1fr)
    }
}

.card {
    background: var(--panel-2);
    border: 1px solid var(--ring);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px
}

.badge {
    display: inline-block;
    font-size: .8rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    background: rgba(167, 138, 100, .18);
    border: 1px solid rgba(166, 138, 100, .5);
    color: #e9ddcf
}

footer {
    margin-top: 48px;
    padding: 24px 0;
    border-top: 1px solid var(--ring);
    color: var(--muted);
    font-size: .95rem
}


/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .9rem;
    border-radius: 12px;
    background: var(--accent);
    color: #0b0d0c;
    border: 0;
    font-weight: 600
}

.btn:hover {
    filter: brightness(1.05);
    text-decoration: none
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--ring);
    color: var(--text)
}


/* Prose for care sheets */

.prose {
    max-width: 800px;
    margin: 0 auto
}

.prose h1,
.prose h2,
.prose h3 {
    scroll-margin-top: 90px
}

.prose h1 {
    font-size: 2rem;
    margin: .2rem 0 1rem
}

.prose h2 {
    margin: 1.4rem 0 .6rem;
    border-bottom: 1px dashed var(--ring);
    padding-bottom: .25rem
}

.prose h3 {
    margin: 1rem 0 .4rem
}

.prose p,
.prose li {
    color: var(--text)
}

.prose ul {
    padding-left: 1.1rem
}


/* Table of contents box */

.toc {
    position: sticky;
    top: 82px;
    background: var(--panel);
    border: 1px solid var(--ring);
    border-radius: 14px;
    padding: 12px
}

.toc h4 {
    margin: .2rem 0 .4rem;
    color: var(--muted)
}

.toc a {
    display: block;
    padding: .2rem 0
}


/* Print-friendly for care pages */

@media print {
    .header,
    .toc,
    .btn.print {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000
    }
    .prose h2 {
        border-color: #ccc
    }
}


/* Care sheet layout adjustment for mobile */

@media (max-width: 719px) {
    main.container {
        display: block !important;
    }
    .prose {
        margin-bottom: 20px;
    }
    aside.toc {
        position: static;
        margin-top: 20px;
    }
}


/* --- Care page TOC: mobile-friendly & collapsible --- */

@media (max-width: 719px) {
    main.container {
        display: block !important;
    }
    /* stack prose + toc */
    .prose {
        margin-bottom: 20px;
    }
    aside.toc {
        position: static;
        margin-top: 20px;
        border-radius: 12px;
    }
    /* Toggle button */
    .toc-toggle {
        width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
        padding: .6rem .9rem;
        border: 1px solid var(--ring);
        border-radius: 12px;
        background: var(--panel);
        color: var(--text);
        font-weight: 600;
        cursor: pointer;
    }
    .toc-toggle:focus {
        outline: 2px solid var(--ring);
        outline-offset: 2px;
    }
    /* Collapsible area */
    .toc-body {
        display: none;
        padding: 10px 0 0;
    }
    .toc.expanded .toc-body {
        display: block;
    }
}


/* --- TOC animation + chevron --- */

@media (max-width: 719px) {
    /* Collapsible area with smooth slide */
    .toc-body {
        display: block;
        /* JS will control height; keep block here */
        overflow: hidden;
        max-height: 0;
        /* collapsed */
        opacity: 0;
        transition: max-height 240ms ease, opacity 200ms ease;
    }
    .toc.expanded .toc-body {
        /* JS will set max-height to content size; opacity handles fade */
        opacity: 1;
    }
    /* Chevron rotation */
    .toc-toggle .chev {
        display: inline-block;
        transition: transform 200ms ease;
    }
    .toc.expanded .toc-toggle .chev {
        transform: rotate(180deg);
    }
}


/* Desktop keeps sticky behavior */

@media (min-width: 720px) {
    aside.toc {
        position: sticky;
        top: 82px;
    }
}

:target {
    scroll-margin-top: 90px;
    /* same as header height + some padding */
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
}

.food-availability {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    /* keeps months readable on phones */
    font-size: 0.95rem;
}

.food-availability caption {
    text-align: left;
    font-weight: 600;
    padding: 10px 12px;
}

.food-availability th,
.food-availability td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
}

.food-availability thead th {
    background: #f7f7f7;
    position: sticky;
    top: 0;
    z-index: 1;
}

.food-availability td:first-child,
.food-availability th:first-child {
    text-align: left;
    white-space: normal;
    min-width: 220px;
}


/* Color by data value */

.food-availability td[data-val="good"] {
    color: #1a7f37;
    font-weight: 700;
}

.food-availability td[data-val="limited"] {
    color: #b26b00;
    font-weight: 700;
}

.food-availability td[data-val="none"] {
    color: #777;
    font-weight: 600;
}


/* Print-friendly tweaks */

@media print {
    .table-scroll {
        overflow: visible;
        border: none;
    }
    .food-availability {
        min-width: auto;
        font-size: 11pt;
    }
    .btn.print {
        display: none !important;
    }
}

.footer {
    border-top: 1px solid #eee;
    padding: 16px 0;
}

.footer__wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    /* allows wrapping so items don’t squish */
}

.footer__brand {
    flex: 1 1 220px;
    min-width: 220px;
}

.footer__links {
    flex: 2 1 320px;
    /* center block grows most */
    display: flex;
    gap: 12px 18px;
    justify-content: center;
    /* keeps links centered across the row */
    flex-wrap: wrap;
}

.footer__links a {
    text-decoration: none;
    color: inherit;
    opacity: .9;
}

.footer__links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer__social {
    flex: 1 1 200px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    /* pins social to the right on desktop */
}

.footer .social {
    display: inline-flex;
    line-height: 0;
    color: #3b5998;
}

.footer .social:hover {
    opacity: .85;
}


/* Mobile tweaks */

@media (max-width: 640px) {
    .footer__wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .footer__links,
    .footer__social {
        justify-content: center;
    }
}