/*
 * NDB website — seasonal Christmas theme (home page).
 *
 * Everything below is scoped to the .ndb-xmas class that the small date check
 * in index.html's <head> puts on <html>, so this file is harmless out of season.
 * To switch the theme off entirely, remove the stylesheet link, the inline date
 * check and the ndb-christmas.js link from index.html, plus the three blocks of
 * markup flagged with "Christmas theme" comments. Nothing else depends on it.
 */

:root {
  --ndb-xmas-red: #b3202a;
  --ndb-xmas-red-deep: #8b151e;
  --ndb-xmas-pine: #0f3a2f;
  --ndb-xmas-snow: #f4f9ff;
}

/* ---------------------------------------------------------------------------
   Seasonal markup is hidden unless the theme is active
   --------------------------------------------------------------------------- */
.ndb-xmas-greeting { display: none; }
.ndb-xmas .ndb-xmas-greeting { display: block; }
.ndb-xmas-chip { display: none; }
.ndb-xmas .ndb-xmas-chip { display: inline-flex; }
.ndb-xmas-wish { display: none; }
.ndb-xmas .ndb-xmas-wish { display: inline-flex; }

/* ---------------------------------------------------------------------------
   Greeting strip (sits above the sticky header, so it scrolls away)
   --------------------------------------------------------------------------- */
.ndb-xmas-greeting {
  position: relative;
  overflow: hidden;
  background: linear-gradient(100deg, var(--ndb-xmas-red-deep) 0%, var(--ndb-xmas-red) 42%, var(--ndb-xmas-pine) 100%);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
}

.ndb-xmas-greeting::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  background: repeating-linear-gradient(135deg, #fff 0 9px, var(--ndb-xmas-red) 9px 18px);
  opacity: .9;
}

.ndb-xmas-greeting .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .45rem 1rem .55rem;
  text-align: center;
}

.ndb-xmas-greeting .container > i { color: var(--ndb-gold); font-size: .95rem; }
.ndb-xmas-greeting-text { letter-spacing: .02em; }

.ndb-xmas-greeting-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .08rem .6rem .12rem;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  color: #fff;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .03em;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.ndb-xmas-greeting-link i { font-size: .68rem; }
.ndb-xmas-greeting-link:hover,
.ndb-xmas-greeting-link:focus-visible { border-color: #fff; background: #fff; color: var(--ndb-xmas-red-deep); }

/* ---------------------------------------------------------------------------
   Twinkling light garland under the header (bulbs are added by the script)
   --------------------------------------------------------------------------- */
.ndb-xmas-lights {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 3;
  display: flex;
  height: 18px;
  align-items: flex-start;
  justify-content: space-around;
  pointer-events: none;
  transition: opacity .35s ease;
}

/* Out of the way once the visitor starts reading. */
.ndb-xmas-lights.is-dimmed { opacity: 0; }

.ndb-xmas-lights::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, #1d4d3f, #3c7a63 50%, #1d4d3f);
}

.ndb-xmas-bulb {
  position: relative;
  width: 9px;
  height: 13px;
  margin-top: 5px;
  border-radius: 50% 50% 55% 55% / 42% 42% 58% 58%;
  background: currentColor;
  box-shadow: 0 0 9px 2px currentColor;
  animation: ndb-xmas-twinkle 2.6s ease-in-out infinite;
}

.ndb-xmas-bulb::before {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 5px;
  height: 4px;
  content: "";
  transform: translateX(-50%);
  border-radius: 1px;
  background: #2b5c4b;
}

@keyframes ndb-xmas-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ---------------------------------------------------------------------------
   Snowfall canvas (added by the script; never blocks clicks, sits under the header)
   --------------------------------------------------------------------------- */
