:root {
  --bg: #f6f8f9;
  --surface: #ffffff;
  --surface-strong: #eef6f1;
  --text: #172126;
  --muted: #65747b;
  --border: #d8e2e4;
  --open: #16784f;
  --open-soft: #dff3ea;
  --closed: #b42318;
  --closed-soft: #fbe6e4;
  --accent: #245b7c;
  --shadow: 0 18px 48px rgba(22, 41, 52, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(36, 91, 124, 0.08), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

button:hover {
  background: #1b4863;
  box-shadow: 0 8px 24px rgba(36, 91, 124, 0.22);
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(36, 91, 124, 0.26);
  outline-offset: 2px;
}

.app-shell {
  margin: 0 auto;
  max-width: 1040px;
  padding: 32px 20px 56px;
}

.hero {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 36px 0 28px;
}

.hero-copy {
  flex: 1 1 520px;
}

.brand-media {
  align-items: stretch;
  display: grid;
  flex: 0 1 320px;
  gap: 12px;
  grid-template-columns: 110px minmax(0, 1fr);
  margin-left: auto;
}

.city-logo,
.place-photo,
.media-placeholder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(22, 41, 52, 0.08);
}

.city-logo {
  align-self: stretch;
  height: 100%;
  min-height: 132px;
  object-fit: contain;
  padding: 14px;
  width: 100%;
}

.place-photo {
  margin: 0;
  min-height: 132px;
  overflow: hidden;
  position: relative;
}

.place-photo img {
  display: block;
  height: 100%;
  min-height: 132px;
  object-fit: cover;
  width: 100%;
}

.place-photo figcaption {
  background: rgba(23, 33, 38, 0.76);
  bottom: 0;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  left: 0;
  line-height: 1.25;
  padding: 8px 10px;
  position: absolute;
  right: 0;
}

.media-placeholder {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.9rem;
  font-weight: 800;
  justify-content: center;
  line-height: 1.35;
  min-height: 132px;
  padding: 16px;
  text-align: center;
}

.brand-media:empty::before {
  align-items: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  content: "Ajoutez logo-ville-lodeve.svg et caps-lieu.jpg dans assets/";
  display: flex;
  font-size: 0.9rem;
  font-weight: 800;
  grid-column: 1 / -1;
  min-height: 132px;
  padding: 18px;
}

.site-label,
.panel-label {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 0.95;
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.1;
  margin-bottom: 8px;
}

h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}

a {
  color: var(--accent);
  font-weight: 800;
}

.lead {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.5;
  max-width: 560px;
}

.date-context {
  color: var(--text);
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 0;
}

.tabs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  padding: 4px;
  width: fit-content;
}

.tab {
  background: transparent;
  color: var(--muted);
  min-height: 38px;
  padding: 0 14px;
}

.tab:hover {
  background: #edf3f5;
  box-shadow: none;
  color: var(--text);
}

.tab.is-active {
  background: var(--accent);
  color: #fff;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.emergency-alert {
  background: var(--closed);
  border-radius: 8px;
  color: #fff;
  margin-bottom: 20px;
  padding: 22px 24px;
}

.emergency-alert h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 8px;
}

.emergency-alert p {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 0;
  max-width: 850px;
}

.status-panel,
.admin-login,
.admin-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-panel {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 210px;
  padding: 36px;
}

.status-panel.is-open {
  background: linear-gradient(135deg, var(--open-soft), #fff 70%);
}

.status-panel.is-closed {
  background: linear-gradient(135deg, var(--closed-soft), #fff 70%);
}

.status-panel h2 {
  font-size: clamp(2rem, 6vw, 4rem);
  margin-bottom: 12px;
}

.status-detail {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 0;
}

.status-dot {
  border-radius: 999px;
  flex: 0 0 90px;
  height: 90px;
  width: 90px;
}

.is-open .status-dot {
  background: var(--open);
  box-shadow: 0 0 0 18px rgba(22, 120, 79, 0.12);
}

.is-closed .status-dot {
  background: var(--closed);
  box-shadow: 0 0 0 18px rgba(180, 35, 24, 0.12);
}

.notice {
  background: #fff8df;
  border: 1px solid #ecd37c;
  border-radius: 8px;
  color: #5d4610;
  font-weight: 700;
  margin-top: 20px;
  padding: 18px 20px;
}

.practical-info,
.schedule-section {
  margin-top: 34px;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading p,
.muted {
  color: var(--muted);
  margin-bottom: 0;
}

.schedule-list,
.form-grid,
.info-grid {
  display: grid;
  gap: 12px;
}

.schedule-row,
.day-card,
.info-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  min-height: 68px;
  padding: 16px 18px;
}

.info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card {
  align-items: start;
  grid-template-columns: 1fr;
}

.info-card p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 0;
}

.day-name {
  font-weight: 800;
}

.day-title {
  align-items: center;
  display: flex;
  gap: 10px;
}

.day-status {
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 12px;
  height: 12px;
  width: 12px;
}

.day-status.is-open-day {
  background: var(--open);
  box-shadow: 0 0 0 5px rgba(22, 120, 79, 0.12);
}

.day-status.is-closed-day {
  background: var(--closed);
  box-shadow: 0 0 0 5px rgba(180, 35, 24, 0.12);
}

.day-date {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 4px;
}

.time-text {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.today {
  border-color: rgba(36, 91, 124, 0.55);
  box-shadow: inset 4px 0 0 var(--accent);
}

.admin-login,
.admin-form {
  padding: 28px;
}

.login-form {
  margin-top: 24px;
  max-width: 440px;
}

label {
  color: var(--text);
  display: block;
  font-weight: 800;
}

input,
textarea {
  background: #fbfdfe;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

.inline-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  margin-top: 8px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.day-card {
  align-items: start;
  grid-template-columns: 1fr;
}

.day-card-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.closed-toggle {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.92rem;
  gap: 8px;
  white-space: nowrap;
}

.closed-toggle input {
  min-height: auto;
  width: auto;
}

.time-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.note-field {
  margin-top: 18px;
}

.note-field textarea {
  margin-top: 8px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.secondary-button {
  background: #e7eef1;
  color: var(--text);
}

.secondary-button:hover {
  background: #dbe6ea;
  box-shadow: none;
}

.form-message {
  color: var(--accent);
  font-weight: 800;
  min-height: 24px;
  margin: 12px 0 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: 44px;
  padding-top: 22px;
  text-align: center;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 22px 14px 42px;
  }

  .hero,
  .section-heading,
  .status-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .hero {
    gap: 14px;
    padding: 22px 0 20px;
  }

  .hero-copy {
    flex: 0 1 auto;
  }

  h1 {
    margin-bottom: 10px;
  }

  .lead {
    margin-bottom: 10px;
  }

  .tabs {
    width: 100%;
  }

  .brand-media {
    align-items: start;
    grid-template-columns: 1fr;
    margin-left: 0;
    margin-top: 0;
  }

  .city-logo {
    justify-self: start;
    max-height: 118px;
    min-height: 96px;
    width: min(220px, 70vw);
  }

  .place-photo,
  .place-photo img,
  .media-placeholder {
    min-height: 112px;
  }

  .tab {
    flex: 1;
  }

  .status-panel,
  .admin-login,
  .admin-form {
    padding: 22px;
  }

  .status-dot {
    flex-basis: 68px;
    height: 68px;
    width: 68px;
  }

  .schedule-row {
    grid-template-columns: 1fr;
  }

  .time-text {
    text-align: left;
  }

  .form-grid,
  .info-grid,
  .inline-form,
  .time-fields {
    grid-template-columns: 1fr;
  }
}
