* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, system-ui, Roboto, Arial, sans-serif;
  font-size: 13px;
  color: #f3ede0;
  background: #15130f;
}

a { color: inherit; }

#layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 960px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ── Rail (colonne latérale) ──────────────────────────────────────────── */

#rail {
  padding: 30px 24px;
  border-right: 1px solid #241f18;
  display: flex;
  flex-direction: column;
  gap: 26px;
  align-self: start;
  position: sticky;
  top: 0;
}

#rail-word {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 22px;
  color: #f6efe1;
  margin: 0;
  letter-spacing: 0.01em;
}

#rail-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#rail-stat .num {
  font-family: Georgia, serif;
  font-size: 26px;
  color: #e0a944;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#rail-stat .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7f7663;
}

.rail-feat-top,
.rail-block-h {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4f8f80;
  margin-bottom: 8px;
}

.rail-block-h { color: #7f7663; }

.rail-feat {
  border: 1px solid #2c2619;
  border-radius: 4px;
  overflow: hidden;
}

.rail-feat img.poster {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  background: #1c1811;
}

.rail-feat-body {
  padding: 8px 10px 12px;
}

.rail-feat-title {
  font-family: Georgia, "Iowan Old Style", serif;
  font-weight: 700;
  font-size: 13.5px;
  color: #f6efe1;
}

.rail-feat-meta {
  font-size: 10.5px;
  color: #9a917c;
  margin-top: 3px;
}

#rail-villette {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-villette-item {
  font-size: 11.5px;
  color: #d8cfba;
  line-height: 1.5;
}

.rail-villette-item .d {
  color: #7f7663;
  font-size: 10px;
}

#rail-empty {
  display: none;
}

/* ── Colonne principale ───────────────────────────────────────────────── */

#main {
  min-width: 0;
  border-left: none;
}

header {
  padding: 30px 28px 20px;
}

#header-top {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
}

#imdb-legend {
  font-size: 11px;
  color: #7f7663;
}

#date-label {
  font-size: 12px;
  color: #b7ac8e;
  margin: -18px 0 18px;
  text-transform: capitalize;
}

#search {
  width: 100%;
  padding: 0 2px 8px;
  border: none;
  border-bottom: 1px solid #332c20;
  background: transparent;
  color: #f3ede0;
  font-size: 13px;
  outline: none;
}

#search::placeholder { color: #6f6656; }

#filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

#tabs {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tab {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8f8570;
  padding: 0 0 6px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, text-shadow 0.2s;
}

.tab:hover {
  color: #d8cfba;
  text-shadow: 0 0 10px rgba(224, 169, 68, 0.45);
}

.tab.active {
  color: #e0a944;
  border-bottom-color: #e0a944;
}

.tab.active:hover {
  color: #f0c168;
  text-shadow: 0 0 12px rgba(224, 169, 68, 0.7);
}

#showtime-filters {
  display: flex;
  gap: 14px;
}

#time-filter,
#version-filter {
  flex: 1;
  padding: 4px 18px 4px 0;
  border: none;
  border-bottom: 1px solid #241f18;
  border-radius: 0;
  font-size: 11px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a89d84' fill='none' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  color: #a89d84;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
  transition: color 0.15s, border-color 0.15s;
}

#time-filter:hover,
#version-filter:hover {
  color: #d8cfba;
  border-bottom-color: #4f8f80;
}

#time-filter option,
#version-filter option {
  background: #1c1811;
  color: #f3ede0;
}

#status {
  padding: 10px 28px;
  font-size: 12px;
  color: #9a917c;
}

#status.error {
  color: #d9603b;
}

#sort-bar {
  display: flex;
  gap: 16px;
  padding: 12px 28px;
  border-bottom: 1px solid #211c15;
  background: transparent;
}

.sort-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #695f4c;
  padding: 0;
  font-weight: 600;
  transition: color 0.15s, text-shadow 0.2s;
}

.sort-btn:hover {
  color: #d8cfba;
  text-shadow: 0 0 8px rgba(224, 169, 68, 0.4);
}

.sort-btn.active {
  color: #e0a944;
  font-weight: 700;
}

.sort-btn.active:hover {
  color: #f0c168;
  text-shadow: 0 0 10px rgba(224, 169, 68, 0.65);
}

#movie-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.movie {
  display: flex;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid #211c15;
  cursor: pointer;
}

.movie:hover {
  background: rgba(255, 255, 255, 0.02);
}

.movie.hidden,
.movie.time-hidden {
  display: none;
}

.movie img.poster {
  width: 56px;
  height: 82px;
  object-fit: cover;
  border-radius: 2px;
  background: #1c1811;
  flex-shrink: 0;
}

.movie-main {
  flex: 1;
  min-width: 0;
}

.movie-title {
  font-family: Georgia, "Iowan Old Style", serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #f6efe1;
}

.bookmark-btn {
  margin-left: auto;
  background: none;
  border: 1px solid #3a3223;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  color: #8f8570;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.bookmark-btn:hover {
  border-color: #d9603b;
  color: #d9603b;
  background: rgba(217, 96, 59, 0.1);
  box-shadow: 0 0 10px rgba(217, 96, 59, 0.35);
}

