/* ==========================================================================
   Shared components (see js/components.js). Geometry follows Figma 1:1.
   ========================================================================== */

/* ---------- Ask ATK button (40×40) ---------- */
.ask-atk-btn { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.ask-atk-btn > img:first-child { position: absolute; inset: 0; }
.ask-atk-glyph {
  position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%);
}
.ask-atk-glyph img { position: absolute; inset: 10.16% 10.17% 10.16% 10.15%; width: 79.68%; height: 79.68%; }
.ask-atk-glyph b {
  position: absolute; left: 50%; top: calc(50% - 8.5px); transform: translateX(-50%);
  font: 700 11px/17.063px var(--font-sans); color: #fff;
}
.ask-atk-dot { position: absolute; left: 30px; top: -2px; }

/* ---------- Dark CLASSES header (status bar + 50px bar) ---------- */
.classes-header {
  position: relative; flex-shrink: 0;
  background: var(--caviar);
  height: calc(var(--safe-top) + 50px);
  padding-top: var(--safe-top);
  display: flex; align-items: center; justify-content: space-between;
  padding-left: 16px; padding-right: 16px;
  z-index: 20;
}
.classes-header .classes-logo { width: 84px; height: 16px; }

/* ---------- Search row (white, 16px padding, 72px tall) ---------- */
.search-row {
  background: var(--bg); padding: 16px;
  display: flex; gap: 8px; align-items: center;
}
.search-pill {
  flex: 1 1 auto; height: 40px; border-radius: var(--radius-pill);
  background: var(--neutral-light);
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  font: 400 14px/19.6px var(--font-sans); color: var(--neutral-dark); text-align: left;
}
.search-pill .icon { width: 16px; height: 16px; }
.filter-btn { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; }
.filter-btn img { width: 40px; height: 40px; }

/* ---------- Bottom nav (Figma: App / Bottom Nav, 80px on iPhone) ---------- */
.bottom-nav {
  position: relative; flex-shrink: 0; z-index: 20;
  background: var(--bg);
  display: flex; align-items: flex-start;
  padding-top: 7px;
  padding-bottom: max(calc(var(--safe-bottom) - 6px), 8px);
  box-shadow: 0 -1px 0 rgba(0,0,0,.04);
}
.bn-indicator { position: absolute; left: 0; right: 0; top: 0; height: 2px; display: flex; }
.bn-indicator i { display: block; width: 20%; height: 2px; background: var(--caviar); transition: transform .3s var(--ease-out); }
.bn-indicator .i-home { transform: translateX(0); }
.bn-indicator .i-classes { transform: translateX(100%); }
.bn-indicator .i-search { transform: translateX(200%); }
.bn-indicator .i-favorites { transform: translateX(300%); }
.bn-indicator .i-mystuff { transform: translateX(400%); }
.bn-item {
  flex: 1 1 0; height: 45px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
}
.bn-icon { height: 24px; display: flex; align-items: center; justify-content: center; }
.bn-label { font: 500 12px/18px var(--font-sans); color: var(--caviar); text-align: center; }
.bn-item.active .bn-label { font-weight: 700; }

/* ---------- Section head ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; }
.section-head h2 { color: var(--caviar); }
.section-head .see-all { color: var(--tomato); margin-top: 7px; white-space: nowrap; flex-shrink: 0; }

/* ---------- Bookmark / more buttons ---------- */
.bookmark-btn, .more-btn { width: 32px; height: 32px; border-radius: 50%; }
.bookmark-btn img, .more-btn img { width: 32px; height: 32px; }
.bookmark-btn:active, .more-btn:active { transform: scale(.92); }
.bookmark-btn.on img { animation: pop .3s var(--ease-out); }
@keyframes pop { 50% { transform: scale(1.18); } }

/* ---------- Tags ---------- */
/* One "new" tag everywhere: instructor-card style (Figma Tags Web) in tomato red */
.tag-new {
  display: inline-flex; align-items: center; white-space: nowrap;
  background: var(--tomato); color: #fff; border-radius: 4px; padding: 3px 8px;
  font: 600 14px/18px var(--font-sans);
}

