/* ── AM (Aidric / Misaya) — Instagram 스타일 피드 ──────────────
   컬러는 전부 배제한 모노톤 모던 UI. 좋아요만 페이지별 포인트 컬러. */

.am-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 32px 20px 44px;
}
.am-wrap-title {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: center;
}

/* ── iPhone 프레임 ───────────────────────────────────────────── */
.am-phone {
  position: relative;
  width: min(330px, 100%);
  background: #1c1c1e;
  border-radius: 46px;
  padding: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.14);
}
.am-phone-notch {
  position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 22px;
  background: #1c1c1e;
  border-radius: 0 0 16px 16px;
  z-index: 2;
}
.am-phone-screen {
  position: relative;
  background: #fff;
  border-radius: 34px;
  overflow: hidden;
  height: 620px;
  display: flex;
  flex-direction: column;
}

/* ── IG 헤더 ─────────────────────────────────────────────────── */
.am-ig-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 36px 16px 12px;
  border-bottom: 1px solid var(--border-lt);
}
.am-ig-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--text-2);
  background: var(--p4, #F4F5EF);
  border: 1px solid var(--border-lt);
  overflow: hidden;
}
.am-ig-username {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

/* ── 피드 (스크롤) ───────────────────────────────────────────── */
.am-ig-feed {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.am-ig-feed::-webkit-scrollbar { width: 0; }

.am-empty {
  padding: 60px 20px;
  text-align: center;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

/* ── 게시물 카드 ─────────────────────────────────────────────── */
.am-post { border-bottom: 1px solid var(--border-lt); }
.am-post:last-child { border-bottom: none; }

.am-post-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
}
.am-post-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  color: var(--text-2);
  background: var(--p4, #F4F5EF);
  border: 1px solid var(--border-lt);
  overflow: hidden;
}
.am-post-username {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.am-post-owner-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.am-post-edit,
.am-post-del {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-3);
  border: 1px solid var(--border-lt);
  padding: 3px 8px;
  background: #fff;
}
.am-post-edit:hover,
.am-post-del:hover { color: var(--text); border-color: var(--text); }

/* ── 게시물 수정 모달 ─────────────────────────────────────────
   폰 프레임 내부의 스크롤 영역에 갇히지 않도록 화면 전체를 덮는 오버레이로 띄운다 */
.am-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.am-edit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,20,20,0.46);
}
.am-edit-modal-card {
  position: relative;
  width: min(360px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,0.28);
}
.am-edit-modal-title {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}

.am-post-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f4f4f4;
  overflow: hidden;
}
.am-post-image { width: 100%; height: 100%; object-fit: cover; display: block; }

.am-post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 0;
}
.am-like-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  line-height: 1;
  color: var(--text-2);
  transition: color 0.15s ease, transform 0.15s ease;
}
.am-like-btn:active { transform: scale(0.88); }
.am-like-btn.liked { transform: scale(1.05); }
.am-heart-svg {
  width: 23px;
  height: 23px;
  display: block;
}

/* 페이지별 '좋아요' 포인트 컬러 — 유일한 컬러 포인트 */
body.am-aidric .am-like-btn.liked { color: #4F8B5E; }
body.am-misaya .am-like-btn.liked { color: #E08FB0; }

.am-post-likes {
  padding: 6px 14px 0;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text);
}
.am-post-caption {
  padding: 4px 14px 0;
  font-family: var(--serif-kr);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}
.am-post-caption b { font-family: var(--sans); font-weight: 600; margin-right: 5px; }
.am-post-date {
  padding: 5px 14px 14px;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── 페이지네이션 (피드 아래, 폰 프레임 밖) ──────────────────── */
.am-pagination { margin-top: 0; }

/* ── 새 게시물 작성 (관리자 전용) ────────────────────────────── */
.am-write {
  width: min(330px, 100%);
}
.am-write-toggle {
  width: 100%;
  padding: 11px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--border);
  background: #fff;
  transition: background 0.15s, color 0.15s;
}
.am-write-toggle:hover { background: var(--text); color: #fff; }

.am-write-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border-lt);
  background: #fff;
}
.am-write-file {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text-2);
  padding: 6px 0;
}
.am-write-preview {
  display: none;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f4f4f4;
  border: 1px solid var(--border-lt);
}
.am-write-caption {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-lt);
  background: #fff;
  font-family: var(--serif-kr);
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 56px;
}
.am-write-caption:focus { border-color: var(--border); }
.am-write-actions { display: flex; justify-content: flex-end; gap: 6px; }
.am-write-submit {
  padding: 8px 18px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--text);
  border: 1px solid var(--text);
}
.am-write-submit:disabled { opacity: 0.5; cursor: default; }
.am-write-cancel {
  padding: 8px 18px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  background: #fff;
  border: 1px solid var(--border-lt);
}
.am-draft-banner {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--text-2);
  background: #FBF8F3;
  border: 1px solid var(--border-lt);
  padding: 7px 10px;
}
.am-draft-banner button {
  margin-left: 8px;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  padding: 2px 9px;
  border: 1px solid var(--border-lt);
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.am-draft-banner button:hover { color: var(--text); border-color: var(--text); }
.am-write-alert {
  font-family: var(--sans);
  font-size: 11px;
  color: #b14545;
}

/* ── 모바일 ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  /* 하단 dock(고정바)에 글쓰기 버튼이 가려지지 않도록 여백 확보 */
  .am-wrap { padding: 22px 14px calc(76px + env(safe-area-inset-bottom)); gap: 22px; }
  .am-phone { border-radius: 38px; padding: 11px; }
  .am-phone-screen { height: calc(100svh - 250px); min-height: 400px; max-height: 600px; border-radius: 28px; }
  .am-ig-header { padding: 30px 14px 12px; }
  .am-like-btn { padding: 5px; }
  .am-heart-svg { width: 26px; height: 26px; }
  .am-write-toggle, .am-write-submit, .am-write-cancel { padding: 12px; }
  .am-edit-modal-card { padding: 18px; max-height: 82vh; }
}
