/**
 * RSB Bento Widget (Image Report) — Stylesheet
 * Version: 2.2.0
 * Author: Meysam Behrouz
 */

/* ==========================================================================
   Base Container & Grid
   ========================================================================== */

.rsb__wrapper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  direction: rtl;
  text-align: right;
  overflow: hidden;
  transition: all 0.3s ease;
}

.rsb__wrapper *,
.rsb__wrapper *::before,
.rsb__wrapper *::after {
  box-sizing: border-box;
}

/* Glassmorphism Frame */
.rsb__wrapper.rsb__glass {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rsb__grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  align-items: stretch;
  width: 100%;
  gap: 20px;
}

/* Reverse layout toggle */
.rsb__wrapper.rsb__layout--reverse .rsb__grid {
  grid-template-columns: 1fr 1.45fr;
}
.rsb__wrapper.rsb__layout--reverse .rsb__big-card-col {
  order: 2;
}
.rsb__wrapper.rsb__layout--reverse .rsb__small-cards-col {
  order: 1;
}

/* ==========================================================================
   Big Card
   ========================================================================== */

.rsb__big-card-col {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.rsb__big-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  flex: 1 1 auto;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: #0f172a;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

/* Custom Height Override */
.rsb__big-height-custom .rsb__big-card {
  flex: 0 0 auto;
}

.rsb__big-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
  z-index: 1;
}

.rsb__big-card.is-transitioning .rsb__big-card-img {
  opacity: 0.82;
  transform: scale(1.02);
}

.rsb__big-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.45) 55%, rgba(15, 23, 42, 0.88) 100%);
  z-index: 2;
  pointer-events: none;
  transition: background 0.35s ease;
}

.rsb__big-card-content {
  position: relative;
  z-index: 3;
  margin-top: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: auto;
}

.rsb__big-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.rsb__meta-category {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  background-color: rgba(245, 158, 11, 0.95);
  border-radius: 6px;
  letter-spacing: -0.02em;
}

.rsb__meta-date {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
}

.rsb__meta-date--big {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.rsb__meta-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rsb__meta-date-row--below {
  margin-top: 8px;
}

.rsb__meta-date-row--bottom {
  margin-top: auto;
  padding-top: 10px;
}

.rsb__meta-date-row--small-below {
  margin-top: 4px;
}

/* Big Card Title Tag Normalization (H1-H6, div, span, p) */
h1.rsb__big-card-title,
h2.rsb__big-card-title,
h3.rsb__big-card-title,
h4.rsb__big-card-title,
h5.rsb__big-card-title,
h6.rsb__big-card-title,
div.rsb__big-card-title,
span.rsb__big-card-title,
p.rsb__big-card-title,
.rsb__big-card-title {
  margin: 0;
  padding: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  color: #ffffff;
  transition: color 0.25s ease;
}

.rsb__big-card-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  outline: none;
}

.rsb__big-card-link:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 4px;
  border-radius: 4px;
}

/* Big Card Hover Effects */
.rsb__big-card:hover .rsb__big-card-img {
  transform: scale(1.04);
}

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

.rsb__small-cards-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rsb__small-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  height: 100%;
}

.rsb__small-card {
  position: relative;
  height: 228px;
  border-radius: 12px;
  overflow: hidden;
  background-color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

.rsb__small-card-action-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  text-decoration: none;
  color: inherit;
  outline: none;
}

.rsb__small-card-action-link:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: -2px;
}

.rsb__small-card-media {
  position: relative;
  width: 100%;
  height: 60%;
  min-height: 60%;
  overflow: hidden;
}

.rsb__small-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.rsb__small-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(15, 23, 42, 0.7) 100%);
  pointer-events: none;
}

.rsb__small-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.rsb__small-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.rsb__meta-category--small {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
}

.rsb__meta-date--small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

/* Small Card Title Tag Normalization (H1-H6, div, span, p) */
h1.rsb__small-card-title,
h2.rsb__small-card-title,
h3.rsb__small-card-title,
h4.rsb__small-card-title,
h5.rsb__small-card-title,
h6.rsb__small-card-title,
div.rsb__small-card-title,
span.rsb__small-card-title,
p.rsb__small-card-title,
.rsb__small-card-title {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: #f8fafc;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

/* Active & Hover States */
.rsb__small-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.3);
  border-color: rgba(245, 158, 11, 0.4);
}

.rsb__small-card:hover .rsb__small-card-img {
  transform: scale(1.06);
}

.rsb__small-card:hover .rsb__small-card-title {
  color: #fbbf24;
}

.rsb__small-card.is-active {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px #f59e0b, 0 10px 20px -3px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Dots Navigation (8 Independent Positions)
   ========================================================================== */

.rsb__dots {
  position: absolute;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
}

.rsb__dot-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.rsb__dot-item:hover {
  background: rgba(255, 255, 255, 0.75);
}

.rsb__dot-item.is-active {
  width: 14px;
  height: 14px;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.35);
}

.rsb__dot-item:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* 1. Top Center */
.rsb__dots--top-center {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: row;
}

/* 2. Top Right */
.rsb__dots--top-right {
  top: 18px;
  right: 20px;
  flex-direction: row;
}

/* 3. Top Left */
.rsb__dots--top-left {
  top: 18px;
  left: 20px;
  flex-direction: row;
}

/* 4. Bottom Center */
.rsb__dots--bottom-center {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: row;
}

/* 5. Bottom Right */
.rsb__dots--bottom-right {
  bottom: 20px;
  right: 20px;
  flex-direction: row;
}

/* 6. Bottom Left */
.rsb__dots--bottom-left {
  bottom: 20px;
  left: 20px;
  flex-direction: row;
}

/* 7. Vertical Right */
.rsb__dots--vertical-right {
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  flex-direction: column;
}

