/*
 * Tapestry Web Edition — Living Artwork Navigation II
 * Presentation-only enhancement. The Navigation Catalog, hit-region map,
 * routing, category order, and responsive scrolling behavior remain unchanged.
 */
:root {
    --living-nav-champagne: #aa8547;
    --living-nav-champagne-bright: #c5a25d;
    --living-nav-bronze: #74572f;
    --living-nav-shadow: rgba(57, 55, 50, .62);
    --living-nav-ivory-glow: rgba(255, 249, 229, .38);
    --living-nav-glass: rgba(255, 250, 238, .88);
    --living-nav-glass-deep: rgba(238, 226, 198, .84);
}

.navigation-shell {
    background: #eee3c9;
    color: #3c3022;
    border-bottom: 1px solid rgba(102, 77, 39, .42);
    box-shadow: 0 8px 22px rgba(53, 43, 29, .12);
}

.panorama-scroll {
    scrollbar-color: rgba(142, 109, 55, .55) rgba(255, 250, 239, .6);
    scrollbar-width: thin;
}

.panorama-stage {
    isolation: isolate;
}

.category-hit-grid {
    z-index: 2;
}

.category-hit {
    overflow: visible;
    padding: 0;
    color: var(--living-nav-champagne);
    -webkit-tap-highlight-color: transparent;
}

.category-hit::before {
    content: "";
    position: absolute;
    inset: 5% 2%;
    border-radius: 48% 52% 45% 55%;
    background: radial-gradient(ellipse at center, rgba(255, 248, 222, .18), transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 275ms ease;
}

/* Replaces the former generic bar while preserving a calm selected cue. */
.category-hit::after {
    content: none;
}

.category-title {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 16px;
    width: max-content;
    max-width: 170px;
    transform: translateX(-50%);
    transform-origin: center;
    font-family: "Cormorant Garamond", "Baskerville", "Times New Roman", Georgia, serif;
    font-size: clamp(27px, 1.62vw, 33px);
    font-style: italic;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.018em;
    white-space: nowrap;
    color: var(--living-nav-champagne);
    -webkit-text-stroke: .55px rgba(58, 58, 55, .88);
    paint-order: stroke fill;
    text-shadow:
        0 .6px 0 rgba(255, 252, 237, .92),
        0 1.5px 1.5px rgba(42, 41, 38, .58),
        0 0 4px rgba(255, 249, 229, .2);
    filter: saturate(.72) brightness(.93);
    opacity: 1;
    pointer-events: none;
    transition: opacity 260ms ease, color 260ms ease, filter 260ms ease, text-shadow 260ms ease;
}

.category-flourish {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 48px;
    width: min(72%, 88px);
    height: 12px;
    transform: translateX(-50%);
    transform-origin: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 275ms ease, filter 275ms ease;
}

.category-flourish::before,
.category-flourish::after {
    content: "";
    position: absolute;
    top: 5px;
    width: 47%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--living-nav-champagne-bright));
    box-shadow: 0 1px 2px rgba(70, 50, 24, .38);
}

.category-flourish::before {
    left: 0;
}

.category-flourish::after {
    right: 0;
    transform: scaleX(-1);
}

.category-hit:hover::before,
.category-hit:focus-visible::before,
.category-hit.selected::before {
    opacity: 1;
}

.category-hit:hover .category-title,
.category-hit:focus-visible .category-title {
    color: var(--living-nav-champagne-bright);
    filter: saturate(.92) brightness(1.06);
    -webkit-text-stroke-color: rgba(52, 52, 50, .92);
    text-shadow:
        0 .6px 0 rgba(255, 253, 241, .98),
        0 1.5px 1.5px rgba(39, 39, 37, .52),
        0 0 6px var(--living-nav-ivory-glow);
}

.category-hit:hover .category-flourish,
.category-hit:focus-visible .category-flourish,
.category-hit.selected .category-flourish {
    opacity: .88;
}

.category-hit.selected .category-title {
    color: #c9aa66;
    filter: saturate(.94) brightness(1.04);
    -webkit-text-stroke-color: rgba(52, 52, 50, .92);
    text-shadow:
        0 .6px 0 rgba(255, 253, 241, .98),
        0 1.5px 1.5px rgba(39, 39, 37, .5),
        0 0 5px rgba(255, 247, 218, .34);
}

.category-hit.selected .category-flourish {
    filter: brightness(1.08);
}

.category-hit:focus-visible {
    outline: 2px solid rgba(171, 126, 48, .92);
    outline-offset: -5px;
    border-radius: 12px;
}

/*
 * A single quiet title rail keeps every chapter name on the same plane.
 * Desktop and tablet reveal only the title belonging to the hovered/focused
 * artwork region. Touch-sized phone layouts keep every title visible.
 */
.category-hit--today,
.category-hit--household,
.category-hit--home,
.category-hit--family,
.category-hit--people,
.category-hit--money,
.category-hit--library,
.category-hit--lifestyle,
.category-hit--legacy,
.category-hit--google,
.category-hit--system,
.category-hit--steward {
    --title-angle: 0deg;
}

/*
 * Non-phone layouts use a true artwork-hover experience. This width-based
 * rule is deliberate: desktop browsers with touch support can report
 * hover:none even when a mouse is present. Every title shares the same
 * baseline and is revealed only for its own hit region.
 */
