/* "News and favorites": the homepage area (#favorites), /news and the entry pages.
   Colours from main.css (:root). Pictures are 16:9 boxes, so nothing jumps while they load. */

.fav-section {
  background: #F3F7FA;
  padding: 3.5rem 0 3rem;
  text-align: left;
}

.fav-section-plain {
  padding-top: 2rem;
}

.fav-header {
  color: var(--color-blue-medium);
  text-align: center;
  font-size: 3.4rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  line-height: 1.1;
}

.fav-lead {
  text-align: center;
  color: var(--color-blue-dark);
  max-width: 760px;
  margin: 0 auto 2.2rem;
  font-size: 1.1rem;
}

.fav-row {
  margin-top: 2.2rem;
}

.fav-row:first-of-type {
  margin-top: 0;
}

.fav-row-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-blue-dark);
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 1.1rem;
}

.fav-row-title:after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--color-blue-light), rgba(0, 203, 216, 0));
}

.fav-grid {
  --fav-gap: 1.6rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--fav-gap);
}

@media screen and (max-width: 719px) {
  .fav-grid {
    --fav-gap: 1.4rem;
    grid-template-columns: minmax(0, 1fr);
  }

  .fav-header {
    font-size: 2.2rem;
  }

  .fav-section {
    padding: 2.5rem 0 2rem;
  }
}

@media screen and (min-width: 720px) and (max-width: 1100px) {
  .fav-grid {
    --fav-gap: 1rem;
  }
}

/* ---- the card ---- */

.fav-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(7, 41, 76, 0.08);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fav-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #0b1a2b;
  overflow: hidden;
}

/* browsers without aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
  .fav-thumb {
    height: 0;
    padding-top: 56.25%;
  }

  .fav-thumb img:first-child {
    position: absolute;
    top: 0;
    left: 0;
  }
}

.fav-thumb img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.fav-card:hover .fav-thumb img:first-child {
  transform: scale(1.05);
}

.fav-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: rgba(7, 41, 76, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
  transition: background 0.2s;
}

.fav-play:after {
  content: "";
  position: absolute;
  left: 22px;
  top: 16px;
  border-style: solid;
  border-width: 12px 0 12px 19px;
  border-color: transparent transparent transparent white;
}

.fav-card:hover .fav-play {
  background: rgba(230, 33, 23, 0.9);
}

.fav-card-channel .fav-play {
  display: none;
}

.fav-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.fav-avatar {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid white;
  object-fit: cover;
  background: #ddd;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.fav-text {
  padding: 1rem 1.15rem 0;
  min-width: 0;
}

.fav-foot {
  padding: 0.9rem 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* Line up the buttons of the cards in one row: each card spans three rows of the
   grid (picture, text, buttons), so the text row is as tall as the tallest text and
   every "Watch on YouTube" starts at the same height, with or without store links.
   Row spacing moves from the grid gap to the cards' bottom margin, because the
   grid's rows are now the cards' inner rows. Older browsers keep the flex card. */
@supports (grid-template-rows: subgrid) {
  .fav-grid {
    row-gap: 0;
    margin-bottom: calc(-1 * var(--fav-gap));
  }

  .fav-card {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
    margin-bottom: var(--fav-gap);
  }

  .fav-foot .fav-actions {
    margin-top: 0;
  }

  .fav-foot .fav-more {
    margin-top: auto;
    padding-top: 0.8rem;
  }
}

.fav-title {
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-blue-dark);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.fav-sub {
  margin: 0.3rem 0 0;
  color: #5b6b7b;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-actions {
  margin-top: auto;
}

.fav-btn-yt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #e62117;
  color: white !important;
  font-weight: 800;
  font-size: 0.98rem;
  padding: 0.62rem 1rem;
  border-radius: 26px;
  text-decoration: none !important;
  transition: background 0.2s;
}

.fav-btn-yt:hover,
.fav-btn-yt:focus {
  background: #c1150d;
}

.fav-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.fav-store {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1.5px solid #c9d6e2;
  border-radius: 20px;
  padding: 0.32rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--color-blue-dark) !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
}

.fav-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #999;
  flex: 0 0 auto;
}

