@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap');

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ROOT & RESET
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.bkf-root {
  --bkf-navy:    #0a1628;
  --bkf-blue:    #1a56db;
  --bkf-gold:    #f59e0b;
  --bkf-gold-lt: #fbbf24;
  --bkf-red:     #ef4444;
  --bkf-green:   #16a34a;
  --bkf-card:    #ffffff;
  --bkf-surface: #f1f5f9;
  --bkf-border:  #e2e8f0;
  --bkf-text:    #0f172a;
  --bkf-muted:   #64748b;
  --bkf-topbar:  54px;

  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  font-family: 'DM Sans', sans-serif;
  background: var(--bkf-navy);
  touch-action: pan-y;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TOP BAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.bkf-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--bkf-topbar);
  background: var(--bkf-navy);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bkf-topbar-left  { display:flex; align-items:center; gap:10px; }
.bkf-topbar-right { display:flex; align-items:center; gap:10px; }
.bkf-topbar-title { display:flex; flex-direction:column; }
.bkf-topbar-sub {
  font-size: 9px; color: var(--bkf-gold);
  text-transform: uppercase; letter-spacing: 1.8px; font-weight: 500; line-height: 1;
}
.bkf-topbar-main {
  font-family: 'Playfair Display', serif;
  font-size: 15px; color: #fff; font-weight: 700; line-height: 1.2;
}
.bkf-filter-toggle, .bkf-saved-toggle {
  background: rgba(255,255,255,0.1);
  border: none; border-radius: 8px;
  padding: 7px 10px; color: #fff; cursor: pointer;
  font-size: 14px; line-height: 1;
  transition: background 0.2s;
}
.bkf-filter-toggle:hover, .bkf-saved-toggle:hover { background: rgba(255,255,255,0.2); }
.bkf-filter-toggle svg { display:block; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FILTER DRAWER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.bkf-filter-drawer {
  position: absolute;
  top: var(--bkf-topbar); left: 0; right: 0;
  z-index: 290;
  background: var(--bkf-navy);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bkf-filter-drawer.bkf-open { max-height: 80px; }
.bkf-filter-inner {
  display: flex;
  gap: 6px;
  padding: 10px 14px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bkf-filter-inner::-webkit-scrollbar { display:none; }
.bkf-filter-pill {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.65);
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.bkf-filter-pill.bkf-pill-active,
.bkf-filter-pill:hover {
  background: var(--bkf-gold);
  color: var(--bkf-navy);
  border-color: var(--bkf-gold);
  font-weight: 600;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SWIPE CONTAINER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.bkf-swipe-wrap {
  position: absolute;
  top: var(--bkf-topbar); left: 0; right: 0;
  bottom: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bkf-swipe-wrap::-webkit-scrollbar { display:none; }
.bkf-swipe-wrap.bkf-filter-open {
  top: calc(var(--bkf-topbar) + 52px);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SWIPE CARD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.bkf-swipe-card {
  height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bkf-navy);
  overflow: hidden;
}

/* Image area — top 58% */
.bkf-card-img {
  flex: 0 0 58%;
  background-size: cover;
  background-position: center;
  background-color: #1e3a5f;
  position: relative;
  cursor: pointer;
}
.bkf-card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a1628 0%, #1e3a5f 50%, #0a3d62 100%);
}
.bkf-card-img-placeholder span {
  font-size: 80px; opacity: 0.15;
  font-family: 'Playfair Display', serif; font-weight: 700;
  color: #fff; text-transform: uppercase;
}
.bkf-card-img-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.05) 50%,
    rgba(0,0,0,0.55) 100%
  );
}

/* Badges on image */
.bkf-card-badges {
  position: absolute; bottom: 10px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.bkf-cat-badge {
  font-size: 10px; font-weight: 600;
  background: var(--bkf-gold);
  color: var(--bkf-navy);
  padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.bkf-featured-star {
  font-size: 10px; font-weight: 600;
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 3px 10px; border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Content area — bottom 42% */
.bkf-card-content {
  flex: 1;
  padding: 12px 16px 6px;
  background: var(--bkf-navy);
  cursor: pointer;
  overflow: hidden;
}
.bkf-card-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.bkf-diff-badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.bkf-d-beginner     { background: rgba(22,163,74,0.2);  color: #4ade80; }
.bkf-d-intermediate { background: rgba(234,179,8,0.2);  color: #fbbf24; }
.bkf-d-advanced     { background: rgba(239,68,68,0.2);  color: #f87171; }

.bkf-card-date {
  font-size: 10px; color: rgba(255,255,255,0.35);
  font-feature-settings: "tnum";
}
.bkf-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px; font-weight: 600; line-height: 1.38;
  color: #fff; margin: 0 0 7px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.bkf-card-excerpt {
  font-size: 13px; line-height: 1.6;
  color: rgba(255,255,255,0.62); font-weight: 300;
  margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Helps row */
.bkf-helps-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
}
.bkf-helps-icon {
  font-size: 11px; color: rgba(255,255,255,0.5);
  font-weight: 500;
}
.bkf-helps-chip {
  font-size: 10px; font-weight: 500;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
}

/* Actions bar */
.bkf-card-actions {
  flex-shrink: 0;
  display: flex;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0;
}
.bkf-act-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px;
  padding: 10px 4px 12px;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px; font-weight: 500;
  color: rgba(255,255,255,0.5);
  transition: color 0.15s, background 0.15s;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.bkf-act-btn:last-child { border-right: none; }
.bkf-act-btn:active     { background: rgba(255,255,255,0.05); }
.bkf-act-icon           { font-size: 18px; line-height: 1; }
.bkf-act-btn.bkf-liked  { color: var(--bkf-red); }
.bkf-act-btn.bkf-bookmarked { color: var(--bkf-gold); }
.bkf-read-btn:hover     { color: var(--bkf-gold); }

/* Swipe hint */
.bkf-swipe-hint {
  position: absolute;
  bottom: 70px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: rgba(255,255,255,0.3);
  pointer-events: none;
  animation: bkfHintFade 3.5s ease forwards;
}
@keyframes bkfHintFade { 0%{opacity:1} 60%{opacity:0.6} 100%{opacity:0} }

/* Load More card */
.bkf-load-trigger {
  height: 100svh;
  scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center;
  background: var(--bkf-navy);
}
.bkf-load-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 28px 40px;
  color: #fff; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500;
  transition: background 0.2s;
}
.bkf-load-btn:hover { background: rgba(255,255,255,0.14); }
.bkf-load-icon { font-size: 28px; animation: bkfBounce 1.2s infinite; }
@keyframes bkfBounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DETAIL OVERLAY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.bkf-detail-overlay {
  position: absolute; inset: 0;
  z-index: 400;
  background: #fff;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0, 0.18, 1);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.bkf-detail-overlay.bkf-open { transform: translateY(0); }

.bkf-detail-inner {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
}

/* Detail header image */
.bkf-detail-hero {
  position: relative;
  height: 230px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-color: #1e3a5f;
}
.bkf-detail-hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.65) 100%);
}
.bkf-detail-back {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0,0,0,0.45);
  border: none; border-radius: 20px;
  color: #fff; padding: 7px 14px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  backdrop-filter: blur(4px);
  z-index: 2;
}
.bkf-detail-share-fab {
  position: absolute; top: 12px; right: 12px;
  background: var(--bkf-gold);
  border: none; border-radius: 50%;
  width: 38px; height: 38px;
  font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.bkf-detail-hero-badges {
  position: absolute; bottom: 12px; left: 14px; right: 14px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}

/* Detail body */
.bkf-detail-body {
  padding: 20px 18px 28px;
  flex: 1;
}
.bkf-detail-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.bkf-detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 700; line-height: 1.35;
  color: var(--bkf-text); margin: 0 0 12px;
}
.bkf-detail-excerpt {
  font-size: 14.5px; line-height: 1.7;
  color: #475569; font-weight: 400;
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--bkf-border);
}
.bkf-detail-content {
  font-size: 14px; line-height: 1.78; color: #334155;
}
.bkf-detail-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 15px; color: var(--bkf-navy);
  margin: 18px 0 6px;
}
.bkf-detail-content p  { margin: 0 0 12px; }
.bkf-detail-content ul,
.bkf-detail-content ol { padding-left: 20px; margin: 0 0 12px; }
.bkf-detail-content li { margin-bottom: 6px; }
.bkf-detail-content strong { color: var(--bkf-navy); font-weight: 600; }