.ndb-xmas-snow {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.ndb-xmas-chip {
  align-items: center;
  gap: .45rem;
  margin-bottom: .9rem;
  padding: .32rem .85rem;
  border: 1px solid rgba(252, 224, 0, .5);
  border-radius: 999px;
  background: rgba(179, 32, 42, .3);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ndb-xmas-chip i { color: var(--ndb-gold); font-size: .85rem; }

/* Snow bank along the bottom of the hero, so the shortcut cards sit on snow. */
.ndb-xmas .ndb-hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 30px;
  content: "";
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'><path d='M0 40h1200V20q-60-14-120 0t-120 0-120 0-120 0-120 0-120 0-120 0-120 0-120 0-120 0z' fill='%23ffffff'/></svg>") repeat-x bottom / 1200px 30px;
}

/* Candy-stripe trim on the news card instead of the plain gold rule. */
.ndb-xmas .ndb-hero .ndb-hot-card {
  border-top-color: transparent;
  background-image: linear-gradient(90deg, var(--ndb-xmas-red) 0 33.4%, var(--ndb-gold) 33.4% 66.7%, var(--ndb-green) 66.7% 100%);
  background-repeat: no-repeat;
  background-position: top;
  background-size: 100% 4px;
}

/* ---------------------------------------------------------------------------
   Shortcut cards
   --------------------------------------------------------------------------- */
.ndb-xmas .ndb-shortcut {
  position: relative;
  overflow: hidden;
}

.ndb-xmas .ndb-shortcut::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: repeating-linear-gradient(115deg, var(--ndb-xmas-red) 0 10px, #fff 10px 20px);
  opacity: .7;
}

.ndb-xmas .ndb-shortcuts .col-md-4:nth-child(1) .ndb-shortcut-icon { background: #fdf3d6; color: #8a6708; }
.ndb-xmas .ndb-shortcuts .col-md-4:nth-child(2) .ndb-shortcut-icon { background: #fbeaeb; color: var(--ndb-xmas-red); }
.ndb-xmas .ndb-shortcuts .col-md-4:nth-child(3) .ndb-shortcut-icon { background: #e4f3e8; color: var(--ndb-forest); }

/* ---------------------------------------------------------------------------
   Feature band — faint snowflake watermarks
   --------------------------------------------------------------------------- */
.ndb-xmas .ndb-feature-band {
  position: relative;
  overflow: hidden;
}

.ndb-xmas .ndb-feature-band::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: .14;
  background-image:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='118' height='118' viewBox='0 0 24 24'><g fill='none' stroke='%23ffffff' stroke-width='1.1' stroke-linecap='round'><path d='M12 2v20M3.3 7l17.4 10M3.3 17L20.7 7'/><path d='M12 5.6 10 3.6M12 5.6l2-2M12 18.4l-2 2M12 18.4l2 2M5 9.4 2.4 8.7M19 14.6l2.6.7M19 9.4l2.6-.7M5 14.6l-2.6.7'/></g></svg>"),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='74' height='74' viewBox='0 0 24 24'><g fill='none' stroke='%23ffffff' stroke-width='1.3' stroke-linecap='round'><path d='M12 2v20M3.3 7l17.4 10M3.3 17L20.7 7'/></g></svg>");
  background-repeat: no-repeat, no-repeat;
  background-position: right 26px top 14px, right 78px bottom 18px;
  pointer-events: none;
}

.ndb-xmas .ndb-feature-band .container { position: relative; z-index: 1; }

/* ---------------------------------------------------------------------------
   Closing call to action + footer
   --------------------------------------------------------------------------- */
.ndb-xmas .ndb-cta { background: linear-gradient(180deg, #f4f9f5 0%, #eaf1eb 100%); }

.ndb-xmas .ndb-footer {
  position: relative;
  padding-top: 4.6rem;
}

.ndb-xmas .ndb-footer::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 26px;
  content: "";
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'><path d='M0 0h1200v20q-60 14-120 0t-120 0-120 0-120 0-120 0-120 0-120 0-120 0-120 0-120 0z' fill='%23eaf1eb'/></svg>") repeat-x top / 1200px 26px;
  pointer-events: none;
}

.ndb-xmas-wish {
  align-items: center;
  gap: .4rem;
  color: var(--ndb-forest);
  font-weight: 700;
}

.ndb-xmas-wish i { color: #fff; }

/* ---------------------------------------------------------------------------
   Festive season hours notice (index.html, branches.html, contact.html)
   --------------------------------------------------------------------------- */
.ndb-xmas-hours { display: none; }

.ndb-xmas .ndb-xmas-hours {
  display: block;
  padding: 3.4rem 0;
  background: var(--ndb-paper);
  /* Matches the site's other anchor targets, so the sticky header
     does not cover the notice when the greeting strip links to it. */
  scroll-margin-top: 110px;
}

.ndb-xmas-hours-panel {
  position: relative;
  display: grid;
  overflow: hidden;
  align-items: center;
  padding: 2rem 2.2rem 2rem 2.6rem;
  border: 1px solid #e4e9e3;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(23, 50, 42, .08);
  gap: 1.5rem 3rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
}

.ndb-xmas-hours-panel::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  content: "";
  background: repeating-linear-gradient(160deg, var(--ndb-xmas-red) 0 11px, #fff 11px 22px);
}

.ndb-xmas-hours-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--ndb-xmas-red);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.ndb-xmas-hours-intro h2 {
  margin: .55rem 0 .7rem;
  color: var(--ndb-forest);
  font-size: clamp(1.45rem, 2.3vw, 1.95rem);
  font-weight: 750;
  line-height: 1.16;
}

.ndb-xmas-hours-intro p { margin: 0 0 1rem; color: var(--ndb-muted); }

.ndb-xmas-hours-table { width: 100%; border-collapse: collapse; }

.ndb-xmas-hours-table th,
.ndb-xmas-hours-table td {
  padding: .6rem .1rem;
  border-bottom: 1px dashed #dde5df;
  vertical-align: middle;
}

.ndb-xmas-hours-table th {
  color: var(--ndb-forest);
  font-size: .91rem;
  font-weight: 700;
  text-align: left;
}

.ndb-xmas-hours-table td { text-align: right; }
.ndb-xmas-hours-table tr:last-child th,
.ndb-xmas-hours-table tr:last-child td { border-bottom: 0; }

.ndb-xmas-pill {
  display: inline-block;
  padding: .18rem .7rem .22rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.ndb-xmas-pill-closed { background: #fbeaeb; color: #8b151e; }
.ndb-xmas-pill-part { background: #fdf3d6; color: #7a5806; }
.ndb-xmas-pill-open { background: #e2f2e7; color: #1b6a39; }

@media (max-width: 991.98px) {
  .ndb-xmas-hours-panel { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------------------
   Small screens and reduced motion
   --------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
  .ndb-xmas-greeting { font-size: .74rem; }
  .ndb-xmas-greeting .container { padding-right: .9rem; padding-left: .9rem; }
  .ndb-xmas .ndb-hero::after { height: 20px; background-size: 700px 20px; }
  .ndb-xmas-lights { height: 15px; }
  .ndb-xmas-bulb { width: 7px; height: 11px; }

  .ndb-xmas .ndb-xmas-hours { padding: 2.4rem 0; }
  .ndb-xmas-hours-panel { padding: 1.4rem 1.2rem 1.5rem 1.5rem; }
  .ndb-xmas-hours-table tr { display: block; border-bottom: 1px dashed #dde5df; }
  .ndb-xmas-hours-table tr:last-child { border-bottom: 0; }
  .ndb-xmas-hours-table th,
  .ndb-xmas-hours-table td { display: block; padding: 0; border: 0; text-align: left; }
  .ndb-xmas-hours-table th { padding-top: .65rem; }
  .ndb-xmas-hours-table td { padding: .25rem 0 .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ndb-xmas-bulb { animation: none; }
  .ndb-xmas-lights { transition: none; }
}
