/* ═══════════════════════════════════════════
   BEGIN FINANCIAL SERVICES PAGE
   Requires the Wide Page template (body.page-template-page-wide).
   Reuses theme classes: .hero, .hero__inner, .hero__content, .hero__tagline,
   .hero__heading, .hero__description, .hero__actions, .btn--hero-primary,
   .container-wide, .section-header, .section-heading, .section-description
   Sections, in page order:
   Hero · Stats · Intro · Insights · Offer · Fin sections (Daily / Intraday /
   Delivery / Request) · CTA · Charts · Modals
   ═══════════════════════════════════════════ */

:root {
    --fin-muted: hsl(210 40% 96% / 0.4); /* ≈ bg-muted/40: swap for your muted token */
}

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */

/* Background photo + overlay */
.fin-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.fin-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: hsl(222 47% 11% / 0.80);
}

/* Tweaks to the reused .hero__* classes */
.fin-hero .hero__inner {
    padding-top: 96px;
    padding-bottom: 96px;
}
.fin-hero .hero__content { max-width: 1024px; }
.fin-hero .hero__tagline {
    max-width: 768px;
    margin: 0 0 20px;
    font-size: 14px;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.80);
}
.fin-hero .hero__heading {
    max-width: none;
    min-height: 0;
    margin: 0;
    line-height: 1.25;
    letter-spacing: normal;
}
.fin-hero .hero__description {
    margin: 24px 0 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.80);
}
.fin-hero .hero__actions { margin-top: 32px; }

/* ═══════════════════════════════════════════
   STATS STRIP
   ═══════════════════════════════════════════ */

.fin-stats {
    background: var(--color-bg, #fff);
    border-bottom: 1px solid var(--color-border);
}
.fin-stats__grid {
    display: grid;
    grid-template-columns: 1fr;
    max-width: var(--container-max, 1180px);
    margin-inline: auto;
    padding-inline: var(--container-px, 24px);
}
@media (min-width: 768px) {
    .fin-stats__grid { grid-template-columns: repeat(3, 1fr); }
}
.fin-stats__item {
    padding: 28px 16px;
    text-align: center;
    border-top: 1px solid var(--color-border);
}
.fin-stats__item:first-child { border-top: none; }
@media (min-width: 768px) {
    .fin-stats__item { border-top: none; }
    .fin-stats__item + .fin-stats__item { border-left: 1px solid var(--color-border); }
}
.fin-stats__value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-primary);
}
.fin-stats__label {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-fg-muted);
}

/* ═══════════════════════════════════════════
   INTRO
   ═══════════════════════════════════════════ */

.fin-intro {
    padding: 40px 0;
    background: var(--fin-muted);
}
.fin-intro__text {
    max-width: 896px;
    margin: 0 auto;
    text-align: center;
    font-size: 16px;
    line-height: 1.625;
    color: var(--color-fg-muted);
}

/* ═══════════════════════════════════════════
   INSIGHTS (Data-Driven Insights / case study)
   ═══════════════════════════════════════════ */

.insights {
    padding: 40px 0;
}
@media (min-width: 768px) {
    .insights { padding: 48px 0; }
}

.insights__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
}
@media (min-width: 1024px) {
    .insights__grid { grid-template-columns: repeat(2, 1fr); }
}

/* Case study (left) */
.insights__meta {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    margin: 0;
}
.insights__meta-date {
    margin-left: 12px;
    font-weight: 400;
    color: var(--color-fg-muted);
}
.insights__title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-fg);
    margin: 16px 0 0;
}
@media (min-width: 768px) {
    .insights__title { font-size: 30px; }
}
.insights__text {
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-fg-muted);
    margin: 20px 0 0;
}
.insights__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 32px;
    padding: 24px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.insights__stat-label {
    font-size: 12px;
    color: var(--color-fg-muted);
    margin: 0;
}
.insights__stat-value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary);
    margin: 8px 0 0;
}

/* Chart card (right). Also used by the Daily and Intraday sections. */
.insights-chart {
    min-width: 0;
    margin: 0;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    box-shadow: var(--shadow-card);
}
@media (min-width: 768px) {
    .insights-chart { padding: 28px; }
}
.insights-chart__title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--color-fg);
    margin: 0;
}
.insights-chart__subtitle {
    font-size: 14px;
    color: var(--color-fg-muted);
    margin: 4px 0 0;
}
.insights-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 20px;
    font-size: 12px;
    color: var(--color-fg-muted);
}
.insights-chart__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.insights-chart__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
}

