/* ==========================================================================
   FUN BITS — page layout: header, hero, sections, footer
   ========================================================================== */

/* ————————————————————————————————— Header ————————————————————————————————— */

.fb-header {
  position: relative;
  z-index: 60;
  padding-block: 18px 0;
}

.fb-header__inner {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 66px;
  padding: 10px 14px 10px 18px;
  background: rgba(255, 253, 247, 0.92);
  border: 3px solid var(--fb-white);
  border-radius: 999px;
  box-shadow: 0 6px 0 rgba(37, 37, 37, 0.05), 0 18px 34px -26px rgba(37, 37, 37, 0.5);
  backdrop-filter: blur(8px);
}

/* —— Logo —— */

.fb-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
  border-radius: 14px;
}

.fb-brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--fb-yellow);
  border: 3px solid var(--fb-white);
  box-shadow: 0 3px 0 rgba(37, 37, 37, 0.16);
  transform: rotate(-6deg);
  transition: transform 0.3s var(--fb-ease);
}
.fb-brand:hover .fb-brand__mark { transform: rotate(4deg) scale(1.04); }

.fb-brand__mark svg { width: 24px; height: 24px; }

.fb-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 0.92;
  gap: 3px;
}

.fb-brand__name {
  font-family: var(--fb-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  word-break: break-word;
}

.fb-brand__tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fb-muted);
}

/* —— Nav —— */

.fb-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  justify-content: center;
}

.fb-nav__link {
  position: relative;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fb-ink-2);
  white-space: nowrap;
  transition: background-color 0.18s var(--fb-ease), color 0.18s var(--fb-ease);
}

.fb-nav__link:hover { background: var(--fb-wash); color: var(--fb-ink); }

.fb-nav__link.is-active {
  background: var(--fb-ink);
  color: var(--fb-white);
}

.fb-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fb-orange);
  transform: translateX(-50%);
}

/* —— Header search —— */

.fb-header__search {
  position: relative;
  flex: 0 1 250px;
  min-width: 0;
}

.fb-search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.fb-search-field__icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--fb-muted);
  pointer-events: none;
}

.fb-search-field__input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 40px;
  border: 2px solid rgba(37, 37, 37, 0.1);
  border-radius: 999px;
  background: var(--fb-white);
  font-size: 13.5px;
  transition: border-color 0.18s var(--fb-ease), box-shadow 0.18s var(--fb-ease);
}

.fb-search-field__input::placeholder { color: #A79E90; }

.fb-search-field__input:focus {
  outline: none;
  border-color: var(--fb-orange);
  box-shadow: 0 0 0 4px rgba(255, 133, 82, 0.16);
}

/* Inline results dropdown */
.fb-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 70;
  max-height: 420px;
  overflow-y: auto;
  padding: 10px;
  background: var(--fb-white);
  border: 3px solid var(--fb-white);
  border-radius: 22px;
  box-shadow: 0 7px 0 rgba(37, 37, 37, 0.07), 0 28px 44px -20px rgba(37, 37, 37, 0.45);
}

.fb-search-results__empty {
  padding: 16px 12px;
  font-size: 13px;
  color: var(--fb-muted);
  text-align: center;
}

.fb-search-hit {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px;
  border-radius: 14px;
  transition: background-color 0.15s var(--fb-ease);
}
.fb-search-hit:hover { background: var(--fb-wash); }

.fb-search-hit__thumb {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 11px;
  object-fit: cover;
  border: 2px solid var(--fb-white);
  background: var(--fb-wash);
}

.fb-search-hit__meta { min-width: 0; }

.fb-search-hit__name {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fb-search-hit__cat {
  display: block;
  font-size: 11px;
  color: var(--fb-muted);
}

/* —— Header actions —— */

.fb-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.fb-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(37, 37, 37, 0.1);
  border-radius: 50%;
  background: var(--fb-white);
  color: var(--fb-ink);
  transition: transform 0.18s var(--fb-ease), background-color 0.18s var(--fb-ease),
    border-color 0.18s var(--fb-ease);
}
.fb-icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--fb-ink);
}
.fb-icon-btn svg { width: 19px; height: 19px; }