/* 8. Vertical Left */
.rsb__dots--vertical-left {
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  flex-direction: column;
}

/* ==========================================================================
   Archive Button (4 Designs)
   ========================================================================== */

.rsb__header-bar,
.rsb__footer-bar {
  display: flex;
  margin-bottom: 16px;
  width: 100%;
}

.rsb__footer-bar {
  margin-top: 18px;
  margin-bottom: 0;
}

.rsb__pos-top_left,
.rsb__pos-bottom_left {
  justify-content: flex-end; /* In RTL, left is flex-end */
}

.rsb__pos-top_right,
.rsb__pos-bottom_right {
  justify-content: flex-start; /* In RTL, right is flex-start */
}

.rsb__pos-bottom_center {
  justify-content: center;
}

.rsb__archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.25s ease;
  cursor: pointer;
  outline: none;
}

.rsb__archive-btn:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 3px;
}

.rsb__archive-btn-icon {
  transition: transform 0.25s ease;
}

.rsb__archive-btn:hover .rsb__archive-btn-icon {
  transform: translateX(-4px); /* Moves towards right-to-left arrow */
}

/* Design 1: Solid Filled */
.rsb__btn--solid {
  background: #f59e0b;
  color: #0f172a;
  padding: 8px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}
.rsb__btn--solid:hover {
  background: #d97706;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}

/* Design 2: Outlined */
.rsb__btn--outlined {
  background: transparent;
  color: #f59e0b;
  border: 1.5px solid rgba(245, 158, 11, 0.7);
  padding: 7px 16px;
  border-radius: 8px;
}
.rsb__btn--outlined:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
  color: #fbbf24;
}

/* Design 3: Simple Text */
.rsb__btn--simple {
  background: transparent;
  color: #94a3b8;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.rsb__btn--simple:hover {
  color: #f59e0b;
  border-bottom-color: #f59e0b;
}

/* Design 4: Pill Icon */
.rsb__btn--pill_icon {
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 7px 18px;
  border-radius: 9999px;
  backdrop-filter: blur(8px);
}
.rsb__btn--pill_icon:hover {
  background: #f59e0b;
  color: #0f172a;
  border-color: #f59e0b;
}

/* ==========================================================================
   Preset Styles (6 Distinct Variations)
   ========================================================================== */

/* Style 1: Bento Classic */
.rsb__style-bento_classic .rsb__big-card {
  border-radius: 18px;
}

/* Style 2: Editorial Magazine */
.rsb__style-editorial_magazine {
  padding: 24px;
  background-color: #0b0f19;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.rsb__style-editorial_magazine .rsb__big-card {
  border-radius: 6px;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.rsb__style-editorial_magazine .rsb__big-card-title {
  font-family: inherit;
  font-size: 26px;
  font-weight: 800;
  border-bottom: 2px solid #f59e0b;
  padding-bottom: 8px;
  display: inline-block;
}
.rsb__style-editorial_magazine .rsb__small-card {
  border-radius: 6px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Style 3: Cinematic Overlay */
.rsb__style-cinematic_overlay .rsb__big-card {
  border-radius: 20px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
}
.rsb__style-cinematic_overlay .rsb__big-card-overlay {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.15) 0%, rgba(2, 6, 23, 0.7) 60%, rgba(2, 6, 23, 0.98) 100%);
}
.rsb__style-cinematic_overlay .rsb__small-card {
  border-radius: 16px;
  background: #090d16;
}

/* Style 4: Modern Minimal */
.rsb__style-modern_minimal {
  padding: 10px;
  background: transparent;
}
.rsb__style-modern_minimal .rsb__big-card {
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.rsb__style-modern_minimal .rsb__big-card-overlay {
  background: linear-gradient(180deg, transparent 40%, rgba(15, 23, 42, 0.8) 100%);
}
.rsb__style-modern_minimal .rsb__small-card {
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Style 5: Horizontal Stream */
.rsb__style-horizontal_stream .rsb__small-cards {
  grid-template-columns: 1fr;
}
.rsb__style-horizontal_stream .rsb__small-card-action-link {
  flex-direction: row;
}
.rsb__style-horizontal_stream .rsb__small-card-media {
  width: 40%;
  height: 100%;
}
.rsb__style-horizontal_stream .rsb__small-card-body {
  width: 60%;
}

/* Style 6: Mosaic Grid */
.rsb__style-mosaic_grid .rsb__grid {
  grid-template-columns: 1.1fr 1fr;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1024px) {
  .rsb__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .rsb__wrapper.rsb__layout--reverse .rsb__grid {
    grid-template-columns: 1fr;
  }
  .rsb__big-card-col {
    height: auto;
  }
  .rsb__big-card {
    height: 380px;
    min-height: 380px;
    flex: none;
  }
}

@media (max-width: 640px) {
  .rsb__big-card {
    height: 280px;
    min-height: 280px;
    flex: none;
  }
  .rsb__big-card-title {
    font-size: 17px;
  }
  .rsb__big-card-content {
    padding: 16px;
  }
  .rsb__small-cards {
    grid-template-columns: 1fr;
  }
  .rsb__small-card {
    height: 120px;
  }
  .rsb__small-card-action-link {
    flex-direction: row;
  }
  .rsb__small-card-media {
    width: 36%;
    height: 100%;
  }
  .rsb__small-card-body {
    width: 64%;
    padding: 10px;
  }
  .rsb__dots--vertical-right,
  .rsb__dots--vertical-left {
    display: none; /* Fallback to clean view on narrow mobile */
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .rsb__wrapper,
  .rsb__big-card,
  .rsb__big-card-img,
  .rsb__small-card,
  .rsb__small-card-img,
  .rsb__dot-item,
  .rsb__archive-btn {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
