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

/* ── Section wrapper ── */
.ig-section {
  text-align: left;
  padding: 2rem 0 0;
}

.ig-section h2 {
  font-size: 1.8rem; /* Scaled up for news article header */
  font-weight: 600;
  color: var(--color-text-primary, #111);
  margin-bottom: 0.5rem;
}

.ig-section p {
  font-size: 1rem; /* Scaled up */
  color: var(--color-text-secondary, #888);
  margin-bottom: 1.5rem;
}

/* ── Scene ── */
.ig-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px; /* Pushes the arrows cleanly outside the frame */
  padding: 2rem 0;
  margin: 0 auto;
  max-width: 700px; /* Constrains the whole block including arrows */
}

/* ── Arrows ── */
.ig-arrow {
  background: var(--color-background-primary, #fff);
  border: 0.5px solid var(--color-border-secondary, #ddd);
  border-radius: 50%;
  width: 44px; 
  height: 44px; 
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
  /* ADD THESE TWO LINES: */
  position: static !important; 
  margin: 0 !important;
}
.ig-arrow:hover {
  background: var(--color-background-secondary, #f5f5f5);
  transform: scale(1.08);
}

.ig-arrow svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-text-primary, #111);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Frame ── */
.ig-frame {
  width: 100%;
  max-width: 500px; /* Scaled up from 340px */
  flex-shrink: 0;
  border: 0.5px solid var(--color-border-tertiary, #dbdbdb);
  border-radius: 12px;
  background: var(--color-background-primary, #fff);
  overflow: hidden;
  user-select: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ── Header ── */
.ig-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px; /* Increased padding */
}

.ig-avatar {
  width: 40px; /* Scaled up from 32px */
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ig-avatar img {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  margin: 0 !important;
  display: block !important;
}
.ig-header-text {
  flex: 1;
}

.ig-username {
  font-size: 15px; /* Scaled up */
  font-weight: 600;
  color: var(--color-text-primary, #111);
}

.ig-location {
  font-size: 13px; /* Scaled up */
  color: var(--color-text-secondary, #888);
}

.ig-more {
  display: flex;
  gap: 3px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.ig-more span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text-secondary, #888);
  display: block;
}

/* ── Media ── */
.ig-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1; /* Keeps the square IG format perfectly */
  background: var(--color-background-secondary, #fafafa);
  overflow: hidden;
}

.ig-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  transition: opacity 0.25s;
  cursor: pointer;
}

.ig-media img.fade {
  opacity: 0;
}

.ig-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ig-play-btn svg {
  width: 64px; /* Scaled up */
  height: 64px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

/* ── Dots ── */
.ig-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 0 6px;
}

.ig-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border-secondary, #ddd);
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}

.ig-dot.active {
  background: #0095f6;
  transform: scale(1.25);
}

/* ── Caption ── */
.ig-caption-area {
  padding: 8px 16px 16px;
}

.ig-caption-username {
  font-size: 15px; /* Scaled up */
  font-weight: 800;
  color: var(--color-text-primary, #111);
}

.ig-caption-text {
  font-size: 15px; /* Scaled up */
  color: var(--color-text-primary, #111);
  line-height: 1.5;
  display: inline;
}

.ig-caption-more {
  font-size: 15px;
  color: var(--color-text-secondary, #888);
  cursor: pointer;
  margin-left: 4px;
}

.ig-view-link {
  display: block;
  padding: 0 16px 16px;
  font-size: 14px; /* Scaled up */
  color: #0095f6;
  text-decoration: none;
}

.ig-view-link:hover {
  text-decoration: underline;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .ig-scene {
    padding: 1rem 0;
    gap: 0;
  }

  .ig-arrow {
    display: none; /* Hides arrows on small phones so the post can take the full width */
  }

  .ig-frame {
    width: 100%;
    border-radius: 0; /* Removes rounded corners to look native on mobile */
    border-left: none;
    border-right: none;
  }
}


/* ── Grid Layout ── */
.ig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Creates the 3 columns */
    gap: 24px;
    max-width: 1000px;
    margin: 40px auto;
}

.ig-grid .ig-frame {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

.ig-grid .ig-caption-area {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
}

.ig-grid .ig-view-link {
    margin-top: auto;
    padding-top: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .ig-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .ig-grid { grid-template-columns: 1fr; }
}