/* ==========================================================================
   RCNH Financial - top bar + metal price ticker (v6.3)
   Hand-written (not Tailwind), loaded on every page after css/styles.css.
   The top bar keeps all 4 items on ONE row at every screen size:
     "Established 1990" text | scrolling spot-price ticker | phone | email
   On phones the phone/email links show their icons only (still tappable).
   Ticker script: js/ticker.js
   Also holds the other hand-written additions: contact character count (v6.3/6.4)
   and the brighter home hero photo (v6.4) - see the end of this file.
   ========================================================================== */
.topbar { padding: .5rem .75rem; }
.topbar-inner {
  display: flex; flex-wrap: nowrap; align-items: center;
  gap: .75rem; min-width: 0;
}

/* 1. "Rare Coins of New Hampshire - Established 1990" (short "Est. 1990" on smaller screens) */
.topbar-est {
  display: inline-flex; align-items: center; gap: .375rem;
  flex: 0 0 auto; white-space: nowrap; font-size: 12px; line-height: 1;
}
.topbar-est-full { display: none; }

/* 2. Ticker: fills the space between the text and the phone/email links */
.metal-ticker {
  position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 1.25rem, #000 calc(100% - 1.25rem), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 1.25rem, #000 calc(100% - 1.25rem), transparent 100%);
}
.metal-ticker-track {
  display: inline-flex; flex-wrap: nowrap; white-space: nowrap; will-change: transform;
}
.metal-ticker.is-moving .metal-ticker-track {
  animation: metal-ticker-scroll var(--ticker-duration, 40s) linear infinite;
}
.metal-ticker:hover .metal-ticker-track,
.metal-ticker:focus-within .metal-ticker-track { animation-play-state: paused; }
@keyframes metal-ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.metal-ticker-group { display: inline-flex; align-items: center; flex: 0 0 auto; }
.metal-ticker-msg { padding: 0 1.25rem; color: #94a3b8; }
.mt-item { display: inline-flex; align-items: baseline; gap: .4rem; padding: 0 1.1rem; }
.mt-item + .mt-item::before,
.mt-note::before {
  content: ""; display: inline-block; width: 4px; height: 4px; margin-right: 1.1rem;
  transform: translateY(-2px) rotate(45deg); background: rgba(201, 157, 49, .6);
}
.mt-name { color: #D8B65D; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.mt-price { color: #e2e8f0; font-weight: 600; font-variant-numeric: tabular-nums; }
.mt-chg { font-size: 11px; font-variant-numeric: tabular-nums; color: #94a3b8; }
.mt-chg.is-up { color: #4ade80; }
.mt-chg.is-down { color: #f87171; }
.mt-note { display: inline-flex; align-items: baseline; padding: 0 1.1rem 0 0; color: #64748b; font-size: 11px; letter-spacing: .04em; }

/* 3 + 4. Phone and email */
.topbar-contact { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; }
.topbar-link {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  white-space: nowrap; min-width: 2rem; min-height: 2rem; padding: 0 .25rem; border-radius: .5rem;
}
.topbar-label { display: none; }

@media (min-width: 640px) {
  .topbar { padding: .5rem 1rem; }
  .topbar-inner { gap: 1rem; }
  .topbar-est { font-size: 13px; }
  .topbar-contact { gap: 1rem; }
  .topbar-link { min-width: 0; min-height: 0; padding: 0; }
  .topbar-label--phone { display: inline; }
}
@media (min-width: 768px) {
  .topbar-label--email { display: inline; }
}
@media (min-width: 1280px) {
  .topbar-inner { gap: 1.5rem; }
  .topbar-contact { gap: 1.5rem; }
  .topbar-est-full { display: inline; }
  .topbar-est-short { display: none; }
}

/* Visitors who ask for less motion: no scrolling, the prices can be swiped/scrolled by hand */
@media (prefers-reduced-motion: reduce) {
  .metal-ticker { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: none; mask-image: none; }
  .metal-ticker::-webkit-scrollbar { display: none; }
  .metal-ticker .metal-ticker-track { animation: none !important; transform: none !important; }
  .metal-ticker-group[aria-hidden="true"] { display: none; }
}

/* Contact page: character counter under the Question/Comment box.
   v6.4: larger and darker so it is easy to see on the cream form (it was 12px light grey). */
#cf-comment-count.char-count {
  display: block; visibility: visible; opacity: 1;
  margin: .5rem 0 0; text-align: right;
  font-size: 14px; line-height: 1.3; font-weight: 600; letter-spacing: .02em;
  color: #846019; font-variant-numeric: tabular-nums;
}
#cf-comment-count.char-count.is-near { color: #A97E21; }
#cf-comment-count.char-count.is-full { color: #B91C1C; }

/* v6.4 Home hero: Egyptian gold mask at full strength with a lighter dark shade
   (was opacity 80% under a 60% / 50% / 90% shade). Text keeps its soft shadow. */
.hero-mask-bright { opacity: 1; }
.hero-mask-shade {
  background-image: linear-gradient(to right, rgba(7,7,9,.40) 0%, rgba(7,7,9,.30) 50%, rgba(7,7,9,.80) 100%);
}
@media (min-width: 1024px) {
  .hero-mask-shade {
    background-image: linear-gradient(to right, rgba(7,7,9,.35) 0%, rgba(7,7,9,.25) 50%, #070709 100%);
  }
}

/* v6.7 Home: smooth blend from the autumn trees photo band into the gold coins
   "A Well Diversified Investment Strategy" section (#services).
   - The coins section is pulled up under the band by --photo-blend (overlap) and gets the
     same amount of extra top padding, so its text stays exactly where it was.
   - The band (photo + its shade) fades to transparent over its lower part, so the trees
     cross-fade into the coins photo instead of ending in a black strip and a hard edge.
   - The band's shade now ends at the same 45% dark tone as the coins section's shade.
   The coins photo itself is unchanged (opacity 75% + even 45% shade). */
:root { --photo-blend: clamp(5rem, 11vw, 10rem); }
.photo-blend-band {
  position: relative; z-index: 2;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - var(--photo-blend) * 1.25), rgba(0,0,0,.55) calc(100% - var(--photo-blend) * .55), transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - var(--photo-blend) * 1.25), rgba(0,0,0,.55) calc(100% - var(--photo-blend) * .55), transparent 100%);
}
.photo-blend-shade {
  background-image: linear-gradient(to top, rgba(7,7,9,.45) 0%, rgba(7,7,9,.25) 45%, rgba(7,7,9,.10) 100%);
}
#services.photo-blend-under {
  margin-top: calc(var(--photo-blend) * -1);
  padding-top: calc(6rem + var(--photo-blend));
}
