﻿/* Opt-in category presentation; a zero/default configuration adds no layout class. */
.jcGroup { box-sizing:border-box; }
.jcGroup:where([data-jc-layout]:not([data-jc-layout="0"])) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px 14px; padding:0 12px 20px; align-items:stretch; }
/* Explicit layouts must also override the preview's legacy flex wrapper. */
.jcGroup[data-jc-layout]:not([data-jc-layout="0"]) { display:grid; }
.jcGroup[data-jc-layout="2"] { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px 12px; }
.jcGroup[data-jc-layout="3"] { grid-template-columns:minmax(0,1fr); }
:is(.jcGroup,.jcSpaced)[data-jc-spacing="1"] { padding-inline:8px !important; gap:8px !important; }
:is(.jcGroup,.jcSpaced)[data-jc-spacing="2"] { padding-inline:20px !important; gap:24px !important; }
:is(.jcGroup,.jcSpaced)[data-jc-spacing="3"] { padding-inline:0 !important; }
.jcGroup[data-jc-layout="0"][data-jc-spacing]:not([data-jc-spacing="0"]) > .jcTile { margin-inline:0; max-width:100%; }
.jcGroup > .jcTile { position:relative; box-sizing:border-box; background-image:none !important; display:grid; grid-template-columns:minmax(0,1fr); align-content:start; align-items:stretch; padding:0 !important; box-shadow:none !important; }
.jcGroup:not([data-jc-layout="0"]) > .jcTile { width:auto !important; min-width:0; min-height:0; margin:0; }
.jcGroup[data-jc-layout] > .jcTile { display:grid; }
.jcTile.jcImage::before { content:""; display:block; width:100%; aspect-ratio:var(--jc-ratio,1); background-image:var(--jc-image); background-position:center; background-size:cover; background-repeat:no-repeat; min-height:0; }
.jcTile[data-jc-fit="2"]::before { background-size:contain; }
.jcTile > .jcCaption { display:block !important; position:static !important; inset:auto !important; transform:none !important; box-sizing:border-box; width:100%; max-width:100%; padding:10px 8px !important; margin:0 !important; white-space:normal; word-break:normal; hyphens:manual; overflow-wrap:anywhere; -webkit-line-clamp:unset !important; background:none !important; line-height:1.25; }
/* Only collapsed captions are fitted; expanded headings keep their existing typography. */
.jcTile:not(.active) > .jcCaption[data-jc-fitted] { font-size:var(--jc-caption-size) !important; }
.jcTile[data-jc-position="center"] > .jcCaption { text-align:center; }
.jcTile.jcImage:is([data-jc-position="bottom"],[data-jc-position="center"],[data-jc-position="top"])::before,
.jcTile.jcImage:is([data-jc-position="bottom"],[data-jc-position="center"],[data-jc-position="top"]) > .jcCaption { grid-area:1 / 1; }
.jcTile[data-jc-position="bottom"] > .jcCaption { align-self:end; }
.jcTile[data-jc-position="center"] > .jcCaption { align-self:center; }
.jcTile[data-jc-position="top"] > .jcCaption { align-self:start; }
.jcTile.jcImage > .jcCaption { z-index:1; }
.jcTile[data-jc-position="beside"] { grid-template-columns:minmax(0,36%) minmax(0,1fr); align-items:center; text-align:start; }
.jcTile:not(.jcImage) { min-height:60px !important; align-content:center; }
.jcTile[data-jc-effect="0"]::before { box-shadow:var(--jc-legacy-shadow,none); }
.jcTile.jcImage[data-jc-effect="0"]:not([data-jc-position="below"]):not([data-jc-position="beside"]) > .jcCaption { background:var(--jc-legacy-background,transparent) !important; }
.jcTile[data-jc-effect="2"]::before { box-shadow:inset 0 0 0 1000px rgba(10,10,10,.3); }
.jcTile.jcImage[data-jc-effect="3"] > .jcCaption { background:linear-gradient(transparent,rgba(0,0,0,.7)) !important; }
.jcTile.jcImage[data-jc-effect="4"] > .jcCaption { background:var(--jc-band,rgba(0,0,0,.55)) !important; }
/* Keep accessible names in the document while hiding image-only captions visually. */
.jcTile.jcImageOnly:not(.active) > .jcCaption { position:absolute !important; width:1px !important; height:1px; margin:-1px !important; padding:0 !important; overflow:hidden; clip-path:inset(50%); }
.jcTile:focus-visible { outline:2px solid currentColor; outline-offset:-3px; }
.jcGroup[data-jc-layout="4"] > .jcTile:not([data-jc-shape="pair"]) { grid-column:1 / -1; }
.jcGroup[data-jc-layout="4"] > .jcTile[data-jc-shape="cover"]::before,
.jcGroup[data-jc-layout="4"] > .jcTile[data-jc-shape="spread"]:not([data-jc-position="beside"])::before { aspect-ratio:1.85; }
.jcGroup[data-jc-layout="4"] > .jcTile[data-jc-shape="text"] { min-height:100px !important; border-block:1px solid currentColor; }
.jcGroup[data-jc-layout="4"] > .jcTile[data-jc-position="beside"] { grid-template-columns:minmax(0,42%) minmax(0,1fr); }
/* Accordion children own their configuration: never select their labels through a parent. */
.jcGroup > .jcTile.active { grid-column:1 / -1; width:100% !important; display:flex; flex-direction:column; box-shadow:none; }
.jcTile.active::before { display:none; }
.jcTile.active > .jcCaption { text-align:start; background:none !important; padding-inline-end:70px !important; }
.jcTile:not(.active) > .sectionCategoriesWrapper { display:none !important; }
.jcTile.active > .sectionCategoriesWrapper { width:100%; max-height:none !important; box-sizing:border-box; }
/* Old parent layout + an independently enhanced child layout. */
.menuSectionTitle.active:has(> .jcGroup) { max-width:100%; box-sizing:border-box; }
@media (prefers-reduced-motion:reduce) { .jcTile > .sectionCategoriesWrapper { transition:none; } }

