/* styles/index.css */
:root {
  --carousel-btn-bg: rgba(255,255,255,0.92);
  --carousel-btn-size: 48px;
  --carousel-btn-icon-color: #1f2937;
  --carousel-btn-hover-scale: 1.2;
  --carousel-btn-transition: 0.3s ease;
  --carousel-accent: var(--gold-500, #e7b84c);
}

/* Container/track */
.carousel-container { position: relative; overflow: hidden; margin: 20px; }
.carousel { overflow: hidden; width: 100%; }
.carousel-slides {
  display: flex;
  transition: transform 0.5s ease;
  will-change: transform;
  touch-action: pan-y;
  user-select: none;
}

/* Slide grid */
.carousel-slide {
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 20px;
  box-sizing: border-box;
}

/* Floating arrows (desktop/tablet) */
.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--carousel-btn-size);
  height: var(--carousel-btn-size);
  background: var(--carousel-btn-bg);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
  transition: transform var(--carousel-btn-transition), background var(--carousel-btn-transition), box-shadow var(--carousel-btn-transition);
  z-index: 1000;
}
.carousel-button.prev { left: 1rem; }
.carousel-button.next { right: 1rem; }

.carousel-button svg { width: 60%; height: 60%; display: block; pointer-events: none; }
.carousel-button svg path {
  /* Force icon visibility in all browsers */
  fill: var(--carousel-btn-icon-color) !important;
  stroke: var(--carousel-btn-icon-color) !important;
  stroke-width: 0 !important;
}
.carousel-button:hover, .carousel-button:focus {
  background: #fff;
  box-shadow: 0 18px 36px rgba(0,0,0,.25);
  outline: none;
}
.carousel-button:hover path, .carousel-button:focus path {
  transform: scale(var(--carousel-btn-hover-scale));
}

/* Hide the row buttons by default; show on phones only */
.carousel-button-row.mobile-only { display: none; }

/* Post cards */
.post-preview {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(8, 29, 54, 0.08);
  box-shadow: 0 16px 30px rgba(17,24,39,0.12);
  padding: 14px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.post-preview:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 46px rgba(17,24,39,0.22);
  border-color: rgba(231,184,76,.6);
}
.post-preview img {
  width: 100%; height: auto; border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0,0,0,.12);
}
.post-preview p { font-weight: 700; font-size: 15px; }
.post-preview .admin-owner { color: rgb(180, 2, 2) !important; }
.post-preview .editor-user { color: #cd8d01 !important; }
.post-preview .regular-user { color: #0e3a5d !important; }

/* Dots */
.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 2px;
}
.carousel-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(31,41,55,.25);
  border: 2px solid rgba(31,41,55,.35);
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}
.carousel-dot:hover { transform: scale(1.15); }
.carousel-dot.active {
  transform: scale(1.2);
  background: var(--carousel-accent);
  border-color: var(--carousel-accent);
}

/* Tablet */
@media (max-width: 900px) {
  .carousel-slide { grid-template-columns: repeat(2, 1fr) !important; }
  .carousel-button { width: 50px; height: 50px; }
  .carousel-button svg { width: 65%; height: 65%; }
}

/* Phone */
@media (max-width: 640px) {
  .carousel-slide { grid-template-columns: 1fr !important; }
  .carousel-container > .carousel-button { display: none !important; }

  .carousel-button-row.mobile-only {
    display: flex !important;
    justify-content: space-between;
    width: 100%;
    margin: 8px 0;
  }
  .carousel-button-row.mobile-only .carousel-button {
    position: relative;
    width: 42px; height: 42px;
    background: var(--carousel-btn-bg);
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(0,0,0,0.18);
    align-items: center; justify-content: center;
  }
  .carousel-button-row.mobile-only .carousel-button svg { width: 60%; height: 60%; }
  .carousel-button-row.mobile-only .carousel-button:active,
  .carousel-button-row.mobile-only .carousel-button:hover {
    background: #fff;
    box-shadow: 0 16px 30px rgba(0,0,0,0.24);
  }
}