/* ---------- Rating ---------- */
.rating { display: inline-flex; align-items: center; gap: 8px; }
.rating .icon { width: 16px; height: 16px; }
.rating b { font-weight: 500; color: var(--caviar); }
.rating .rating-count { color: var(--neutral-dark); }
.rating.light b { color: #fff; }
.rating.light .rating-count { color: var(--neutral-light); }

/* ---------- Class card 283×329 (Figma 283×322; photo changed to 4:3) ---------- */
.class-card {
  position: relative; width: 283px; height: 329px; flex-shrink: 0;   /* height +7px for the 4:3 photo */
  background: #fff; border: 1px solid var(--neutral-light-shade); border-radius: var(--radius-card);
  overflow: hidden; cursor: pointer;
  transition: transform .15s ease;
}
.class-card:active { transform: scale(.985); }
.class-card.in-progress { background: var(--neutral-light); }
.cc-media {
  position: absolute; top: -1px; left: -1px; right: -1px; aspect-ratio: 4 / 3;   /* 285 × 213.75 */
  background: var(--neutral-light); overflow: hidden;
}
.cc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cc-shade { position: absolute; inset: 0; background: rgba(0,0,0,.45); } /* Figma .35 + 10% */
.cc-grad {
  position: absolute; left: 0; right: 0; bottom: 0; height: 80px;
  background: linear-gradient(180deg, rgba(44,44,44,0) 3.866%, rgba(0,0,0,.6) 70.361%); /* Figma .8, lightened 20% */
}
.cc-title {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 251px; text-align: center; color: #fff;
}
.cc-instructor {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: 251px; text-align: center; color: var(--cream);
}
.cc-media .tag-new { position: absolute; left: 16px; top: 15px; }
.cc-actions { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.cc-desc {
  position: absolute; top: 229px; left: 15px; right: 15px; color: var(--neutral-dark);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cc-foot { position: absolute; left: 15px; right: 15px; bottom: 15px; display: flex; align-items: center; justify-content: space-between; }
.progress { position: relative; width: 84px; height: 3px; border-radius: 24px; background: var(--neutral-light-shade); margin-bottom: -1px; }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 24px; background: var(--success); }

/* ---------- Instructor card 200×276 ---------- */
.instructor-card {
  width: 200px; flex-shrink: 0;
  background: rgba(255,255,255,.8); border: 1px solid var(--neutral-light-shade); border-radius: var(--radius-card);
  padding: 15px; display: flex; flex-direction: column; align-items: center; gap: 16px; /* 15 + 1px border = Figma 16 */
  cursor: pointer;
}
.ic-photo { width: 120px; height: 120px; border-radius: 240px; overflow: hidden; position: relative; background: #e8e3e0; }
.ic-photo img { width: 100%; height: 100%; object-fit: cover; }
.ic-text { display: flex; flex-direction: column; gap: 8px; width: 168px; text-align: center; }
.ic-text h3 { color: var(--wine); }
.ic-text p { color: var(--caviar); height: 40px; }
.ic-count { display: flex; align-items: center; justify-content: center; gap: 4px; font: 700 14px/1.2 var(--font-sans); color: var(--wine); }
.ic-count .icon { width: 16px; height: 16px; }

/* ---------- Technique card 252×230 ---------- */
.technique-card { position: relative; width: 252px; height: 230px; flex-shrink: 0; cursor: pointer; }
.tc-media { position: relative; height: 175px; border-radius: var(--radius-card); overflow: hidden; background: #fff; }
.tc-media img { width: 100%; height: 100%; object-fit: cover; }
.tc-media .tc-play { position: absolute; left: 50%; top: calc(50% + 1.5px); transform: translate(-50%, -50%); width: 48px; height: 48px; }
.technique-card h3 { margin-top: 8px; width: 209px; color: var(--caviar); }
.tc-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--neutral-dark); }
.tc-meta .icon { width: 16px; height: 16px; }

/* ---------- Placeholder toast ---------- */
.stub-toast {
  background: #474747; color: #fff; border-radius: 80px; padding: 10px 16px;
  font: 600 14px/19.6px var(--font-sans); box-shadow: 0 6px 20px rgba(0,0,0,.2);
  max-width: 340px; text-align: center;
}
