/*
 * Nicky Amat Art – Christmas 2026
 *
 * Everything festive lives in this file and christmas.js. To switch it off after Christmas:
 *   1. remove the <body class="xmas"> class, and the christmas.css / christmas.js tags
 *   2. delete the .xmas-banner element in index.html
 * The order form, card tiles and stock list styles at the bottom are shop features and can stay.
 */
:root {
  --xmas-red: #b3282d;
  --xmas-red-dark: #8e1f23;
  --xmas-green: #1f5f3f;
  --xmas-gold: #c9a227;
  --xmas-cream: #fdf6ea;
}

/* Anchor links should not land underneath the fixed header */
section[id] { scroll-margin-top: 4.5rem; }

/* ---------- Festive theme ---------- */
body.xmas #home { background: linear-gradient(180deg, #fdf1e3 0%, #f7ecdf 100%); }
body.xmas #request { background: var(--xmas-cream); }
body.xmas #cards { background: #f3f7f2; }

body.xmas .bg-blue-500 { background-color: var(--xmas-red); }
body.xmas .hover\:bg-blue-600:hover { background-color: var(--xmas-red-dark); }
body.xmas .hover\:text-blue-500:hover,
body.xmas .hover\:text-blue-400:hover { color: var(--xmas-red); }
body.xmas .text-blue-600 { color: var(--xmas-red); }
body.xmas .hover\:text-blue-800:hover { color: var(--xmas-red-dark); }

body.xmas section h2::after {
  content: '';
  display: block;
  width: 72px;
  height: 3px;
  margin: 0.7rem auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--xmas-red), var(--xmas-gold), var(--xmas-green));
}
body.xmas section h2 { margin-bottom: 2rem; }