/* ═══════════════════════════════════════════
   OFFER (What We Offer)
   ═══════════════════════════════════════════ */

.offer {
    padding: 40px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    background: var(--fin-muted);
}
@media (min-width: 768px) {
    .offer { padding: 48px 0; }
}

.offer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 768px) {
    .offer__grid { grid-template-columns: repeat(3, 1fr); }
}

.offer-card {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    padding: 28px;
    box-shadow: var(--shadow-card);
}
.offer-card__icon {
    width: 28px;
    height: 28px;
    margin-bottom: 20px;
    color: var(--color-primary);
    flex-shrink: 0;
}
.offer-card__title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--color-fg);
    margin: 0;
}

.offer-card__list {
    list-style: none;
    margin: 24px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.offer-card__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.offer-card__check {
    width: 20px;
    height: 20px;
    margin-top: 4px;
    border-radius: 50%;
    background: hsl(217 91% 55% / 0.1);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.offer-card__check svg {
    width: 12px;
    height: 12px;
}
.offer-card__text {
    line-height: 1.65;
    color: color-mix(in srgb, var(--color-fg) 85%, transparent);
}

.offer-card__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-top: auto;
    height: 36px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.offer-card__link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}
.offer-card__link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 4px;
}
.offer-card__link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   FIN SECTIONS (Daily / Intraday / Delivery / Request)
   ═══════════════════════════════════════════ */

.fin-section {
    padding: 40px 0;
    scroll-margin-top: 112px;
}
@media (min-width: 768px) {
    .fin-section { padding: 48px 0; }
}

/* Muted band with top/bottom borders (Intraday, Custom Data Request) */
.fin-section--muted {
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    background: var(--fin-muted);
}

/* Feature row: 2-up / 4-up (Daily) */
.fin-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 40px;
}
@media (min-width: 640px) {
    .fin-features { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .fin-features { grid-template-columns: repeat(4, 1fr); }
}
/* 3-up variant (Intraday) */
@media (min-width: 640px) {
    .fin-features--3 { grid-template-columns: 1fr; }
}
@media (min-width: 768px) {
    .fin-features--3 { grid-template-columns: repeat(3, 1fr); }
}
.fin-feature__icon {
    display: block;
    width: 24px;
    height: 24px;
    margin-bottom: 12px;
    color: var(--color-primary);
}
.fin-feature__title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-fg);
    margin: 0;
}
.fin-feature__text {
    font-size: 14px;
    color: var(--color-fg-muted);
    margin: 8px 0 0;
}

/* Action buttons under the charts (open the CSV preview modals) */
.fin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}
.fin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-fg);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.fin-btn:hover {
    border-color: hsl(217 91% 55% / 0.3);
    background: hsl(217 91% 55% / 0.06);
    color: var(--color-primary);
}
.fin-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
.fin-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.fin-btn--primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}
.fin-btn--primary:hover {
    background: var(--color-primary);
    color: #fff;
    opacity: 0.9;
}

/* Delivery Options */
.delivery__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}
@media (min-width: 768px) {
    .delivery__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .delivery__grid { grid-template-columns: repeat(4, 1fr); }
}
.delivery-item__icon {
    display: block;
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}
.delivery-item__title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--color-fg);
    margin: 16px 0 0;
}
.delivery-item__text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-fg-muted);
    margin: 12px 0 0;
}

/* Custom Data Request */
.request__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 768px) {
    .request__grid { grid-template-columns: repeat(3, 1fr); }
}
.request-card {
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    padding: 28px;
    box-shadow: var(--shadow-card);
}
.request-card__icon {
    display: block;
    width: 24px;
    height: 24px;
    margin-bottom: 16px;
    color: var(--color-primary);
}
.request-card__title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--color-fg);
    margin: 0;
}
.request-card__text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-fg-muted);
    margin: 12px 0 0;
}

/* ═══════════════════════════════════════════
   CTA (closing call to action)
   ═══════════════════════════════════════════ */

