/* DANZO San Marino V5 — image clarity and reliable text layers, scoped only to San Marino. */
:root{--sm-hero-min:320px}
body:has(#country-data) .hero{height:clamp(300px,24vw,380px)!important;min-height:300px!important;overflow:hidden;isolation:isolate}
body:has(#country-data) .hero>img{object-fit:cover!important;object-position:center 42%!important;filter:none!important;transform:none!important}
body:has(#country-data) .hero-glow,html[dir="rtl"] body:has(#country-data) .hero-glow{display:flex!important;align-items:flex-end!important;justify-content:center!important;padding:18px 26px 28px!important;background:linear-gradient(0deg,rgba(5,16,29,.92) 0%,rgba(5,16,29,.76) 34%,rgba(5,16,29,.20) 74%,rgba(5,16,29,.06) 100%)!important;inset:0;overflow:hidden}
body:has(#country-data) .hero-text,html[dir="rtl"] body:has(#country-data) .hero-text{display:flex!important;flex-direction:column!important;gap:5px!important;align-items:center!important;justify-content:center!important;position:relative!important;margin:0!important;max-width:min(720px,95%)!important;padding:0!important;transform:none!important;box-shadow:none!important;min-height:0!important;text-align:center!important}
body:has(#country-data) .hero h1{font-size:clamp(35px,5vw,59px)!important;line-height:1.15!important;max-width:100%;margin:0!important;color:white!important;text-wrap:balance!important;overflow-wrap:anywhere!important}
body:has(#country-data) .hero p{display:block!important;position:static!important;font-size:clamp(13px,1.35vw,19px)!important;line-height:1.5!important;max-width:620px!important;margin:0!important;color:#fff!important;text-shadow:0 2px 12px #071525!important;white-space:normal!important;overflow-wrap:anywhere!important}
body:has(#country-data) .hero .flag{max-width:80px;height:44px!important;margin:0 0 4px!important}
.dance-page .dhero{min-height:clamp(410px,38vw,530px)!important;isolation:isolate}
.dance-page .dhero>img{opacity:1!important;object-fit:cover!important;object-position:center center!important}
.dance-page .dhero::after,html[dir="rtl"] .dance-page .dhero::after{background:linear-gradient(0deg,rgba(15,10,41,.97) 0%,rgba(20,12,55,.76) 42%,rgba(25,12,50,.16) 100%)!important}
.dance-page .dhero-in{padding:20px 0 34px!important;width:100%}
.dance-page .dhero h1{font-size:clamp(34px,5.8vw,70px)!important;line-height:1.08!important;max-width:900px!important;overflow-wrap:anywhere!important;text-wrap:balance!important}
.dance-page .dhero .tagline{font-size:clamp(14px,1.7vw,20px)!important;max-width:820px!important;line-height:1.5!important}
.dance-page .dhero .crumbs-row{margin-bottom:clamp(15px,2.3vw,34px)!important}
.dance-page .dhero .aurora{opacity:.20;pointer-events:none}
.san-marino-photo-note{font-size:12px;color:#596a83}
.sm-photo-credit{text-align:center!important;font-size:11px!important;margin:17px auto!important;opacity:.8}
.sm-photo-credit a{text-decoration:underline!important;color:inherit!important}
/* Respect the Scotland card geometry and avoid oversized images. */
body:has(#country-data) #dances.dances{grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
body:has(#country-data) #dances .dcard .ph{aspect-ratio:200/130;overflow:hidden}
body:has(#country-data) #dances .dcard .ph img{object-fit:cover!important;max-width:100%!important}
@media(max-width:1100px){body:has(#country-data) #dances.dances{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){body:has(#country-data) #dances.dances{grid-template-columns:repeat(2,minmax(0,1fr))}body:has(#country-data) .hero{height:330px!important}body:has(#country-data) .hero-glow{padding:15px 12px 20px!important}body:has(#country-data) .hero h1{font-size:38px!important}}
@media(max-width:390px){body:has(#country-data) #dances.dances{grid-template-columns:1fr}}

/* V6 owner-requested: remove the colorful dots and duplicate section jump strip on dance pages. */
body.dance-page nav.jump{display:none!important}
body.dance-page .dhero,body.dance-page .dhero img{image-rendering:auto!important}
/* Anchor links point to chapters rendered by history.js; allow room for sticky global header. */
html:has(#history-data) section.chap{scroll-margin-top:110px}
/* Images should crop cleanly, never stretch or blur with filters. */
body:has(#country-data) .place img,body:has(#country-data) .dcard img,.history-page .ex img,.history-page .chap img{object-fit:cover!important;filter:none!important;image-rendering:auto!important}
