/* ===========================================================
   Stone Artistry HISUI — Instagram Mockup CSS (DEMO ONLY)
   スマホ画面風（375px幅・iPhoneフレーム想定）
   =========================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

:root {
  --ig-bg: #ffffff;
  --ig-bg-alt: #fafafa;
  --ig-border: #dbdbdb;
  --ig-border-soft: #efefef;
  --ig-text: #262626;
  --ig-text-soft: #8e8e8e;
  --ig-text-light: #c7c7c7;
  --ig-blue: #0095f6;
  --ig-red: #ed4956;
  --ig-bg-page: #f0f2f5;
  --sans: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
}

html { -webkit-text-size-adjust: 100%; background: var(--ig-bg-page); }
body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ig-text);
  background: var(--ig-bg-page);
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* DEMO ONLY バッジ */
.demo-badge {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  background: #c0392b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(192, 57, 43, .35);
  pointer-events: none;
}

/* ============= スマホフレーム ============= */
.phone-frame {
  width: 100%;
  max-width: 414px;
  background: var(--ig-bg);
  min-height: 100vh;
  position: relative;
  border-left: 1px solid var(--ig-border);
  border-right: 1px solid var(--ig-border);
  box-shadow: 0 0 60px rgba(0,0,0,0.06);
}

/* ============= Status Bar (iPhone風) ============= */
.status-bar {
  height: 44px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ig-text);
}
.status-bar__icons { display: flex; gap: 6px; align-items: center; font-size: 12px; }

/* ============= Top Header ============= */
.ig-header {
  height: 44px;
  border-bottom: 1px solid var(--ig-border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.ig-header__back {
  font-size: 22px;
  color: var(--ig-text);
  width: 24px;
}
.ig-header__title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ig-header__title .lock { font-size: 12px; }
.ig-header__icons {
  display: flex; gap: 18px; align-items: center;
  font-size: 22px;
}

/* ============= Profile Header ============= */
.profile-section {
  padding: 20px 16px;
}
.profile-row {
  display: flex; align-items: center; gap: 28px;
  margin-bottom: 18px;
}
.profile-avatar-wrap {
  width: 86px; height: 86px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
  padding: 3px;
  flex-shrink: 0;
}
.profile-avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
}
.profile-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #1a0d12;
}
.profile-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.profile-stats {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  text-align: center;
}
.profile-stat strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--ig-text);
}
.profile-stat span {
  font-size: 13px;
  color: var(--ig-text);
}

