/* Events: calendar, event pages, cards. Category colours: --ev-accent on dark, --ev-ink on light. */
[data-category] { --ev-accent: var(--c-accent); --ev-ink: var(--c-accent-dark); }
[data-category="public-holiday"] { --ev-accent: #E25A4B; --ev-ink: #A1271C; }
[data-category="festival"] { --ev-accent: #E8B04A; --ev-ink: #855600; }
[data-category="commemoration"] { --ev-accent: #4FC2B1; --ev-ink: #0F6A5E; }
[data-category="company"] { --ev-accent: #D4A43A; --ev-ink: #7A5A1E; }

.ev-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ev-accent, var(--c-accent)); margin-right: 8px; vertical-align: .05em; flex: none; }
.ev-note { font-size: .875rem; color: var(--c-text-2); margin-top: 20px; }
.section--light .ev-note { color: var(--c-text-dark-2); }
.ev-countdown { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border: var(--line-w) solid var(--ev-accent, var(--c-accent)); color: var(--c-text); font-family: var(--f-display); font-size: 1rem; letter-spacing: .03em; text-transform: uppercase; }
.no-uppercase .ev-countdown { text-transform: none; }
.ev-countdown::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ev-accent, var(--c-accent)); }

/* Index hero with the next event */
.ev-hero__inner { display: grid; gap: 32px; padding-top: 48px; padding-bottom: 56px; }
.ev-hero__text { min-width: 0; }
@media (min-width: 960px) { .ev-hero__inner { grid-template-columns: minmax(0, 1fr) 380px; align-items: end; } }
.ev-spotlight { position: relative; display: grid; gap: 6px; padding: 28px 28px 24px; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--ev-accent) 32%, transparent), transparent 60%), var(--c-ink-2); border: var(--line-w) solid var(--c-line); border-top: 4px solid var(--ev-accent); color: var(--c-text); text-decoration: none; overflow: hidden; min-width: 0; }
.ev-spotlight:hover, .ev-spotlight:focus-visible { border-color: var(--ev-accent); }
.ev-spotlight__label { font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ev-accent); font-weight: 600; }
.ev-spotlight__art { position: absolute; right: -18px; top: 18px; width: 150px; height: 150px; color: rgba(242, 242, 240, .32); }
.ev-spotlight__date { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; position: relative; }
.ev-spotlight__day { font-family: var(--f-display); font-size: 4.5rem; line-height: .9; font-weight: 700; }
.ev-spotlight__month { font-family: var(--f-display); font-size: 1.25rem; color: var(--c-text-2); }
.ev-spotlight__name { position: relative; font-family: var(--f-display); font-size: 1.625rem; line-height: 1.15; font-weight: 600; margin-top: 4px; }
.ev-spotlight__meta { position: relative; color: var(--c-text-2); font-size: .9375rem; }
.ev-spotlight .ev-countdown { justify-self: start; margin-top: 12px; position: relative; }

