/* ==========================================================================
   RiseUp7 Market Data — institutional dashboard styling
   Bloomberg / Reuters inspired, dark finance theme, responsive, mobile-first.
   ========================================================================== */

:root {
    --r7-bg:           #0b0f17;
    --r7-bg-elev:      #11172257;
    --r7-bg-card:      #0f1623;
    --r7-border:       #1f2a3a;
    --r7-text:         #e6edf7;
    --r7-muted:        #8a97ad;
    --r7-accent:       #f5b301;   /* gold tone, RiseUp7 institutional accent */
    --r7-accent-2:     #3fa7ff;
    --r7-up:           #2ecc71;
    --r7-down:         #ff4d5a;
    --r7-flat:         #8a97ad;
    --r7-radius:       10px;
    --r7-shadow:       0 10px 30px rgba(0,0,0,.35);
    --r7-font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Arabic", sans-serif;
}

.riseup7-md {
    color: var(--r7-text);
    background: var(--r7-bg);
    font-family: var(--r7-font);
    font-size: 16px;
    line-height: 1.55;
    padding: 2rem 1rem;
    border-radius: var(--r7-radius);
    box-shadow: var(--r7-shadow);
    --r7-max: 1200px;
}

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

.riseup7-md a { color: var(--r7-accent-2); text-decoration: none; }
.riseup7-md a:hover { text-decoration: underline; }

.riseup7-md h1,
.riseup7-md h2,
.riseup7-md h3 {
    color: #fff;
    letter-spacing: -0.01em;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 .5rem;
}

.riseup7-md__hero {
    max-width: var(--r7-max);
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #0f1623 0%, #121c2d 100%);
    border: 1px solid var(--r7-border);
    border-radius: var(--r7-radius);
}

.riseup7-md__eyebrow {
    margin: 0 0 .5rem;
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--r7-accent);
}

#riseup7-md-h1 {
    font-size: clamp(1.6rem, 2.6vw + 1rem, 2.6rem);
    margin-bottom: .75rem;
}

.riseup7-md__lede {
    max-width: 75ch;
    color: #cfd7e6;
    font-size: 1.02rem;
}

.riseup7-md__breadcrumbs {
    margin-top: 1rem;
    font-size: .85rem;
    color: var(--r7-muted);
}
.riseup7-md__breadcrumbs a { color: var(--r7-muted); }
.riseup7-md__breadcrumbs span { margin: 0 .4rem; }
.riseup7-md__breadcrumbs [aria-current="page"] { color: #fff; }

.riseup7-md__section {
    max-width: var(--r7-max);
    margin: 0 auto 2rem;
    padding: 1.25rem;
    background: var(--r7-bg-card);
    border: 1px solid var(--r7-border);
    border-radius: var(--r7-radius);
}

.riseup7-md__section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--r7-border);
}

.riseup7-md__section-head h2 {
    font-size: clamp(1.15rem, 1.2vw + .8rem, 1.5rem);
}

.riseup7-md__muted { color: var(--r7-muted); margin: 0; font-size: .9rem; }
.riseup7-md__section-note { color: var(--r7-muted); font-size: .85rem; margin: 1rem 0 0; }

.riseup7-md__dot {
    display: inline-block;
    width: .55rem; height: .55rem;
    background: var(--r7-up);
    border-radius: 50%;
    margin-right: .4rem;
    box-shadow: 0 0 0 0 rgba(46, 204, 113, .5);
    animation: riseup7-pulse 2s infinite;
    vertical-align: baseline;
}