/* Detail helps */
.bkf-detail-helps {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--bkf-border);
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.bkf-detail-helps-label {
  font-size: 12px; font-weight: 600;
  color: var(--bkf-muted); margin-right: 4px;
}
.bkf-detail-helps-chip {
  font-size: 11px; padding: 3px 10px; border-radius: 20px;
  background: var(--bkf-surface);
  border: 1px solid var(--bkf-border);
  color: var(--bkf-muted); font-weight: 500;
}

/* Detail action bar */
.bkf-detail-actions {
  flex-shrink: 0;
  display: flex;
  border-top: 1px solid var(--bkf-border);
  background: #fff;
}
.bkf-detail-act {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px 14px;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px; font-weight: 500;
  color: var(--bkf-muted);
  border-right: 1px solid var(--bkf-border);
  transition: color 0.15s, background 0.15s;
}
.bkf-detail-act:last-child { border-right: none; }
.bkf-detail-act:active  { background: var(--bkf-surface); }
.bkf-detail-act-icon    { font-size: 20px; line-height: 1; }
.bkf-detail-act.bkf-liked     { color: var(--bkf-red); }
.bkf-detail-act.bkf-bookmarked { color: var(--bkf-gold); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SAVED OVERLAY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.bkf-saved-overlay {
  position: absolute; inset: 0;
  z-index: 350;
  background: var(--bkf-surface);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex; flex-direction: column;
}
.bkf-saved-overlay.bkf-open { transform: translateX(0); }
.bkf-saved-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--bkf-navy);
  font-size: 14px; font-weight: 600; color: #fff;
}
.bkf-back-btn {
  background: none; border: none; color: var(--bkf-gold);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.bkf-saved-list { flex: 1; overflow-y: auto; padding: 14px; }
.bkf-saved-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh;
  text-align: center; color: var(--bkf-muted);
}
.bkf-empty-icon { font-size: 52px; opacity: 0.3; margin-bottom: 12px; }
.bkf-saved-empty p { font-size: 14px; line-height: 1.6; margin: 0; }

