:root {
  --color-green-light: #cad87ac8;
  --color-green: #c6e1ae;
  --color-teal: #a3d8cc;
  --color-blue-light: #a4cfdd;
  --color-blue: #b4c9f1;
  --color-blue-dark: #31589c;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-grey-light: #f5f5f5;
  --color-grey: #e0e0e0;
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 100%;
  --header-height: 70px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  font-family: var(--font-family);
  color: var(--color-black);
  background: var(--color-white);
  line-height: 1.6;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-black);
}



/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 3px solid var(--color-blue);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.header-right {
  justify-self: end;
}

.site-title.nav-link {
  text-decoration: none;
  color: var(--color-black);
  font-weight: 600;
  font-size: 0.85rem;
  transition: color 0.3s ease;
  text-transform: uppercase;
  text-align: center;
}

.site-title-link {
  text-decoration: none;
  color: var(--color-black);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--color-black);
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  line-height: 1.2;
}

.nav-link:hover {
  border-bottom-color: var(--color-blue);
}

.lang-toggle {
  display: inline-block;
  padding: 0.25rem 0;
  color: var(--color-black);
  text-decoration: none;
  font-weight: 500;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
}

.lang-toggle:hover {
  border-bottom-color: var(--color-blue);
}

.nav-toggle,
.mobile-menu-btn,
.mobile-close-btn,
.mobile-overlay {
  display: none;
}

.mobile-sidebar {
  display: contents;
}

/* ===== Hero Banner ===== */
.hero-banner {
  position: relative;
  text-align: center;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-grey-light);
}

.hero-banner.no-image {
  padding: 4rem 1.5rem;
}

.hero-image-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
}