/* Toolbar: year switcher + category filters */
.ev-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; }
.ev-toolbar__title { margin: 0; }
.ev-years ul { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; border: var(--line-w) solid var(--c-paper-2); }
.ev-years a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; color: var(--c-text-dark); text-decoration: none; font-family: var(--f-display); font-size: 1.0625rem; }
.ev-years li + li a { border-left: 1px solid var(--c-paper-2); }
.ev-years a:hover { background: var(--c-paper-2); }
.ev-years a[aria-current] { background: var(--c-text-dark); color: var(--c-paper); }
.ev-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 28px; }
.ev-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ev-chip { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px; border: 1px solid #c9c4b8; color: var(--c-text-dark); text-decoration: none; font-size: .9375rem; background: #fff; }
.ev-chip:hover { border-color: var(--c-text-dark); }
.ev-chip[aria-current] { background: var(--c-text-dark); border-color: var(--c-text-dark); color: var(--c-paper); }
.ev-chip[data-category] .ev-dot { background: var(--ev-ink); }
.ev-chip[aria-current] .ev-dot { background: var(--ev-accent); }
.ev-filters__count { margin: 0; color: var(--c-text-dark-2); font-size: .9375rem; }
.ev-empty { padding: 32px; background: #fff; border: 1px solid var(--c-paper-2); }

/* Month grid */
.ev-months { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.ev-month { background: #fff; border: 1px solid var(--c-paper-2); border-top: 3px solid var(--c-text-dark); padding: 18px 18px 8px; min-width: 0; }
.ev-month--empty { border-top-color: var(--c-paper-2); }
.ev-month__title { font-family: var(--f-display); font-size: 1.375rem; margin: 0 0 8px; }
.ev-month__empty { color: var(--c-text-dark-2); font-size: .9375rem; margin: 4px 0 12px; }
.ev-list { margin: 0; padding: 0; list-style: none; }
.ev-item { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--c-paper-2); }
.ev-item:first-child { border-top: 0; }
.ev-item__day { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 56px; background: var(--c-paper); border-left: 4px solid var(--ev-ink); line-height: 1; }
.ev-item__day span { font-family: var(--f-display); font-size: 1.75rem; font-weight: 700; }
.ev-item__day small { font-size: .6875rem; color: var(--c-text-dark-2); margin-top: 3px; text-transform: uppercase; letter-spacing: .02em; max-width: 52px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-item.is-today .ev-item__day { background: var(--ev-ink); color: #fff; }
.ev-item.is-today .ev-item__day small { color: rgba(255, 255, 255, .85); }
.ev-item__body { min-width: 0; }
.ev-item__name { font-weight: 600; color: var(--c-text-dark); text-decoration: none; line-height: 1.35; }
.ev-item__name:hover { color: var(--ev-ink); text-decoration: underline; }
.ev-item__meta { margin: 4px 0 0; font-size: .875rem; color: var(--c-text-dark-2); }
.ev-item__tags { margin: 6px 0 0; }
.ev-tag { display: inline-block; padding: 2px 8px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; color: var(--ev-ink); border: 1px solid currentColor; }
.ev-tag--now { color: #fff; background: var(--c-text-dark); border-color: var(--c-text-dark); }

/* Holidays table + download */
.ev-holidays__inner { display: grid; gap: 40px; }
.ev-holidays__inner > div { min-width: 0; }
@media (min-width: 1024px) { .ev-holidays__inner { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.ev-table th[scope="row"] a { color: inherit; }
.ev-table tr.is-next th, .ev-table tr.is-next td { background: color-mix(in srgb, var(--ev-accent, var(--c-accent)) 14%, transparent); }
.ev-mark { color: var(--c-accent); margin-left: 2px; }
.ev-download { display: grid; gap: 16px; justify-items: start; padding: 28px; border: var(--line-w) solid var(--c-line); background: var(--c-ink-2); }
.ev-download__art { width: 96px; height: 96px; color: var(--c-accent); --ev-accent: var(--c-accent); }
.ev-download p { margin: 0; color: var(--c-text-2); font-size: .9375rem; }

/* Event page hero */
.ev-feature { position: relative; overflow: hidden; background:
  radial-gradient(70% 90% at 85% 40%, color-mix(in srgb, var(--ev-accent) 30%, transparent), transparent 70%),
  linear-gradient(160deg, var(--c-ink) 0%, var(--c-ink-2) 100%);
  border-bottom: 4px solid var(--ev-accent); color: var(--c-text); }
.ev-feature::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(var(--c-line) 1px, transparent 1px), linear-gradient(90deg, var(--c-line) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(90deg, transparent 30%, #000 100%); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%); }
.ev-feature__inner { position: relative; z-index: 1; display: grid; gap: 24px; padding-top: 40px; padding-bottom: 56px; }
.ev-feature__text { min-width: 0; }
@media (min-width: 960px) { .ev-feature__inner { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; padding-top: 48px; padding-bottom: 72px; } }
.ev-feature__eyebrow { display: flex; align-items: center; color: var(--ev-accent); }
.ev-feature__title { font-size: calc(clamp(2.5rem, 7vw, 5rem) * var(--hero-scale, 1)); line-height: 1; margin: 8px 0 0; overflow-wrap: anywhere; }
.ev-feature__alt { margin: 12px 0 0; font-size: 1.125rem; color: var(--c-text-2); }
.ev-when { display: flex; align-items: stretch; gap: 20px; margin-top: 32px; }
.ev-when__day { font-family: var(--f-display); font-weight: 700; font-size: clamp(4.5rem, 12vw, 7.5rem); line-height: .82; color: var(--ev-accent); padding-right: 20px; border-right: var(--line-w) solid var(--c-line); }
.ev-when__text { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.ev-when__text p { margin: 0; }
.ev-when__month { font-family: var(--f-display); font-size: 1.75rem; line-height: 1.1; }
.ev-when__full { color: var(--c-text-2); }
.ev-when__lunar { color: var(--c-text); font-weight: 500; }
.ev-countdown--lg { margin-top: 24px; font-size: 1.25rem; padding: 10px 16px; }
.ev-feature .hero__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.ev-feature__art { display: flex; justify-content: center; }
.ev-motif { display: block; width: 100%; height: auto; }
.ev-motif--hero { max-width: 420px; color: rgba(242, 242, 240, .85); filter: drop-shadow(0 0 40px color-mix(in srgb, var(--ev-accent) 35%, transparent)); }
@media (max-width: 959px) { .ev-feature__art { position: absolute; right: -40px; top: 24px; width: 220px; opacity: .28; pointer-events: none; } .ev-feature__text { position: relative; } }
@media (prefers-reduced-motion: no-preference) {
  .ev-motif--hero { animation: ev-float 9s ease-in-out infinite; }
  @keyframes ev-float { 50% { transform: translateY(-10px) rotate(-1.5deg); } }
}

/* Event page body */
.ev-body { display: grid; gap: 40px; }
@media (min-width: 1024px) { .ev-body { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 64px; } }
.ev-body__main { min-width: 0; }
.ev-body .section__title--sub { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 0 0 20px; }
.ev-body .section__title--sub + .ev-lead { margin-top: 0; }
.ev-lead { font-size: 1.25rem; line-height: 1.5; margin: 0 0 20px; color: var(--c-text-dark); border-left: 4px solid var(--ev-ink); padding-left: 16px; }
.ev-prose { margin-bottom: 48px; }
.ev-customs { display: grid; gap: 2px; margin: 0 0 48px; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); background: var(--c-paper-2); border: 2px solid var(--c-paper-2); }
.ev-customs li { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: #fff; font-weight: 500; line-height: 1.45; }
.ev-customs__num { font-family: var(--f-display); font-size: 1.75rem; font-weight: 700; color: var(--ev-ink); line-height: 1; }
.ev-callout { padding: 24px 28px; background: var(--c-text-dark); color: var(--c-paper); border-left: 6px solid var(--ev-accent); }
.ev-callout__title { font-family: var(--f-display); font-size: 1.375rem; margin: 0 0 8px; color: var(--ev-accent); }
.ev-callout p { margin: 0; line-height: 1.6; }
.ev-facts { padding: 24px; background: #fff; border: 1px solid var(--c-paper-2); border-top: 4px solid var(--ev-ink); }
@media (min-width: 1024px) { .ev-facts { position: sticky; top: calc(var(--sticky-top) + 24px); } }
.ev-facts__title { font-family: var(--f-display); font-size: 1.375rem; margin: 0 0 12px; }
.ev-facts dl { margin: 0; }
.ev-facts dl > div { padding: 12px 0; border-top: 1px solid var(--c-paper-2); }
.ev-facts dt { font-size: .8125rem; letter-spacing: .04em; text-transform: uppercase; color: var(--c-text-dark-2); }
.no-uppercase .ev-facts dt { text-transform: none; }
.ev-facts dd { margin: 4px 0 0; font-weight: 500; }
.ev-facts a { color: var(--ev-ink); }

/* Cards (event page, homepage) */
.ev-cards { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.ev-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 24px; min-height: 260px; overflow: hidden; background: radial-gradient(110% 80% at 100% 0%, color-mix(in srgb, var(--ev-accent) 24%, transparent), transparent 60%), var(--c-ink-2); border: var(--line-w) solid var(--c-line); border-top: 4px solid var(--ev-accent); min-width: 0; }
.ev-card:hover, .ev-card:focus-within { border-color: var(--ev-accent); }
.ev-card__art { position: absolute; right: -16px; top: -8px; width: 130px; height: 130px; color: rgba(242, 242, 240, .22); }
.ev-card__date { display: flex; align-items: baseline; gap: 10px; position: relative; }
.ev-card__day { font-family: var(--f-display); font-size: 3.25rem; line-height: .9; font-weight: 700; color: var(--ev-accent); }
.ev-card__month { font-family: var(--f-display); font-size: 1.0625rem; color: var(--c-text-2); }
.ev-card__title { font-family: var(--f-display); font-size: 1.375rem; line-height: 1.2; margin: 8px 0 0; }
.ev-card__link { color: var(--c-text); text-decoration: none; }
.ev-card__link::after { content: ""; position: absolute; inset: 0; }
.ev-card__link:hover { text-decoration: underline; }
.ev-card__meta { position: relative; margin: 0; color: var(--c-text-2); font-size: .875rem; }
.ev-card .ev-countdown { margin-top: auto; align-self: flex-start; font-size: .875rem; }
.ev-card__title { margin-top: 12px; }
@media (min-width: 600px) { .ev-customs--pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
