/**
 * Contents Shelf 公開ページ専用スタイル
 *
 * 概要:
 *   get-drift.com/s/{userId} の公開シェルフページのスタイル。
 *   モバイルアプリの ContentsShelvesScreen に近いダークUIを再現する。
 *
 * 主な仕様:
 *   - style.css のベース（#09090b ダークテーマ）を前提に追記する
 *   - Contents Shelf は Top3 + グリッドレイアウト（モバイルと同じ）
 *   - 最近の評価済み / 体験したいは横スクロールカード（全ユーザー公開時のみ）
 *   - プロフィール / About me / AI分析 / App Store CTA で構成
 *
 * 制限事項:
 *   - フレームワーク不使用の純粋CSS
 */

/* ===== ページ全体 ===== */
.shelf-page {
  background: #0a0a0a;
}

/* ===== トップバー ===== */
.shelf-topbar {
  display: flex;
  align-items: center;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.5);
}

.shelf-topbar__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.shelf-topbar__logo-img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.shelf-topbar__logo-text {
  font-size: 18px;
  font-weight: 800;
  font-style: italic;
  color: #fff;
}

/* ===== メイン ===== */
.shelf-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 10px 12px 64px;
}

.shelf-main--message {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

/* ===== プロフィール ===== */
.shelf-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.shelf-profile__avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}

.shelf-profile__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #374151;
  color: #9ca3af;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
}

.shelf-profile__meta {
  min-width: 0;
}

.shelf-profile__name {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.4;
}

.shelf-profile__sub {
  margin-top: 2px;
  font-size: 10px;
  color: #6b7280;
}

/* ===== About me / AI分析（モバイル sectionCard 相当） ===== */
.shelf-section {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  background: #000000;
}

.shelf-section__title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: normal;
  text-transform: none;
}

.shelf-section__text {
  margin: 0;
  font-size: 11px;
  color: #ffffff;
  line-height: 16px;
  white-space: pre-wrap;
}

.shelf-section__text--muted {
  color: #6b7280;
}

/* ===== Contents Shelf タブ（表示のみ） ===== */
.shelf-shelf {
  margin-top: 10px;
}

.shelf-tabs {
  display: flex;
  gap: 8px;
  padding: 0 0 10px;
  overflow-x: auto;
}

.shelf-tabs::-webkit-scrollbar {
  display: none;
}

.shelf-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 9999px;
  background: #111827;
  border: 1px solid rgba(75, 85, 99, 0.55);
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.shelf-tab__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.shelf-tab--active {
  background: rgba(37, 99, 235, 0.24);
  border-color: rgba(96, 165, 250, 0.45);
  color: #ffffff;
}

.shelf-tab-lead {
  margin: 0 0 10px;
  padding: 14px 4px 0;
  font-size: 11px;
  line-height: 1.55;
  color: #9ca3af;
}

.shelf-tab-lead--hidden {
  display: none;
}

.shelf-tab-panel--hidden {
  display: none;
}

.shelf-private-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: #000000;
  text-align: center;
}

.shelf-private-box p {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

/* ===== Contents Shelf グリッド（モバイル contentArea 相当） ===== */
.shelf-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

.shelf-grid__top3 {
  display: flex;
  gap: 10px;
}

.shelf-grid__rank23 {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.shelf-grid__card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #000000;
}

.shelf-grid__card--rank1 {
  width: 48%;
  aspect-ratio: 3 / 4;
  flex-shrink: 0;
}

.shelf-grid__card--rank2,
.shelf-grid__card--rank3 {
  flex: 1;
  min-height: 0;
  position: relative;
}

.shelf-grid__card--square {
  width: calc((100% - 10px) / 2);
  aspect-ratio: 1 / 1;
}

.shelf-grid__card--rank6 {
  width: 100%;
  aspect-ratio: 4 / 1;
}

.shelf-grid__card--small {
  width: 100%;
  aspect-ratio: 4 / 5;
}

.shelf-grid__card--rank7 {
  width: 100%;
  aspect-ratio: 32 / 35;
}

.shelf-grid__card--rank8 {
  width: 100%;
  aspect-ratio: 6 / 5;
}

.shelf-grid__card--rank9 {
  width: 100%;
  aspect-ratio: 12 / 5;
}

.shelf-grid__card--rank11 {
  width: 100%;
  aspect-ratio: 16 / 15;
}

.shelf-grid__card--rank12 {
  width: 100%;
  aspect-ratio: 24 / 25;
}

.shelf-grid__card--rank15 {
  width: 100%;
  aspect-ratio: 8 / 5;
}

.shelf-grid__pair {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shelf-grid__masonry {
  display: flex;
  gap: 10px;
}

.shelf-grid__masonry-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.shelf-grid__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shelf-grid__card--rank1 .shelf-grid__image,
.shelf-grid__card--rank2 .shelf-grid__image,
.shelf-grid__card--rank3 .shelf-grid__image,
.shelf-grid__card--rank6 .shelf-grid__image {
  position: absolute;
  inset: 0;
}

.shelf-grid__card--square .shelf-grid__image,
.shelf-grid__card--small .shelf-grid__image,
.shelf-grid__card--rank7 .shelf-grid__image,
.shelf-grid__card--rank8 .shelf-grid__image,
.shelf-grid__card--rank9 .shelf-grid__image,
.shelf-grid__card--rank11 .shelf-grid__image,
.shelf-grid__card--rank12 .shelf-grid__image,
.shelf-grid__card--rank15 .shelf-grid__image {
  position: absolute;
  inset: 0;
}

.shelf-grid__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  color: #6b7280;
  font-size: 11px;
}

.shelf-grid__card--square .shelf-grid__placeholder {
  position: absolute;
  inset: 0;
}

.shelf-grid__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
}

