/* BRISE-343 Accessible Nutrition Information */

.nutrition-facts,
.nutrition-facts *,
.nutrition-facts *::before,
.nutrition-facts *::after {
    box-sizing: border-box;
}

.nutrition-facts {
    --nf-text: #1a1a1a;
    --nf-muted: #595959;
    --nf-border: #c8c8c8;
    --nf-surface: #f5f5f5;
    --nf-white: #ffffff;
    --nf-primary: #b52329;
    --nf-primary-dark: #731419;
    --nf-focus: #005fcc;
    --nf-table-heading: #292929;
    width: min(calc(100% - 2rem), 90rem);
    margin: 0 auto;
    padding: 2rem 0 4rem;
    color: var(--nf-text);
    font-size: 1rem;
    line-height: 1.5;
}

.nf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
}

.nf-skip-link {
    position: absolute;
    top: 0;
    left: -9999px;
    z-index: 10000;
    padding: 0.75rem 1rem;
    color: #ffffff;
    background: #000000;
    font-weight: 700;
    text-decoration: none;
}

    .nf-skip-link:focus {
        top: 1rem;
        left: 1rem;
        outline: 3px solid #ffffff;
        outline-offset: 2px;
    }

.nutrition-facts a:focus-visible,
.nutrition-facts button:focus-visible,
.nutrition-facts input:focus-visible,
.nutrition-facts [tabindex="0"]:focus-visible {
    outline: 3px solid var(--nf-focus);
    outline-offset: 3px;
}

.nf-header {
    margin-bottom: 1.5rem;
}

.nf-disclaimer {
    font-size: 11px;
    line-height: 1.3;
    color: var(--nf-text);
    font-weight: 400;
    text-align: left;
    margin-top: 20px;
    background: var(--nf-surface);
}

    .nf-disclaimer p {
        margin: 0;
    }

.nf-title {
    margin: 0 0 0.5rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
}

.nf-updated {
    margin: 0;
    color: var(--nf-muted);
}

.nf-notes,
.nf-empty-message {
    margin-bottom: 2rem;
    padding: 1.25rem;
    border-left: 0.4rem solid var(--nf-primary);
    background: var(--nf-surface);
}

.nf-notes-title {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
}

.nf-notes-content > :first-child {
    margin-top: 0;
}

.nf-notes-content > :last-child {
    margin-bottom: 0;
}

.nf-controls {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) auto auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
    padding: 1.25rem;
    border: 1px solid var(--nf-border);
    border-radius: 0.5rem;
    background: var(--nf-white);
}

.nf-search label,
.nf-view-controls legend {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.nf-search-input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.6rem 0.75rem;
    border: 2px solid #767676;
    border-radius: 0.25rem;
    color: var(--nf-text);
    background: var(--nf-white);
    font: inherit;
}

.nf-hint {
    margin: 0.4rem 0 0;
    color: var(--nf-muted);
    font-size: 0.9rem;
}

.nf-view-controls {
    min-width: 12rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.nf-segmented-control {
    display: flex;
}

.nf-view-button,
.nf-button {
    min-height: 2.75rem;
    padding: 0.55rem 1rem;
    border: 2px solid var(--nf-primary);
    color: var(--nf-primary-dark);
    background: var(--nf-white);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

    .nf-view-button:first-child {
        border-radius: 0.25rem 0 0 0.25rem;
    }

    .nf-view-button:last-child {
        margin-left: -2px;
        border-radius: 0 0.25rem 0.25rem 0;
    }

    .nf-view-button:hover,
    .nf-button:hover {
        color: var(--nf-white);
        background: var(--nf-primary-dark);
    }

    .nf-view-button.is-active,
    .nf-view-button[aria-pressed="true"] {
        color: var(--nf-white);
        background: var(--nf-primary);
    }

.nf-print-button {
    border-radius: 0.25rem;
}

.nf-status {
    grid-column: 1 / -1;
    margin: 0;
    font-weight: 700;
}

.nf-categories {
    margin-bottom: 2.5rem;
    padding: 1.25rem;
    border-radius: 0.5rem;
    background: var(--nf-surface);
}

    .nf-categories h2 {
        margin: 0 0 0.75rem;
        font-size: 1.5rem;
    }

    .nf-categories ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem 1.25rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .nf-categories a,
    .nf-back-to-categories a {
        color: var(--nf-primary-dark);
        font-weight: 700;
        text-decoration-thickness: 2px;
        text-underline-offset: 0.2rem;
    }

.nf-category-disclaimer {
    margin: 0;
    padding: 6px 10px;
    background-color: #f2f0eb;
    border-top: 1px solid #a79d8a;
    font-size: 12px;
    font-weight: 700;
    color: #2f2f2f;
    line-height: 1.3;
}

.nf-group-title {
    margin: 3rem 0 1.25rem;
    padding: 0.85rem 1rem;
    color: var(--nf-white);
    background: var(--nf-table-heading);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    text-transform: uppercase;
}

.nf-category {
    margin-bottom: 3rem;
    scroll-margin-top: 2rem;
}

.nf-category-title {
    margin: 0 0 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 3px solid var(--nf-primary);
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.nf-count {
    color: var(--nf-muted);
    font-size: 0.8em;
    font-weight: 400;
}

.nf-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .nf-cards[hidden],
    .nf-table-wrapper[hidden],
    [data-nutrition-item][hidden],
    [data-nutrition-category][hidden],
    .nf-no-results[hidden] {
        display: none;
    }

.nf-card {
    padding: 1.25rem;
    border: 1px solid var(--nf-border);
    border-radius: 0.5rem;
    background: var(--nf-white);
    box-shadow: 0 2px 7px rgb(0 0 0 / 8%);
}

.nf-card-title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
}

.nf-feature {
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--nf-text);
    font-weight: 700;
}

.nf-feature-number {
    margin-right: 0.2rem;
    font-size: 1.8rem;
}

.nf-nutrient-list {
    margin: 0;
}

    .nf-nutrient-list > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 1rem;
        padding: 0.45rem 0;
        border-bottom: 1px solid #dddddd;
    }

        .nf-nutrient-list > div:last-child {
            border-bottom: 0;
        }

    .nf-nutrient-list dt {
        font-weight: 700;
    }

    .nf-nutrient-list dd {
        margin: 0;
        text-align: right;
    }