.fav-store-spotify .fav-dot { background: #1db954; }
.fav-store-apple .fav-dot { background: #fa243c; }
.fav-store-amazon .fav-dot { background: #25d1da; }
.fav-store-spotify:hover { border-color: #1db954; background: #f0fbf4; }
.fav-store-apple:hover { border-color: #fa243c; background: #fff2f4; }
.fav-store-amazon:hover { border-color: #25d1da; background: #effcfd; }

.fav-more {
  margin-top: 0.8rem;
  align-self: flex-start;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-blue-medium) !important;
}

.fav-all {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem 2.5rem;
  margin-top: 2.4rem;
}

.fav-all a {
  color: var(--color-blue-medium);
  font-weight: 700;
  text-decoration: none;
}

.fav-all a:hover {
  color: var(--color-blue-dark);
}

/* ---- /news and the entry pages ---- */

.fav-page {
  background: #F3F7FA;
  text-align: left;
}

.fav-page-hero,
.fav-entry {
  background: #051D35;
  color: white;
  padding: 2.6rem 0 2.4rem;
}

.fav-page-hero h1 {
  color: white;
  margin: 0 0 0.4rem;
  font-weight: 900;
}

.fav-page-hero .fav-lead {
  color: var(--color-gray);
  text-align: left;
  margin: 0;
  max-width: 760px;
}

.fav-page-hero a {
  color: var(--color-blue-light);
}

.fav-crumb {
  font-size: 0.88rem;
  color: var(--color-gray);
  margin-bottom: 1.2rem;
}

.fav-crumb a {
  color: var(--color-gray);
}

.fav-crumb a:hover {
  color: white;
}

.fav-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 2.2rem;
  align-items: center;
}

@media screen and (max-width: 959px) {
  .fav-entry-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.4rem;
  }
}

/* the player's place: the picture until play, then the iframe (js/favorites.js) */
.fav-player-slot {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #0b1a2b;
}

.fav-dock {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 16px;
  overflow: hidden;
}

.fav-dock-frame {
  width: 100%;
  height: 100%;
}

.fav-dock-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: black;
}

.fav-dock-bar {
  display: none;
}

/* played and scrolled away: the video docks in the bottom right corner */
.fav-dock.fav-docked {
  position: fixed;
  top: auto;
  left: auto;
  right: 16px;
  bottom: 16px;
  width: 400px;
  max-width: calc(100vw - 24px);
  z-index: 985;   /* above the page, below UIkit's off-canvas menu and modals */
  border-radius: 10px;
  background: black;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.fav-dock.fav-docked .fav-dock-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 4px 0 2px;
  background: #051D35;
}

.fav-dock.fav-docked .fav-dock-frame {
  height: auto;
  aspect-ratio: 16 / 9;
}

.fav-dock-title,
.fav-dock-btn {
  border: 0;
  background: none;
  color: white;
  cursor: pointer;
  font: inherit;
}

.fav-dock-title {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 8px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-dock-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 26px;
  border-radius: 5px;
  font-size: 1.05rem;
  line-height: 26px;
  color: rgba(255, 255, 255, 0.8);
}

.fav-dock-btn:hover,
.fav-dock-btn:focus,
.fav-dock-title:hover {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

/* what stays in the video's place while it is docked */
.fav-player-docked .fav-player-slot::before {
  content: "The video is playing in the bottom right corner";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
}

.fav-player-on .fav-player-note {
  visibility: hidden;
}

@media screen and (max-width: 639px) {
  .fav-dock.fav-docked {
    right: 12px;
    bottom: 12px;
  }
}

.fav-player-btn {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #0b1a2b;
  cursor: pointer;
}

.fav-player-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fav-play-big {
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  background: rgba(230, 33, 23, 0.92);
  border-color: white;
}

.fav-play-big:after {
  left: 32px;
  top: 24px;
  border-width: 16px 0 16px 26px;
}

.fav-player-btn:hover .fav-play-big,
.fav-player-btn:focus .fav-play-big {
  background: #c1150d;
}

.fav-player-note {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  margin: 0.5rem 0 0;
}

.fav-thumb-big {
  border-radius: 16px;
}

.fav-entry-title {
  text-transform: none;
  color: white;
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  overflow-wrap: anywhere;
}

.fav-entry-sub {
  color: var(--color-gray);
  font-size: 1.1rem;
  margin: 0 0 1.4rem;
}

.fav-actions-big {
  max-width: 420px;
  padding-top: 0;
}

.fav-actions-big .fav-btn-yt {
  font-size: 1.1rem;
  padding: 0.8rem 1.2rem;
}

.fav-also {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-gray);
}

.fav-actions-big .fav-store {
  background: white;
  font-size: 0.95rem;
  padding: 0.45rem 0.9rem;
}

.fav-entry-text {
  padding: 2.6rem 0 0.5rem;
  color: #263544;
  font-size: 1.08rem;
  line-height: 1.7;
}

.fav-entry-text p {
  margin: 0 0 1.1rem;
  overflow-wrap: anywhere;   /* long addresses in a YouTube description */
}

.fav-entry-text a {
  color: var(--color-blue-medium);
}

/* a time in the text (a chapter): plays the video from there */
.fav-entry-text a.fav-ts {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.fav-entry-text a.fav-ts:hover {
  border-bottom-style: solid;
}

.fav-related {
  padding-top: 2.2rem;
}

.fav-pager {
  margin-top: 2rem;
}

/* the homepage slogan became an h1 (index.php): keep it looking like the picture it is */
h1#innovationImg {
  font-size: 1rem;
  line-height: 1.5;
  font-weight: normal;
}