.shelf-grid__overlay--md {
  padding: 8px;
}

.shelf-grid__overlay--sm {
  padding: 6px;
}

.shelf-grid__title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
}

.shelf-grid__title--sm {
  font-size: 9px;
}

.shelf-grid__comment-overlay {
  margin: 2px 0 0;
  font-size: 9px;
  color: #d1d5db;
  line-height: 1.4;
}

.shelf-grid__comment-below {
  margin: 0;
  padding: 8px;
  font-size: 10px;
  color: #ffffff;
  line-height: 1.5;
}

.shelf-empty {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  padding: 40px 24px;
}

/* ===== 評価済み / 体験したい 2列グリッド ===== */
.shelf-list-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
}

.shelf-list-grid__card {
  width: calc((100% - 12px) / 2);
  border-radius: 14px;
  overflow: hidden;
  background: #111827;
}

/* ===== コンテンツカード共通（横スクロール / 2列グリッド） ===== */
.shelf-content-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #1f2937;
}

.shelf-content-card__image--placeholder {
  background: #1f2937;
}

.shelf-content-card__body {
  padding: 10px;
}

.shelf-content-card__badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  font-size: 9px;
  font-weight: 700;
}

.shelf-content-card__title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shelf-content-card__meta {
  margin: 4px 0 0;
  font-size: 10px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shelf-list-grid__card .shelf-content-card__title {
  font-size: 12px;
  line-height: 18px;
}

.shelf-list-grid__card .shelf-content-card__meta {
  font-size: 10px;
}

/* ===== 最近登録（評価済み / 体験したい） ===== */
.shelf-recent {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(156, 163, 175, 0.18);
}

.shelf-recent__lead {
  font-size: 11px;
  line-height: 1.55;
  color: #9ca3af;
  margin-bottom: 14px;
}

.shelf-recent-section + .shelf-recent-section {
  margin-top: 16px;
}

.shelf-recent-section {
  padding: 12px 0;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
}

.shelf-recent-section__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 10px;
}

.shelf-recent-section__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #93c5fd;
  font-size: 12px;
  line-height: 1;
}

.shelf-recent-section__icon-svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.shelf-recent-section__title {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.shelf-recent-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 12px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.shelf-recent-scroll::-webkit-scrollbar {
  display: none;
}

.shelf-recent-item {
  flex: 0 0 132px;
  width: 132px;
  border-radius: 14px;
  overflow: hidden;
  background: #111827;
  scroll-snap-align: start;
}

/* ===== CTA ===== */
.shelf-cta {
  margin-top: 32px;
  padding: 28px 20px;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(160deg, rgba(125, 211, 252, 0.12), rgba(56, 132, 255, 0.06));
  border: 1px solid rgba(125, 211, 252, 0.2);
}

.shelf-cta__lead {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 16px;
}

/* CTA 内の App Store バッジ（style.css の .app-store-badge を継承） */
.shelf-cta .app-store-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.shelf-cta .app-store-badge img {
  display: block;
  height: 54px;
  width: auto;
}

/* ===== フッター ===== */
.shelf-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding: 24px 20px 40px;
  text-align: center;
}

.shelf-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.shelf-footer__links a {
  font-size: 13px;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.shelf-footer__links a:hover {
  color: #e2e8f0;
}

.shelf-footer__copy {
  font-size: 12px;
  color: #475569;
}

/* ===== メッセージ（非公開・404・エラー） ===== */
.shelf-message {
  text-align: center;
  padding: 24px;
}

.shelf-message__heading {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.shelf-message__text {
  font-size: 15px;
  color: #94a3b8;
  line-height: 1.8;
  margin-bottom: 24px;
}

.shelf-message__home {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 9999px;
  background: #7dd3fc;
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
}

/* ===== レスポンシブ ===== */
@media (min-width: 640px) {
  .shelf-main {
    max-width: 430px;
  }
}
