/* ---------- Blog Flips (on top of blog.css) ----------
   The Read | Flips switch in the blog banner, the banner's Flips look (a night
   sky with a stack of Flip cards and a play button), the Flip label on blog
   cards, the "Watch as a Flip" parts of a post, and the Flip page, where the
   banner holds the uploaded Flip file in its frame. The Flip parts stay dark in
   both blog themes, like the Flip files themselves. */

:root {
  --flip-night: #141a3a;
  --flip-night-2: #1d2450;
  --flip-plum: #3b2a55;
  --flip-dawn: #ffb38a;
  --flip-dawn-ink: #ffd6a0;
  --flip-sky: radial-gradient(ellipse at 18% 0%, rgba(255, 179, 138, 0.26), transparent 50%),
    radial-gradient(circle at 92% 105%, rgba(244, 162, 89, 0.32), transparent 48%),
    linear-gradient(165deg, #12162e 0%, #1d2450 48%, #3b2a55 100%);
}

.flip-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.14em;
}

/* ---------- Read | Flips switch ---------- */

.flip-switch {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.flip-switch a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.flip-switch a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.flip-switch a[aria-current="page"] {
  background: #fff;
  color: var(--bb-blue-900);
}

.flip-switch a.flip-switch-flips[aria-current="page"] {
  background: linear-gradient(135deg, #fff, #ffe6d6);
  color: var(--flip-plum);
}

.flip-switch .flip-switch-count {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--bb-gold-400);
  color: var(--bb-sage-900);
}

/* ---------- The banner in Flips view ---------- */

.blog-hero.blog-hero-flips {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--flip-sky);
  box-shadow: 0 18px 40px -24px rgba(20, 26, 58, 0.8);
}

/* A few stars. */
.blog-hero-flips::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 24%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 22% 70%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 36% 14%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 51% 82%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1px 1px at 63% 20%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 10%, rgba(255, 255, 255, 0.5), transparent 60%);
}

.blog-hero-flips .blog-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--flip-dawn);
}

.blog-hero-flips .blog-hero-eyebrow .flip-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.blog-hero-flips h1 em {
  font-style: italic;
  color: var(--flip-dawn);
}

.flip-hero-side {
  display: grid;
  gap: 1rem;
  justify-items: end;
  flex: 1 1 18rem;
  max-width: 26rem;
}

.flip-hero-side .blog-search {
  width: 100%;
  max-width: none;
}

/* The stack of Flip cards with a play button. */
.flip-hero-art {
  position: relative;
  width: 210px;
  height: 150px;
  margin-right: 0.5rem;
}

.flip-hero-art .fh-card {
  position: absolute;
  bottom: 0;
  width: 84px;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  box-shadow: 0 14px 24px -14px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.flip-hero-art .fh-card::after {
  /* a sun over hills */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, 50%);
  background: radial-gradient(circle, rgba(255, 243, 214, 0.95) 0%, rgba(255, 208, 138, 0.55) 42%, rgba(255, 176, 94, 0) 70%);
}

.fh-card.fh-1 {
  left: 0;
  transform: rotate(-12deg) translateY(4px);
  background: linear-gradient(180deg, #1e3a8a, #2563eb 60%, #bfdbfe);
  opacity: 0.85;
}

.fh-card.fh-2 {
  right: 0;
  transform: rotate(11deg) translateY(4px);
  background: linear-gradient(180deg, #4a1d12, #b4532a 55%, #f4c27a);
  opacity: 0.85;
}

.fh-card.fh-3 {
  left: 50%;
  width: 94px;
  transform: translateX(-50%);
  z-index: 1;
  background: linear-gradient(180deg, #141a3a 0%, #3c3f78 55%, #e0876a 100%);
  animation: flip-float 5s ease-in-out infinite;
}

.fh-bars {
  position: absolute;
  top: 7px;
  left: 7px;
  right: 7px;
  display: flex;
  gap: 2px;
  z-index: 1;
}

.fh-bars i {
  flex: 1;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.fh-bars i:first-child,
.fh-bars i:nth-child(2) {
  background: var(--flip-dawn);
}

.fh-play {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  color: var(--flip-plum);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.18);
  animation: flip-pulse 2.4s ease-out infinite;
}

.fh-play svg {
  width: 15px;
  height: 15px;
  margin-left: 2px;
}

.fh-chip {
  position: absolute;
  right: -6px;
  top: 6px;
  z-index: 3;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bb-gold-400);
  color: var(--bb-sage-900);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

@keyframes flip-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

@keyframes flip-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); }
  70% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

@media (max-width: 640px) {
  .flip-hero-side {
    justify-items: stretch;
    max-width: none;
  }
  .flip-hero-art {
    display: none;
  }
}

.flip-list-note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #f2ecfa, #fdeee4);
  color: var(--flip-plum);
  font-weight: 700;
  font-size: 0.92rem;
}

.flip-list-note .flip-icon {
  width: 1.25rem;
  height: 1.25rem;
}

