/* Homepage refinements. Loaded after the shared design and converter styles. */
.home-redesign .main-site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
}

.main-site-header .home-language-switcher {
  display: block;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.home-language-switcher details { position: relative; }

.home-language-switcher summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--cbc-line-strong);
  border-radius: var(--cbc-radius-sm);
  background: var(--cbc-surface);
  color: var(--cbc-ink);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.home-language-switcher summary::-webkit-details-marker { display: none; }
.home-language-switcher summary::after { content: "⌄"; }

.home-language-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 168px;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--cbc-line);
  border-radius: var(--cbc-radius-sm);
  background: var(--cbc-surface);
  box-shadow: var(--cbc-shadow-md);
}

.main-site-header .home-language-options a {
  display: flex;
  min-height: 44px;
  justify-content: flex-start;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.home-language-switcher summary:hover,
.home-language-switcher details[open] summary { border-color: var(--cbc-brand); }

.home-language-switcher summary:focus-visible,
.home-money-about summary:focus-visible {
  outline: 3px solid var(--cbc-focus);
  outline-offset: 3px;
}

.home-redesign .cash-route-bar {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 32px;
  padding: 28px 30px;
}

.home-redesign .cash-route-copy h1 {
  max-width: none;
  font-size: clamp(2.25rem, 3.5vw, 3rem);
  line-height: 1.04;
  text-wrap: balance;
}

.home-redesign .cash-route-copy .home-brand-claim { margin-bottom: 8px; }
.home-redesign .cash-route-copy > p:last-child { max-width: 42ch; line-height: 1.5; }

.home-redesign .cash-route-controls {
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  gap: 10px;
}

.home-redesign .cash-route-controls .bill-swap-button { width: 48px; min-width: 48px; }
.home-redesign .cash-route-field > span { min-height: 2.4em; line-height: 1.2; }
.home-redesign .home-notes-board { padding: 24px 30px; }
.home-redesign .cash-board-heading { align-items: start; gap: 16px; padding: 0; }
.home-redesign .cash-board-title { gap: 10px; }
.home-redesign .cash-board-title h2 { font-size: 2rem; }
.home-redesign .cash-board-actions { display: grid; justify-items: end; gap: 8px; }

.home-money-modes {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--cbc-line-strong);
  border-radius: var(--cbc-radius-sm);
  background: var(--cbc-surface-soft, #f1f3ee);
}

.home-money-modes button {
  min-height: 40px;
  padding: 8px 18px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--cbc-brand);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.home-money-modes button:hover { background: #dfeae4; }
.home-money-modes button[aria-pressed="true"] { background: var(--cbc-brand); color: #fff; }
.home-money-modes button:active { transform: scale(0.97); }
.home-money-modes button:disabled { opacity: 0.6; cursor: wait; }
.home-money-modes button[hidden] { display: none; }

.home-converter-link,
.home-all-guides {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  color: var(--cbc-brand);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.home-converter-link:hover,
.home-all-guides:hover { color: var(--cbc-ink); text-decoration-thickness: 2px; }

.home-redesign .money-rate-reference { gap: 5px 8px; max-width: 680px; }
.home-redesign .money-rate-label { color: var(--cbc-brand); font-size: 0.72rem; }
.home-redesign .money-rate-value { font-size: 0.88rem; }
.home-redesign .money-rate-refresh { width: 36px; height: 36px; }
.home-redesign .money-rate-reference small { flex-basis: 100%; font-size: 0.78rem; line-height: 1.45; color: #535e59; }
.home-redesign .money-rate-reference small::before { content: none; }
.home-redesign .money-rate-reference[data-rate-state="sample"] .money-rate-label { color: #82411f; }
.home-rate-details { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.78rem; color: #535e59; }
.home-rate-details[hidden] { display: none; }
.home-rate-details a { color: var(--cbc-brand); text-underline-offset: 3px; }
.home-redesign .home-notes-board .notes-grid { margin-top: 18px; }

.home-redesign .cash-board-footer { align-items: start; gap: 16px; }
.home-money-about { flex: 1; min-width: 0; }
.home-money-about summary { min-height: 44px; padding: 10px 0; color: var(--cbc-brand); font-size: 0.88rem; font-weight: 650; cursor: pointer; }
.home-money-about summary:hover { color: var(--cbc-ink); }
.home-redesign .home-money-about p { margin: 10px 0; max-width: 78ch; font-size: 0.9rem; line-height: 1.6; }
.home-redesign .cash-board-footer > span { padding-top: 13px; font-size: 0.78rem; }

#billCalculator { scroll-margin-top: 24px; transition: none; padding: 28px 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; align-content: start; gap: 16px 40px; }
#billCalculator:not(.is-active) { min-height: 0; padding: 28px 32px; grid-template-rows: auto auto; }
#billCalculator .exact-converter-heading { max-width: none; }
#billCalculator .exact-converter-heading h2 { max-width: none; font-size: clamp(1.85rem, 2.3vw, 2.2rem); line-height: 1.08; }
#billCalculator .counter-console { width: 100%; margin-top: 0; gap: 10px; }
#billCalculator:not(.is-active) .bill-result { display: none; }
#billCalculator:not(.is-active) .cash-wallet-stage { display: none; }
#billCalculator .home-converter-empty { grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-self: center; max-width: 34ch; padding: 24px; border-left: 1px solid #477f7d; }
#billCalculator .home-converter-empty strong { display: block; font-size: 1.15rem; line-height: 1.3; }
#billCalculator .home-converter-empty p { margin: 8px 0 0; font-size: 0.92rem; line-height: 1.5; }
#billCalculator.is-active .home-converter-empty { display: none; }

.home-amount-examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.home-amount-examples > span { font-size: 0.82rem; margin-right: 2px; }
.home-amount-examples button { min-width: 44px; min-height: 40px; padding: 6px 12px; border: 1px solid #315e5c; border-radius: 4px; background: #edf4ef; color: #173d3b; font: inherit; font-size: 0.88rem; font-weight: 700; cursor: pointer; }
.home-amount-examples button:hover { background: #fff; }
.home-amount-examples button:active { transform: scale(0.97); }
.home-amount-examples button:disabled { opacity: 0.6; cursor: wait; }
#billCalculator .calculator-input-rate { font-size: 0.8rem; line-height: 1.5; }
.home-guide-links { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.home-guide-links .destination-spotlight-link { margin-top: 0; }

.home-redesign .home-cheat-sheet-cta {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  margin: 18px 30px 0;
  padding: 16px 20px;
  border: 1px solid #b6c4ad;
  border-radius: 6px;
  background: #f2edcf;
  color: #173d3b;
  text-decoration: none;
  transition: background-color 150ms ease, transform 150ms cubic-bezier(0.23, 1, 0.32, 1);
}
.home-cheat-sheet-icon { display: block; width: 32px; height: 40px; }
.home-cheat-sheet-copy { display: grid; gap: 4px; min-width: 0; }
.home-cheat-sheet-copy strong { font-size: 1.06rem; line-height: 1.3; }
.home-cheat-sheet-copy small { font-size: 0.83rem; line-height: 1.4; }
.home-cheat-sheet-arrow { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 4px; background: #173d3b; color: #fff; font-size: 1.4rem; }
.home-redesign .home-cheat-sheet-cta:focus-visible { outline: 3px solid var(--cbc-focus); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .home-redesign .home-cheat-sheet-cta:hover { background: #e8dfb4; }
}
@media (prefers-reduced-motion: no-preference) {
  .home-redesign .home-cheat-sheet-cta:active { transform: scale(0.99); }
}
@media (max-width: 600px) {
  .home-redesign .home-cheat-sheet-cta { margin: 14px 16px 0; padding: 14px 12px; gap: 12px; grid-template-columns: 26px minmax(0, 1fr) 32px; }
  .home-cheat-sheet-icon { width: 26px; height: 34px; }
  .home-cheat-sheet-arrow { width: 32px; height: 32px; }
  .home-cheat-sheet-copy strong { font-size: 0.98rem; }
  .home-cheat-sheet-copy small { font-size: 0.76rem; }
}
@media (prefers-reduced-motion: reduce) {
  .home-redesign .home-cheat-sheet-cta { transition: none; }
}

@media (min-width: 901px) {
  #billCalculator .cash-wallet-stage { width: 50%; }
}

@media (max-width: 900px) {
  #billCalculator,
  #billCalculator:not(.is-active) { display: block; padding: 24px 18px; }
  #billCalculator.is-active { padding-bottom: 0; }
  #billCalculator .cash-wallet-stage { width: calc(100% + 36px); margin-inline: -18px; }
  #billCalculator .counter-console { margin-top: 20px; }
  #billCalculator .home-converter-empty { max-width: none; margin-top: 24px; padding: 20px 0 0; border-left: 0; border-top: 1px solid #477f7d; }
}

@media (max-width: 1100px) {
  .home-redesign .cash-route-bar { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .home-redesign .cash-route-controls { max-width: 700px; }
  .home-redesign .cash-route-field > span { min-height: 0; }
}

@media (max-width: 780px) {
  .home-redesign .main-site-header { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; min-height: 0; padding: 0 4px 6px; margin-bottom: 10px; }
  .home-redesign .main-site-header .main-site-brand { grid-column: 1; grid-row: 1; justify-self: start; width: auto; }
  .home-redesign .main-site-brand img { width: 220px; max-width: 100%; height: auto; }
  .main-site-header .home-language-switcher { grid-column: 2; grid-row: 1; }
  .home-redesign .main-site-header > nav:not(.language-switcher) { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .home-redesign .main-site-header > nav:not(.language-switcher) a { min-height: 40px; padding: 8px 4px; }
  .home-redesign .cash-route-bar { padding: 20px 16px; gap: 18px; }
  .home-redesign .cash-route-copy .home-brand-claim { display: none; }
  .home-redesign .cash-route-copy h1 { font-size: 2.1rem; line-height: 1.06; }
  html[lang="fr"] .home-redesign .cash-route-copy h1 { font-size: clamp(1.4rem, 7vw, 1.75rem); }
  .home-redesign .cash-route-copy > p:last-child { font-size: 0.88rem; margin-top: 6px; }
  .home-redesign .cash-route-field > span { min-height: 2.4em; font-size: 0.65rem; }
  .home-redesign .cash-route-controls { gap: 6px; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); }
  .home-redesign .cash-route-controls .bill-swap-button { width: 40px; min-width: 40px; height: 64px; min-height: 64px; }
  .home-redesign .cash-route-field .currency-trigger { min-height: 64px; padding: 8px 20px 8px 8px; gap: 7px; }
  .home-redesign .cash-route-field .currency-trigger,
  #billCalculator .currency-trigger { display: block; }
  .home-redesign .currency-trigger .currency-option-text { display: grid; gap: 2px; }
  .home-redesign .currency-trigger .currency-option-text strong { padding-left: 32px; line-height: 22px; }
  .home-redesign .cash-route-field .currency-trigger .currency-option-text span,
  #billCalculator .currency-trigger .currency-option-text span { display: block; font-size: 0.72rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
  .home-redesign .cash-route-field .currency-trigger .currency-option-text small { display: none; }
  .home-redesign .currency-trigger .flag-icon { position: absolute; top: 11px; left: 8px; width: 25px; min-width: 25px; height: 18px; }
  .home-redesign .home-notes-board { padding: 18px 16px; }
  .home-redesign .cash-board-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .home-redesign .cash-board-title { gap: 6px; }
  .home-redesign .cash-board-title h2 { font-size: 1.65rem; }
  .home-redesign .cash-board-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
  .home-money-modes button { padding: 8px 12px; font-size: 0.82rem; }
  .home-converter-link { font-size: 0.78rem; }
  .home-redesign .cash-board-footer { display: block; }
  .home-redesign .cash-board-footer > span { display: block; padding-top: 4px; }
  #billCalculator .home-converter-empty strong { font-size: 1rem; }
  #billCalculator .home-converter-empty p { font-size: 0.85rem; }
}

@media (max-width: 380px) {
  .home-redesign .cash-route-copy h1 { font-size: 1.9rem; }
  .home-redesign .cash-route-field .currency-trigger { column-gap: 5px; }
  .home-redesign .currency-trigger .flag-icon { display: none; }
  .home-redesign .currency-trigger .currency-option-text strong { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .home-money-modes button { transition: none; }
}