/* Saved list card */
.bkf-saved-item {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--bkf-border);
  display: flex;
  cursor: pointer;
}
.bkf-saved-item-thumb {
  width: 80px; flex-shrink: 0;
  background-size: cover; background-position: center;
  background-color: #1e3a5f;
}
.bkf-saved-item-body {
  flex: 1; padding: 10px 12px;
}
.bkf-saved-item-cat {
  font-size: 9px; font-weight: 700;
  color: var(--bkf-blue); text-transform: uppercase;
  letter-spacing: 0.6px; margin-bottom: 4px;
}
.bkf-saved-item-title {
  font-size: 13px; font-weight: 600;
  color: var(--bkf-text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SHARE CANVAS (off-screen for screenshot)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.bkf-share-canvas-wrap {
  position: fixed;
  top: -9999px; left: -9999px;
  width: 360px;
  pointer-events: none;
  z-index: -1;
}
.bkf-share-card {
  width: 360px;
  background: #fff;
  border-radius: 0;
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
}
.bkf-sc-hero {
  height: 180px;
  background-size: cover; background-position: center;
  background-color: #1e3a5f;
  position: relative;
}
.bkf-sc-hero-grad {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.55));
}
.bkf-sc-badges {
  position: absolute; bottom: 10px; left: 12px; right: 12px;
  display: flex; gap: 6px;
}
.bkf-sc-body { padding: 16px; }
.bkf-sc-diff {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  display: inline-block; margin-bottom: 8px;
}
.bkf-sc-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px; font-weight: 700; line-height: 1.38;
  color: #0f172a; margin: 0 0 8px;
}
.bkf-sc-excerpt {
  font-size: 12px; line-height: 1.6; color: #475569;
  margin: 0 0 12px;
}
.bkf-sc-helps {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  margin-bottom: 12px;
}
.bkf-sc-helps-lbl { font-size: 10px; font-weight: 600; color: #64748b; }
.bkf-sc-helps-chip {
  font-size: 10px; padding: 2px 7px; border-radius: 20px;
  background: #f1f5f9; border: 1px solid #e2e8f0; color: #64748b;
}
.bkf-sc-footer {
  background: #0a1628;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.bkf-sc-brand { font-family: 'Playfair Display', serif; font-size: 12px; font-weight: 700; color: #fff; }
.bkf-sc-url   { font-size: 10px; color: rgba(255,255,255,0.5); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SHARE MODAL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.bkf-share-modal {
  position: absolute; inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.7);
  display: none; align-items: flex-end;
  animation: bkfFadeIn 0.2s ease;
}
.bkf-share-modal.bkf-open { display: flex; }
@keyframes bkfFadeIn { from{opacity:0} to{opacity:1} }
.bkf-share-sheet {
  width: 100%;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  animation: bkfSlideUp 0.3s ease;
}
@keyframes bkfSlideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.bkf-share-sheet h4 {
  font-size: 14px; font-weight: 600; margin: 0 0 16px;
  color: var(--bkf-text); text-align: center;
}
.bkf-share-preview {
  width: 100%; border-radius: 10px;
  overflow: hidden; margin-bottom: 14px;
  border: 1px solid var(--bkf-border);
}
.bkf-share-preview img {
  width: 100%; display: block;
}
.bkf-share-preview-loading {
  height: 120px; background: var(--bkf-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--bkf-muted);
}
.bkf-share-options {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.bkf-share-opt {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 14px 8px;
  background: var(--bkf-surface); border-radius: 12px;
  border: 1.5px solid var(--bkf-border);
  cursor: pointer; font-size: 12px; font-weight: 500;
  color: var(--bkf-text); transition: border-color 0.2s;
}
.bkf-share-opt:hover { border-color: var(--bkf-blue); }
.bkf-share-opt-icon { font-size: 28px; }
.bkf-share-cancel {
  width: 100%;
  padding: 12px;
  background: none;
  border: 1.5px solid var(--bkf-border);
  border-radius: 10px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; color: var(--bkf-muted);
  font-family: 'DM Sans', sans-serif;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 400px) {
  .bkf-card-title  { font-size: 14.5px; }
  .bkf-card-excerpt { font-size: 12.5px; }
  .bkf-detail-title { font-size: 18px; }
}
