/* ==========================================================================
   Avezz Posts Hub & Post Detail (css/pages/posts.css) — 1:1 UI/posts.html
   ========================================================================== */

:root {
  --post-shadow-img: 0 18px 24px -6px rgba(15, 23, 42, 0.14), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  --post-shadow-card: 0 20px 40px -14px rgba(15, 23, 42, 0.18), 0 4px 12px -4px rgba(15, 23, 42, 0.06);
  --post-shadow-text: 0 12px 28px -10px rgba(15, 23, 42, 0.12), 0 2px 6px -2px rgba(15, 23, 42, 0.05);
  --tag-blue-bg: #eff6ff;    --tag-blue-txt: #2563eb;    --tag-blue-bd: rgba(219, 234, 254, 0.7);
  --tag-emerald-bg: #ecfdf5; --tag-emerald-txt: #059669; --tag-emerald-bd: rgba(209, 250, 229, 0.7);
  --tag-orange-bg: #fff7ed;  --tag-orange-txt: #ea580c;  --tag-orange-bd: rgba(255, 237, 213, 0.7);
  --tag-purple-bg: #faf5ff;  --tag-purple-txt: #9333ea;  --tag-purple-bd: rgba(243, 232, 255, 0.7);
  --tag-rose-bg: #fff1f2;    --tag-rose-txt: #e11d48;    --tag-rose-bd: rgba(255, 228, 230, 0.7);
}

[data-theme="dark"] {
  --post-shadow-img: 0 18px 28px -6px rgba(0, 0, 0, 0.45);
  --post-shadow-card: 0 22px 44px -12px rgba(0, 0, 0, 0.65);
  --post-shadow-text: 0 14px 30px -10px rgba(0, 0, 0, 0.5);
  --tag-blue-bg: rgba(37, 99, 235, 0.16);    --tag-blue-txt: #60a5fa;    --tag-blue-bd: rgba(96, 165, 250, 0.25);
  --tag-emerald-bg: rgba(5, 150, 105, 0.16); --tag-emerald-txt: #34d399; --tag-emerald-bd: rgba(52, 211, 153, 0.25);
  --tag-orange-bg: rgba(234, 88, 12, 0.16);  --tag-orange-txt: #fb923c;  --tag-orange-bd: rgba(251, 146, 60, 0.25);
  --tag-purple-bg: rgba(147, 51, 234, 0.16); --tag-purple-txt: #c084fc;  --tag-purple-bd: rgba(192, 132, 252, 0.25);
  --tag-rose-bg: rgba(225, 29, 72, 0.16);    --tag-rose-txt: #fb7185;    --tag-rose-bd: rgba(251, 113, 133, 0.25);
}

.posts-wrap {
  max-width: 1520px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}

.hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.hub-toolbar-left,
.hub-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hub-form-drawer { margin-bottom: 20px; }
.hub-form-drawer.hide { display: none; }

/* Pinterest Masonry Stage */
.posts-stage {
  position: relative;
  width: 100%;
  min-height: 240px;
}

.posts-stage:not(.is-masonry-ready) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.posts-stage.is-masonry-ready > .postcard-container {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform, width;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 1:1 Postcard (UI/posts.html) */
.postcard-container { z-index: 1; }
.postcard-container.is-filtered-out { display: none; }

.postcard-hero {
  display: block;
  width: 100%;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--post-shadow-img);
  background: var(--surface-muted);
}

.postcard-hero img {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.postcard-hero img:not([width]) { aspect-ratio: 4 / 3; }

.postcard-hero:hover img { transform: scale(1.03); }

.postcard-content {
  position: relative;
  margin-top: -20%;
  margin-inline: 12px;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--post-shadow-card);
  padding: 20px;
  z-index: 10;
  border: 1px solid var(--border);
}

.postcard-container.is-text-only .postcard-content {
  margin-top: 0;
  margin-inline: 0;
  border-radius: 24px;
  box-shadow: var(--post-shadow-text);
  padding: 20px 18px 16px;
}

.text-only-accent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
  padding: 0 4px;
}

.text-only-accent::before {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
}

.post-body-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.post-body-link:hover { text-decoration: none; }

.post-description {
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.48;
  margin-bottom: 12px;
  font-weight: 500;
  padding: 0 4px;
  white-space: pre-line;
  word-break: break-word;
}

.postcard-container.is-text-only .post-description {
  font-size: 14px;
  line-height: 1.56;
}

.post-description a { color: var(--accent); }

/* Scrollable Colored Tags (1:1 UI/posts.html) */
.tags-wrapper {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  margin-bottom: 14px;
  padding: 0 4px;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}
.tags-wrapper::-webkit-scrollbar { display: none; }

.post-tag {
  white-space: nowrap;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 6px;
  border: 1px solid;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.post-tag:hover { transform: translateY(-1px); opacity: 0.9; text-decoration: none; }

.tag-blue    { background: var(--tag-blue-bg);    color: var(--tag-blue-txt);    border-color: var(--tag-blue-bd); }
.tag-emerald { background: var(--tag-emerald-bg); color: var(--tag-emerald-txt); border-color: var(--tag-emerald-bd); }
.tag-orange  { background: var(--tag-orange-bg);  color: var(--tag-orange-txt);  border-color: var(--tag-orange-bd); }
.tag-purple  { background: var(--tag-purple-bg);  color: var(--tag-purple-txt);  border-color: var(--tag-purple-bd); }
.tag-rose    { background: var(--tag-rose-bg);    color: var(--tag-rose-txt);    border-color: var(--tag-rose-bd); }

/* Footer & Author */
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 2px 0;
}

.post-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}
.post-author:hover { color: var(--accent); text-decoration: none; }

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  position: relative;
  flex-shrink: 0;
}

.post-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

/* Post Full Detail Page */
.post-full-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 16px 56px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-full-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: visible;
  box-shadow: var(--shadow-card);
}

.post-full-media {
  width: 100%;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  background: var(--surface-muted);
  display: flex;
  justify-content: center;
}

.post-full-media img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

.post-full-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-full-text {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-line;
  word-break: break-word;
}
