/* ========================================
   INSTAGRAM FEED — CORE STYLES
   ======================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #fafaf8;
  --surface:     #ffffff;
  --border:      #e8e5e0;
  --text-primary:   #1a1a18;
  --text-secondary: #6b6860;
  --text-muted:     #9e9b96;
  --accent:      #c8553d;
  --accent-light:#fdf0ed;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,.09);
  --font-body:   'DM Sans', sans-serif;
  --font-display:'Playfair Display', serif;
  --transition:  0.22s ease;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- HEADER ---- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ig-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
}

.header-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.follow-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  background: var(--text-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity var(--transition);
  white-space: nowrap;
}
.follow-btn:hover { opacity: 0.82; }

/* ---- MAIN ---- */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

/* ---- GRID ---- */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ---- POST CARD ---- */
.post-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

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

/* ---- IMAGE ---- */
.post-image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f0ede8;
}

.post-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.post-card:hover .post-img {
  transform: scale(1.04);
}

/* ---- OVERLAY ---- */
.post-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 14, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.post-card:hover .post-overlay {
  opacity: 1;
}

.overlay-text {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255,255,255,0.55);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
}

/* ---- BADGES ---- */
.media-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  letter-spacing: 0.03em;
}

.video-badge {
  background: rgba(200, 85, 61, 0.88);
  color: #fff;
}

.carousel-badge {
  background: rgba(26, 26, 24, 0.75);
  color: #fff;
}

/* ---- CAPTION ---- */
.post-caption {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.caption-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-date {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- ERROR / EMPTY ---- */
.error-box, .empty-box {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
}

.error-icon {
  font-size: 36px;
  margin-bottom: 14px;
}

.error-title {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 8px;
}

.error-msg {
  font-size: 14px;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 12px 0;
  word-break: break-word;
}

.error-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- FOOTER ---- */
.site-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .header-title { font-size: 17px; }
  .follow-btn { padding: 8px 14px; font-size: 12px; }
  .main-content { padding: 24px 14px 40px; }
  .feed-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .post-caption { padding: 10px 12px 12px; }
}

@media (max-width: 360px) {
  .feed-grid { grid-template-columns: 1fr; }
}