@media (min-width: 769px) {
    .category-title {
        top: 16px;
        opacity: 0 !important;
    }

    .category-flourish {
        top: 50px;
        opacity: 0 !important;
    }

    .category-hit:hover .category-title,
    .category-hit:focus-visible .category-title {
        opacity: 1 !important;
    }

    .category-hit:hover .category-flourish,
    .category-hit:focus-visible .category-flourish {
        opacity: .88 !important;
    }

    .category-hit.selected:not(:hover):not(:focus-visible) .category-title,
    .category-hit.selected:not(:hover):not(:focus-visible) .category-flourish {
        opacity: 0 !important;
    }
}

/* Museum-glass child navigation; behavior and NavLink routing are untouched. */
.child-region {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px clamp(14px, 3vw, 44px);
    color: #403425;
    background:
        linear-gradient(180deg, rgba(255, 253, 247, .94), rgba(239, 228, 202, .88)),
        rgba(255, 250, 238, .88);
    border-top: 1px solid rgba(126, 93, 43, .48);
    border-bottom: 1px solid rgba(126, 93, 43, .3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .88),
        inset 0 -1px 0 rgba(125, 91, 42, .12),
        0 5px 15px rgba(61, 48, 30, .08);
    backdrop-filter: blur(8px) saturate(.88);
}

.child-region strong {
    color: var(--living-nav-bronze);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .14em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}

.child-strip {
    gap: 7px;
    padding: 2px 1px 4px;
    scrollbar-color: rgba(142, 109, 55, .48) transparent;
    scrollbar-width: thin;
}

.child-link {
    min-height: 38px;
    padding: 7px 13px;
    border: 1px solid rgba(125, 92, 42, .34);
    border-radius: 999px;
    color: #554631;
    background: rgba(255, 252, 244, .48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: .94rem;
    text-decoration: none;
    transition: background-color 240ms ease, border-color 240ms ease, color 240ms ease, box-shadow 240ms ease;
}

.child-link:hover,
.child-link:focus-visible {
    color: #4c3920;
    border-color: rgba(157, 117, 47, .64);
    background: rgba(255, 249, 232, .8);
}

.child-link.selected {
    color: #4d381b;
    border-color: rgba(151, 106, 36, .76);
    background: linear-gradient(180deg, rgba(232, 207, 145, .82), rgba(205, 169, 91, .72));
    box-shadow:
        inset 0 1px 0 rgba(255, 251, 226, .9),
        0 2px 7px rgba(91, 65, 28, .14);
    font-weight: 600;
}

@media (max-width: 1200px) {
    .category-title {
        font-size: clamp(24px, 2.65vw, 29px);
    }
}

@media (max-width: 768px) {
    .category-title {
        top: 11px;
        font-size: clamp(20px, 4.25vw, 25px);
        opacity: 1;
    }

    .category-flourish {
        top: 40px;
        height: 10px;
    }

    .child-region {
        display: block;
        padding-block: 9px;
    }

    .child-region strong {
        display: block;
        margin-bottom: 7px;
        font-size: 13px;
    }

    .child-link {
        min-height: 44px;
    }
}

@media (hover: none) {
    .category-hit:active .category-title {
        color: var(--living-nav-champagne-bright);
        filter: brightness(1.12);
    }

    .category-hit:active .category-flourish,
    .category-hit:active::before {
        opacity: .9;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-hit::before,
    .category-title,
    .category-flourish,
    .child-link {
        transition: none;
    }
}

/* PATCH 38 — quiet artwork interaction ------------------------------------ */
.category-hit::before {
    inset: 5% 3% 10%;
    border-radius: 42%;
    background: radial-gradient(ellipse at center,
        rgba(255, 246, 205, .58) 0%,
        rgba(255, 240, 178, .25) 38%,
        transparent 72%);
    box-shadow: none;
    filter: brightness(1.05);
    transition: none;
}

.category-hit:hover::before,
.category-hit:focus-visible::before {
    opacity: .92;
}

.category-hit.selected::before {
    opacity: .42;
}

.category-title,
.category-flourish {
    display: none !important;
}

.category-hit,
.category-hit::before,
.child-link {
    transition: none !important;
    animation: none !important;
}

@media (max-width: 768px) {
    /* The labels are part of the panorama artwork, so the phone crop ends
       above that engraved title rail. The artwork remains fully scrollable. */
    .panorama-stage {
        height: 126px;
        background-size: auto 164px;
        background-position: center top;
    }

    .child-region strong {
        display: none;
    }
}

/* PATCH 40 — recalibrated hit map for the replacement panorama.
   Percentages follow the visual centers of the twelve painted vignettes. */
.category-hit-grid{
    grid-template-columns:
        11.0% 9.3% 9.1% 8.7% 8.7% 8.7%
        8.5% 7.8% 6.7% 6.8% 7.3% 7.4% !important;
}
.category-hit--today{grid-column:1 !important}
.category-hit--household{grid-column:2 !important}
.category-hit--home{grid-column:3 !important}
.category-hit--family{grid-column:4 !important}
.category-hit--people{grid-column:5 !important}
.category-hit--money{grid-column:6 !important}
.category-hit--library{grid-column:7 !important}
.category-hit--lifestyle{grid-column:8 !important}
.category-hit--legacy{grid-column:9 !important}
.category-hit--google{grid-column:10 !important}
.category-hit--system{grid-column:11 !important}
.category-hit--steward{grid-column:12 !important}