[data-blog-theme="dark"] .flip-list-note {
  background: linear-gradient(135deg, #261f38, #33241f);
  color: var(--flip-dawn-ink);
}

/* ---------- Blog cards ---------- */

.blog-card-media {
  position: relative;
}

.flip-card-tag {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(20, 26, 58, 0.84);
  color: var(--flip-dawn-ink);
  font-size: 0.75rem;
  font-weight: 800;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.flip-card-tag .flip-icon {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--flip-dawn);
}

/* No cover picture: the play button takes the middle, not the category name. */
.blog-card-flip .blog-cover-placeholder > * {
  visibility: hidden;
}

.blog-card-flip .blog-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 26, 58, 0) 30%, rgba(20, 26, 58, 0.6));
  pointer-events: none;
}

.flip-card-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  color: var(--flip-plum);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease;
}

.flip-card-play svg {
  width: 20px;
  height: 20px;
  margin-left: 3px;
}

.blog-card-flip:hover .flip-card-play {
  transform: translate(-50%, -50%) scale(1.08);
}

.flip-card-watch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--flip-plum);
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
}

.flip-card-watch:hover {
  color: var(--bb-blue-700);
}

.flip-card-watch .flip-icon {
  width: 1rem;
  height: 1rem;
}

[data-blog-theme="dark"] .flip-card-watch {
  color: var(--flip-dawn-ink);
}

/* ---------- On a blog post ---------- */

.flip-watch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem 0.4rem 0.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--flip-night-2), var(--flip-plum));
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px -10px rgba(59, 42, 85, 0.8);
}

.flip-watch-btn:hover {
  color: #fff;
  filter: brightness(1.1);
}

.flip-watch-btn .flip-dot {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--flip-dawn);
  color: var(--flip-night);
}

.flip-watch-btn .flip-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.flip-post-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  margin: 1.25rem 0 0.5rem;
  padding: 1rem 1.15rem 1rem 1rem;
  border-radius: 1.1rem;
  color: #fff;
  background: var(--flip-sky);
}

.flip-post-thumb {
  display: block;
  position: relative;
  width: 72px;
  aspect-ratio: 9 / 16;
  border-radius: 0.75rem;
  overflow: hidden;
  background: linear-gradient(180deg, #141a3a 0%, #3c3f78 55%, #e0876a 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.flip-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flip-post-thumb .fh-play {
  width: 30px;
  height: 30px;
  top: 50%;
}

.flip-post-card .flip-eb {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--flip-dawn-ink);
}

.flip-post-card h2 {
  margin: 0.25rem 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.flip-post-card p {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.82);
}

.flip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 0;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.flip-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.flip-btn svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.flip-btn.flip-btn-light {
  background: #fff;
  color: var(--flip-night);
}

.flip-btn.flip-btn-light:hover {
  background: #ffeede;
  color: var(--flip-night);
}

/* ---------- The Flip page ---------- */

.blog-hero.flip-hero {
  display: block;
  position: relative;
  isolation: isolate;
  padding: 1.25rem 1.5rem 1.75rem;
  background: var(--flip-sky);
  box-shadow: 0 24px 48px -28px rgba(20, 26, 58, 0.9);
  animation: flip-hero-in 0.5s cubic-bezier(0.3, 0.7, 0.3, 1);
}

.flip-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 34% 8%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 76% 12%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 90% 34%, rgba(255, 255, 255, 0.4), transparent 60%);
}

@keyframes flip-hero-in {
  from { opacity: 0.4; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .blog-hero.flip-hero {
    padding: 1rem 0.75rem 1.25rem;
    border-radius: 1rem;
  }
}

.flip-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.flip-bar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  min-width: 0;
}

.flip-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.9rem 0.4rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  text-decoration: none;
}

.flip-back:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.flip-back svg {
  width: 1rem;
  height: 1rem;
}

.flip-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--flip-dawn);
}

.flip-mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--flip-dawn), #e0876a);
  color: var(--flip-night);
}

.flip-mark .flip-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.flip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Share: a small panel under the button. */
.flip-share {
  position: relative;
}

.flip-share > summary {
  list-style: none;
}

.flip-share > summary::-webkit-details-marker {
  display: none;
}

.flip-share-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 20;
  min-width: 16rem;
  padding: 0.8rem;
  border-radius: 1rem;
  background: #fff;
  color: var(--bb-sage-900);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.55);
}

.flip-share-panel .blog-share {
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .flip-share-panel {
    right: auto;
    left: 0;
  }
}

.flip-stage {
  margin-top: 0.75rem;
}

.flip-frame {
  display: block;
  width: 100%;
  height: 900px;
  border: 0;
  background: transparent;
  /* So the browser keeps the dark Flip page see-through on the banner. */
  color-scheme: dark;
}

.flip-frame-note {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

.flip-title-locked {
  margin: 1.5rem 0 0.4rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
  color: #fff;
}

.flip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.flip-lock {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  max-width: 26rem;
  margin: 2rem auto 1rem;
  padding: 1.75rem 1.5rem;
  border-radius: 1.25rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.flip-lock-icon {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
}

.flip-lock-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.flip-lock h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.flip-lock p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.flip-more-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 2rem 0 1rem;
}

.flip-more-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.flip-more-head .flip-icon {
  width: 1.4rem;
  height: 1.4rem;
  color: var(--flip-plum);
}

.flip-more-head a {
  margin-left: auto;
  font-weight: 700;
}

[data-blog-theme="dark"] .flip-more-head .flip-icon {
  color: var(--flip-dawn);
}

@media (prefers-reduced-motion: reduce) {
  .fh-card.fh-3,
  .fh-play,
  .blog-hero.flip-hero {
    animation: none;
  }
}