.fb-icon-btn__count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--fb-orange);
  border: 2px solid var(--fb-white);
  color: var(--fb-white);
  font-size: 10px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
}

.fb-icon-btn--menu { display: none; }

/* ————————————————————————————————— Hero ————————————————————————————————— */

.fb-hero {
  position: relative;
  padding-block: 46px 30px;
  overflow: clip;
}

.fb-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  grid-template-areas:
    "lead  art"
    "act   art"
    "ad    ad";
  align-items: center;
  column-gap: 54px;
  row-gap: 26px;
}

.fb-hero__lead { grid-area: lead; position: relative; z-index: 2; align-self: end; }
.fb-hero__actions { grid-area: act; align-self: start; }
.fb-hero__art { grid-area: art; }

/* First-screen ad. Sits inside the hero grid so it lands in the upper-middle
   of the mobile first screen; on desktop it spans both columns below the copy
   and art rather than squeezing between them. */
.fb-hero__ad {
  grid-area: ad;
  grid-column: 1 / -1;
  margin-top: 8px;
}

.fb-hero__ad .fb-ad { margin-block: 0; }

.fb-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 7px 16px 7px 10px;
  border: 2px solid var(--fb-white);
  border-radius: 999px;
  background: var(--fb-white);
  box-shadow: 0 3px 0 rgba(37, 37, 37, 0.07);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fb-ink-2);
}

.fb-hero__kicker-flag {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--fb-green);
  transform: rotate(-6deg);
}
.fb-hero__kicker-flag svg { width: 13px; height: 13px; }

.fb-hero__title {
  font-size: clamp(44px, 6.1vw, 82px);
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.fb-hero__title-line { display: block; }

/* Each phrase is its own cut-out word so colour can rotate per line */
.fb-word {
  position: relative;
  display: inline-block;
  padding: 0.02em 0.1em 0.08em;
  margin-bottom: 0.06em;
  border-radius: 14px;
  background: var(--fb-word-tone, var(--fb-yellow));
  border: 3px solid var(--fb-white);
  box-shadow: 0 4px 0 rgba(37, 37, 37, 0.14);
  transform: rotate(var(--fb-word-tilt, -1.2deg));
}
.fb-word--plain {
  background: none;
  border-color: transparent;
  box-shadow: none;
  padding-inline: 0;
  transform: none;
}
.fb-word--pink { --fb-word-tone: var(--fb-pink); --fb-word-tilt: 1.4deg; }
.fb-word--blue { --fb-word-tone: var(--fb-blue); --fb-word-tilt: -1.8deg; }
.fb-word--green { --fb-word-tone: var(--fb-green); --fb-word-tilt: 1deg; }

.fb-word__star {
  position: absolute;
  top: -10px;
  right: -12px;
  width: 22px;
  height: 22px;
  color: var(--fb-orange);
  transform: rotate(12deg);
}

.fb-hero__lede {
  max-width: 47ch;
  margin-top: 24px;
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--fb-ink-2);
}

.fb-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.fb-hero__note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 24px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fb-muted);
}

.fb-hero__note span { display: inline-flex; align-items: center; gap: 6px; }

.fb-hero__note-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fb-orange);
}

/* —— Hero sticker board —— */

.fb-hero__art {
  position: relative;
  min-height: 460px;
  display: grid;
  place-items: center;
}

.fb-hero__backdrop {
  position: absolute;
  inset: 4% 2% 2% 4%;
  border-radius: 48% 52% 44% 56% / 54% 46% 58% 42%;
  background: var(--fb-yellow);
  opacity: 0.55;
  filter: blur(0.5px);
}

.fb-hero__backplate {
  position: absolute;
  inset: 12% 8% 8% 10%;
  border-radius: 38px;
  background: var(--fb-paper);
  border: 3px dashed rgba(37, 37, 37, 0.16);
  transform: rotate(-2.4deg);
}

