/* =========================================================
   CINEDOME — old-school stylesheet
   No border-radius. No transparency. Monospace only.
   ========================================================= */

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

:root {
  /* Change to match your page scans: 3/4, 2/3, 1/1, 2/1 ... */
  --slide-ratio: 3 / 4;
}

html {
  background: #000000;
}

body {
  font-family: "Courier New", Courier, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.5;
  color: #000000;
  background: url("background.webp") center / cover no-repeat fixed;
  background-color: #000000;
  padding: 24px 12px 48px;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
}

/* ---------------- links ---------------- */
a {
  color: #0000cc;
  text-decoration: underline;
}
a:visited {
  color: #660099;
}
a:hover {
  background: #ffff00;
  color: #000000;
}

/* ---------------- masthead ---------------- */
.masthead {
  margin-bottom: 20px;
  text-align: center;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ffffff;
}

.tagline {
  margin-top: 8px;
  font-size: 13px;
}

/* ---------------- 2x2 grid ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* If there is an ODD number of cards (i.e. 3), centre the last one */
.grid > .card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: calc(50% - 10px);
}

/* ---------------- card ---------------- */
.card {
  background: #ffffff;
  border: 3px solid #000000;
  display: flex;
  flex-direction: column;
}

/* ---------------- carousel ---------------- */
.carousel {
  position: relative;
  overflow: hidden;
  background: #000000;
  aspect-ratio: var(--slide-ratio);
}

.track {
  display: flex;
  width: 400%;
  height: 100%;
  animation: slide 18s linear infinite;
}

.track img {
  display: block;
  width: 25%;
  height: 100%;
  object-fit: contain;
  background: #000000;
}

/* 3 images + 1 duplicate of the first = seamless loop */
@keyframes slide {
  0%,   22%  { transform: translateX(0); }
  25%,  47%  { transform: translateX(-25%); }
  50%,  72%  { transform: translateX(-50%); }
  75%,  97%  { transform: translateX(-75%); }
  100%       { transform: translateX(-75%); }
}

/* stagger so cards don't flip in sync */
.card:nth-child(2) .track { animation-delay: -4.5s; }
.card:nth-child(3) .track { animation-delay: -9s; }
.card:nth-child(4) .track { animation-delay: -13.5s; }

@media (prefers-reduced-motion: reduce) {
  .track { animation: none; }
}

/* ---------------- card body ---------------- */
.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.card h2 {
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.meta {
  font-size: 13px;
}

.button {
  display: block;
  margin-top: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: #000000;
  background: #c0c0c0;
  border: 3px solid #000000;
}

.button:visited {
  color: #000000;
}

.button:hover {
  background: #e8e8e8;
  color: #000000;
  text-decoration: none;
}

.button:active {
  background: #a0a0a0;
}

/* ---------------- legend / footer ---------------- */
.legend {
  margin-top: 26px;
  background: #ffffff;
  border: 3px solid #000000;
  padding: 14px 16px;
  font-size: 13px;
}

.legend hr {
  border: 0;
  border-top: 1px dashed #000000;
  margin: 14px 0;
}

.credit {
  text-align: right;
}

/* ---------------- small screens ---------------- */
@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .grid > .card:last-child:nth-child(odd) {
    grid-column: auto;
    max-width: none;
  }
  h1 {
    font-size: 22px;
    letter-spacing: 2px;
  }
  body {
    padding: 16px 10px 32px;
  }
}
