/* =========================
   Base styles
========================= */

body {
  background: #fafafa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
  color: #222;
}

/* Content images only */
.post-content img,
.card-image img {
  max-width: 100%;
  border-radius: 12px;
}

/* =========================
   Layout & typography
========================= */

.post-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin-top: 2.5rem;
}

.post-content img {
  margin: 2rem 0;
}

/* Story images: keep tall phone photos from taking over the page */
.post p img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

.muted {
  color: #6b7280;
  font-size: 0.9rem;
}

/* =========================
   Post header
========================= */

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  margin: 0 0 0.5rem;
  line-height: 1.25;
}

.post-meta {
  margin: 0 0 0.75rem;
}

.post-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.post-author {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #374151;
  font-size: 0.85rem;
  font-weight: 500;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.25rem 0.9rem 0.25rem 0.3rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-author:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0;
}

/* Wider container on the home page so the card grid can breathe */
.home .post-content {
  max-width: 1040px;
}

/* =========================
   Cards
========================= */

#posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.card h3 {
  margin: 0.25rem 0 0.25rem;
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card h3 a:hover {
  text-decoration: underline;
}

.card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 1rem;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fade-in {
  animation: fadeUp 0.6s ease both;
}

/* "Share your story" placeholder card */
.share-card {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: transparent;
  border: 2px dashed #d1d5db;
  text-decoration: none;
  color: inherit;
  min-height: 260px;
}

.share-card:hover {
  border-color: #9ca3af;
  background: #fff;
}

.share-card .share-plus {
  font-size: 2.5rem;
  line-height: 1;
  color: #9ca3af;
}

.share-card h3 {
  margin: 0.75rem 0 0.25rem;
}

.share-card p {
  margin: 0;
  max-width: 26ch;
}

/* =========================
   Adventurers (top section)
========================= */

.adventurers {
  margin: 3rem 0;
  text-align: center;
}

.adventurers-grid {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.adventurer {
  text-decoration: none;
  color: inherit;
  width: 56px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.adventurer img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ddd;
  transition: transform 0.2s ease;
}

.adventurer:hover img {
  transform: scale(1.05);
}

.adventurer.active img {
  outline: 2px solid currentColor;
}

.add-adventurer .add-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px dashed #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #9ca3af;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.add-adventurer:hover .add-circle {
  transform: scale(1.05);
  border-color: #9ca3af;
}

/* Tooltip (name only on hover) */
.adventurer .tooltip {
  display: none;
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.adventurer:hover .tooltip {
  display: block;
}

/* =========================
   Inline adventurers (under posts)
========================= */

.post-travellers {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;   /* ensures space before Read more */
  display: flex;
  align-items: center;      /* aligns avatars with "By" */
  gap: 0.5rem;
  line-height: 1;
}

.post-travellers::before {
  content: "By";
  font-size: 0.75rem;
  opacity: 0.6;
  margin-right: 0.25rem;
}

/* Lock avatar size & alignment */
.inline-adventurer {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.inline-adventurer img {
  width: 24px;
  height: 24px;
  max-width: none;      /* prevents global stretching */
  border-radius: 50%;
  object-fit: cover;
  display: block;       /* removes baseline issues */
  opacity: 0.85;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.inline-adventurer img:hover {
  transform: scale(1.1);
  opacity: 1;
}

/* =========================
   Animations
========================= */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