.fb-hero__tiles {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  height: 420px;
}

.fb-hero__tile {
  position: absolute;
  display: block;
  overflow: hidden;
  border: 4px solid var(--fb-white);
  border-radius: 26px;
  box-shadow: var(--fb-shadow);
  transition: transform 0.4s var(--fb-ease), box-shadow 0.4s var(--fb-ease);
}

.fb-hero__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--fb-ease);
}

.fb-hero__tile:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.02) !important;
  box-shadow: var(--fb-shadow-lift);
}
.fb-hero__tile:hover img { transform: scale(1.06); }

.fb-hero__tile--a {
  width: 58%;
  aspect-ratio: 4 / 5;
  left: 4%;
  top: 8%;
  transform: rotate(-5deg);
  z-index: 3;
}

.fb-hero__tile--b {
  width: 42%;
  aspect-ratio: 1;
  right: 0;
  top: 0;
  transform: rotate(5deg);
  z-index: 2;
}

.fb-hero__tile--c {
  width: 46%;
  aspect-ratio: 5 / 4;
  right: 4%;
  bottom: 2%;
  transform: rotate(-2deg);
  z-index: 4;
}

.fb-hero__badge {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 3px solid var(--fb-white);
  background: var(--fb-white);
  box-shadow: var(--fb-shadow-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--fb-ink);
  white-space: nowrap;
}

.fb-hero__badge--play {
  left: -6px;
  bottom: 16%;
  background: var(--fb-ink);
  color: var(--fb-white);
  border-color: var(--fb-ink);
  transform: rotate(-3deg);
}

.fb-hero__badge--fresh {
  right: 0;
  top: 46%;
  background: var(--fb-green);
  transform: rotate(3deg);
}

.fb-hero__badge-dot {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fb-orange);
  color: var(--fb-white);
}
.fb-hero__badge-dot svg { width: 9px; height: 9px; }

/* Loose stickers floating on the board */
.fb-sticker {
  position: absolute;
  display: grid;
  place-items: center;
  border: 3px solid var(--fb-white);
  box-shadow: 0 4px 0 rgba(37, 37, 37, 0.12);
  pointer-events: none;
}

.fb-sticker--star {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--fb-orange);
  color: var(--fb-white);
  transform: rotate(-12deg);
}
.fb-sticker--star svg { width: 28px; height: 28px; }

.fb-sticker--dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--fb-blue);
  border-width: 3px;
}

.fb-sticker--pill {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--fb-purple);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(6deg);
}

.fb-sticker--squiggle {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--fb-pink);
  transform: rotate(8deg);
}
.fb-sticker--squiggle svg { width: 24px; height: 24px; }

/* ————————————————————————————————— Sections ————————————————————————————————— */

.fb-section {
  position: relative;
  padding-block: 46px;
}

.fb-section--tight { padding-block: 30px; }

.fb-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.fb-section__titles { min-width: 0; }

.fb-section__index {
  display: block;
  margin-bottom: 8px;
  font-family: var(--fb-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fb-muted);
}

.fb-section__title {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: clamp(27px, 3.1vw, 40px);
  letter-spacing: -0.025em;
}

.fb-section__title-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 13px;
  border: 3px solid var(--fb-white);
  background: var(--fb-tone, var(--fb-yellow));
  box-shadow: 0 3px 0 rgba(37, 37, 37, 0.14);
  font-family: var(--fb-display);
  font-size: 18px;
  font-weight: 800;
  transform: rotate(-6deg);
}

.fb-section__sub {
  max-width: 56ch;
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--fb-muted);
}

.fb-section__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 9px 16px;
  border-radius: 999px;
  border: 2px solid rgba(37, 37, 37, 0.14);
  background: var(--fb-white);
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.18s var(--fb-ease), border-color 0.18s var(--fb-ease);
}
.fb-section__more:hover {
  transform: translateY(-2px);
  border-color: var(--fb-ink);
}
.fb-section__more svg { width: 15px; height: 15px; }