.hero-content-over {
  position: absolute;
  top: 33.33%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  max-width: 800px;
  padding: 2rem;
  color: var(--color-white);
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

.hero-content-over h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.hero-banner.no-image .hero-content-over {
  color: var(--color-black);
  text-shadow: none;
}

.hero-text {
  font-size: 1.25rem;
  font-weight: 500;
}

/* ===== Cards Grid ===== */
.cards-row {
  max-width: 3000px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

@media (max-width: 3000px) {
  .cards-row {
    max-width: 100%;
  }
}

.cards-row>* {
  flex: 1 1 26rem;
  min-width: 25%;
}

.card {
  background: var(--color-white);
  border: none;
  border-radius: 5px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.card-with-thumb {
  flex-direction: row;
  gap: 1.5rem;
  align-items: flex-start;
}

.card-thumb-side {
  flex-shrink: 0;
  width: 150px;
  background: var(--color-grey-light);
  border-radius: 4px;
  overflow: hidden;
}

.card-thumb-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-thumb-side.format-poster {
  height: 212px;
}

.card-thumb-side.format-photo {
  height: 100px;
}

.card-thumb-side.format-square {
  height: 150px;
}

.card-body {
  flex-grow: 1;
}

.card h3 {
  color: var(--color-black);
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.card-image-wrap {
  width: 100%;
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--color-grey-light);
  border-radius: 4px;
}

.card-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.card-image-wrap.format-poster {
  aspect-ratio: 1 / 1.41;
}

.card-image-wrap.format-photo {
  aspect-ratio: 3 / 2;
}

.card-image-wrap.format-square {
  aspect-ratio: 1 / 1;
}

.card a {
  color: var(--color-blue-dark);
}

.card p {
  margin-bottom: 0.5rem;
}

.card ul {
  list-style: none;
  padding: 0;
}

.card ul li {
  padding: 0.3rem 0;
}

.card-content ul,
.card-content ol {
  list-style: initial;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.card-content li {
  padding: 0.2rem 0;
}

.card-content h1,
.card-content h2,
.card-content h3,
.card-content h4 {
  font-size: 1.1rem !important;
  margin: 0.75rem 0 0.25rem 0 !important;
  color: var(--color-black);
  text-transform: none !important;
  border: none !important;
  padding: 0 !important;
}

/* ===== Info Cards ===== */
.card-contact {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-section label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 0.25rem;
}

.sub-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-black);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.mairie-group .sub-section {
  margin-bottom: 1rem;
}

.mairie-group .sub-section:last-child {
  margin-bottom: 0;
}

.contact-section p,
.address-lines {
  margin: 0;
  font-weight: 500;
  line-height: 1.4;
}

.duty-section {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
}

.phone-name-stack p {
  margin: 0 !important;
}

.duty-person {
  font-weight: 600;
  color: #555;
  font-size: 0.95rem;
  margin-top: 0.15rem !important;
}

.phone-group {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.phone-item {
  flex: 1;
}

.phone-number {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700 !important;
  color: var(--color-blue-dark);
}

.duty-container {
  background: rgba(255, 255, 255, 0.5);
  padding: 0.5rem;
  border-radius: 4px;
  font-style: italic;
  font-size: 0.95rem;
}

.duty-icon {
  margin-right: 0.3rem;
}

.list-section-header {
  margin: 5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.hours-table td {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.hours-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #777;
  padding: 0.5rem 0.25rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.hours-table td {
  padding: 0.6rem 0.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.day-label {
  font-weight: 700;
  color: var(--color-blue-dark);
  width: 30%;
}

.hours-table td:not(.day-label) {
  width: 35%;
}

.hours-table td.is-closed {
  background-color: rgba(0, 0, 0, 0.05) !important;
  color: #999 !important;
  font-style: italic;
  font-size: 0.85rem;
  border: 1px inset rgba(0, 0, 0, 0.02);
}

.exception-label {
  color: #000;
  font-style: normal;
}

.muted-text {
  color: #999 !important;
  font-weight: 400;
}

.exceptional-container {
  margin-top: -0.5rem;
}

.exceptional-notice {
  background: #fff3cd;
  color: #856404;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid #ffeeba;
  font-weight: 600;
  font-size: 0.9rem;
}

.permanence-section label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 0.5rem;
}

.permanence-entry {
  background: rgba(255, 255, 255, 0.4);
  padding: 0.75rem;
  border-radius: 6px;
}

.perm-info {
  margin: 0 0 0.25rem 0;
  font-weight: 600;
}

.perm-people {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
  font-style: italic;
}


/* ===== Events ===== */
.event-item,
.list-item-container {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-grey-light);
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.item-thumbnail-wrap {
  flex-shrink: 0;
  width: 100px;
  background: var(--color-grey-light);
  border-radius: 4px;
  overflow: hidden;
}

.item-thumbnail-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-thumbnail-wrap.format-poster {
  height: 141px;
}

.item-thumbnail-wrap.format-photo {
  height: 66px;
}

.item-thumbnail-wrap.format-square {
  height: 100px;
}

.item-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.1rem;
}

.item-title {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
}

.item-title a {
  text-decoration: none;
  color: var(--color-blue-dark);
}

.item-title a:hover {
  text-decoration: underline;
}

.item-description {
  font-size: 0.95rem;
  color: #555;
  margin: 0 !important;
}

.event-item:last-child {
  border-bottom: none;
}

.event-date {
  display: inline-block;
  background: var(--color-green);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.content-badge {
  display: inline-block;
  background: var(--color-blue-light);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

/* ===== Sections ===== */
.page-section {
  padding: 1rem 0 2rem;
}

.section-heading {
  text-align: center;
  font-size: 1.8rem;
  color: var(--color-black);
  padding: 1.5rem;
  margin: 1rem auto;
  max-width: var(--max-width);
  border-bottom: 3px solid var(--color-green);
  text-transform: uppercase;
}

.section-heading .title-container {
  align-items: center;
}

.section-heading .sub-title {
  border-bottom: none;
}

/* ===== Read More ===== */
.read-more {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--color-blue-dark);
  font-weight: 500;
  text-decoration: underline;
}

.read-more:hover {
  text-decoration: none;
}

/* ===== Project List ===== */
.project-list {
  list-style: none;
  padding: 0;
}

.project-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-grey-light);
}

.project-list li:last-child {
  border-bottom: none;
}

.project-list a {
  font-weight: 500;
}

.project-list p {
  font-size: 0.9rem;
  margin: 0.2rem 0 0;
}

/* ===== Background Layers ===== */
.bg-layer-1 {
  background-color: rgb(from var(--color-green-light) r g b / 0.2);
}

.bg-layer-2 {
  background-color: rgb(from var(--color-green-light) r g b / 0.5);
}

.bg-layer-3 {
  background-color: rgb(from var(--color-green-light) r g b / 0.8);
  flex-grow: 1;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-grey-light);
  border-top: 3px solid var(--color-blue);
  padding: 2rem 1.5rem;
  text-align: center;
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-inner p {
  margin-bottom: 0.25rem;
}

/* ===== Single Page ===== */
.single-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-date {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.page-content h2,
.page-content h3 {
  color: var(--color-black);
  margin: 1.5rem 0 0.75rem;
}

.page-content p {
  margin-bottom: 1rem;
}

.page-content ul,
.page-content ol {
  margin: 0 0 1rem 1.5rem;
}

/* ===== List Page ===== */
.list-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.list-items {
  list-style: none;
  padding: 0;
}

.list-items li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-grey);
}

.list-items .item-date {
  font-size: 0.85rem;
  color: #666;
  margin-right: 0.5rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--color-black);
  }

  .mobile-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: -280px;
    width: 250px;
    height: 100vh;
    background: var(--color-white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    padding: 2rem 1.5rem;
    z-index: 1000;
  }

  .nav-toggle:checked~.mobile-sidebar {
    right: 0;
  }

  .mobile-close-btn {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-black);
  }

  .header-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 1.5rem;
  }

  .header-nav .nav-link .title-container {
    align-items: flex-start;
    text-align: left;
  }

  .header-right {
    margin-top: 1.5rem;
    justify-self: start;
    border-top: 1px solid var(--color-grey-light);
    padding-top: 1.5rem;
    width: 100%;
  }

  .mobile-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .nav-toggle:checked~.mobile-overlay {
    opacity: 1;
    pointer-events: all;
  }

  .hero-banner {
    min-height: 300px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-content-over {
    padding: 0rem;
  }

  .hero-content-over h1 {
    font-size: 1.5rem;
  }

  .section-heading {
    font-size: 1.4rem;
  }

  .card-with-thumb {
    flex-direction: column;
    gap: 1rem;
  }

  .card-thumb-side {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .item-thumbnail-wrap {
    width: 60px;
  }

  .item-thumbnail-wrap.format-poster {
    height: 85px;
  }

  .item-thumbnail-wrap.format-photo {
    height: 40px;
  }

  .item-thumbnail-wrap.format-square {
    height: 60px;
  }
}

/* ===== Language Modal ===== */
.lang-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.lang-modal-content {
  background: var(--color-white);
  padding: 3rem 2rem;
  border-radius: 12px;
  text-align: center;
  max-width: 800px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.lang-selection-layout {
  display: flex;
  gap: 3rem;
  justify-content: center;
}

@media (max-width: 600px) {
  .lang-selection-layout {
    flex-direction: column;
    gap: 2rem;
  }
}

.lang-welcome-group {
  flex: 1;
}

.lang-welcome-group h2 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  text-transform: uppercase;
}

.lang-welcome-group p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  color: #555;
}