.jcGroup > .jcTile[hidden] { display:none !important; }

/* Independent overrides apply only to the chosen tile, never to nested categories.
   With no explicit override, every original border/alignment/icon rule remains intact. */
.jcDecorated[data-jc-align="1"], .jcDecorated[data-jc-align="1"] > :is(.menuSectionName,.categoryName) { text-align:left !important; }
.jcDecorated[data-jc-align="2"], .jcDecorated[data-jc-align="2"] > :is(.menuSectionName,.categoryName) { text-align:center !important; }
.jcDecorated[data-jc-align="3"], .jcDecorated[data-jc-align="3"] > :is(.menuSectionName,.categoryName) { text-align:right !important; }
.jcDecorated[data-jc-border="1"] { border:0 !important; }
.jcDecorated[data-jc-border="2"] { border:1px solid currentColor !important; box-sizing:border-box; }
.jcDecorated[data-jc-indicator] > :is(.menuSectionName,.categoryName) > i { display:none !important; }
.jcDirection { display:inline-block; box-sizing:border-box; width:.45em; height:.45em; border-right:.09em solid currentColor; border-bottom:.09em solid currentColor; margin-inline:.12em .5em; vertical-align:.06em; pointer-events:none; }
.jcDecorated.active > .menuSectionName > .jcDirection { display:none; }

.jcDecorated[data-jc-align] > :is(.menuSectionName,.categoryName) { width:100%; box-sizing:border-box; }

/* Match the tallest below-image caption in each visible row. */
.jcTile:not(.active):not(.jcImageOnly)[data-jc-position="below"] > .jcCaption { padding-block:calc(10px + var(--jc-caption-extra,0px) / 2) !important; }
/* Six tracks permit one-, two- and three-column rows in the chosen sequence. */
.jcGroup[data-jc-layout="4"][data-jc-custom-rows] { grid-template-columns:repeat(6,minmax(0,1fr)); }
.jcGroup[data-jc-layout="4"][data-jc-custom-rows] > .jcTile[data-jc-columns="1"] { grid-column:span 6; }
.jcGroup[data-jc-layout="4"][data-jc-custom-rows] > .jcTile[data-jc-columns="2"] { grid-column:span 3; }
.jcGroup[data-jc-layout="4"][data-jc-custom-rows] > .jcTile[data-jc-columns="3"] { grid-column:span 2; }
.jcGroup[data-jc-layout="4"][data-jc-custom-rows] > .jcTile.active { grid-column:1 / -1; }

/* Spacing is decoration even for the original single-column / image-shaped cards. */
.jcSpaced:not(.jcGroup) { box-sizing:border-box; }
.jcSpaced:not(.jcGroup) > :is(.menuSectionTitle,.sectionCategory):not(.active) { margin:0; max-width:100%; }
.jcSpaced:not(.jcGroup) > .landscapeImage:not(.active) { width:100%; }
.jcSpaced[data-jc-spacing="3"] { column-gap:0; }
/* Height belongs to the collapsed card; opening its children never clips them. */
.menuSideBar .jcSized:not(.active),.jcPreview .jcSized:not(.active) { height:auto !important; min-height:var(--jc-card-height) !important; aspect-ratio:auto !important; }
.jcGroup > .jcSized.jcTile:not(.active) { min-height:var(--jc-card-height) !important; grid-template-rows:minmax(0,1fr); }
.jcGroup > .jcSized.jcTile:not(.active)[data-jc-position="below"] { grid-template-rows:minmax(0,1fr) auto; }
.jcGroup > .jcSized.jcTile:not(.active)::before { aspect-ratio:auto; height:100%; min-height:0; }
.jcSized:not(.active) > :is(.menuSectionName,.categoryName) { white-space:normal; overflow-wrap:anywhere; -webkit-line-clamp:unset; }