/* ————————————————————————————————— Ad slots ————————————————————————————————— */

/* Ads are deliberately quiet: flat, dashed, labelled, never sticker-like. */
.fb-ad {
  margin-block: 34px;
}

.fb-ad__frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 110px;
  padding: 16px;
  border: 1px dashed rgba(37, 37, 37, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
}

.fb-ad__label {
  position: absolute;
  top: -9px;
  left: 14px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--fb-bg);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9A9082;
}

.fb-ad__frame > * { max-width: 100%; }

/* ————————————————————————————————— Footer ————————————————————————————————— */

.fb-foot {
  position: relative;
  margin-top: 60px;
  padding-block: 54px 30px;
  background: var(--fb-ink);
  color: rgba(255, 248, 233, 0.72);
  border-radius: 48px 48px 0 0;
  overflow: clip;
}

.fb-foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 120px;
  height: 12px;
  border-radius: 0 0 12px 12px;
  background: var(--fb-yellow);
  transform: translateX(-50%);
}

.fb-foot__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 0.7fr));
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 248, 233, 0.14);
}

.fb-foot__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.fb-foot__brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--fb-yellow);
  color: var(--fb-ink);
  transform: rotate(-6deg);
  flex: none;
}
.fb-foot__brand-mark svg { width: 22px; height: 22px; }

.fb-foot__tagline {
  font-family: var(--fb-display);
  font-size: 22px;
  font-weight: 800;
  color: #FFF8E9;
  letter-spacing: -0.01em;
}

.fb-foot__blurb {
  max-width: 34ch;
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.65;
}

.fb-foot__col-title {
  margin-bottom: 14px;
  font-family: var(--fb-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 248, 233, 0.44);
}

.fb-foot__link {
  display: block;
  padding-block: 5px;
  font-size: 14px;
  color: rgba(255, 248, 233, 0.82);
  transition: color 0.18s var(--fb-ease), transform 0.18s var(--fb-ease);
}
.fb-foot__link:hover { color: var(--fb-yellow); transform: translateX(3px); }

.fb-foot__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 24px;
  font-size: 12.5px;
}

.fb-foot__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.fb-foot__legal a:hover { color: var(--fb-yellow); }

/* ————————————————————————————————— Overlays ————————————————————————————————— */

.fb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(37, 37, 37, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--fb-ease), visibility 0.22s;
}
.fb-backdrop.is-visible { opacity: 1; visibility: visible; }

.fb-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(360px, 88vw);
  padding: 26px 22px 32px;
  overflow-y: auto;
  background: var(--fb-paper);
  border-left: 4px solid var(--fb-white);
  box-shadow: -20px 0 50px -30px rgba(37, 37, 37, 0.6);
  transform: translateX(105%);
  transition: transform 0.3s var(--fb-ease);
  overscroll-behavior: contain;
}
.fb-drawer.is-open { transform: translateX(0); }

.fb-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.fb-drawer__title {
  font-family: var(--fb-display);
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.fb-drawer__group { margin-bottom: 22px; }

.fb-drawer__label {
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fb-muted);
}

.fb-drawer__link {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 12px;
  background: none;
  text-align: left;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fb-ink-2);
  transition: background-color 0.15s var(--fb-ease);
}
.fb-drawer__link:hover,
.fb-drawer__link.is-active {
  background: var(--fb-wash);
  color: var(--fb-ink);
}

/* Favourites panel reuses the drawer shell */
.fb-fav-empty {
  padding: 26px 18px;
  border: 2px dashed rgba(37, 37, 37, 0.16);
  border-radius: 16px;
  font-size: 13.5px;
  color: var(--fb-muted);
  text-align: center;
}

.fb-fav-list { display: grid; gap: 8px; }

/* Mobile search sheet */
.fb-search-sheet {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  background: var(--fb-bg);
  overflow-y: auto;
}
.fb-search-sheet[hidden] { display: none; }

.fb-search-sheet__bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

body.fb-no-scroll { overflow: hidden; }
