/* Baseline components.css + CleanWhale catalog extensions */
html, body { max-width: 100%; overflow-x: hidden; }
header {
  background: var(--blue);
  color: white;
  padding: 14px max(24px, calc((100% - var(--max)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cw-header-left, .cw-header-right { display: flex; align-items: center; gap: 20px; min-width: 0; }
.cw-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 22px; font-weight: 800; white-space: nowrap; }
.cw-whale-svg { width: 32px; height: 22px; flex-shrink: 0; }
nav { display: flex; gap: 20px; align-items: center; }
.cw-nav-link { background: transparent; border: 0; color: rgba(255,255,255,0.92); font-weight: 600; font-size: 14px; padding: 6px 2px; white-space: nowrap; }
.cw-nav-link:hover, .cw-nav-link.active { color: #fff; text-decoration: underline; text-underline-offset: 6px; }
.cw-city-select, .cw-lang-switch {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
}
.cw-city-select option, .cw-lang-switch option { color: var(--ink); background: #fff; }
.cw-header-search {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  padding: 7px 12px;
  color: #fff;
  width: 190px;
  font-size: 13.5px;
}
.cw-header-search::placeholder { color: rgba(255,255,255,0.75); }
.cw-auth-btn {
  background: #fff;
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: 10px;
  white-space: nowrap;
}

main { max-width: var(--max); margin: auto; padding: 24px; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(115deg, #f0f5ff, #d7e6ff);
  min-height: 340px;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  padding: 36px;
  gap: 28px;
}
.hero-greeting {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(32px, 3.8vw, 54px); line-height: 1.04; letter-spacing: -.04em; max-width: 560px; }
.hero p { color: var(--muted); margin: 14px 0 0; line-height: 1.5; max-width: 500px; }
.search { display: flex; gap: 8px; background: white; border-radius: 18px; padding: 8px; margin-top: 22px; flex-wrap: wrap; }
.search input, .search select { min-width: 0; flex: 1; border: 0; padding: 11px 12px; background: white; color: var(--ink); font-size: 14px; }
.btn { background: var(--action); color: white; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { opacity: 0.94; }
.secondary { background: var(--soft); color: var(--ink); }

.hero-media {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 290px;
}
.hero-portrait { background: #c7dcff; overflow: hidden; min-height: 260px; }
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.hero-card-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hero-badge-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero-badge { background: var(--soft); color: var(--blue); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.hero-match-pill { background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.hero-card-body h3 { font-size: 24px; letter-spacing: -0.02em; }
.hero-reasons { list-style: none; margin: 2px 0 6px; padding: 0; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink); }
.hero-reasons li { display: flex; gap: 7px; line-height: 1.35; }
.hero-reasons li::before { content: '✓'; color: var(--action); font-weight: 800; }
.hero-card-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.hero-card-actions .btn { flex: 1; }

section { margin-top: 32px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
h2 { font-size: 26px; letter-spacing: -.03em; margin: 0; }
.sec-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.sec-link { color: var(--action); font-weight: 700; font-size: 14px; text-decoration: none; }

.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.tile { position: relative; aspect-ratio: 1.35; border: 2px solid transparent; border-radius: 18px; overflow: hidden; background: #dce8fa; text-align: left; padding: 0; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile span { position: absolute; bottom: 10px; left: 10px; right: 10px; background: white; border-radius: 12px; padding: 8px 10px; font-weight: 700; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile[aria-pressed="true"] { border-color: var(--action); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.person { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: white; display: flex; flex-direction: column; }
.portrait { aspect-ratio: 1.35; background: #e4edfb; overflow: hidden; position: relative; cursor: pointer; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.portrait-badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.94); color: var(--ink); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.details { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.details-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.details h3 { font-size: 21px; letter-spacing: -0.02em; cursor: pointer; }
.fav-btn { border: 1px solid var(--line); background: #fff; color: var(--muted); width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.fav-btn.active { color: var(--action); border-color: var(--action); background: var(--soft); }
.meta { color: var(--muted); font-size: 14px; }
.star { color: #f59e0b; }
.reason { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.4; color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { background: var(--soft); border-radius: 20px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.bottom { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bottom-actions { display: flex; gap: 6px; align-items: center; }

.awards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.award {
  padding: 16px;
  border-radius: 18px;
  background: var(--soft);
  min-height: 112px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}
.award:first-child { background: var(--blue); color: white; }
.award-kicker { font-size: 12px; font-weight: 700; opacity: 0.88; margin-bottom: 4px; }
.award strong { font-size: 18px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.award p { font-size: 13px; opacity: 0.88; margin-top: 4px; }
.award-photo { width: 76px; height: 84px; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,0.2); }
.award-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

.reviews-strip {
  background: var(--soft);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.reviews-quote { flex: 1; min-width: 220px; font-size: 14px; color: var(--ink); }
.reviews-arrows { display: flex; gap: 8px; }

.catalog-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sort-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.sort-tab { background: var(--soft); color: var(--ink); border: 0; border-radius: 12px; padding: 9px 14px; font-weight: 700; font-size: 13.5px; }
.sort-tab.active { background: var(--action); color: #fff; }
.mobile-filter-btn { display: none; }

.catalog { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.filters { border: 1px solid var(--line); border-radius: 18px; padding: 18px; align-self: start; display: grid; gap: 14px; background: #fff; }
.filters select, .filters input[type="text"], .filters input[type="search"] { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.filter-group { display: grid; gap: 8px; }
.filter-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.filter-chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.filter-chk input { width: 16px; height: 16px; accent-color: var(--action); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.page-btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 8px 13px; font-weight: 700; font-size: 13.5px; }
.page-btn.active { background: var(--action); color: #fff; border-color: var(--action); }
.page-btn:disabled { opacity: 0.45; cursor: default; }

.cw-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cw-modal[hidden] { display: none; }
.cw-modal-backdrop { position: absolute; inset: 0; background: rgba(16,24,40,0.55); }
.cw-modal-dialog { position: relative; background: #fff; border-radius: 20px; max-width: 620px; width: 100%; max-height: 90vh; overflow-y: auto; z-index: 1; }
.cw-modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.cw-modal-head { display: flex; gap: 18px; padding: 22px; background: var(--soft); border-bottom: 1px solid var(--line); }
.cw-modal-photo { width: 120px; height: 150px; border-radius: 16px; object-fit: cover; object-position: top center; }
.cw-modal-reviews { padding: 18px 22px 22px; display: grid; gap: 10px; }
.cw-modal-review-item { background: var(--soft); border-radius: 12px; padding: 12px; font-size: 14px; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; padding: 26px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .awards { grid-template-columns: repeat(2, 1fr); }
  .catalog { grid-template-columns: 220px 1fr; }
}
@media (max-width: 820px) {
  .catalog { grid-template-columns: 1fr; }
  .mobile-filter-btn { display: inline-flex; }
  .filters { display: none; }
  .filters.open { display: grid; }
}
@media (max-width: 680px) {
  header { padding: 12px 14px; gap: 10px; }
  nav, .cw-header-search { display: none; }
  .cw-header-left, .cw-header-right { gap: 8px; }
  main { padding: 14px; }
  .hero { padding: 18px; grid-template-columns: 1fr; gap: 14px; border-radius: 20px; }
  .hero h1 { font-size: 32px; }
  .hero-media { grid-template-columns: 1fr; min-height: 0; }
  .hero-portrait { height: 220px; min-height: 220px; }
  .search { flex-direction: column; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid { grid-template-columns: 1fr; }
  .portrait { aspect-ratio: 1.45; }
  h2 { font-size: 22px; }
  .awards { grid-template-columns: 1fr; gap: 10px; }
  .cw-modal-head { flex-direction: column; }
  .cw-modal-photo { width: 100%; height: 220px; }
}


@media (max-width: 1180px) {
  .cw-header-search { display: none; }
}
@media (max-width: 680px) {
  header { padding: 10px 12px; gap: 6px; }
  .cw-header-left { gap: 6px; flex: 0 1 auto; }
  .cw-header-right { gap: 6px; flex: 0 0 auto; }
  .cw-logo { font-size: 16px; gap: 6px; }
  .cw-whale-svg { width: 24px; height: 17px; }
  .cw-city-select, .cw-lang-switch { padding: 5px 6px; font-size: 12px; max-width: 96px; }
  .cw-auth-btn { padding: 6px 10px; font-size: 12px; }
}
@media (max-width: 375px) {
  .cw-logo strong { display: none; }
}
.portrait-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 800; color: var(--blue); background: var(--soft); }

.award { height: auto !important; max-height: none !important; min-height: 100px; overflow: hidden; }
.award-photo { width: 76px; height: 80px; max-height: 80px; overflow: hidden; }
.award-photo img { width: 76px; height: 80px; object-fit: cover; object-position: top center; }

.award > img { width: 76px; height: 80px; border-radius: 14px; object-fit: cover; object-position: top center; display: block; }