.fin-cta {
    padding: 40px 0;
    text-align: center;
}
@media (min-width: 768px) {
    .fin-cta { padding: 48px 0; }
}
.fin-cta__title {
    max-width: 56rem;
    margin: 0 auto;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-fg);
}
@media (min-width: 768px) {
    .fin-cta__title { font-size: 36px; }
}
.fin-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
    margin-top: 32px;
    padding: 12px 24px;
    border-radius: 6px;
    background: var(--gradient-primary, var(--color-primary)); /* swap for your gradient token */
    box-shadow: var(--shadow-glow, 0 8px 24px hsl(217 91% 55% / 0.3));
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}
.fin-cta__btn:hover { opacity: 0.9; }
.fin-cta__btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}
.fin-cta__btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   CHARTS (D3, rendered by assets/js/job-charts.js)
   ═══════════════════════════════════════════ */

/* Containers: JS reads clientWidth / clientHeight */
.fin-chart {
    position: relative;
    width: 100%;
    margin-top: 28px;
}
.fin-chart--tesla    { height: 260px; }
.fin-chart--daily    { height: 400px; }
.fin-chart--intraday { height: 350px; }
@media (min-width: 768px) {
    .fin-chart--tesla { height: 320px; }
}
.fin-chart svg { display: block; max-width: 100%; overflow: visible; }
.fin-chart__msg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 14px;
    color: var(--color-fg-muted);
}

/* Axes, grid, lines */
.fin-axis text { fill: var(--color-fg-muted); font-size: 11px; }
.fin-axis line,
.fin-axis .domain { stroke: var(--color-border); }
.fin-grid line {
    stroke: var(--color-border);
    stroke-dasharray: 3 3;
    shape-rendering: crispEdges;
}
.fin-grid .domain { display: none; }
.fin-line { fill: none; stroke-width: 1.75; }
.fin-guide { stroke: var(--color-border); stroke-width: 1; pointer-events: none; }
.fin-ref { stroke: var(--color-fg); stroke-dasharray: 4 4; }
.fin-ref__label { fill: var(--color-fg); font-size: 11px; }

/* Clickable ticker legend (Daily, Intraday) */
.fin-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}
.fin-legend + .fin-chart { margin-top: 16px; }
.fin-legend__item {
    --c: var(--color-primary);
    padding: 3px 13px;
    border-radius: 24px;
    border: 1px solid var(--c);
    background: color-mix(in srgb, var(--c) 8%, transparent);
    color: var(--c);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.fin-legend__item.is-off { opacity: 0.3; text-decoration: line-through; }
.fin-legend__item:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Shared tooltip */
.fin-tooltip {
    position: fixed;
    z-index: 10000;
    visibility: hidden;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    box-shadow: var(--shadow-card);
    font-size: 11px;
    pointer-events: none;
}
.fin-tooltip__head {
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}
.fin-tooltip__row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* ═══════════════════════════════════════════
   CSV PREVIEW MODALS
   ═══════════════════════════════════════════ */

.fin-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(0 0 0 / 0.4);
    backdrop-filter: blur(4px);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.fin-modal.is-open { visibility: visible; opacity: 1; }
.fin-modal__dialog {
    width: 90%;
    max-width: 700px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--color-card);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.fin-modal.is-open .fin-modal__dialog { transform: translateY(0); }
.fin-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.fin-modal__title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.2; color: var(--color-fg); }
.fin-modal__subtitle { margin: 4px 0 0; font-size: 11px; color: var(--color-fg-muted); }
.fin-modal__close {
    padding: 0;
    border: 0;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: var(--color-fg-muted);
    cursor: pointer;
}
.fin-modal__close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}
.fin-modal__body { padding: 20px; }
.fin-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
}
.fin-modal__table-wrap {
    max-height: 400px;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

/* Table inside the modal */
.fin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-card);
    font-size: 12px;
    text-align: left;
    color: var(--color-fg);
}
.fin-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: hsl(210 40% 98%);
    box-shadow: 0 1px 0 var(--color-border);
}
.fin-table th { padding: 12px 16px; font-weight: 600; white-space: nowrap; }
.fin-table td { padding: 10px 16px; border-bottom: 1px solid var(--color-border); white-space: nowrap; vertical-align: top; }
.fin-table tbody tr:last-child td { border-bottom: 0; }
.fin-table tbody tr:hover { background: hsl(210 40% 98%); }
.fin-table__msg { padding: 20px; text-align: center; }
.fin-table__msg.is-error { color: #dc2626; }
.fin-more {
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 12px;
    font-family: inherit;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

/* ═══════════════════════════════════════════
   END FINANCIAL SERVICES PAGE
   ═══════════════════════════════════════════ */