/* ==========================================================================
   RTT Archives — Main Stylesheet
   Heritage site for the Régie des Télégraphes & Téléphones (1930-1992)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CUSTOM PROPERTIES
   -------------------------------------------------------------------------- */

:root {
  --accent:        #c16b30;
  --accent-dark:   #a8571f;
  --accent-light:  rgba(193, 107, 48, 0.12);
  --text:          #2c2216;
  --text-secondary:#5c4b38;
  --muted:         #8a7559;
  --muted-light:   #a39177;
  --surface:       #f9f4e7;
  --surface-alt:   #f2ead8;
  --bg:            #ece5d5;
  --border:        rgba(44, 34, 22, 0.18);
  --border-strong: rgba(44, 34, 22, 0.32);
  --dark-footer:   #241b11;
  --radius:        2px;
  --shadow-sm:     0 2px 6px rgba(44, 34, 22, 0.08);
  --shadow-md:     0 6px 18px rgba(44, 34, 22, 0.11);
  --shadow-lg:     0 14px 32px rgba(44, 34, 22, 0.14);
}


/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Spectral', Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
}

textarea {
  resize: vertical;
}

::selection {
  background: rgba(193, 107, 48, 0.22);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.2rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
  margin-bottom: 1em;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

.kicker {
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}

.section-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.meta-text {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.text-muted {
  color: var(--muted);
}

.text-accent {
  color: var(--accent);
}

.text-center { text-align: center; }
.text-right  { text-align: right; }


/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

.container--narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 80px 0;
}

.section--sm {
  padding: 48px 0;
}

.section--lg {
  padding: 120px 0;
}

.section--alt {
  background: var(--surface-alt);
}

.section--surface {
  background: var(--surface);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.col-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.col-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.col-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}


/* --------------------------------------------------------------------------
   5. HEADER & NAVIGATION
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #f6f0e2;
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 32px;
  max-width: 1180px;
  margin: 0 auto;
  height: 60px;
}

.site-logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo__abbr {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.site-logo__sub {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
}

.nav-link {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 14px;
  padding: 6px 1px;
  border-bottom: 2px solid transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  color: #3a2e1f;
  background: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
  display: inline-block;
  line-height: 1;
}

.nav-link.active,
.nav-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lang-btn {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.lang-btn:hover,
.lang-btn.active {
  color: var(--accent);
  background: var(--accent-light);
}

.lang-sep {
  color: var(--border-strong);
  font-size: 10px;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
  margin-left: auto;
}

.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle-icon span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-open .nav-toggle-icon span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle-icon span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle-icon span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* --------------------------------------------------------------------------
   6. BUTTONS
   -------------------------------------------------------------------------- */

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 13.5px;
  padding: 14px 24px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: filter 0.15s;
  text-decoration: none;
  line-height: 1;
}

.btn-primary:hover {
  filter: brightness(1.08);
  color: #fff;
}

.btn-primary:active {
  filter: brightness(0.96);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(44, 34, 22, 0.42);
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 13.5px;
  padding: 14px 24px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  line-height: 1;
}

.btn-outline:hover {
  background: rgba(44, 34, 22, 0.05);
  color: var(--text);
}

