/* Stable HTML first. These rules do not depend on an enhancement-ready class. */
.festival-template {--ss-detail-border:#dce1e7;--ss-detail-muted:#596471;--ss-detail-surface:#f5f7f9;}
.festival-template .ss-festival-essentials {margin:0 0 2rem;padding:1rem 0 1.5rem;border-bottom:1px solid var(--ss-detail-border);font-family:system-ui,sans-serif;}
.festival-template .ss-festival-essentials__media {float:right;width:96px;height:96px;max-width:25%;margin:0 0 1rem 1rem;}
.festival-template .ss-festival-essentials__media img {display:block;width:100%;height:96px;object-fit:contain;border-radius:10px;}
/* Use the same in-place zoom and return transition as editorial images. */
.festival-template .ss-festival-essentials__media {position:relative;}
.festival-template .ss-festival-essentials__zoom {position:absolute;inset:0;float:none;width:100%;height:100%;padding:0;margin:0;border:0;border-radius:10px;background:none;color:inherit;cursor:zoom-in;opacity:1;outline:none;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;}
.festival-template .ss-festival-essentials__zoom::before {display:none;}
.festival-template .ss-festival-essentials__zoom:focus-visible {outline:1px dotted currentColor;outline-offset:3px;}
.festival-template .ss-festival-essentials__zoom[aria-expanded="true"] + img {border-radius:0;scale:var(--ss-logo-zoom-scale,1)!important;}
@media (prefers-reduced-motion:reduce) {
 .festival-template .lightbox {transition-duration:0s;}
}
.festival-template .ss-festival-essentials__eyebrow {font-size:.75rem;letter-spacing:.13em;text-transform:uppercase;font-weight:700;color:var(--ss-detail-muted);margin:0 0 .65rem;}
.festival-template .ss-festival-essentials .ss-festival-essentials__title {font-size:clamp(1.85rem,4vw,3rem);line-height:1.12;letter-spacing:-.035em;font-weight:750;margin:0 0 1.15rem;overflow-wrap:anywhere;}
.festival-template .ss-festival-essentials__facts {clear:both;display:grid;grid-template-columns:1fr 1fr;gap:.5rem 1.5rem;margin-bottom:1rem;}
.festival-template .ss-festival-essentials__facts p {display:flex;flex-direction:column;gap:.25rem;min-height:80px;margin:0;font-size:1rem;line-height:1.4;overflow-wrap:anywhere;}
.festival-template .ss-festival-essentials__facts span {font-size:.75rem;font-weight:500;color:var(--ss-detail-muted);}
.festival-template .ss-festival-essentials__action {min-height:48px;}
.festival-template .ss-festival-registration {display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:.7rem 1.2rem;border-radius:10px;background:#162b3a!important;color:#fff!important;font-size:.95rem;font-weight:650;line-height:1.4;text-decoration:none;box-sizing:border-box;max-width:100%;overflow-wrap:anywhere;}
.festival-template .ss-festival-registration:hover {background:#25475b!important;}
.festival-template .ss-festival-essentials__nav {clear:both;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem;margin-top:1rem;}
.festival-template .ss-festival-essentials__nav a {display:flex;align-items:center;justify-content:center;min-height:44px;border:1px solid var(--ss-detail-border);border-radius:8px;padding:.4rem;text-decoration:none;font-size:.82rem;font-weight:600;background:var(--ss-detail-surface);color:inherit;overflow-wrap:anywhere;}
.festival-template .ss-festival-essentials a:focus-visible,.festival-template .ss-festival-navigation:focus-visible {outline:3px solid #307cc0;outline-offset:3px;}
.festival-template .ss-festival-essentials__signals {min-height:48px;display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;}
.festival-template .ss-festival-essentials .festival-hero-rating--desktop:not([hidden]) {display:inline-flex!important;position:static;margin:0;}
.festival-template .ss-festival-essentials .ss-festival-badges--header {position:static;margin:0;}
.festival-template .ss-festival-essentials__excerpt {font-size:.95rem;line-height:1.6;}
.festival-template .ss-festival-essentials__styles {font-size:.8rem;display:flex;flex-wrap:wrap;gap:.6rem;}
.festival-template .ss-festival-essentials__styles:empty {display:none;}
/* Mobile-only community row under the registration CTA (desktop keeps the sidebar block only). */
.festival-template .ss-festival-essentials__community:not([hidden]) {display:flex;align-items:center;gap:.6rem;min-height:44px;margin-top:.75rem;}
.festival-template .ss-festival-essentials__community-count {flex:1 1 auto;min-width:0;font-size:.9rem;font-weight:600;line-height:1.3;}
.festival-template .ss-festival-essentials__community-action {flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;min-width:5.5rem;min-height:44px;padding:.5rem 1.1rem;border:1px solid var(--ss-detail-border);border-radius:999px;background:var(--ss-detail-surface);color:inherit;font:inherit;font-size:.9rem;font-weight:650;cursor:pointer;}
.festival-template .ss-festival-essentials__community-action.is-active {border-color:#162b3a;background:#162b3a;color:#fff;}
.festival-template .ss-festival-essentials__community-action:disabled {opacity:.55;cursor:default;}
.festival-template .ss-festival-essentials__community-action:focus-visible {outline:3px solid #307cc0;outline-offset:3px;}
[data-color-scheme='dark'] .festival-template .ss-festival-essentials__community-action.is-active {border-color:#d4e9f5;background:#d4e9f5;color:#132431;}
@media(min-width:768px){.festival-template .ss-festival-essentials__community {display:none!important;}}
/* Existing content is styled in place. No wrappers or inferred people/price relationships. */
.festival-template .post-content>:is(h2,h3,h4) {font-size:1.3rem;line-height:1.35;margin:1.5rem 0 .75rem;scroll-margin-top:5rem;}
.festival-template .post-content>ul[data-content-section]:not([data-pending-section]),
.festival-template .post-content>:is(h2,h3,h4)[id$="dates-registration"]+ul,
.festival-template .post-content>:is(h2,h3,h4)[id$="teachers-artists"]+p,
.festival-template .post-content>:is(h2,h3,h4)[id$="live-music-djs"]+p,
.festival-template .post-content>:is(h2,h3,h4)[id$="what-where"]+ul {border:1px solid var(--ss-detail-border);border-radius:14px;padding:1rem 1.2rem;margin:0 0 1.5rem;list-style:none;font-size:var(--ss-reading-size,1.08rem);line-height:1.7;}
.festival-template .post-content>ul[data-content-section] {display:block;}
.festival-template .post-content>ul[data-content-section]>li {border:0;border-radius:0;box-shadow:none;background:transparent;padding:.65rem 0;margin:0;}
.festival-template .post-content>ul[data-content-section]>li+li {border-top:1px solid var(--ss-detail-border);}
.festival-template .post-content>ul[data-content-section]>li::before {display:none;}
.festival-template .post-content>ul[data-content-section] p {margin:.4rem 0;}
.festival-template .post-content a {overflow-wrap:anywhere;}
.festival-template [data-festival-duplicate][hidden] {display:none!important;}
.festival-template .ss-festival-secondary {margin-top:2.5rem;padding-top:1.5rem;border-top:1px solid var(--ss-detail-border);}
/* The "On this page" TOC renders at its natural height; it scrolls internally only when taller than the viewport. */
.festival-template .ss-festival-navigation {height:auto;max-height:none;box-sizing:border-box;overflow:visible;margin-bottom:1.5rem;}
.festival-template .ss-festival-navigation .toc {position:static;max-height:none;}
/* Active TOC entry: accent colour, no underline. Dark mode uses a light coral of the same hue for contrast. */
.festival-template {--ss-toc-active:var(--ss-accent,#c9162b);}
[data-color-scheme='dark'] .festival-template {--ss-toc-active:#ff6b7a;}
@media(prefers-color-scheme:dark){[data-color-scheme='system'] .festival-template {--ss-toc-active:#ff6b7a;}}
/* No underline in any state: the theme re-adds a transparent underline to links that lose .active and fades
   its colour from the accent, which flashed under the previous entry while scrolling between sections. */
.festival-template .ss-festival-navigation .toc a {text-decoration:none;transition:color .1s;}
.festival-template .ss-festival-navigation .toc a.active {color:var(--ss-toc-active);}
.festival-template .ss-festival-navigation .toc > ul::before {background-color:var(--ss-toc-active);}
.festival-template .ss-festival-anchor {scroll-margin-top:1rem;}
[data-color-scheme='dark'] .festival-template {--ss-detail-border:#414953;--ss-detail-muted:#b6c0cb;--ss-detail-surface:#242a31;}
[data-color-scheme='dark'] .festival-template .ss-festival-registration {background:#d4e9f5!important;color:#132431!important;}
@media(prefers-color-scheme:dark){[data-color-scheme='system'] .festival-template{--ss-detail-border:#414953;--ss-detail-muted:#b6c0cb;--ss-detail-surface:#242a31;}}
@media(max-width:1100px){
 .festival-template.post-has-sidebar .post-content-grid {display:block;}
 .festival-template .post-content-wrapper,.festival-template .post-sidebar {display:block;width:100%;}
 .festival-template .post-content-wrapper>.post-content {margin-top:0;}
 .festival-template .post-sidebar {margin-top:1.5rem;}
}
@media(max-width:620px){
 .festival-template .ss-festival-essentials {padding-top:.75rem;}
 .festival-template .ss-festival-essentials__facts {grid-template-columns:1fr;gap:.25rem;}
 .festival-template .ss-festival-essentials__facts p {min-height:64px;}
 .festival-template .ss-festival-essentials__action a {width:100%;}
}
/* Keep text updates and inherited font metrics from resizing the header column. */
.festival-template .post-content-wrapper>.post-content {width:100%;max-width:100%;margin-inline:0;}
/* The registration CTA spans the full content column on every breakpoint. */
.festival-template .ss-festival-essentials__action a {display:flex;width:100%;max-width:none;}
.festival-template .ss-festival-essentials__action a>span {display:block;width:100%;text-align:center;}
/* Reserve the cover layout without cropping; JS fills the gutters with one solid border colour. */
.festival-template .post-content .ss-festival-cover {aspect-ratio:3/2;background:transparent;}
.festival-template .post-content .ss-festival-cover img {display:block;width:100%;height:100%;object-fit:contain;}
.festival-template .post-content .kg-image-card img,
.festival-template .ss-festival-essentials__media img {background-color:transparent;background-image:none;}
/* Cross-origin images that cannot be sampled keep their natural aspect ratio. */
.festival-template .post-content .ss-festival-cover:has(img[data-festival-natural-frame]) {aspect-ratio:auto;}
.festival-template .post-content img[data-festival-natural-frame] {height:auto;}

.festival-template .ss-festival-essentials__summary {font-size:.95rem;}
.festival-template .ss-festival-essentials__summary>summary {min-height:44px;line-height:1.5;padding:.6rem 0;cursor:pointer;font-weight:600;}
.festival-template .ss-festival-essentials__summary>summary:focus-visible {outline:3px solid #307cc0;outline-offset:3px;}

/* Native and community deep links share clearance below the fixed site navbar. */
.festival-template :is(#festival-wall-title,[id^="festival-wall-post-"],[id^="festival-wall-reply-"],#festival-navigation,#festival-details) {scroll-margin-top:calc(var(--navbar--min-height,64px) + 1rem);}

/* Keep the existing FIE translation hook without inheriting the old mobile hiding rule. */
.festival-template .ss-festival-essentials__summary[open] > .ss-festival-essentials__excerpt {display:block;}

/* D: B proportions, C information hierarchy. No arbitrary compression target. */
.festival-template .ss-festival-essentials__facts {grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.5rem 1.5rem;}
.festival-template .ss-festival-essentials__meta {display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;min-height:36px;margin-top:.5rem;}
.festival-template .ss-festival-essentials__signals {min-height:0;}
.festival-template .ss-festival-essentials__styles {margin:0;line-height:1.5;}
.festival-template .ss-festival-essentials__nav {display:flex;flex-wrap:wrap;gap:.5rem;}
/* Teachers, venues and community share one row; below ~21rem the third link wraps under the first two. */
.festival-template .ss-festival-essentials__nav a {flex:1 1 0;min-width:6.5rem;font-size:.875rem;box-sizing:border-box;}
.festival-template .post-content>:is(h2,h3,h4):is([id="passes"],[id="teachers"],[id="live-bands"],[id="djs"],[id="festival-dates"],[id="festival-teachers"],[id="festival-where"],[id$="dates-registration"],[id$="what-where"])+ul {border:1px solid var(--ss-detail-border);border-radius:14px;padding:1rem 1.2rem;margin:0 0 1.5rem;list-style:none;font-size:var(--ss-reading-size,1.08rem);line-height:1.7;}
.festival-template .post-content>:is(h2,h3,h4):is([id="passes"],[id="teachers"],[id="live-bands"],[id="djs"],[id="festival-dates"],[id="festival-teachers"],[id="festival-where"],[id$="dates-registration"],[id$="what-where"])+ul>li {padding:.65rem 0;margin:0;font-size:inherit;line-height:1.7;}
.festival-template .post-content>:is(h2,h3,h4):is([id="passes"],[id="teachers"],[id="live-bands"],[id="djs"],[id="festival-dates"],[id="festival-teachers"],[id="festival-where"],[id$="dates-registration"],[id$="what-where"])+ul>li+li {border-top:1px solid var(--ss-detail-border);}
.festival-template .post-content>:is(h2,h3,h4):is([id="passes"],[id="teachers"],[id="live-bands"],[id="djs"],[id="festival-dates"],[id="festival-teachers"],[id="festival-where"],[id$="dates-registration"],[id$="what-where"])+ul>li::before {display:none;}
.festival-template .post-content>ul a {display:inline-block;min-height:44px;align-content:center;}
.festival-template .post-content>h1 {scroll-margin-top:calc(var(--navbar--min-height,64px) + 1rem);}
@media(max-width:1100px){.festival-template .ss-festival-navigation {height:auto;max-height:none;min-height:48px;overflow:visible;}}
/* Desktop: the whole right column (TOC, community, share) is one sticky block, so nothing slides under anything.
   The TOC keeps its natural height; the column scrolls internally only when it is taller than the viewport. */
@media(min-width:1101px){
 .festival-template .post-sidebar.post-sidebar-sticky {position:sticky;top:calc(var(--navbar--min-height,58px) + 1rem);align-self:start;max-height:calc(100vh - var(--navbar--min-height,58px) - 2rem);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;}
 .festival-template .ss-festival-navigation {position:static;max-height:none;overflow:visible;}
 /* The share menu opens upwards: a closed menu below the last button would add phantom scroll height to the column. */
 .festival-template .post-sidebar .dropdown-share {top:auto;bottom:100%;margin-top:0;margin-bottom:var(--dropdown--offset);transform:translateY(2px);}
 .festival-template .post-sidebar .dropdown-share.show {transform:translateY(0);}
 .festival-template .post-sidebar .dropdown-share::before {top:auto;bottom:calc(var(--dropdown--offset) * -1);}
}
