/* Integration with DataMairies: live panels, original photos and larger crests.
   Each page loads exactly one original, unmodified pack before this adapter. */
.commune-theme { --app-primary: var(--dm-primary, var(--dm-green)); }
.commune-theme figure { margin: 0; }
.commune-theme .proposal-strip { padding: 7px 20px; font-size: 10px; text-align: center; }
.commune-theme .dm-header { position: relative; z-index: 5; }
.commune-theme .dm-header .dm-header-inner { min-height: 128px; height: auto; padding-block: 10px; }
.commune-theme .dm-header .dm-brand { flex-shrink: 1; min-width: 0; max-width: 52%; }
.commune-theme.municipal .dm-header .town-crest { width: 90px; height: 104px; flex: 0 0 90px; object-fit: contain; }
.commune-theme .dm-brand-copy { min-width: 0; }
.commune-theme .dm-header .dm-brand strong { overflow-wrap: anywhere; font-size: clamp(22px, 2.15vw, 31px); }
.commune-theme .dm-header .dm-brand small { line-height: 1.4; }
.commune-theme .brand-icon { display: grid; place-items: center; flex: 0 0 64px; width: 64px; height: 64px; border-radius: 20px; background: var(--app-primary); color: white; font-size: 34px; font-weight: 800; }
.commune-theme .brand-icon > span { display: none; }
.commune-theme .municipal-tabs { display: none; }
.commune-theme .dm-hero-grid > * { min-width: 0; }
.commune-theme .dm-hero-photo { object-fit: cover; }
.commune-theme.theme-jardin .dm-hero-photo { aspect-ratio: 1.65; border-radius: 175px 175px 34px 34px; }
.commune-theme .section-content { padding-block: 30px 48px; }
.commune-theme.municipal .content-heading { align-items: start; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.commune-theme .content-heading p { color: var(--dm-muted); max-width: 75ch; }
.commune-theme .photo-tiles { margin-bottom: 45px; }
.commune-theme .local-story { margin-bottom: 45px; }
.commune-theme .local-story > * { min-width: 0; }
.commune-theme .local-story .dm-discover-copy { overflow-wrap: anywhere; }
.commune-theme .facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-block: 22px; }
.commune-theme .facts > div { min-width: 0; border-left: 2px solid var(--dm-line); padding-left: 12px; }
.commune-theme .facts > div:last-child { grid-column: 1/-1; }
.commune-theme .facts strong { display: block; font-size: 23px; line-height: 1.2; }
.commune-theme .facts span { display: block; font-size: 11px; color: var(--dm-muted); margin-top: 5px; }
.commune-theme .local-discover-link { background: var(--app-primary); color: white; margin-top: 3px; }
.commune-theme .content-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 23px; }
.commune-theme .info-panel, .commune-theme .contact-panel { border-radius: 24px; padding: 29px; min-width: 0; overflow-wrap: anywhere; }
.commune-theme .info-panel { background: white; border: 1px solid var(--dm-line); }
.commune-theme .info-panel h3, .commune-theme .contact-panel h3 { font-size: 25px; line-height: 1.2; margin-bottom: 17px; letter-spacing: -.03em; }
.commune-theme .info-panel p { margin-block: 12px; line-height: 1.7; }
.commune-theme .contact-panel { position: relative; isolation: isolate; overflow: hidden; background: var(--app-primary); color: white; }
.commune-theme .contact-panel::before { content: ""; position: absolute; z-index: -1; right: -120px; top: -90px; width: 280px; height: 280px; border: 45px solid #ffffff09; border-radius: 50%; box-shadow: 0 0 0 36px #ffffff05; }
.commune-theme .eyebrow { font-size: 10px; letter-spacing: .15em; font-weight: 800; margin-bottom: 13px; text-transform: uppercase; }
.commune-theme .contact-panel > p:not(.eyebrow) { font-size: 14px; line-height: 1.7; }
.commune-theme .contact-panel > a { display: inline-block; font-size: 12px; margin-top: 12px; text-decoration: underline; text-underline-offset: 4px; }
.commune-theme .contact-lines { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 20px; }
.commune-theme .contact-lines a { min-height: 44px; display: flex; align-items: center; padding: 10px 14px; border: 1px solid currentColor; border-radius: 12px; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; max-width: 100%; }
.commune-theme .hours-list { padding: 0; margin: 14px 0; list-style: none; }
.commune-theme .hours-list li { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); gap: 12px; padding-block: 12px; border-bottom: 1px solid var(--dm-line); font-size: 13px; }
.commune-theme .source-note { font-size: 12px; color: var(--dm-muted); margin-top: 18px; }
.commune-theme .source-note a { text-decoration: underline; }
.commune-theme .service-list { display: grid; gap: 12px; }
.commune-theme .service-list a { display: flex; justify-content: space-between; gap: 12px; padding: 15px; border: 1px solid var(--dm-line); border-radius: 12px; font-weight: 650; font-size: 14px; }
.commune-theme .service-list a:hover { background: var(--dm-cream); }
.commune-theme .school-item { border-top: 1px solid var(--dm-line); padding-block: 16px; }
.commune-theme .school-item h4 { font-size: 18px; margin: 0 0 8px; }
.commune-theme .school-item p { margin-block: 5px; font-size: 14px; }
.commune-theme .municipal-footer { background: var(--dm-cream); border-top: 1px solid var(--dm-line); padding-block: 30px; }
.commune-theme .municipal-footer > div { display: flex; justify-content: space-between; gap: 35px; }
.commune-theme .municipal-footer .brand { font-weight: 800; font-size: 25px; }
.commune-theme .municipal-footer p { color: var(--dm-muted); font-size: 12px; margin-top: 8px; }
.commune-theme .municipal-footer nav { display: grid; gap: 12px; align-content: start; font-size: 13px; }
.commune-theme .municipal-footer a { overflow-wrap: anywhere; }
.commune-theme .municipal-footer .contact-lines { margin-bottom: 0; }
.commune-theme .media-fallback { background: var(--dm-cream); min-height: 180px; }
/* Verified context retains its content contract, in the active theme's colors. */
.commune-theme .history-card, .commune-theme .mayor-card { padding: 30px; border: 1px solid var(--dm-line); border-radius: 24px; background: var(--dm-cream); margin-bottom: 28px; }
.commune-theme .history-card h3, .commune-theme .mayor-card h3 { font-size: 30px; margin-bottom: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.commune-theme .history-text { max-width: 950px; }
.commune-theme .history-text p { line-height: 1.8; margin-bottom: 16px; }
.commune-theme .history-credit { font-size: 12px; color: var(--dm-muted); margin-top: 22px; }
.commune-theme .history-credit a { color: var(--app-primary); text-decoration: underline; }
.commune-theme .history-credit span { display: block; font-size: 10px; margin-top: 9px; }
.commune-theme .mayor-card { display: flex; align-items: center; gap: 36px; }
.commune-theme .mayor-card p { color: var(--dm-muted); }
.commune-theme .mayor-since { font-size: 13px; margin-top: 12px; }
.commune-theme .mayor-portrait { flex-shrink: 0; width: 210px; height: 260px; object-fit: cover; border-radius: 18px; }
.commune-theme .local-news { margin-block: 15px 45px; }
.commune-theme .news-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
.commune-theme .news-card { background: var(--dm-cream); border: 1px solid var(--dm-line); border-radius: 22px; padding: 25px; display: flex; flex-direction: column; min-width: 0; }
.commune-theme .news-card:nth-child(2) { background: #edf7f2; }
.commune-theme .news-card:nth-child(3) { background: #fff4e5; }
.commune-theme .news-meta { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--dm-muted); margin-bottom: 19px; }
.commune-theme .news-meta span { font-weight: 700; color: var(--app-primary); }
.commune-theme .news-card h3 { font-size: 23px; line-height: 1.25; letter-spacing: -.025em; margin-bottom: 24px; overflow-wrap: anywhere; }
.commune-theme .news-read { font-size: 12px; font-weight: 700; color: var(--app-primary); margin-top: auto; }
.commune-theme .news-card a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Current menu state remains owned by commune.js. */
@media(max-width:1100px) {
 .commune-theme .dm-header .dm-header-inner { flex-wrap: wrap; gap: 12px; padding-block: 12px; }
 .commune-theme .dm-header .dm-brand { max-width: 100%; }
 .commune-theme .dm-header .dm-nav { width: 100%; justify-content: flex-end; }
}
@media(max-width:780px) {
 .commune-theme .dm-header .dm-header-inner { min-height: 100px; flex-wrap: nowrap; gap: 10px; }
 .commune-theme .dm-header .dm-brand { max-width: calc(100% - 85px); gap: 10px; }
 .commune-theme.municipal .dm-header .town-crest { width: 64px; height: 76px; flex-basis: 64px; }
 .commune-theme .dm-header .dm-brand strong { font-size: 20px; letter-spacing: -.6px; }
 .commune-theme .dm-header .dm-brand small { font-size: 9px; }
 .commune-theme .dm-header .dm-menu-button { display: inline-flex; flex-shrink: 0; font-size: 12px; padding: 9px 10px; }
 .commune-theme .dm-header .dm-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; width: 100%; padding: 18px; background: var(--dm-paper); box-shadow: 0 15px 25px #0002; border-bottom: 1px solid var(--dm-line); flex-wrap: wrap; justify-content: center; gap: 10px 20px; }
 .commune-theme.menu-open .dm-header .dm-nav { display: flex; }
 .commune-theme .content-grid, .commune-theme .news-grid { grid-template-columns: minmax(0,1fr); }
 .commune-theme .section-content { padding-block: 22px 35px; }
 .commune-theme .content-heading h2 { overflow-wrap: anywhere; }
 .commune-theme .info-panel, .commune-theme .contact-panel { padding: 24px; }
 .commune-theme .photo-tiles, .commune-theme .local-story { margin-bottom: 30px; }
 .commune-theme .municipal-footer > div { flex-direction: column; }
 .commune-theme .history-card, .commune-theme .mayor-card { padding: 24px; }
 .commune-theme .mayor-card { flex-direction: column; align-items: flex-start; gap: 22px; }
 .commune-theme .mayor-portrait { width: 180px; height: 220px; align-self: center; }
 .commune-theme .history-card h3, .commune-theme .mayor-card h3 { font-size: 27px; }
 .commune-theme .history-text p { font-size: 14px; }
}
@media(max-width:360px) {
 .commune-theme .dm-header .dm-brand strong { font-size: 18px; }
 .commune-theme .dm-header .dm-brand small { display: none; }
 .commune-theme .dm-header .dm-brand { max-width: calc(100% - 70px); }
 .commune-theme .hours-list li { grid-template-columns: minmax(0,1fr); gap: 5px; }
 .commune-theme .info-panel, .commune-theme .contact-panel { padding: 20px; }
}
.commune-theme.theme-jardin .dm-stories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 23px; }
.commune-theme.theme-jardin .dm-story { --story-color: #ad2466; --story-tint: #fff0f6; position: relative; min-width: 0; border: 1px solid var(--dm-line); border-radius: 22px; background: white; box-shadow: 0 5px 14px #37205204; transition: transform .22s ease, box-shadow .22s ease; }
.commune-theme.theme-jardin .dm-story--teal { --story-color: #087b72; --story-tint: #eaf7f2; }
.commune-theme.theme-jardin .dm-story--blue { --story-color: #265ccd; --story-tint: #edf2ff; }
.commune-theme.theme-jardin .dm-story-image { overflow: hidden; position: relative; border-radius: 21px 21px 0 0; background: var(--story-tint); }
.commune-theme.theme-jardin .dm-story-image img { width: 100%; height: 204px; object-fit: cover; transition: transform .4s ease; }
.commune-theme.theme-jardin .dm-story-chip { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 6px; color: var(--story-color); background: #fffdfaf5; border: 1px solid #ffffff90; border-radius: 50px; padding: 6px 11px; font-size: 11px; font-weight: 750; }
.commune-theme.theme-jardin .dm-story-chip .dm-icon { width: 15px; height: 15px; }
.commune-theme.theme-jardin .dm-story-body { position: relative; padding: 20px 22px 19px; border-top: 3px solid var(--story-color); }
.commune-theme.theme-jardin .dm-story-body h3 { font-size: 24px; letter-spacing: -.045em; line-height: 1.2; }
.commune-theme.theme-jardin .dm-story-body p { margin-top: 9px; font-size: 14px; color: var(--dm-muted); min-height: 42px; }
.commune-theme.theme-jardin .dm-story-link { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; margin-top: 11px; padding: 0; color: var(--story-color); font-size: 13px; font-weight: 750; text-align: left; border: 0; background: none; }
.commune-theme.theme-jardin .dm-story-link::after { content: ""; position: absolute; inset: 0; border-radius: 22px; }
.commune-theme.theme-jardin .dm-story-link > span:last-child { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--story-tint); }
.commune-theme.theme-jardin .dm-story-link .dm-icon { width: 19px; height: 19px; }
.commune-theme.theme-jardin .dm-story:focus-within { outline: 3px solid var(--story-color); outline-offset: 4px; }
.commune-theme.theme-jardin .dm-story-link:focus-visible { outline: none; }
.commune-theme.theme-jardin .dm-discover { padding-block: 0 49px; }
.commune-theme.theme-jardin .dm-discover-card { display: grid; grid-template-columns: 1fr 1fr; gap: 43px; padding: 27px; border-radius: 28px; background: var(--dm-cream); border: 1px solid var(--dm-line); align-items: center; }
.commune-theme.theme-jardin .dm-discover-picture { position: relative; min-width: 0; }
.commune-theme.theme-jardin .dm-discover-picture > img { width: 100%; height: 318px; object-fit: cover; border-radius: 18px 60px 18px 18px; }
.commune-theme.theme-jardin .dm-place-label { position: absolute; bottom: 15px; left: 15px; display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 12px; color: var(--dm-ink); background: #fffdf8f2; font-size: 12px; font-weight: 700; }
.commune-theme.theme-jardin .dm-place-label .dm-icon { color: var(--dm-primary); width: 18px; height: 18px; }
.commune-theme.theme-jardin .dm-discover-copy { padding-right: 14px; }
.commune-theme.theme-jardin .dm-discover-copy h2 { font-size: clamp(29px, 2.75vw, 39px); font-weight: 750; letter-spacing: -.045em; line-height: 1.1; }
.commune-theme.theme-jardin .dm-discover-copy h2 span { color: var(--dm-primary); }
.commune-theme.theme-jardin .dm-discover-copy > p:not(.dm-source-note) { margin-top: 15px; color: var(--dm-muted); font-size: 14px; line-height: 1.7; }
.commune-theme.theme-jardin .dm-stats { display: flex; flex-wrap: wrap; gap: 18px; margin: 20px 0; }
.commune-theme.theme-jardin .dm-stats > div { display: flex; flex-direction: column; flex: 1; min-width: 88px; padding-left: 13px; border-left: 2px solid var(--dm-green-light); }
.commune-theme.theme-jardin .dm-stats dt { font-size: 11px; color: var(--dm-muted); margin-top: 4px; }
.commune-theme.theme-jardin .dm-stats dd { order: -1; margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.03em; color: var(--dm-ink); font-weight: 750; }
.commune-theme.theme-jardin .dm-source-note { font-size: 10px; color: var(--dm-muted); margin-top: 13px; }
.commune-theme.theme-jardin .dm-discover .dm-btn { min-height: 47px; }

.commune-theme.theme-jardin .dm-discover-copy .dm-overline { color: var(--dm-green); }
@media(max-width:780px) {
 .commune-theme.theme-jardin .dm-stories, .commune-theme.theme-jardin .dm-discover-card { grid-template-columns: minmax(0,1fr); }
 .commune-theme.theme-jardin .dm-discover-card { padding: 22px; gap: 24px; }
 .commune-theme.theme-jardin .dm-discover-picture > img { height: auto; aspect-ratio: 1.6; }
 .commune-theme.theme-jardin .dm-story-image img { height: auto; aspect-ratio: 1.7; }
}

/* Wikipedia memory: shared by every municipal theme, beside the original crest. */
.commune-theme .memory-home-icon { display: flex; flex-shrink: 0; color: inherit; }
.commune-theme .memory-home-name { color: inherit; display: block; }
.commune-theme .dm-header .dm-brand-copy .memory-access { display: inline-flex; align-items: center; gap: 8px; margin-top: 5px; padding-block: 7px; font-size: 13px; line-height: 1.35; font-weight: 750; color: var(--app-primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; letter-spacing: 0; }
.commune-theme .memory-access:hover, .commune-theme .memory-read:hover { text-decoration-thickness: 2px; }
.commune-theme .memory-heading { margin-bottom: 34px; }
.commune-theme .memory-heading .eyebrow { color: var(--app-primary); }
.commune-theme .memory-heading h2 { font-size: clamp(32px, 3.7vw, 52px); line-height: 1.1; letter-spacing: -.045em; max-width: 22ch; }
.commune-theme .memory-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,.85fr); gap: 48px; align-items: start; }
.commune-theme .memory-narrative, .commune-theme .memory-visuals { min-width: 0; }
.commune-theme .memory-intro { font-size: 18px; line-height: 1.8; color: var(--dm-muted); margin: 0 0 32px; }
.commune-theme .memory-chapter { margin-bottom: 32px; }
.commune-theme .memory-chapter h3 { color: var(--app-primary); font-size: 25px; line-height: 1.25; letter-spacing: -.025em; margin-bottom: 17px; }
.commune-theme .memory-chapter p { font-size: 16px; line-height: 1.85; margin-bottom: 14px; overflow-wrap: anywhere; }
.commune-theme .memory-visuals { display: grid; gap: 25px; }
.commune-theme .memory-figure { border: 1px solid var(--dm-line); border-radius: 22px; overflow: hidden; background: var(--dm-cream); }
.commune-theme .memory-figure a { display: block; }
.commune-theme .memory-figure img { display: block; width: 100%; height: auto; max-height: 430px; object-fit: contain; background: white; }
.commune-theme .memory-figure figcaption { padding: 13px 17px; font-size: 12px; line-height: 1.6; color: var(--dm-muted); overflow-wrap: anywhere; }
.commune-theme .memory-map img { max-height: 540px; }
.commune-theme .memory-source { border-top: 1px solid var(--dm-line); margin-top: 32px; padding-top: 22px; font-size: 14px; line-height: 1.7; }
.commune-theme .memory-source > a, .commune-theme .memory-read { display: inline-block; color: var(--app-primary); font-weight: 750; text-decoration: underline; text-underline-offset: 4px; padding-block: 10px; }
.commune-theme .memory-source span { display: block; color: var(--dm-muted); font-size: 11px; margin-top: 8px; }
.commune-theme .memory-source span a { text-decoration: underline; }
.commune-theme .memory-read { margin-top: 12px; font-size: 14px; }
@media (max-width: 780px) {
 .commune-theme .dm-header .dm-brand-copy .memory-access { font-size: 11px; gap: 5px; margin-top: 3px; padding-block: 6px; }
 .commune-theme .memory-layout { grid-template-columns: minmax(0,1fr); gap: 25px; }
 .commune-theme .memory-heading { margin-bottom: 24px; }
 .commune-theme .memory-intro { font-size: 16px; }
 .commune-theme .memory-chapter h3 { font-size: 23px; }
 .commune-theme .memory-chapter p { font-size: 15px; line-height: 1.8; }
}

/* Additional monuments and historical figures form a gallery under the story. */
.commune-theme .memory-gallery-section { margin-top: 40px; }
.commune-theme .memory-gallery-section h3 { font-size: 27px; color: var(--app-primary); margin-bottom: 22px; }
.commune-theme .memory-gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.commune-theme .memory-gallery .memory-figure { min-width: 0; }
.commune-theme .memory-gallery .memory-figure img { height: 290px; max-height: none; object-fit: contain; }
@media (max-width: 900px) { .commune-theme .memory-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 600px) { .commune-theme .memory-gallery { grid-template-columns: minmax(0,1fr); } }

/* Explicit home navigation remains visible even when the mobile menu is closed. */
.commune-theme .dm-header .dm-brand-copy .commune-home-link,
.commune-theme .memory-return { display: inline-flex; align-items: center; justify-content: center; background: var(--app-primary); color: white; border-radius: 999px; font-size: 13px; font-weight: 750; line-height: 1.35; padding: 10px 16px; text-decoration: none; }
.commune-theme .dm-header .dm-brand-copy .commune-home-link { background: var(--dm-yellow); color: var(--dm-ink); margin: 6px 12px 0 0; vertical-align: middle; }
.commune-theme .commune-home-link:focus-visible, .commune-theme .memory-return:focus-visible { outline: 3px solid var(--app-primary); outline-offset: 4px; }
.commune-theme .memory-return-row { padding-top: 28px; }
.commune-theme .memory-return-bottom { padding: 0 0 40px; }
@media (max-width: 780px) {
 .commune-theme .dm-header .dm-brand-copy .commune-home-link { font-size: 11px; padding: 8px 12px; margin-right: 8px; }
}

/* A visible route back to the photographic homepage after every active section. */
.commune-theme .commune-home-bottom { padding-bottom: 40px; }
.commune-theme .commune-home-bottom-link { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: 999px; background: var(--dm-yellow); color: var(--dm-ink); font-size: 13px; font-weight: 750; line-height: 1.35; text-decoration: none; }
.commune-theme .commune-home-bottom-link:focus-visible { outline: 3px solid var(--app-primary); outline-offset: 4px; }
