/* media-log.css: styles for read books and watched movies page */

.media-log-hero {
  background: linear-gradient(120deg, #fffdf9, #fbeee6);
  border-bottom: 1px solid rgba(180, 83, 47, 0.14);
}

.media-log-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.media-log-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b665d;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.media-log-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1f1e1d;
  margin-bottom: 0.5rem;
}

.media-log-lede {
  color: #3d3a35;
  max-width: 520px;
  margin-bottom: 0;
}

.media-log-filters {
  background: #fff;
  border: 1px solid rgba(31, 30, 29, 0.1);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  box-shadow: 0 12px 30px rgba(31, 30, 29, 0.08);
}

.media-log-filter-label {
  font-size: 0.85rem;
  color: #6b665d;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.media-log-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.media-log-filter-buttons .btn {
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 600;
}

.media-log-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.media-log-stat {
  background: rgba(217, 119, 87, 0.14);
  color: #7a3a20;
  padding: 0.45rem 0.85rem;
  border-radius: 14px;
  font-weight: 600;
}

.media-section {
  background: #fff;
  border: 1px solid rgba(31, 30, 29, 0.08);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(31, 30, 29, 0.06);
}

.media-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.media-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.media-section-subtitle {
  color: #6b665d;
  font-size: 0.9rem;
  margin-bottom: 0;
}

.media-subsection + .media-subsection {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(31, 30, 29, 0.08);
}

.media-subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.media-subsection-title {
  font-weight: 700;
  font-size: 1rem;
}

.media-item {
  padding: 1rem 0;
  border-bottom: 1px dashed rgba(31, 30, 29, 0.2);
}

.media-item:last-child {
  border-bottom: none;
}

.media-item-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.media-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #6b665d;
}

.media-item-badge {
  background: #f3efe6;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1f1e1d;
}

.media-item-notes {
  margin: 0.5rem 0 0;
  color: #3d3a35;
}

.media-empty {
  text-align: center;
  padding: 2rem;
  border-radius: 16px;
  border: 1px dashed rgba(31, 30, 29, 0.2);
  color: #6b665d;
  background: #f7f4ee;
}

@media (max-width: 991.98px) {
  .media-log-header {
    align-items: flex-start;
  }

  .media-log-title {
    font-size: 1.9rem;
  }

  .media-section {
    padding: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .media-log-title {
    font-size: 1.6rem;
  }

  .media-log-filters {
    width: 100%;
  }
}

/* ---- Watched movies/series: two cards, year accordion ---------------- */

.media-card {
  background: #fff;
  border: 1px solid rgba(31, 30, 29, 0.08);
  border-radius: 20px;
  padding: 1.25rem 1.25rem 0.5rem;
  box-shadow: 0 20px 40px rgba(31, 30, 29, 0.06);
  min-width: 0; /* long titles wrap instead of widening the grid column */
}

.media-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(31, 30, 29, 0.08);
}

.media-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f1e1d;
  margin: 0;
}

.media-card-count {
  min-width: 2.2rem;
  text-align: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #1f1e1d;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.media-card-series .media-card-count {
  background: #a84a2a;
}

.media-year {
  border-bottom: 1px solid rgba(31, 30, 29, 0.08);
}

.media-year:last-of-type {
  border-bottom: none;
}

.media-year-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.25rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.media-year-summary::-webkit-details-marker {
  display: none;
}

.media-year-summary:focus-visible {
  outline: 2px solid #d97757;
  outline-offset: 2px;
  border-radius: 8px;
}

.media-year-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1f1e1d;
}

.media-year-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b665d;
  background: #f3efe6;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

.media-year-caret {
  margin-left: auto;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid #6b665d;
  border-bottom: 2px solid #6b665d;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.media-year[open] > .media-year-summary .media-year-caret {
  transform: rotate(-135deg);
}

.media-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.75rem;
}

.media-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.25rem;
  border-top: 1px dashed rgba(31, 30, 29, 0.12);
}

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

.media-row-title {
  display: block;
  font-weight: 600;
  color: #1f1e1d;
  overflow-wrap: anywhere;
}

.media-row-sub {
  display: block;
  font-size: 0.82rem;
  color: #6b665d;
}

.media-row-notes {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  color: #3d3a35;
}

.media-row-rating {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: #1f1e1d;
  background: #f3efe6;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.media-row-rating small {
  font-weight: 600;
  color: #6b665d;
}

@media (prefers-reduced-motion: reduce) {
  .media-year-caret { transition: none; }
}
