/* ===============================
   Chess in Literature – Timeline
   Cleaned + fixed
   =============================== */

/* Theme */
:root{
  --accent:#2d7ef7;
  --bg:#f8f9fa;
  --card-bg:#fff;
  --text:#1f2937;
  --muted:#6b7280;
  --shadow:0 6px 18px rgba(0,0,0,.08);
  --shadow-hover:0 10px 24px rgba(0,0,0,.12);
  --badge:#e0e7ff;
}

body{background:var(--bg);color:var(--text)}
.container{width:100%;max-width:1100px;padding:0 20px;margin:0 auto}

/* Heading */
.timeline-header h1{
  text-align:center;
  font-size:clamp(1.6rem,1.2rem+1.2vw,2.2rem);
  font-weight:800; margin:0 0 28px; letter-spacing:.2px;
}

.notice {
  background-color: #fff3cd;
  border-left: 5px solid #ffcc00;
  padding: 15px;
  margin: 20px 0;
  font-weight: bold;
  color: #333;
}

/* Track (spine) */
.timeline-wrapper{padding:64px 0}
.timeline-track{position:relative}
.timeline-track::before{
  content:"";
  position:absolute; top:0; bottom:0;
  left:50%; transform:translateX(-50%);
  width:10px; background:var(--accent); border-radius:2px;
}

/* Items */
.tl-item{display:flex; position:relative; margin:34px 0}
.tl-content-wrap{width:50%; padding:0 34px; box-sizing:border-box; position:static}

/* Alternate sides with your custom classes */
.tl-item.left{justify-content:flex-end}
.tl-item.right{justify-content:flex-start}
.tl-item.left .tl-content-wrap{text-align:right}
.tl-item.right .tl-content-wrap{text-align:left}

/* Dot — centered on the row (spine) so it works for both sides */
.tl-dot{
  position:absolute;
  left:50%; transform:translateX(-50%);
  top:18px; /* tweak to align with card padding */
  width:16px; height:16px;
  background:#fff; border:4px solid var(--accent); border-radius:50%;
  z-index:2;
}

/* Card */
.tl-card{
  background:var(--card-bg); border-radius:14px;
  box-shadow:var(--shadow); padding:18px 20px;
  display:inline-block; max-width:520px; text-align:left;
  transition:transform .18s ease, box-shadow .18s ease;
}
.tl-card:hover{transform:translateY(-2px); box-shadow:var(--shadow-hover)}

.tl-card h6.tl-year{margin:0 0 6px; color:#4b5563; font-weight:700; letter-spacing:.3px; font-size:.95rem}
.tl-title{margin:0 0 8px; font-size:1.15rem; font-weight:800; color:var(--accent)}
.tl-meta{color:var(--muted); font-size:.95rem; margin-bottom:8px}
.tl-desc{margin:0; color:var(--text); line-height:1.65}

/* Badges */
.badge{display:inline-block; font-size:.72em; padding:4px 9px; border-radius:999px; margin:6px 6px 0 0; font-weight:700; background:var(--badge); color:#29304a}
.badge.type{background:#e0f2fe; color:#0369a1}
.badge.subject{background:#d1fae5; color:#065f46}
.badge.fundamental-symbolism{background:#fde68a; color:#92400e}
.badge.incidental-symbolism{background:#e5e7eb; color:#374151}
.badge.brief{background:#f3e8ff; color:#6b21a8}

/* Links */
.tl-card a{color:var(--accent); text-decoration:none; font-weight:600}
.tl-card a:hover{text-decoration:underline}

/* Optional image */
.tl-card img{max-width:120px; border-radius:8px; margin:10px 0; display:block}

/*Filters */

.filter-heading {
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 10px;
  margin-top: 50px;
}

form.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* centers the controls */
  gap: 15px;
  margin-bottom: 60px;
  background: #f5f5f5;
  padding: 15px 20px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

form.filters>div:not(.year-range) {
    display: flex;
    flex-direction: column;
    align-items: center;
}

form.filters label {
  margin-bottom: 5px;
  font-weight: bold;
}

form.filters select {
  padding: 6px 10px;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}

form.filters input[type="number"] {
    padding: 6px 10px;
    font-size: 1rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    width: 100px;
}

.filters .reset-button {
  display: inline-block;
  padding: 10px 16px;
  margin-top: 8px;
  background-color: #ccc;
  color: #000;
  text-decoration: none;
  border-radius: 4px;
  font-size: 20px;
  text-align: center;
  transition: background 0.3s;
}

.filters .reset-button:hover {
  background-color: #aaa;
}

.filters .year-range {
  display: flex;
  gap: 15px;
  align-items: flex-end;
}

.filters .year-range label {
  margin-right: 4px;
  font-weight: bold;
}

.filters .year-range input {
  width: 100px;
  padding: 4px 6px;
  font-size: 14px;
}

.submit-button {
  padding: 10px 16px;
  font-size: 20px;
  background-color: #444;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 8px;
}
.submit-button:hover {
  background-color: #666;
}

/* Responsive */
@media (max-width: 768px) {
  .timeline-track::before {
    left: 22px;
    transform: none;
  }
  .tl-item {
    justify-content: flex-start !important;
    flex-direction: row !important;
  }
  .tl-side {
    display: none;
  }
  .tl-content-wrap {
    width: 100%;
    padding-left: 46px;
    padding-right: 0;
    text-align: left !important;
  }
  .tl-dot {
    left: 22px;
    transform: none;
  }
}