.btn-outline--accent {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline--accent:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.btn-text {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding: 0 0 3px;
  transition: opacity 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-text:hover {
  opacity: 0.75;
  color: var(--accent);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 12px;
}

.btn-lg {
  padding: 18px 32px;
  font-size: 15px;
}

.btn-danger {
  background: #9b463a;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius);
  transition: filter 0.15s;
}

.btn-danger:hover {
  filter: brightness(1.1);
}


/* --------------------------------------------------------------------------
   7. BADGES & CHIPS
   -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--radius);
  line-height: 1.4;
}

.badge-kept      { color: #4f6b46; background: rgba(79, 107, 70, 0.14); }
.badge-converted { color: #b6601f; background: rgba(182, 96, 31, 0.14); }
.badge-demolished{ color: #9b463a; background: rgba(155, 70, 58, 0.14); }
.badge-toDoc     { color: #8a7559; background: rgba(138, 117, 89, 0.16); }

/* Filter chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  line-height: 1;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.active {
  background: #2c2216;
  color: #f4eedd;
  border-color: #2c2216;
}

.chip--accent.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Status-colored chips */
.chip--kept.active     { background: #4f6b46; border-color: #4f6b46; color: #fff; }
.chip--converted.active{ background: #b6601f; border-color: #b6601f; color: #fff; }
.chip--demolished.active{ background: #9b463a; border-color: #9b463a; color: #fff; }
.chip--toDoc.active    { background: #8a7559; border-color: #8a7559; color: #fff; }


/* --------------------------------------------------------------------------
   8. FORMS
   -------------------------------------------------------------------------- */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--accent);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(44, 34, 22, 0.28);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: 'Spectral', serif;
  font-size: 16px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(193, 107, 48, 0.12);
}

.form-control::placeholder {
  color: var(--muted-light);
}

.form-control--sm {
  padding: 9px 12px;
  font-size: 14px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a7559' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

textarea.form-control {
  min-height: 120px;
}

.form-error {
  color: #9b3a2e;
  font-size: 13px;
  margin-top: 5px;
  font-family: 'Space Mono', monospace;
}

.form-hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
  font-family: 'Space Mono', monospace;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.char-count {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}

.char-count.over-limit {
  color: #9b3a2e;
}

/* Fieldset */
fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

legend {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding: 0 8px;
}

/* Type chip radio */
.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-chip-label {
  cursor: pointer;
}

.type-chip-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-chip-label .chip {
  transition: all 0.15s;
}

.type-chip-label input:checked + .chip {
  background: #2c2216;
  color: #f4eedd;
  border-color: #2c2216;
}

/* File upload */
.upload-area {
  border: 2px dashed rgba(44, 34, 22, 0.28);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fff;
  position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-area__icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
  line-height: 1;
}

.upload-area__text {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.upload-area__hint {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--muted-light);
  margin-top: 6px;
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-file-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
}

.upload-file-item__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-item__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}

.upload-file-item__remove:hover {
  color: #9b3a2e;
}


/* --------------------------------------------------------------------------
   9. FLASH MESSAGES
   -------------------------------------------------------------------------- */

.flash {
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.flash-success {
  background: rgba(79, 107, 70, 0.15);
  color: #3a5434;
  border: 1px solid rgba(79, 107, 70, 0.3);
}

.flash-error {
  background: rgba(155, 70, 58, 0.15);
  color: #7a2e24;
  border: 1px solid rgba(155, 70, 58, 0.3);
}

.flash-info {
  background: rgba(193, 107, 48, 0.12);
  color: #7a4215;
  border: 1px solid rgba(193, 107, 48, 0.28);
}

.flash__close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  margin-left: auto;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.flash__close:hover {
  opacity: 1;
}


/* --------------------------------------------------------------------------
   10. CARDS — BUILDINGS
   -------------------------------------------------------------------------- */

.buildings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.building-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}

.building-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}

.building-card__image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg);
}

.building-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.building-card:hover .building-card__image img {
  transform: scale(1.04);
}

.building-card__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8ddd0 0%, #d8cebb 100%);
  color: var(--muted-light);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.building-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.building-card__body {
  padding: 18px 20px 20px;
}

.building-card__code {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.building-card__name {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  color: var(--text);
}

.building-card__city {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}

.building-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--muted-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.building-card__meta-sep {
  opacity: 0.4;
}

/* Featured card (larger) */
.building-card--featured {
  grid-column: span 1;
}

.building-card--featured .building-card__image {
  aspect-ratio: 16 / 9;
}


/* --------------------------------------------------------------------------
   11. HERO
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  background: var(--text);
  color: #f4eedd;
  padding: 100px 0 80px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 50%, rgba(193, 107, 48, 0.18) 0%, transparent 65%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero__kicker {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero__title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.1;
  color: #f4eedd;
  margin-bottom: 24px;
}

.hero__title em {
  color: var(--accent);
  font-style: normal;
}

.hero__description {
  font-size: 1.1rem;
  color: rgba(244, 238, 221, 0.82);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 560px;
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero__decoration {
  position: absolute;
  right: -40px;
  bottom: -20px;
  width: 380px;
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  font-family: 'Oswald', sans-serif;
  font-size: 200px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.04em;
}


/* --------------------------------------------------------------------------
   12. STATS BAR
   -------------------------------------------------------------------------- */

.stats-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.stats-bar__inner {
  display: flex;
  align-items: stretch;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

.stat-item {
  flex: 1;
  padding: 28px 24px;
  border-right: 1px solid var(--border);
  text-align: center;
}

.stat-item:last-child {
  border-right: none;
}

.stat-item__number {
  font-family: 'Oswald', sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-item__label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}


/* --------------------------------------------------------------------------
   13. SECTION HEADERS
   -------------------------------------------------------------------------- */

.section-header {
  margin-bottom: 48px;
}

.section-header--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
}

.section-header__eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-header__title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.section-header__desc {
  color: var(--text-secondary);
  max-width: 520px;
}


/* --------------------------------------------------------------------------
   14. BUILDINGS FILTER BAR
   -------------------------------------------------------------------------- */

.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: sticky;
  top: 60px;
  z-index: 40;
}

.filter-bar__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

.filter-bar__search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.filter-bar__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 14px;
}