.xmas-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  background: var(--xmas-red);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.xmas-banner a { color: #fff; text-decoration: underline; }

/* Twinkling lights under the header */
body.xmas header::before,
body.xmas header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 20px;
  pointer-events: none;
  background-repeat: repeat-x;
  background-size: 160px 20px;
}
body.xmas header::before {
  background-image:
    linear-gradient(#3d4a3d, #3d4a3d),
    radial-gradient(circle at 12px 11px, #e53935 0 4px, transparent 5px),
    radial-gradient(circle at 92px 11px, #fbc02d 0 4px, transparent 5px);
  background-position: 0 0, 0 0, 0 0;
  background-size: 100% 2px, 160px 20px, 160px 20px;
  background-repeat: no-repeat, repeat-x, repeat-x;
  animation: xmas-twinkle 2.4s ease-in-out infinite alternate;
}
body.xmas header::after {
  background-image:
    radial-gradient(circle at 52px 11px, #43a047 0 4px, transparent 5px),
    radial-gradient(circle at 132px 11px, #1e88e5 0 4px, transparent 5px);
  animation: xmas-twinkle 2.4s ease-in-out -1.2s infinite alternate;
}
@keyframes xmas-twinkle {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

/* Snow */
#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}
#snowToggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  padding: 0.4rem 0.9rem;
  border: 1px solid #c8d4e3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #334155;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
#snowToggle:hover { background: #fff; }

@media (prefers-reduced-motion: reduce) {
  body.xmas header::before,
  body.xmas header::after { animation: none; opacity: 0.85; }
  html { scroll-behavior: auto !important; }
}

/* ---------- Christmas card tiles ---------- */
#cardGrid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  max-width: 80rem;
  margin: 0 auto;
}
.card-tile {
  width: 224px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.card-photo {
  position: relative;
  height: 320px;
  background: #e8efe9;
  cursor: pointer;
}
.card-photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.35s ease;
}
.card-photo > .card-inside { opacity: 0; background: #f4f1ea; }
.card-tile.open .card-inside { opacity: 1; }
.card-tile.open .card-front { opacity: 0; }
@media (hover: hover) {
  .card-photo:hover > .card-inside { opacity: 1; }
  .card-photo:hover > .card-front { opacity: 0; }
}
.card-title { margin: 0.9rem 0 0.4rem; font-weight: 600; color: #1f2937; }
.card-actions { display: flex; gap: 0.5rem; justify-content: center; padding: 0 0.75rem 1rem; margin-top: auto; flex-wrap: wrap; }
.card-actions button {
  padding: 0.4rem 0.9rem;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
}
.card-actions button:hover { background: #f1f5f9; }
.card-actions .card-add { background: var(--xmas-green); border-color: var(--xmas-green); color: #fff; }
.card-actions .card-add:hover { background: #164a31; }

@media (max-width: 600px) { .card-tile { width: min(100%, 300px); } }
.card-prices span + span::before { content: '·'; margin-right: 1.25rem; color: var(--xmas-gold); }
.card-prices {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin: 0 auto 2rem;
  padding: 0.6rem 1.25rem;
  background: #fff;
  border: 1px dashed var(--xmas-gold);
  border-radius: 0.6rem;
  font-weight: 600;
  color: #1f2937;
}

/* ---------- Mug stock list ---------- */
.stock-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.4rem 1rem;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  text-align: left;
}
.stock-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
  background: #fff;
  font-size: 0.95rem;
}
.stock-list .stock-name { font-weight: 600; }
.stock-list .stock-colour { color: #6b7280; }
.stock-list .stock-left { margin-left: auto; color: #166534; font-size: 0.85rem; white-space: nowrap; }
.stock-list li.no-stock { opacity: 0.8; background: #fffbeb; }
.stock-list li.no-stock .stock-left { color: #92400e; }
.colour-dot {
  display: inline-block;
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  vertical-align: -0.1em;
}

/* ---------- Order form extras ---------- */
.item-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 768px) { .item-grid { grid-template-columns: 1fr 1.4fr 0.6fr; } }
#orderSummary { list-style: none; margin: 0; padding: 0.75rem 1rem; text-align: left; background: #f8fafc; border-radius: 0.5rem; font-size: 0.95rem; }
#orderSummary:empty { display: none; }
#orderSummary li + li { margin-top: 0.25rem; }
#stockNote {
  padding: 0.75rem 1rem;
  border-left: 4px solid #d97706;
  border-radius: 0.4rem;
  background: #fffbeb;
  color: #78350f;
  font-size: 0.95rem;
  text-align: left;
}
#stockNote ul { margin: 0.35rem 0 0; padding-left: 1.1rem; list-style: disc; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Meet the artist ---------- */
.artist-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-width: 64rem;
  margin: 2rem auto 0;
  padding: 0 1rem;
}
@media (min-width: 768px) { .artist-photos { grid-template-columns: repeat(4, 1fr); } }
.artist-photos figure { margin: 0; }
.artist-photos img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 0.6rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.artist-photos figcaption { margin-top: 0.4rem; font-size: 0.9rem; color: #4b5563; }

/* ---------- Video (in Meet the Artist): thumbnail that opens in the same zoomed viewer as the pictures ---------- */
.artist-video { margin: 2rem auto 1.5rem; padding: 0 1rem; position: relative; z-index: 1; }
.video-open {
  position: relative;
  display: block;
  width: min(100%, 15rem);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.video-open img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.video-open .play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5rem;
  height: 5rem;
  margin: -2.5rem 0 0 -2.5rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease;
}
.video-open:hover .play-badge { transform: scale(1.08); }
.video-open .video-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.75rem;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.video-open:focus-visible { outline: 3px solid var(--xmas-gold); outline-offset: 4px; border-radius: 0.75rem; }
/* the zoomed viewer, when it is showing the video */
.modal video {
  max-width: min(92vw, 26rem);
  max-height: 88vh;
  border-radius: 10px;
  background: #000;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
}

#submitOrder:disabled { opacity: 0.6; cursor: wait; }

/* ---------- Charities (prominent, straight under the hero) ---------- */
.charity {
  padding: 2.5rem 1rem;
  text-align: center;
  background: linear-gradient(180deg, #f3f7f2 0%, #eaf3ea 100%);
  border-top: 4px solid var(--xmas-green);
  border-bottom: 4px solid var(--xmas-red);
}
.charity-intro { max-width: 48rem; margin: 0 auto 1.5rem; font-size: 1.15rem; line-height: 1.6; color: #1f2937; }
.charity-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.charity-list a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 14rem;
  padding: 0.9rem 1.5rem;
  background: #fff;
  border: 2px solid var(--xmas-gold);
  border-radius: 0.75rem;
  color: #1f2937;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.charity-list a:hover { border-color: var(--xmas-red); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18); }
.charity-list strong { font-size: 1.15rem; }
.charity-list span { font-size: 0.9rem; color: var(--xmas-red); text-decoration: underline; }

/* The gallery tile style sets a fixed image height; the artist photos should fill their frame instead */
.artist-photos .image-card img { height: auto; object-fit: cover; background: transparent; }

/* The zoomed viewer sits above the floating Snow and Go-to-order buttons */
#imgModal { z-index: 100; }

/* ---------- Basket (header icon + panel) ---------- */
.header-actions { flex: none; }
.basket-btn {
  position: relative;
  padding: 0.25rem;
  border: 0;
  background: none;
  color: #1f2937;
  line-height: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.basket-btn:hover { color: var(--xmas-red); }
.basket-btn:focus-visible { outline: 3px solid var(--xmas-gold); outline-offset: 3px; border-radius: 0.5rem; }
.basket-count {
  position: absolute;
  top: -0.35rem;
  right: -0.5rem;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--xmas-red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3rem;
  text-align: center;
}
.basket-count[hidden] { display: none; }
.basket-btn.bump { animation: basket-bump 0.5s ease; }
@keyframes basket-bump {
  0% { transform: scale(1); }
  30% { transform: scale(1.3) rotate(-8deg); }
  60% { transform: scale(0.95) rotate(5deg); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .basket-btn.bump { animation: none; } }

.basket-panel {
  position: fixed;
  top: 4.4rem;
  right: 0.5rem;
  z-index: 70;
  width: min(26rem, calc(100vw - 1rem));
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  text-align: left;
}
.basket-panel[hidden] { display: none; }
.basket-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; font-size: 1.15rem; }
.basket-head button { border: 0; background: none; color: #6b7280; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.basket-empty { margin: 0.5rem 0 0.25rem; color: #6b7280; }
.basket-items, .basket-prices { margin: 0; padding: 0; list-style: none; }
.basket-line { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0; border-bottom: 1px solid #f1f5f9; }
.basket-name { flex: 1; min-width: 0; font-weight: 600; }
.basket-sub { display: block; font-size: 0.85rem; font-weight: 400; color: #6b7280; }
.basket-qty { display: flex; align-items: center; gap: 0.4rem; }
.basket-qty button {
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.basket-qty span { min-width: 1.4rem; text-align: center; font-weight: 600; }
.basket-remove { padding: 0 0.25rem; border: 0; background: none; color: #b91c1c; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.basket-prices { margin-top: 0.75rem; font-size: 0.92rem; color: #374151; }
.basket-prices li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.12rem 0; }
.basket-prices li.basket-hint { display: block; color: #166534; }
.basket-note { margin-top: 0.75rem; padding: 0.6rem 0.8rem; border-left: 4px solid #d97706; border-radius: 0.35rem; background: #fffbeb; color: #78350f; font-size: 0.88rem; }
.basket-note ul { margin: 0.3rem 0 0; padding-left: 1.1rem; list-style: disc; }
.basket-total { display: flex; justify-content: space-between; margin-top: 0.75rem; padding-top: 0.6rem; border-top: 2px solid #e5e7eb; font-size: 1.2rem; font-weight: 700; }
.basket-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.basket-actions[hidden] { display: none; }
.basket-go { flex: 1; padding: 0.6rem 1rem; border-radius: 0.4rem; background: var(--xmas-red); color: #fff; font-weight: 600; text-align: center; text-decoration: none; }
.basket-go:hover { background: var(--xmas-red-dark); color: #fff; }
#basket-clear { border: 0; background: none; color: #6b7280; text-decoration: underline; cursor: pointer; }

/* ---------- Merchandise artwork tiles ---------- */
.art-body { padding: 0.9rem 1rem 1.1rem; }
.art-title { margin-bottom: 0.6rem; font-weight: 600; color: #1f2937; }
.art-types { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.art-type {
  padding: 0.35rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 0.9rem;
  cursor: pointer;
}
.art-type.is-selected { border-color: var(--xmas-green); background: var(--xmas-green); color: #fff; }
.art-note { min-height: 2.4em; margin: 0 0 0.6rem; font-size: 0.82rem; color: #4b5563; }
.art-add { padding: 0.45rem 1.1rem; border: 0; border-radius: 0.4rem; background: var(--xmas-red); color: #fff; font-weight: 600; cursor: pointer; }
.art-add:hover { background: var(--xmas-red-dark); }

/* Stock wording: green for in stock, amber for pre-order */
.stock-ok { color: #166534; }
.stock-pre { color: #92400e; font-weight: 600; }
