/* Styles for the Fig & Lit pages (index.php, episode.php), on top of the Apps pages' (apps.css):
   the same white sections, charcoal buttons and light grey cards. The posters are tall (9 by 16),
   as the videos are. */

/* ---- The list page: what the show is ---- */

.fl-hero {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.fl-hero-picture {
  flex: none;
  width: 220px;
  height: 220px;
  border-radius: 12px;
  object-fit: cover;
}

.fl-hero-text {
  min-width: 0;
}

.fl-hero h1 {
  margin: 0 0 10px;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.1;
  color: #2c3e50;
}

.fl-shows {
  margin: 0 0 20px;
  padding-left: 22px;
  max-width: 46em;
  font-size: 16px;
  line-height: 1.55;
}

.fl-shows li {
  margin-bottom: 6px;
}

/* ---- The search ---- */

.fl-search {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin: 0 0 14px;
  padding: 16px;
  border-radius: 8px;
  background: #f4f4f4;
}

.fl-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.fl-field label {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

.fl-field input,
.fl-field select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #8a8a8a;
  border-radius: 6px;
  background: #fff;
  color: #222;
  font-size: 16px; /* 16px or more, so a phone does not zoom in on it */
}

.fl-field input:focus-visible,
.fl-field select:focus-visible,
.fl-play:focus-visible,
.fl-clear:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

.fl-buttons {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.fl-page .fl-buttons .app-button {
  min-height: 44px;
}

.fl-clear,
.fl-clear:visited {
  font-size: 15px;
  color: #303030;
  text-decoration: underline;
}

.fl-page h1.fl-missing {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  color: #2c3e50;
}

.fl-count {
  margin: 0 0 14px;
  font-size: 15px;
  color: #555;
}

.fl-none {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-left: 4px solid #303030;
  border-radius: 4px;
  background: #f4f4f4;
  font-size: 16px;
}

/* ---- Episode cards ---- */

.fl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.fl-grid-small {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.fl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background-color: #f8f8f8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.fl-card[hidden] {
  display: none;
}

@media (hover: hover) {
  .fl-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
  }
}

/* The poster's middle: the title card at its top and the hosts under it. */
.fl-card-poster {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 28%;
  background: #ddd;
}

.fl-card-text {
  padding: 12px 14px 14px;
  min-width: 0;
}

.fl-kicker {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #555;
}

/* (.section h2 in responsive/header.php draws a section's heading: big, with a rule under it) */
.fl-page .fl-card .fl-card-name {
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.fl-card-name a,
.fl-card-name a:visited {
  color: #2c3e50;
  text-decoration: none;
}

.fl-card-name a:hover,
.fl-card-name a:focus {
  color: #000;
  text-decoration: underline;
}

/* The whole card is the link. */
.fl-card-name a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.fl-card-name a:focus-visible::after {
  outline: 3px solid #1a73e8;
  outline-offset: -3px;
  border-radius: 8px;
}

.fl-card-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #333;
}

/* ---- An episode's page ---- */

/* The video on the left, the name and the facts beside it; on a phone the name comes first, then the
   video, then the facts. */
.fl-episode {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "player head" "player text";
  column-gap: 32px;
  align-items: start;
}

.fl-episode-head {
  grid-area: head;
  min-width: 0;
}

.fl-player {
  grid-area: player;
  max-width: 100%;
}

.fl-play,
.fl-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #000;
}

.fl-play img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fl-play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

/* A solid band, so the words keep their contrast whatever the poster has behind them (a gradient
   over the picture failed pa11y's contrast check). */
.fl-play-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 11px 12px 12px;
  background: #1b1b1b;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.fl-episode-text {
  grid-area: text;
  min-width: 0;
}

.fl-episode-head h1 {
  margin: 0 0 18px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
  color: #2c3e50;
  overflow-wrap: anywhere;
}

.fl-facts {
  display: grid;
  gap: 14px;
  margin: 0 0 20px;
  max-width: 40em;
}

.fl-facts dt {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #555;
}

.fl-facts dd {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
}

.fl-watch {
  margin: 0;
  font-size: 16px;
}

.fl-lines {
  margin: 0;
  padding-left: 0;
  max-width: 46em;
  list-style: none;
  font-size: 16px;
  line-height: 1.6;
}

.fl-lines li {
  margin-bottom: 8px;
}

.fl-sources ul {
  margin: 0;
  padding-left: 22px;
  font-size: 16px;
  line-height: 1.6;
}

@media (max-width: 991px) {
  .fl-search {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fl-field-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .fl-hero {
    display: block;
  }

  .fl-hero-picture {
    float: left;
    width: 96px;
    height: 96px;
    margin: 0 14px 10px 0;
  }

  .fl-hero h1 {
    padding-top: 18px;
    font-size: 30px;
  }

  .fl-hero .app-pitch,
  .fl-shows,
  .fl-follow {
    clear: both;
  }

  /* On a phone: the search box, then show and order side by side, then language or country, whose
     label is the long one, across the width. */
  .fl-search {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .fl-field-sort {
    order: 1;
  }

  .fl-field-from {
    order: 2;
    grid-column: 1 / -1;
  }

  .fl-buttons {
    order: 3;
    grid-column: 1 / -1;
  }

  .fl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .fl-page .fl-card .fl-card-name {
    font-size: 16px;
  }

  .fl-episode {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "head" "player" "text";
  }

  .fl-player {
    width: min(100%, 300px);
    margin: 0 auto 22px;
  }

  .fl-episode-head h1 {
    font-size: 28px;
  }
}

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

  .fl-card:hover {
    transform: none;
  }
}
