/* Index (landing) page minimal enhancements */
:root {
  --rr-primary: #0d6efd;
  --rr-secondary: #6c757d;
  --rr-text: #212529;
  --rr-muted: #6c757d;
  --rr-surface: #ffffff;
  --rr-border: rgba(0,0,0,0.08);
  --rr-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --rr-maxw: 1140px;
}

/* Fluid type for hero */
.hero-section .hero-text h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
}
.hero-section .hero-text p {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.hero-section .hero-actions {
  margin-top: 1rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn-rr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  min-height: 44px; /* touch target */
  min-width: 44px;
  border-radius: .5rem;
  text-decoration: none;
  font-weight: 600;
  transition: transform .12s ease-out, box-shadow .12s ease-out, background-color .12s ease-out;
  will-change: transform;
}
.btn-rr:focus { outline: 2px solid rgba(13,110,253,.35); outline-offset: 2px; }
.btn-rr:hover { transform: translateY(-1px); box-shadow: var(--rr-shadow); }
.btn-rr:active { transform: translateY(0); box-shadow: none; }

.btn-primary { background: var(--rr-primary); color: #fff; }
.btn-primary:hover { background: #0b5ed7; }

.btn-secondary { background: #f1f3f5; color: var(--rr-text); border: 1px solid var(--rr-border); }
.btn-secondary:hover { background: #e9ecef; }

/* Hero (landing) */
.hero-section {
  position: relative;
  color: #fff;
}
.hero-section .btn-rr {
  border-radius: 1rem;
  padding: 0.6rem 1.25rem;
}
.hero-section .btn-rr:hover {
  box-shadow: 0 6px 14px rgba(13,110,253,0.18);
}

/* Widget accordion (mobile-first) */
.widget-accordion {
  border: 1px solid var(--rr-border);
  border-radius: .75rem;
  background: #fff;
  box-shadow: var(--rr-shadow);
  overflow: clip;
}
.tickers-container .row.mt-4 { margin-top: 0 !important; }
/* Visually attach accordion body to the section header above */
.widget-accordion {
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.widget-accordion > summary,
.widget-accordion > summary .wa-title,
.widget-accordion > summary .wa-toggle {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.widget-accordion summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: .875rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.widget-accordion summary::-webkit-details-marker { display: none; }
.widget-accordion .wa-title {
  font-weight: 700;
  font-size: 1rem;
}
.widget-accordion .wa-toggle {
  width: 1.25rem; height: 1.25rem;
  border-radius: 999px;
  border: 2px solid var(--rr-border);
  position: relative;
}
.widget-accordion[open] .wa-toggle { border-color: var(--rr-primary); }

.widget-accordion .widget-container { padding: .75rem 1rem 1rem; }

/* Desktop: keep accordion open look-and-feel */
@media (min-width: 768px) {
  .widget-accordion summary { padding: 1rem 1.25rem; }
  .widget-accordion .widget-container { padding: 1rem 1.25rem 1.25rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Pillar cards */
.pillar-cards { margin-top: .25rem; }
.pillar-card {
  display: block;
  height: 100%;
  border: 1px solid var(--rr-border);
  border-radius: .75rem;
  background: var(--rr-surface);
  padding: .875rem;
  text-decoration: none;
  color: var(--rr-text);
  box-shadow: var(--rr-shadow);
  transition: transform .12s ease-out, box-shadow .12s ease-out, border-color .12s ease-out;
}
.pillar-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.pillar-card:focus { outline: 2px solid rgba(13,110,253,.35); outline-offset: 2px; }
.pillar-card .pc-icon { font-size: 1.5rem; line-height: 1; margin-bottom: .5rem; }
.pillar-card .pc-title { font-weight: 700; font-size: 1rem; margin-bottom: .25rem; }
.pillar-card .pc-sub { font-size: .9rem; color: var(--rr-muted); }

/* Skeleton cards for gallery */
.skeleton-card {
  border-radius: .75rem;
  height: 180px;
  background: linear-gradient(90deg, #e9ecef 25%, #f1f3f5 37%, #e9ecef 63%);
  background-size: 400% 100%;
  animation: rr-shimmer 1.2s ease-in-out infinite;
}
@keyframes rr-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (min-width: 768px) {
  .skeleton-card { height: 220px; }
}

/* Section headers and spacing */
.section-block { max-width: var(--rr-maxw); }
.section-header { margin: 2rem auto 0.5rem; }
.section-header .section-title {
  font-weight: 800;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  margin: 0;
}
.section-header .header-toggle {
  margin-left: .5rem;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--rr-border);
  color: #0d6efd;
  cursor: pointer;
  vertical-align: middle;
}
.section-header .header-toggle:hover { box-shadow: 0 4px 12px rgba(13,110,253,0.12); }
.section-header .header-toggle:focus-visible { outline: 2px solid rgba(13,110,253,.35); outline-offset: 2px; }
.section-header .header-toggle .icon { display: none; }
.section-header .header-toggle[aria-expanded="false"] .icon-collapsed { display: block; }
.section-header .header-toggle[aria-expanded="true"] .icon-expanded { display: block; }
.section-header .section-title .section-link { color: inherit; text-decoration: none; }
.section-header .section-title .section-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.section-header .section-title .section-link:focus-visible { outline: 2px solid rgba(13,110,253,.35); outline-offset: 2px; border-radius: 4px; }
.section-header .section-subtitle {
  color: var(--rr-muted);
  margin: .25rem 0 0;
  font-size: .95rem;
}

/* Accessibility helpers */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.visually-hidden.focusable:active, .visually-hidden.focusable:focus { position: static !important; width: auto !important; height: auto !important; margin: 0 !important; overflow: visible !important; clip: auto !important; white-space: normal !important; }

/* Layout stability: reserve height for widgets */
.tradingview-widget-container { min-height: 64px; }
.news-ticker-wrapper .widget-container { min-height: 220px; }

/* Anchor comfort: avoid header overlap on scroll */
#media-gallery { scroll-margin-top: 72px; }
#robots { scroll-margin-top: 72px; }

/* Robots cards: reserve height to reduce initial shift */
#robots-carousel-cards { min-height: 220px; }
#robots-accordion .widget-container { min-height: 220px; }
#media-accordion .widget-container { min-height: 220px; }

/* Footer readability */
footer.footer { font-size: .95rem; }
footer.footer a { color: var(--rr-primary); text-decoration: none; }
footer.footer a:hover { text-decoration: underline; text-underline-offset: 2px; }
footer.footer a:focus-visible { outline: 2px solid rgba(13,110,253,.35); outline-offset: 2px; border-radius: 4px; }
footer.footer .text-muted { color: #495057 !important; }

/* Section spacing rhythm */
.section-block + .tickers-container { margin-top: .5rem; }

/* Mobile: keep hero CTA buttons on one line */
@media (max-width: 575.98px) {
  .hero-section .btn-rr {
    white-space: nowrap;           /* prevent text wrapping inside buttons */
    font-size: 0.95rem;            /* slightly smaller text on mobile */
    padding: 0.5rem 0.875rem;      /* reduce padding to help fit on one line */
    max-width: 100%;               /* ensure it doesn't exceed container */
    overflow: hidden;              /* guard against overflow */
    text-overflow: ellipsis;       /* ellipsis if label is extremely long */
  }
  .hero-section .hero-actions { gap: 0.5rem; }
}