@keyframes riseup7-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(46, 204, 113, .45); }
    70%  { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* --------- Metals cards --------- */
.riseup7-md__metals-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.riseup7-md__metals-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.riseup7-md__card {
    background: linear-gradient(180deg, #121b2c 0%, #0d1422 100%);
    border: 1px solid var(--r7-border);
    border-radius: var(--r7-radius);
    padding: 1rem;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.riseup7-md__card:hover {
    transform: translateY(-2px);
    border-color: #2a3a54;
    box-shadow: 0 6px 24px rgba(0,0,0,.35);
}

.riseup7-md__card-head {
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: .5rem;
}

.riseup7-md__badge {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 28px; height: 28px;
    background: #1b2638;
    color: var(--r7-accent);
    font-weight: 700;
    font-size: .75rem;
    border-radius: 50%;
    border: 1px solid #2a3a54;
}

.riseup7-md__card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.riseup7-md__price {
    margin: .25rem 0 .35rem;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.riseup7-md__price-currency {
    font-size: .8rem;
    color: var(--r7-muted);
    margin-left: .35rem;
    font-weight: 500;
}

.riseup7-md__change {
    margin: 0 0 .25rem;
    font-size: .95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.riseup7-md__trend-up    .riseup7-md__change { color: var(--r7-up); }
.riseup7-md__trend-down  .riseup7-md__change { color: var(--r7-down); }
.riseup7-md__trend-flat  .riseup7-md__change { color: var(--r7-flat); }
.riseup7-md__trend-up    { border-left: 3px solid var(--r7-up); }
.riseup7-md__trend-down  { border-left: 3px solid var(--r7-down); }
.riseup7-md__trend-flat  { border-left: 3px solid var(--r7-flat); }

.riseup7-md__arrow { margin-right: .25rem; font-size: .8em; }

.riseup7-md__meta {
    margin: .5rem 0 0;
    font-size: .78rem;
    color: var(--r7-muted);
}
.riseup7-md__meta-label { margin-right: .3rem; }

/* --------- Companies table --------- */
.riseup7-md__table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .75rem;
}

.riseup7-md__search input {
    width: 100%;
    min-width: 260px;
    background: #0b1220;
    color: var(--r7-text);
    border: 1px solid var(--r7-border);
    border-radius: 8px;
    padding: .55rem .75rem;
    font-size: .92rem;
}
.riseup7-md__search input:focus {
    outline: none;
    border-color: var(--r7-accent);
    box-shadow: 0 0 0 3px rgba(245,179,1,.15);
}

.riseup7-md__page-size {
    color: var(--r7-muted);
    font-size: .88rem;
}
.riseup7-md__page-size select {
    background: #0b1220;
    color: var(--r7-text);
    border: 1px solid var(--r7-border);
    border-radius: 6px;
    padding: .35rem .5rem;
    margin-left: .35rem;
}

.riseup7-md__table-wrap {
    overflow-x: auto;
    border: 1px solid var(--r7-border);
    border-radius: 8px;
    background: #0a1120;
}

.riseup7-md__table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    min-width: 640px;
}
.riseup7-md__table th,
.riseup7-md__table td {
    padding: .6rem .75rem;
    text-align: start;
    border-bottom: 1px solid var(--r7-border);
    vertical-align: top;
    font-variant-numeric: tabular-nums;
}
.riseup7-md__table thead th {
    background: #101a2c;
    color: #dce5f3;
    font-weight: 600;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .06em;
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 1;
}
.riseup7-md__table thead th[aria-sort="ascending"]::after  { content: " ▲"; color: var(--r7-accent); }
.riseup7-md__table thead th[aria-sort="descending"]::after { content: " ▼"; color: var(--r7-accent); }
.riseup7-md__table tbody tr:hover { background: #10192a; }
.riseup7-md__empty { color: var(--r7-muted); text-align: center; padding: 2rem 1rem; }

.riseup7-md__pager {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    padding: 1rem 0 0;
}
.riseup7-md__pager button {
    background: #11192a;
    color: var(--r7-text);
    border: 1px solid var(--r7-border);
    border-radius: 6px;
    padding: .35rem .7rem;
    font-size: .85rem;
    cursor: pointer;
}
.riseup7-md__pager button[aria-current="page"] {
    background: var(--r7-accent);
    color: #111;
    border-color: var(--r7-accent);
    font-weight: 700;
}
.riseup7-md__pager button:disabled { opacity: .4; cursor: not-allowed; }

/* --------- Insights --------- */
.riseup7-md__insights-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 1rem;
}
.riseup7-md__insight {
    background: #0d1524;
    border: 1px solid var(--r7-border);
    border-radius: 10px;
    padding: 1rem;
}
.riseup7-md__insight h3 { font-size: 1.05rem; color: var(--r7-accent); margin-bottom: .4rem; }

/* --------- FAQ --------- */
.riseup7-md__faq-item {
    border: 1px solid var(--r7-border);
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-top: .75rem;
    background: #0d1524;
}
.riseup7-md__faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: #fff;
}
.riseup7-md__faq-item[open] { border-color: var(--r7-accent-2); }
.riseup7-md__faq-item p { margin: .5rem 0 0; color: #cfd7e6; }

/* --------- Internal links --------- */
.riseup7-md__internal-links {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}
.riseup7-md__internal-links a {
    display: block;
    background: #0d1524;
    border: 1px solid var(--r7-border);
    border-radius: 8px;
    padding: .75rem 1rem;
    color: #cfd7e6;
}
.riseup7-md__internal-links a:hover { border-color: var(--r7-accent); color: #fff; }

/* --------- Footer --------- */
.riseup7-md__footer {
    max-width: var(--r7-max);
    margin: 1rem auto 0;
    color: var(--r7-muted);
    font-size: .82rem;
    text-align: center;
}

/* ===================== HOME PREVIEW (compact) ============================ */
.riseup7-md--preview {
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #0b0f17 0%, #0f1a2d 100%);
}
.riseup7-md__preview-inner {
    max-width: 1100px;
    margin: 0 auto;
}
.riseup7-md__preview-head { text-align: center; margin-bottom: 1rem; }
.riseup7-md__preview-head h2 { font-size: clamp(1.3rem, 1.4vw + 1rem, 1.9rem); }
.riseup7-md__preview-lede { color: #cfd7e6; max-width: 70ch; margin: .5rem auto 0; }

.riseup7-md__preview-companies {
    margin-top: 1rem;
    padding: .85rem 1rem;
    background: #0d1524;
    border: 1px solid var(--r7-border);
    border-radius: 10px;
    color: #cfd7e6;
}
.riseup7-md__preview-companies-head { font-weight: 600; color: #fff; margin-bottom: .25rem; }

.riseup7-md__cta-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.25rem;
}
.riseup7-md__cta {
    display: inline-block;
    background: var(--r7-accent);
    color: #141414;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .8rem 1.4rem;
    border-radius: 999px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.riseup7-md__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(245,179,1,.25);
    text-decoration: none;
}
.riseup7-md__cta-note { color: var(--r7-muted); font-size: .82rem; }

/* ===================== Responsive ======================================== */
@media (max-width: 640px) {
    .riseup7-md { padding: 1rem .5rem; }
    .riseup7-md__section { padding: .9rem; }
    .riseup7-md__price { font-size: 1.3rem; }
}

/* RTL / Arabic: the companies table uses dir="auto" so rows self-align. */

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .riseup7-md__dot { animation: none; }
    .riseup7-md__card { transition: none; }
}
