/* =============================================================
   Related Posts Widget — foodhitsdifferent.com
   All colors driven by CSS variables.
   Paste the :root block from the theme dashboard at the top
   of your child theme's style.css to override defaults.
   ============================================================= */

/* ----- DEFAULT PALETTE (matches foodhitsdifferent.com) ----- */
:root {
  --rc-background: #FFF5E1;
  --rc-card-bg: #ffffff;
  --rc-accent: #E8532A;
  --rc-text: #1A1A1A;
  --rc-muted: #7A6A58;
  --rc-border: #EAD9C0;
  --rc-tag-bg: #FDECD9;
  --rc-tag-text: #C4460F;
  --rc-radius: 12px;
  --rc-title-size: 15px;
  --rc-display: grid;
}

/* ----- SHARED BASE ----- */
.rc-widget {
  margin: 3rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rc-border);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.rc-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.rc-widget-title {
  font-size: var(--rc-title-size);
  font-weight: 600;
  color: var(--rc-text);
  margin: 0;
  letter-spacing: -.01em;
}

/* ----- TYPE TAGS ----- */
.rc-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 5px;
  background: var(--rc-tag-bg);
  color: var(--rc-tag-text);
}

/* all post types share the same tag style — no dark-mode variants */
.rc-tag--post,
.rc-tag--recipe { background: var(--rc-tag-bg); color: var(--rc-tag-text); }

/* ----- CARD (scroll + grid) ----- */
.rc-card {
  border-radius: var(--rc-radius);
  border: 1px solid var(--rc-border);
  background: var(--rc-card-bg);
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}

.rc-card:hover { border-color: var(--rc-accent); transform: translateY(-2px); }

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

.rc-card-thumb {
  width: 100%;
  height: 110px;
  background: var(--rc-background);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rc-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rc-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rc-tag-text);
  opacity: .55;
}

.rc-card-body { padding: 10px 12px 13px; }

.rc-card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--rc-text);
  line-height: 1.45;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rc-card-meta { font-size: 10px; color: var(--rc-muted); }

/* ============================================================
   STYLE 1 — HORIZONTAL SCROLL
   ============================================================ */
.rc-widget--scroll .rc-scroll-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.rc-widget--scroll .rc-scroll-track::-webkit-scrollbar { display: none; }

.rc-widget--scroll .rc-card {
  flex: 0 0 185px;
  scroll-snap-align: start;
}

/* ============================================================
   STYLE 2 — CARD GRID
   ============================================================ */
.rc-widget--grid .rc-grid-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

/* ============================================================
   STYLE 3 — INLINE LIST
   ============================================================ */
.rc-inline-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--rc-muted);
  margin: 0 0 .75rem;
}

.rc-inline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rc-inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--rc-text);
  font-size: 13px;
  transition: background .12s;
}

.rc-inline-row:hover { background: var(--rc-tag-bg); }

.rc-inline-text { flex: 1; line-height: 1.35; }

.rc-inline-arrow {
  flex-shrink: 0;
  color: var(--rc-muted);
  transition: transform .15s, color .15s;
}

.rc-inline-row:hover .rc-inline-arrow { transform: translateX(3px); color: var(--rc-accent); }

/* body-text inline links */
.rc-inline-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rc-border);
  text-underline-offset: 2px;
  transition: text-decoration-color .15s;
}

.rc-inline-link:hover { text-decoration-color: var(--rc-accent); }

/* ============================================================
   STYLE 4 — BANNER LIST
   ============================================================ */
.rc-banner-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rc-banner-item {
  border-radius: var(--rc-radius);
  border: 1px solid var(--rc-border);
  background: var(--rc-card-bg);
  overflow: hidden;
  transition: border-color .15s;
}

.rc-banner-item:hover { border-color: var(--rc-accent); }

.rc-banner-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.rc-banner-thumb {
  flex: 0 0 80px;
  height: 74px;
  background: var(--rc-background);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rc-tag-text);
  opacity: .75;
}

.rc-banner-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rc-banner-body { flex: 1; padding: 10px 12px; min-width: 0; }

.rc-banner-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--rc-text);
  margin: 2px 0 3px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-banner-meta { font-size: 10px; color: var(--rc-muted); }

.rc-banner-arrow {
  flex-shrink: 0;
  margin: 0 14px;
  color: var(--rc-border);
  transition: transform .15s, color .15s;
}

.rc-banner-item:hover .rc-banner-arrow { transform: translateX(3px); color: var(--rc-accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .rc-widget--scroll .rc-card { flex: 0 0 160px; }
  .rc-card-thumb { height: 95px; }
  .rc-widget--grid .rc-grid-track { grid-template-columns: repeat(2, 1fr); }
  .rc-banner-title { white-space: normal; }
}
