/* ============================================================
   GRT News & Events
   Uses the theme's design tokens when present, with fallbacks so
   the plugin still looks right under any theme.
   ============================================================ */

.grt-events-section{
  --gre-maroon: var(--maroon, #7A1428);
  --gre-maroon-deep: var(--maroon-deep, #5A0A1A);
  --gre-gold: var(--gold, #C9962E);
  --gre-ink: var(--ink-soft, #6B6259);
  --gre-line: var(--line, #E8DED0);
  --gre-radius: var(--r-md, 14px);
  --gre-shadow: var(--shadow-sm, 0 2px 10px rgba(60,30,20,.08));
  --gre-shadow-md: var(--shadow-md, 0 10px 30px rgba(60,30,20,.14));
}
.grt-events-carousel-section,
.grt-events-calendar-section,
.grt-events-grid-section{
  --gre-maroon: var(--maroon, #7A1428);
  --gre-maroon-deep: var(--maroon-deep, #5A0A1A);
  --gre-gold: var(--gold, #C9962E);
  --gre-gold-bright: var(--gold-bright, #E3B23C);
  --gre-ink: var(--ink-soft, #6B6259);
  --gre-line: var(--line, #E8DED0);
  --gre-ivory: var(--ivory, #FBF7F0);
  --gre-radius: var(--r-md, 14px);
  --gre-shadow: var(--shadow-sm, 0 2px 10px rgba(60,30,20,.08));
  --gre-shadow-md: var(--shadow-md, 0 10px 30px rgba(60,30,20,.14));
}

/* ---------- Cards ---------- */
.grt-event-card .date-badge{ left:auto; right:12px; }
.grt-events-split-cta{ grid-column:1 / -1; text-align:center; margin-top:8px; }
.grt-event-card .grt-event-tag{
  position:absolute; left:14px; top:14px; z-index:2;
  background:rgba(255,255,255,.94); color:var(--gre-maroon);
  font-size:11px; font-weight:600; letter-spacing:.1em; text-transform:uppercase;
  padding:5px 11px; border-radius:999px; box-shadow:var(--gre-shadow);
}
.grt-event-meta{ list-style:none; margin:10px 0 0; padding:0; display:grid; gap:6px; }
.grt-event-meta li{
  display:flex; align-items:center; gap:8px;
  font-size:13px; color:var(--gre-ink);
}
.grt-event-meta svg{ width:15px; height:15px; color:var(--gre-gold); flex:none; }

/* ---------- Carousel beside calendar ---------- */
.grt-events-split{
  display:grid;
  grid-template-columns:minmax(0,1.75fr) minmax(220px,280px);
  gap:12px 36px;
  max-width:var(--wrap, 1200px);
  margin:0 auto;
  padding:36px 24px 12px;
  align-items:start;
}
.grt-events-split-head{ grid-column:1 / -1; margin-bottom:8px; }
.grt-events-split > .section{ padding:0 0 28px; }
.grt-events-split .wrap{ max-width:none; padding:0; }
.grt-events-split .grt-carousel-slide{ flex:0 0 calc((100% - 22px) / 2); }
.grt-events-split .grt-cal-layout,
.grt-events-split .grt-cal-months{ grid-template-columns:1fr; }
.grt-events-split .grt-cal-main{ padding:16px 14px 12px; }
@media (max-width:980px){
  .grt-events-split{ grid-template-columns:1fr; padding:28px 16px 0; }
  .grt-events-split .grt-carousel-slide{ flex-basis:calc((100% - 22px) / 2); }
}

/* ---------- Carousel ---------- */
.grt-carousel{ position:relative; display:flex; align-items:center; gap:10px; }
.grt-carousel-viewport{ overflow:hidden; flex:1; padding:6px 4px 10px; }
.grt-carousel-track{
  display:flex; gap:22px;
  transition:transform .55s cubic-bezier(.4,.14,.3,1); will-change:transform;
}
.grt-carousel-slide{
  flex:0 0 calc((100% - 66px) / 4);
  min-width:0;
  transition:opacity .3s ease;
}
.grt-carousel-slide .news-card{ height:100%; }
.grt-carousel-slide:not(.is-active){ opacity:.45; }
.grt-carousel-arrow{
  flex:none; width:44px; height:44px; border-radius:50%; cursor:pointer;
  display:grid; place-items:center;
  background:#fff; color:var(--gre-maroon);
  border:1.5px solid var(--gre-line); box-shadow:var(--gre-shadow);
  transition:background .2s ease, color .2s ease, transform .2s ease;
}
.grt-carousel-arrow:hover{ background:var(--gre-maroon); color:#fff; transform:translateY(-2px); }
.grt-carousel-arrow:focus-visible{ outline:3px solid var(--gre-gold-bright); outline-offset:2px; }
.grt-carousel-arrow svg{ width:20px; height:20px; }
.grt-carousel-dots{ display:flex; gap:8px; justify-content:center; margin-top:18px; }
.grt-carousel-dot{
  width:9px; height:9px; padding:0; border-radius:50%; cursor:pointer;
  border:0; background:var(--gre-line); transition:all .2s ease;
}
.grt-carousel-dot.is-active{ background:var(--gre-maroon); width:26px; border-radius:999px; }
.grt-carousel-dot:focus-visible{ outline:2px solid var(--gre-gold-bright); outline-offset:3px; }

@media (max-width:1080px){ .grt-carousel-slide{ flex-basis:calc((100% - 44px) / 3); } }
@media (max-width:820px){ .grt-carousel-slide{ flex-basis:calc((100% - 22px) / 2); } }
@media (max-width:600px){
  .grt-carousel-slide{ flex-basis:100%; }
  .grt-carousel-arrow{ width:38px; height:38px; }
  .grt-carousel-track{ gap:16px; }
}

/* ---------- Calendar ---------- */
.grt-calendar{ position:relative; }
.grt-calendar.is-loading{ opacity:.55; pointer-events:none; }
.grt-cal-filters{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-bottom:28px; }
.grt-cal-filters .chip{
  padding:8px 18px; border-radius:999px; cursor:pointer; font:inherit; font-size:13.5px;
  background:#fff; border:1.5px solid var(--gre-line); color:var(--gre-ink);
  transition:all .18s ease;
}
.grt-cal-filters .chip:hover{ border-color:var(--gre-gold); color:var(--gre-maroon); }
.grt-cal-filters .chip.is-active{ background:var(--gre-maroon); border-color:var(--gre-maroon); color:#fff; }

.grt-cal-layout{ display:grid; grid-template-columns:minmax(0,1.55fr) minmax(0,1fr); gap:32px; align-items:start; }
.grt-cal-main{ background:#fff; border-radius:var(--gre-radius); box-shadow:var(--gre-shadow); padding:24px 26px 20px; }

.grt-cal-nav{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:18px; }
.grt-cal-range{ font-family:var(--font-display, Georgia, serif); font-size:19px; color:var(--gre-maroon); margin:0; }
.grt-cal-prev,.grt-cal-next{
  width:38px; height:38px; border-radius:50%; cursor:pointer; display:grid; place-items:center;
  background:var(--gre-ivory); border:1px solid var(--gre-line); color:var(--gre-maroon);
  transition:background .18s ease, color .18s ease;
}
.grt-cal-prev:hover,.grt-cal-next:hover{ background:var(--gre-maroon); color:#fff; }
.grt-cal-prev:focus-visible,.grt-cal-next:focus-visible{ outline:3px solid var(--gre-gold-bright); outline-offset:2px; }
.grt-cal-prev svg,.grt-cal-next svg{ width:18px; height:18px; }

.grt-cal-months{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:26px; }
.grt-cal-month-label{
  font-size:12px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--gre-ink); text-align:center; margin-bottom:12px;
}
.grt-cal-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.grt-cal-weekday{
  text-align:center; font-size:11px; letter-spacing:.06em; text-transform:uppercase;
  color:var(--gre-ink); padding-bottom:6px; text-decoration:none; border:0;
}
.grt-cal-day{
  position:relative; aspect-ratio:1; border-radius:10px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  font-size:14px; color:var(--gre-ink); text-decoration:none;
}
.grt-cal-day.is-empty{ visibility:hidden; }
a.grt-cal-day{
  background:var(--gre-ivory); color:var(--gre-maroon); font-weight:600;
  border:1px solid transparent; transition:all .16s ease;
}
a.grt-cal-day:hover{ background:var(--gre-maroon); color:#fff; transform:translateY(-1px); }
a.grt-cal-day:hover .grt-cal-dots i{ background:var(--gre-gold-bright); }
a.grt-cal-day:focus-visible{ outline:3px solid var(--gre-gold-bright); outline-offset:2px; }
.grt-cal-day.is-today{ border-color:var(--gre-gold); }
.grt-cal-day.is-today .grt-cal-num{ text-decoration:underline; text-underline-offset:3px; }
.grt-cal-day.is-selected{ background:var(--gre-maroon); color:#fff; }
.grt-cal-day.is-selected .grt-cal-dots i{ background:var(--gre-gold-bright); }
.grt-cal-dots{ display:flex; gap:3px; }
.grt-cal-dots i{ width:4px; height:4px; border-radius:50%; background:var(--gre-gold); display:block; }
.grt-cal-hint{ margin:16px 0 0; font-size:12.5px; color:var(--gre-ink); text-align:center; }

.grt-calendar.has-popover .grt-cal-layout,
.grt-calendar.has-popover .grt-cal-main,
.grt-calendar.has-popover .grt-cal-months,
.grt-calendar.has-popover .grt-cal-grid{ overflow:visible; }
.grt-calendar.has-popover .grt-cal-day.has-events{
  background:var(--gre-ivory); color:var(--gre-maroon); font-weight:600;
}
.grt-calendar.has-popover .grt-cal-hit{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  width:100%; height:100%; border-radius:10px; color:inherit; text-decoration:none;
}
.grt-calendar.has-popover .grt-cal-day.has-events:hover,
.grt-calendar.has-popover .grt-cal-day.has-events:focus-within{
  background:var(--gre-maroon); color:#fff; z-index:5;
}
.grt-calendar.has-popover .grt-cal-day.has-events:hover .grt-cal-dots i,
.grt-calendar.has-popover .grt-cal-day.has-events:focus-within .grt-cal-dots i{ background:var(--gre-gold-bright); }
.grt-cal-popover{
  display:none; position:absolute; z-index:30; right:0; bottom:calc(100% + 8px);
  width:230px; padding:12px 14px; text-align:left; font-weight:400;
  background:#fff; color:var(--gre-ink); border-radius:12px; box-shadow:var(--gre-shadow-md);
}
.grt-cal-day.has-events:hover .grt-cal-popover,
.grt-cal-day.has-events:focus-within .grt-cal-popover{ display:block; }
.grt-cal-popover-title{
  margin:0 0 8px; font-size:13px; font-weight:700; color:var(--gre-maroon); line-height:1.35;
}
.grt-cal-popover .grt-cal-list-title{ color:#3a1218; font-size:14px; }
.grt-cal-popover .grt-cal-list a{ color:inherit; }
.grt-cal-popover .grt-cal-all{ color:var(--gre-maroon); font-size:13px; }

.grt-cal-panel{
  background:#fff; border-radius:var(--gre-radius); box-shadow:var(--gre-shadow);
  padding:24px 24px 20px; position:sticky; top:110px;
}
.grt-cal-panel-title{
  font-family:var(--font-display, Georgia, serif); font-size:18px;
  color:var(--gre-maroon); margin:0 0 14px;
}
.grt-cal-list{ list-style:none; margin:0; padding:0; display:grid; gap:2px; }
.grt-cal-list li + li{ border-top:1px solid var(--gre-line); }
.grt-cal-list a{ display:grid; gap:3px; padding:12px 0; text-decoration:none; color:inherit; }
.grt-cal-list a:hover .grt-cal-list-title{ color:var(--gre-maroon); }
.grt-cal-list-date{ font-size:11.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--gre-gold); }
.grt-cal-list-title{ font-weight:600; font-size:15px; line-height:1.35; transition:color .16s ease; }
.grt-cal-list-meta,.grt-cal-list-excerpt{ font-size:13px; color:var(--gre-ink); }
.grt-cal-empty,.grt-cal-loading{ font-size:14px; color:var(--gre-ink); margin:0 0 14px; }
.grt-cal-all{ display:inline-flex; align-items:center; gap:8px; margin-top:16px; font-size:14px; }
.grt-cal-all svg{ width:15px; height:15px; }

@media (max-width:900px){
  .grt-cal-layout{ grid-template-columns:1fr; }
  .grt-cal-panel{ position:static; }
}
@media (max-width:600px){
  .grt-cal-main{ padding:18px 14px 14px; }
  .grt-cal-months{ grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce){
  .grt-carousel-track{ transition:none; }
  a.grt-cal-day:hover{ transform:none; }
}

/* ---------- Highlighted dates ---------- */
/* Works for both calendar modes: the linked day cell and the
   popover variant, where the cell is a span wrapping .grt-cal-hit. */
.grt-cal-day.has-events.is-highlight,
.grt-calendar.has-popover .grt-cal-day.has-events.is-highlight{
  background:linear-gradient(140deg, var(--gre-gold), #B3841F);
  color:#fff; border-color:var(--gre-gold);
  box-shadow:0 4px 12px rgba(201,150,46,.35);
}
.grt-cal-day.is-highlight .grt-cal-num,
.grt-cal-day.is-highlight .grt-cal-hit{ color:#fff; }
.grt-cal-day.is-highlight .grt-cal-dots i{ background:#fff; }
a.grt-cal-day.is-highlight:hover,
.grt-calendar.has-popover .grt-cal-day.has-events.is-highlight:hover,
.grt-calendar.has-popover .grt-cal-day.has-events.is-highlight:focus-within{
  background:var(--gre-maroon); border-color:var(--gre-maroon);
}
.grt-cal-day.is-highlight.is-selected{ background:var(--gre-maroon); border-color:var(--gre-maroon); }

.grt-cal-list li.is-highlight .grt-cal-list-date::after{
  content:"★"; margin-left:6px; color:var(--gre-gold);
}

.grt-event-flag{
  position:absolute; right:14px; top:14px; z-index:2;
  background:linear-gradient(140deg, var(--gre-gold), #B3841F); color:#fff;
  font-size:10.5px; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  padding:5px 11px; border-radius:999px; box-shadow:0 4px 12px rgba(201,150,46,.4);
}
.grt-event-card.is-highlight .news-media{ box-shadow:inset 0 0 0 2px var(--gre-gold); }

/* A legend under the calendar, so the gold means something. */
.grt-cal-legend{
  display:flex; align-items:center; justify-content:center; gap:18px; flex-wrap:wrap;
  margin-top:14px; font-size:12.5px; color:var(--gre-ink);
}
.grt-cal-legend span{ display:inline-flex; align-items:center; gap:7px; }
.grt-cal-legend i{ width:12px; height:12px; border-radius:4px; display:block; }
.grt-cal-legend .swatch-event{ background:var(--gre-ivory); border:1px solid var(--gre-line); }
.grt-cal-legend .swatch-highlight{ background:linear-gradient(140deg, var(--gre-gold), #B3841F); }