.profile-bio {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ig-text);
  margin-bottom: 16px;
}
.profile-bio strong { display: block; font-weight: 700; margin-bottom: 4px; }
.profile-bio .category {
  color: var(--ig-text-soft);
  font-size: 12px;
  margin-bottom: 4px;
}
.profile-bio a { color: #00376b; }
.profile-bio .pronouns { color: var(--ig-text-soft); }

.profile-followed-by {
  font-size: 12px;
  color: var(--ig-text-soft);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.followed-by-avatars {
  display: inline-flex;
}
.followed-by-avatars span {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: #1a0d12;
  margin-left: -6px;
  background-size: cover;
}
.followed-by-avatars span:first-child { margin-left: 0; }

/* CTAボタン */
.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 36px;
  gap: 6px;
  margin-bottom: 18px;
}
.btn-follow {
  background: var(--ig-blue);
  color: #fff;
  font-weight: 700;
  height: 32px;
  border-radius: 8px;
  font-size: 14px;
}
.btn-message {
  background: var(--ig-bg-alt);
  color: var(--ig-text);
  font-weight: 700;
  height: 32px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid var(--ig-border-soft);
}
.btn-more {
  background: var(--ig-bg-alt);
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  border: 1px solid var(--ig-border-soft);
  display: flex; align-items: center; justify-content: center;
}

/* ============= Story Highlights ============= */
.highlights {
  display: flex;
  gap: 14px;
  padding: 12px 16px 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--ig-border-soft);
  scrollbar-width: none;
}
.highlights::-webkit-scrollbar { display: none; }
.highlight {
  flex-shrink: 0;
  width: 70px;
  text-align: center;
}
.highlight__img {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1.5px solid var(--ig-border);
  padding: 3px;
  background: #fff;
  margin: 0 auto 4px;
}
.highlight__img-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #1a0d12;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: #f5e9d4;
}
.highlight__img-inner img { width: 100%; height: 100%; object-fit: cover; }
.highlight__label {
  font-size: 12px;
  color: var(--ig-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============= Tab Switcher ============= */
.tabs {
  display: flex;
  border-top: 1px solid var(--ig-border);
  border-bottom: 1px solid var(--ig-border-soft);
}
.tabs__item {
  flex: 1;
  height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--ig-text-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs__item.active {
  color: var(--ig-text);
  border-bottom-color: var(--ig-text);
}

/* ============= Feed Grid ============= */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.feed-grid__cell {
  aspect-ratio: 1;
  background: #1a0d12;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.feed-grid__cell img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.feed-grid__cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .15s;
}
.feed-grid__cell:hover::after { background: rgba(0,0,0,.15); }
.feed-grid__cell .icon-overlay {
  position: absolute;
  top: 8px; right: 8px;
  color: #fff;
  font-size: 14px;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ============= Bottom Tab Bar ============= */
.bottom-tabs {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--ig-border-soft);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 16px 4px;
  font-size: 22px;
  color: var(--ig-text);
}
.bottom-tabs__profile {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--ig-text);
  overflow: hidden;
}
.bottom-tabs__profile img { width: 100%; height: 100%; object-fit: cover; }

/* =====================================================
   POST DETAIL PAGE
   ===================================================== */
.post-page {
  padding-bottom: 60px;
}
.post-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ig-border-soft);
}
.post-header__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
  padding: 1.5px;
}
.post-header__avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #fff;
  padding: 1.5px;
}
.post-header__avatar-inner > div {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #1a0d12;
}
.post-header__avatar-inner img { width: 100%; height: 100%; object-fit: cover; }

.post-header__info {
  flex: 1;
  font-size: 13px;
}
.post-header__info strong { font-weight: 700; display: block; line-height: 1.2; }
.post-header__info span { font-size: 11px; color: var(--ig-text); }

.post-image {
  width: 100%;
  aspect-ratio: 1;
  background: #1a0d12;
}
.post-image img { width: 100%; height: 100%; object-fit: cover; }

.post-actions {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 24px;
  gap: 14px;
}
.post-actions__bookmark { margin-left: auto; }

.post-likes {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}
.post-likes strong { font-weight: 700; }

.post-caption {
  padding: 0 14px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 6px;
}
.post-caption__author { font-weight: 700; margin-right: 6px; }
.post-caption__text {
  white-space: pre-wrap;
  word-wrap: break-word;
}
.post-caption__text .tag { color: #00376b; }

.post-comments {
  padding: 0 14px;
  font-size: 14px;
  color: var(--ig-text-soft);
  margin-bottom: 6px;
}
.post-comments__view { color: var(--ig-text-soft); margin-bottom: 8px; cursor: pointer; }
.comment {
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--ig-text);
}
.comment strong { font-weight: 700; margin-right: 6px; }
.comment-meta {
  font-size: 12px;
  color: var(--ig-text-soft);
  margin-top: 2px;
  margin-bottom: 8px;
  display: flex; gap: 12px;
}

.post-time {
  padding: 6px 14px 14px;
  font-size: 11px;
  color: var(--ig-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--ig-border-soft);
}

.add-comment {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  gap: 10px;
}
.add-comment__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #1a0d12;
  overflow: hidden;
  flex-shrink: 0;
}
.add-comment__avatar img { width: 100%; height: 100%; object-fit: cover; }
.add-comment__input {
  flex: 1;
  font-size: 14px;
  color: var(--ig-text-soft);
  background: transparent;
  border: none;
  outline: none;
}
.add-comment__post {
  color: var(--ig-blue);
  font-weight: 700;
  font-size: 14px;
  opacity: .4;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 414px) {
  .phone-frame {
    border-left: none;
    border-right: none;
    box-shadow: none;
    max-width: 100%;
  }
}
@media (min-width: 415px) {
  body { padding: 20px 0; }
}