.lang-options {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.lang-btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 6px;
  background: var(--color-blue);
  color: var(--color-black);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  text-transform: uppercase;
}

.lang-btn:hover {
  background: var(--color-blue-dark);
  color: var(--color-white);
  transform: translateY(-2px);
}

.lang-btn[data-lang="bzh"] {
  background: var(--color-green-light);
}

.lang-btn[data-lang="bzh"]:hover {
  background: var(--color-green);
  color: var(--color-black);
}

/* ===== Static Logic Components ===== */
.hours-table tr.is-today {
  background-color: rgba(163, 216, 204, 0.15);
  border-left: 3px solid var(--color-teal);
}

.list-section-title {
  margin: 2.5rem 0 1rem;
  font-size: 1.4rem;
  color: var(--color-black);
  border-bottom: 2px solid var(--color-grey-light);
  padding-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.past-list {
  opacity: 0.85;
}

.no-events-placeholder {
  color: #888;
  font-style: italic;
  padding: 1rem 0;
}

.permanence-entry-static {
  background: rgba(0, 0, 0, 0.04);
  padding: 1rem;
  border-radius: 8px;
}

/* --- Responsive Layout Tweaks --- */
.exception-label .short-text {
  display: none;
}

@media (max-width: 480px) {
  .exception-label .full-text {
    display: none;
  }

  .exception-label .short-text {
    display: inline;
  }

  .hours-table td {
    font-size: 0.8rem;
    padding: 0.4rem 0.2rem;
  }
}

/* --- Language Badges for Fallbacks --- */
.lang-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--color-blue-dark);
  color: white;
  margin-right: 0.5rem;
  vertical-align: middle;
  text-transform: uppercase;
  opacity: 0.9;
}

.list-item-container {
  list-style: none;
}

.event-item.fallback-item .lang-badge {
  margin-bottom: 2px;
}

/* --- Discover Sub-Sections --- */
.discover-sub-section {
  margin-top: 2rem;
  margin-bottom: 4rem;
}

.sub-section-title {
  font-size: 1.6rem;
  color: var(--color-black);
  margin: 0 auto 2rem auto;
  border-bottom: 3px solid var(--color-blue-light);
  display: table;
  text-align: center;
  max-width: 100%;
  padding-bottom: 0.25rem;
}

.sub-section-title .title-container {
  align-items: center;
}

.sub-section-title .sub-title {
  border-bottom: none;
}

.permanence-card {
  background-color: #e8f5e9;
  border-radius: 4px;
  padding: 4px 6px;
  margin-top: 4px;
  display: block;
  border: 1px solid rgba(76, 175, 80, 0.1);
}

/* --- Bilingual Titles --- */
.title-container {
  display: flex;
  flex-direction: column;
  align-items: inherit;
  gap: 0.4rem;
}

.hero-content-over .title-container {
  align-items: center;
}

.site-header .title-container {
  align-items: flex-start;
}

.header-nav .title-container {
  align-items: center;
}

.main-title {
  display: block;
}

.bilingual-content .sub-title {
  display: block;
  font-size: 0.6em;
  font-weight: 400;
  font-style: italic;
  margin-top: 0;
  opacity: 0.8;
  width: fit-content;
  padding-bottom: 0.05rem;
}

.site-header .sub-title {
  font-size: 0.75em;
  margin-top: 0;
}

.hero-content-over .sub-title {
  border-bottom: 3px solid var(--color-white);
  margin-left: auto;
  margin-right: auto;
  font-size: 0.6em;
  margin-top: 0.2rem;
  padding-bottom: 0.1rem;
}