.nf-sub-nutrient dt {
    padding-left: 1rem;
    font-weight: 400;
}

.nf-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--nf-border);
    border-radius: 0.25rem;
}

.nf-table {
    width: 100%;
    min-width: 90rem;
    border-collapse: collapse;
    background: var(--nf-white);
    font-size: 0.9rem;
    white-space: nowrap;
    text-align: center;
}

    .nf-table caption {
        caption-side: top;
        padding: 0.8rem;
        color: var(--nf-text);
        background: var(--nf-surface);
        font-weight: 700;
        text-align: left;
    }

    .nf-table th,
    .nf-table td {
        padding: 0.75rem;
        border: 1px solid var(--nf-border);
        line-height: 1.35;
        /*text-align: right;*/
        vertical-align: top;
    }

    .nf-table thead th {
        color: var(--nf-white);
        background: var(--nf-table-heading);
    }

    .nf-table th:first-child,
    .nf-table td:first-child {
        text-align: left;
    }

    .nf-table tbody th {
        background: var(--nf-surface);
        font-weight: 700;
    }

    .nf-table tbody tr:nth-child(even) td {
        background: #fafafa;
    }

    .nf-table tbody tr:hover th,
    .nf-table tbody tr:hover td {
        background: #fff6d9;
    }

.nf-back-to-categories {
    margin: 1rem 0 0;
}

.nf-no-results {
    padding: 1.5rem;
    border: 2px solid var(--nf-primary);
    border-radius: 0.5rem;
    background: var(--nf-surface);
    font-weight: 700;
}

@media (max-width: 64rem) {
    .nf-controls {
        grid-template-columns: 1fr 1fr;
    }

    .nf-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 48rem) {
    .nutrition-facts {
        width: min(calc(100% - 1.25rem), 90rem);
        padding-top: 1.25rem;
    }

    .nf-controls {
        grid-template-columns: 1fr;
    }

    .nf-search,
    .nf-status {
        grid-column: auto;
    }

    .nf-view-controls,
    .nf-print-button,
    .nf-segmented-control {
        width: 100%;
    }

    .nf-view-button {
        flex: 1;
    }

    .nf-categories ul {
        display: block;
    }

    .nf-categories li + li {
        margin-top: 0.6rem;
    }
}

@media (forced-colors: active) {
    .nf-notes,
    .nf-controls,
    .nf-categories,
    .nf-card,
    .nf-table-wrapper,
    .nf-no-results {
        border: 1px solid CanvasText;
    }

    .nf-view-button.is-active,
    .nf-view-button[aria-pressed="true"] {
        border: 3px solid Highlight;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nutrition-facts *,
    .nutrition-facts *::before,
    .nutrition-facts *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

@media print {
    .nf-skip-link,
    .nf-controls,
    .nf-categories,
    .nf-back-to-categories,
    .nf-no-results {
        display: none !important;
    }

    .nutrition-facts {
        width: 100%;
        margin: 0;
        padding: 0;
        color: #000000;
    }

    .nf-notes {
        border: 1px solid #000000;
        background: transparent;
    }

    .nf-category {
        break-inside: avoid;
        margin-bottom: 1.5rem;
    }

    .nf-cards {
        display: none !important;
    }

    .nf-table-wrapper {
        display: block !important;
        overflow: visible;
        border: 0;
    }

    .nf-table {
        min-width: 0;
        font-size: 7pt;
    }

        .nf-table caption,
        .nf-table thead th {
            color: #000000;
            background: transparent;
        }

        .nf-table th,
        .nf-table td {
            padding: 0.2rem;
            border: 1px solid #000000;
        }
}