.bookmark-btn.bookmarked {
  color: #d9603b;
  border-color: #d9603b;
}

.movie-original-title {
  font-style: italic;
  color: #9a917c;
  font-size: 11px;
}

.movie-meta {
  font-size: 12px;
  color: #9a917c;
  margin-top: 4px;
}

.movie-rating {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 2px;
  background: #e0a944;
  color: #1b1610;
  font-weight: 700;
  font-size: 10.5px;
}

.showtime-panel {
  display: none;
  margin-top: 12px;
}

.showtime-panel.open {
  display: block;
}

.day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.day-tab {
  padding: 0 0 4px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  color: #8f8570;
  transition: color 0.15s, text-shadow 0.2s;
}

.day-tab:hover:not(.active) {
  color: #d8cfba;
  text-shadow: 0 0 8px rgba(224, 169, 68, 0.4);
}

.day-tab.active {
  background: none;
  color: #4f8f80;
  border-bottom-color: #4f8f80;
}

.day-tab.active:hover {
  text-shadow: 0 0 10px rgba(79, 143, 128, 0.6);
}

.showtimes {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 12px;
  max-width: 420px;
}

.showtimes li {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-top: 1px dashed #292319;
}

.showtimes li:first-child {
  border-top: none;
}

.showtimes a {
  color: #9a917c;
  text-decoration: none;
  display: flex;
  gap: 8px;
  flex: 1;
  transition: color 0.15s;
}

.showtimes .theatre {
  font-weight: 600;
  color: #5fb0a0;
  transition: color 0.15s;
}

.showtimes a:hover .theatre {
  color: #7bcabb;
  text-decoration: underline;
}

.showtimes .lang-badge {
  font-size: 9px;
  color: #6f6656;
  border: 1px solid #332c20;
  border-radius: 2px;
  padding: 0 4px;
  margin-left: 4px;
}

.showtimes .loading,
.showtimes .empty {
  color: #7f7663;
  font-style: italic;
}

#villette-list,
#watchlist-list {
  display: none;
}

.watchlist-entry {
  padding: 14px 28px;
  border-bottom: 1px solid #211c15;
}

.watchlist-title {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f6efe1;
}

.watchlist-remove {
  margin-left: auto;
  background: none;
  border: 1px solid #3a3223;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: #8f8570;
  padding: 1px 5px;
  line-height: 1;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.watchlist-remove:hover {
  border-color: #d9603b;
  color: #d9603b;
  background: rgba(217, 96, 59, 0.1);
  box-shadow: 0 0 10px rgba(217, 96, 59, 0.35);
}

.watchlist-original {
  font-style: italic;
  font-size: 11px;
  color: #9a917c;
  margin-top: 2px;
}

.watchlist-meta {
  font-size: 12px;
  color: #9a917c;
  margin-top: 4px;
}

.watchlist-saved {
  font-size: 10px;
  color: #695f4c;
  margin-top: 5px;
}

.watchlist-empty {
  padding: 40px 28px;
  text-align: center;
  color: #695f4c;
  font-size: 12px;
  font-style: italic;
}

.villette-date {
  padding: 8px 28px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7f7663;
  border-bottom: 1px solid #211c15;
}

.villette-date.today {
  color: #4f8f80;
}

.villette-date.past {
  color: #4a4536;
}

.villette-entry {
  display: flex;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid #211c15;
}

.villette-entry.past {
  opacity: 0.4;
}

.villette-poster {
  width: 56px;
  height: 82px;
  object-fit: cover;
  border-radius: 2px;
  background: #1c1811;
  flex-shrink: 0;
}

.villette-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.villette-title {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #f6efe1;
}

.villette-badge {
  font-size: 9px;
  font-weight: 700;
  color: #1b1610;
  background: #e0a944;
  border-radius: 2px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.villette-title a {
  color: #5fb0a0;
  text-decoration: none;
}

.villette-title a:hover {
  color: #7bcabb;
  text-decoration: underline;
}

.villette-meta {
  font-size: 12px;
  color: #9a917c;
}

footer {
  padding: 18px 28px;
  font-size: 10px;
  color: #695f4c;
  border-top: 1px solid #211c15;
}

footer a {
  color: #9a917c;
}

/* ── Responsive : le rail passe au-dessus du contenu ─────────────────── */

@media (max-width: 760px) {
  #layout {
    grid-template-columns: 1fr;
  }

  #rail {
    border-right: none;
    border-bottom: 1px solid #241f18;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 18px;
  }

  #rail-word { flex: 1 0 100%; }
  #rail-stat { flex: 0 0 auto; }
  .rail-feat { flex: 1 1 180px; max-width: 220px; }
  #rail-villette { flex: 1 1 180px; }

  header, #status, #sort-bar, .movie, .watchlist-entry, .villette-entry, .villette-date, footer {
    padding-left: 18px;
    padding-right: 18px;
  }
}