.filter-bar__search input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 9px 14px 9px 36px;
  font-family: 'Spectral', serif;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.15s;
}

.filter-bar__search input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-bar__divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.filter-bar__chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-bar__view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.view-btn {
  background: var(--surface);
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-btn + .view-btn {
  border-left: 1px solid var(--border);
}

.view-btn.active,
.view-btn:hover {
  background: #2c2216;
  color: #f4eedd;
}


/* --------------------------------------------------------------------------
   15. MAP VIEW
   -------------------------------------------------------------------------- */

.map-section {
  display: none;
}

.map-section.active {
  display: block;
}

.grid-section.active {
  display: block;
}

.map-container {
  position: relative;
  background: #e8ddd0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 600px;
}

.map-container img,
.map-container svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  cursor: pointer;
  transition: transform 0.15s;
}

.map-pin:hover {
  transform: translate(-50%, -100%) scale(1.15);
}

.map-pin__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.map-pin--kept      .map-pin__dot { background: #4f6b46; }
.map-pin--converted .map-pin__dot { background: #b6601f; }
.map-pin--demolished.map-pin__dot { background: #9b463a; }
.map-pin--toDoc     .map-pin__dot { background: #8a7559; }

.map-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #f4eedd;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: var(--radius);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.map-pin:hover .map-tooltip {
  opacity: 1;
}

.map-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.map-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.map-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-legend__dot--kept      { background: #4f6b46; }
.map-legend__dot--converted { background: #b6601f; }
.map-legend__dot--demolished{ background: #9b463a; }
.map-legend__dot--toDoc     { background: #8a7559; }


/* --------------------------------------------------------------------------
   16. BUILDING DETAIL PAGE
   -------------------------------------------------------------------------- */

.building-detail {
  padding: 56px 0 80px;
}

.building-breadcrumb {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.building-breadcrumb a:hover {
  color: var(--accent);
}

.building-breadcrumb__sep {
  opacity: 0.4;
}

.building-detail__layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

.building-detail__header {
  margin-bottom: 32px;
}

.building-detail__code {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.building-detail__name {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  margin-bottom: 10px;
}

.building-detail__meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.building-detail__meta-item {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.05em;
}

.building-detail__description {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Gallery */
.photo-gallery {
  margin-bottom: 40px;
}

.photo-gallery__main {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: zoom-in;
  margin-bottom: 10px;
  background: var(--bg);
}

.photo-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.photo-gallery__main:hover img {
  transform: scale(1.02);
}

.photo-gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.photo-gallery__thumb {
  flex-shrink: 0;
  width: 72px;
  height: 54px;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.photo-gallery__thumb.active {
  border-color: var(--accent);
}

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

.photo-caption {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-top: 6px;
  text-align: center;
}

/* Building sidebar */
.building-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 80px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.sidebar-card__title {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-card__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.sidebar-card__row:last-child {
  border-bottom: none;
}

.sidebar-card__key {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.sidebar-card__val {
  color: var(--text);
  text-align: right;
  font-size: 14px;
}

/* Contribute CTA */
.contribute-cta {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.contribute-cta__icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.contribute-cta__title {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  color: #fff;
}

.contribute-cta__text {
  font-size: 13px;
  opacity: 0.88;
  margin-bottom: 18px;
  line-height: 1.5;
}

.contribute-cta .btn-outline {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
  font-size: 12px;
  padding: 10px 18px;
}

.contribute-cta .btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}


/* --------------------------------------------------------------------------
   17. CONTRIBUTE BANNER (home page)
   -------------------------------------------------------------------------- */

.contribute-banner {
  background: var(--text);
  color: #f4eedd;
  padding: 72px 0;
  position: relative;
  overflow: hidden;
}

.contribute-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(193,107,48,0.22) 0%, transparent 60%);
  pointer-events: none;
}

.contribute-banner__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.contribute-banner__text h2 {
  color: #f4eedd;
  margin-bottom: 12px;
  font-size: 2rem;
}

.contribute-banner__text p {
  color: rgba(244,238,221,0.78);
  max-width: 480px;
  font-size: 1.05rem;
}

.contribute-banner__actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.contribute-banner .btn-outline {
  color: #f4eedd;
  border-color: rgba(244,238,221,0.4);
}

.contribute-banner .btn-outline:hover {
  background: rgba(244,238,221,0.1);
}


/* --------------------------------------------------------------------------
   18. HISTORY / TIMELINE
   -------------------------------------------------------------------------- */

.timeline {
  position: relative;
  padding-left: 48px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item__dot {
  position: absolute;
  left: -40px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item__year {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 8px;
}

.timeline-item__text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.timeline-item__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: box-shadow 0.15s;
}

.timeline-item__card:hover {
  box-shadow: var(--shadow-md);
}


/* --------------------------------------------------------------------------
   19. HISTORY PAGE — PAGE HEADER
   -------------------------------------------------------------------------- */

.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 40px;
}

.page-header__kicker {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.page-header__title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  margin-bottom: 14px;
}

.page-header__desc {
  color: var(--text-secondary);
  max-width: 560px;
  font-size: 1.05rem;
}


/* --------------------------------------------------------------------------
   20. CONTACT PAGE
   -------------------------------------------------------------------------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 60px;
  align-items: start;
}

.contact-info__item {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.contact-info__icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-info__label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.contact-info__value {
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.contact-info__value a:hover {
  color: var(--accent);
  text-decoration: underline;
}


/* --------------------------------------------------------------------------
   21. LIGHTBOX
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 14, 8, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox__inner {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox__caption {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(244,238,221,0.65);
  margin-top: 12px;
  letter-spacing: 0.05em;
  text-align: center;
}

.lightbox__close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(244,238,221,0.12);
  border: 1px solid rgba(244,238,221,0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #f4eedd;
  font-size: 20px;
  transition: background 0.15s;
  line-height: 1;
}

.lightbox__close:hover {
  background: rgba(244,238,221,0.22);
}

.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(244,238,221,0.1);
  border: 1px solid rgba(244,238,221,0.18);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #f4eedd;
  font-size: 20px;
  transition: background 0.15s;
}

.lightbox__nav:hover {
  background: rgba(244,238,221,0.2);
}

.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }


/* --------------------------------------------------------------------------
   22. FOOTER
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--dark-footer);
  color: rgba(244, 238, 221, 0.7);
  padding: 56px 0 32px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand__logo {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.footer-brand__tagline {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244,238,221,0.45);
  margin-bottom: 16px;
}

.footer-brand__desc {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(244,238,221,0.6);
}

.footer-col__title {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244,238,221,0.9);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 13px;
  color: rgba(244,238,221,0.55);
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--accent);
}

.site-footer__bottom {
  border-top: 1px solid rgba(244,238,221,0.1);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-copy {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244,238,221,0.35);
}

.footer-legal-links {
  display: flex;
  gap: 20px;
}

.footer-legal-links a {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244,238,221,0.35);
  transition: color 0.15s;
}

.footer-legal-links a:hover {
  color: var(--accent);
}


/* --------------------------------------------------------------------------
   23. ADMIN THEME
   -------------------------------------------------------------------------- */

.admin-body {
  background: #1a1410;
  color: #e8ddd0;
  font-family: 'Spectral', serif;
}

.admin-sidebar {
  width: 240px;
  background: #120e0a;
  min-height: 100vh;
  padding: 24px 0;
  border-right: 1px solid rgba(244,238,221,0.08);
  flex-shrink: 0;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-main {
  flex: 1;
  padding: 40px;
  overflow: auto;
}

.admin-nav__section {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244,238,221,0.3);
  padding: 16px 22px 6px;
}

.admin-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  font-family: 'Oswald', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244,238,221,0.6);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  border-left: 3px solid transparent;
}

.admin-nav__link:hover,
.admin-nav__link.active {
  color: #f4eedd;
  background: rgba(244,238,221,0.05);
  border-left-color: var(--accent);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(244,238,221,0.1);
}

.admin-header__title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #f4eedd;
}

.admin-card {
  background: #231b14;
  border: 1px solid rgba(244,238,221,0.1);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-card__title {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244,238,221,0.55);
  margin-bottom: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244,238,221,0.4);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(244,238,221,0.08);
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(244,238,221,0.06);
  color: rgba(244,238,221,0.8);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(244,238,221,0.02);
}

.admin-table__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Admin form overrides */
.admin-body .form-control {
  background: #1e1710;
  border-color: rgba(244,238,221,0.15);
  color: #e8ddd0;
}

.admin-body .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(193,107,48,0.18);
}

.admin-body .form-label {
  color: rgba(244,238,221,0.5);
}

.admin-body .form-hint {
  color: rgba(244,238,221,0.35);
}

.admin-body fieldset {
  border-color: rgba(244,238,221,0.1);
}

.admin-body legend {
  color: var(--accent);
}

/* Featured toggle */
.featured-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(244,238,221,0.5);
  transition: color 0.15s;
}

.featured-toggle input {
  display: none;
}

.featured-toggle__star {
  font-size: 18px;
  transition: color 0.15s, transform 0.15s;
}

.featured-toggle.on .featured-toggle__star,
.featured-toggle:hover .featured-toggle__star {
  color: var(--accent);
  transform: scale(1.15);
}

.featured-toggle.on {
  color: rgba(244,238,221,0.8);
}

/* Admin stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.admin-stat {
  background: #231b14;
  border: 1px solid rgba(244,238,221,0.1);
  border-radius: var(--radius);
  padding: 20px;
}

.admin-stat__number {
  font-family: 'Oswald', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.admin-stat__label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244,238,221,0.4);
}

/* Admin login */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1410;
}

.admin-login__card {
  background: #231b14;
  border: 1px solid rgba(244,238,221,0.1);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
}

.admin-login__logo {
  font-family: 'Oswald', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin-bottom: 6px;
}

.admin-login__sub {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244,238,221,0.35);
  text-align: center;
  margin-bottom: 32px;
}

/* Contribution status badge */
.status-pill {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
}

.status-pill--pending  { color: #b6601f; background: rgba(182,96,31,0.18); }
.status-pill--approved { color: #4f6b46; background: rgba(79,107,70,0.18); }
.status-pill--rejected { color: #9b463a; background: rgba(155,70,58,0.18); }
.status-pill--new      { color: #b6601f; background: rgba(182,96,31,0.18); }
.status-pill--read     { color: #8a7559; background: rgba(138,117,89,0.18); }
.status-pill--replied  { color: #4f6b46; background: rgba(79,107,70,0.18); }


/* --------------------------------------------------------------------------
   24. PAGINATION
   -------------------------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 48px;
  justify-content: center;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}

.page-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-link--prev,
.page-link--next {
  width: auto;
  padding: 0 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
}


/* --------------------------------------------------------------------------
   25. EMPTY STATES
   -------------------------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 80px 32px;
  color: var(--muted);
}

.empty-state__icon {
  font-size: 48px;
  opacity: 0.35;
  margin-bottom: 20px;
}

.empty-state__title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-light);
  margin-bottom: 10px;
}

.empty-state__desc {
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto 24px;
  line-height: 1.6;
}


/* --------------------------------------------------------------------------
   26. UTILITIES
   -------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-none   { display: none; }
.d-block  { display: block; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }

.w-100 { width: 100%; }
.overflow-hidden { overflow: hidden; }

/* Accent underline decoration */
.accent-underline {
  position: relative;
  display: inline-block;
}

.accent-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 40px;
  height: 3px;
  background: var(--accent);
}

/* Separator with label */
.sep-label {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  margin: 24px 0;
}

.sep-label::before,
.sep-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sep-label span {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(193,107,48,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(44,34,22,0.08) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* --------------------------------------------------------------------------
   27. RESPONSIVE — TABLET (max-width: 1024px)
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .building-detail__layout {
    grid-template-columns: 1fr;
  }

  .building-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .col-3 {
    grid-template-columns: 1fr 1fr;
  }

  .col-4 {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  /* La marque occupe toute la largeur ; Explorer et Langue côte à côte dessous */
  .footer-brand {
    grid-column: 1 / -1;
  }
}


/* --------------------------------------------------------------------------
   28. RESPONSIVE — MOBILE (max-width: 768px)
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .container,
  .container--narrow {
    padding: 0 20px;
  }

  .section   { padding: 52px 0; }
  .section--lg { padding: 72px 0; }

  /* Header */
  .site-header__inner {
    padding: 0 20px;
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    padding: 12px 0 16px;
    border-top: 1px solid var(--border);
  }

  .site-nav.open {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    font-size: 15px;
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
  }

  .site-header__actions {
    margin-left: 0;
    order: 3;
    padding-bottom: 8px;
  }

  /* Hero */
  .hero {
    padding: 64px 0 52px;
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__decoration {
    display: none;
  }

  /* Stats */
  .stats-bar__inner {
    flex-wrap: wrap;
    padding: 0 20px;
  }

  .stat-item {
    flex: 1 1 calc(50% - 12px);
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 16px;
  }

  .stat-item:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  .stat-item:last-child,
  .stat-item:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
  }

  /* Grid */
  .col-2, .col-3, .col-4 {
    grid-template-columns: 1fr;
  }

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

  /* Filter */
  .filter-bar__inner {
    padding: 0 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filter-bar__search {
    max-width: 100%;
  }

  .filter-bar__divider {
    display: none;
  }

  /* Buildings */
  .buildings-grid {
    grid-template-columns: 1fr;
  }

  /* Contribute banner */
  .contribute-banner__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .contribute-banner__actions {
    flex-direction: column;
    width: 100%;
  }

  /* Footer : marque en pleine largeur, Explorer à gauche / Langue à droite */
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
  }

  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Building sidebar */
  .building-sidebar {
    grid-template-columns: 1fr;
  }

  /* Section header row */
  .section-header--row {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Admin */
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    min-height: auto;
  }

  .admin-main {
    padding: 24px 20px;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }

  /* Lightbox nav */
  .lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
}


/* --------------------------------------------------------------------------
   29. PRINT
   -------------------------------------------------------------------------- */

@media print {
  .site-header,
  .filter-bar,
  .site-footer,
  .contribute-cta,
  .contribute-banner,
  .lightbox {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .building-card,
  .sidebar-card {
    border: 1px solid #ccc;
    box-shadow: none;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 11px;
    color: #666;
  }
}


/* --------------------------------------------------------------------------
   30. HEADER LOGO (image) & BANDEAU D'INFORMATION
   -------------------------------------------------------------------------- */

.site-logo {
  align-items: center;
}

.site-logo__img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.site-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 2px;
}

/* Bandeau d'information paramétrable (header.php) */
.site-banner {
  background: var(--accent-light);
  border-bottom: 1px solid var(--accent);
}

.site-banner--warning {
  background: rgba(155, 70, 58, 0.12);
  border-bottom-color: #9b463a;
}

.site-banner__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-banner__text {
  flex: 1;
  font-size: 15px;
  line-height: 1.5;
  color: #b6601f;
}

.site-banner--warning .site-banner__text {
  color: #9b463a;
}

.site-banner__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 2px 6px;
  color: inherit;
}

/* Flash affiché juste sous le header (header.php) */
.container > .flash:first-child {
  margin-top: 20px;
}

/* Footer : marge au-dessus + langue active */
.site-footer {
  margin-top: 80px;
  border-top: 3px solid var(--accent);
}

.footer-lang-active {
  color: var(--accent) !important;
}

/* Carrousel des bâtiments à l'honneur (home.php) : les diapositives portent
   un display:grid inline, d'où le !important pour les masquer. */
.featured-slide {
  animation: featured-fade 0.55s ease;
}

.featured-slide--off {
  display: none !important;
}

@keyframes featured-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.featured-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.featured-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(44, 34, 22, 0.22);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.featured-dot:hover {
  background: rgba(44, 34, 22, 0.4);
}

.featured-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}


/* --------------------------------------------------------------------------
   31. RESPONSIVE POUR LES STYLES INLINE DES PAGES
   Les gabarits déclarés en style="..." dans les templates PHP ne peuvent pas
   être adaptés par de simples media queries : on les surcharge ici via des
   sélecteurs d'attribut. Les grilles auto-fill/auto-fit sont déjà fluides et
   sont donc exclues.
   -------------------------------------------------------------------------- */

/* Tablette : les grilles fixes de 3-4 colonnes passent à 2 colonnes */
@media (min-width: 769px) and (max-width: 1024px) {
  main [style*="repeat(3, 1fr)"],
  main [style*="repeat(4, 1fr)"],
  .admin-content [style*="repeat(3, 1fr)"],
  .admin-content [style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Grilles multi-colonnes fixes → une seule colonne
     (exceptions : grilles fluides auto-fill/auto-fit et la frise
     chronologique « 6rem 1fr » qui reste lisible telle quelle) */
  main [style*="grid-template-columns"]:not([style*="auto-fill"]):not([style*="auto-fit"]):not([style*="6rem"]),
  .admin-content [style*="grid-template-columns"]:not([style*="auto-fill"]):not([style*="auto-fit"]) {
    grid-template-columns: 1fr !important;
  }

  /* Les rangées flex inline peuvent passer à la ligne au lieu de déborder
     (flex-wrap n'est jamais posé en inline : pas besoin de !important) */
  main [style*="display: flex"],
  main [style*="display:flex"] {
    flex-wrap: wrap;
  }

  /* Espacements dimensionnés pour desktop */
  main [style*="padding: 5rem"] { padding: 2.75rem 1.25rem !important; }
  main [style*="gap: 4rem"],
  main [style*="gap: 5rem"]     { gap: 2rem !important; }

  /* Les colonnes « sticky » n'ont plus de sens quand tout est empilé */
  main [style*="position: sticky"] { position: static !important; }

  /* Titres à taille fixe inline : plafonnés sur petit écran */
  main h1[style*="font-size"] {
    font-size: clamp(1.7rem, 8vw, 2.4rem) !important;
  }

  /* Tableaux admin : défilement horizontal plutôt que débordement */
  .adm-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .site-logo__sub {
    display: none;
  }

}
