/* ============================================================
   Devders Event Calendar — public styles (ported from reference)
   Scoped for WordPress: no global resets, no body/html rules,
   no external font imports. Everything under .dec-* classes.
   ============================================================ */

.dec-view {
  /* Reference typography: Inter first (enqueued by the plugin), 16px base so
     theme body sizes (e.g. Divi's 14px) don't shrink the views. Background,
     padding and spacing follow the theme — the view blends into the page. */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  color: var(--dec-text, #1f2937);
  -webkit-font-smoothing: antialiased;
}
.dec-view *, .dec-view *::before, .dec-view *::after { box-sizing: border-box; }
.dec-view button { font-family: inherit; }
.dec-view ul { list-style: none; margin: 0; padding: 0; }
.dec-view img { max-width: 100%; }

/* Theme-proof form controls: themes (e.g. Divi) reset inputs with high-
   specificity selectors; keep our controls exactly as the reference. */
.dec-view .dec-search__input,
.dec-view .dec-select,
.dec-view .dec-dateinput {
  padding: 10px 12px 10px 36px !important;
  font-size: 14px !important;
  line-height: normal !important;
  border-radius: 10px !important;
  border: 1px solid #e5e7eb !important;
  background-color: #fff !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
}
/* Reference focus treatment survives theme resets (navy border + soft ring). */
.dec-view .dec-search__input:focus,
.dec-view .dec-select:focus,
.dec-view .dec-dateinput:focus {
  border-color: #111827 !important;
  box-shadow: 0 0 0 3px rgba(31, 56, 100, .12) !important;
  outline: none !important;
}
/* Tree caret keeps the reference 12px under theme svg rules.
   min-* clamps the computed box even if a theme rule out-prioritizes width. */
.dec-view .dec-tree__toggle svg {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
}
.dec-view .dec-select { padding: 9px 30px 9px 11px !important; }
.dec-view .dec-dateinput { padding: 9px 10px !important; font-size: 13px !important; }

/* Design tokens (the generate step had dropped the :root wrapper, which
   silently invalidated every var(--dec-*) below). */
:root {
  --dec-navy: #111827;
  /* Darker, more premium navy/slate */
  --dec-navy-dark: #030712;
  --dec-navy-soft: #f3f4f6;
  --dec-blue: #2563eb;
  --dec-text: #1f2937;
  --dec-muted: #6b7280;
  --dec-border: #e5e7eb;
  --dec-bg: #f9fafb;
  /* Slightly softer background */
  --dec-panel: #ffffff;
  --dec-card: #ffffff;
  --dec-radius: 16px;
  /* Rounder corners */
  --dec-radius-sm: 10px;
  --dec-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.03);
  /* Layered soft shadow */
  --dec-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  --dec-cat-meeting: #3b82f6;
  --dec-cat-review: #8b5cf6;
  --dec-cat-workshop: #10b981;
  --dec-cat-conference: #f97316;
  --dec-cat-training: #ec4899;
  --dec-gold: #f59e0b;
  --dec-gold-strong: #b45309;
  --dec-gold-border: #f3ce7e;
  --dec-gold-ring: rgba(245, 158, 11, .12);
}

/* NOTE: the reference's global *, html, body, button resets were removed —
   WordPress themes own the page; this plugin styles only its .dec-* scope. */

/* ------------------------------------------------------------
   Page shell
   ------------------------------------------------------------ */
.dec-page {
  max-width: 100%;
  margin: 0 auto;
}

.dec-card {
  background: var(--dec-card);
  border: 1px solid var(--dec-border);
  border-radius: var(--dec-radius);
  box-shadow: var(--dec-shadow);
}

/* Section title — blue icon + bold label (matches "Upcoming Events") */
.dec-sectiontitle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  color: var(--dec-text);
}

.dec-sectiontitle__icon {
  display: inline-flex;
  color: var(--dec-blue);
}

.dec-sectiontitle__icon svg {
  width: 21px;
  height: 21px;
}

/* Small gray line under a section title (e.g. "Next 5 events · until 31 Dec 2026") */
.dec-sectionsub {
  font-size: 13px;
  color: var(--dec-muted);
  margin-top: 6px;
}

/* Upcoming events section — marker class so it can be themed
   independently from the month list it shares styles with */
.dec-upcoming {
  margin-top: 26px;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.dec-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--dec-radius-sm);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease,
    box-shadow .16s ease;
}

.dec-btn--primary {
  background: var(--dec-navy);
  color: #fff;
}

.dec-btn--primary:hover {
  background: var(--dec-navy-dark);
}

.dec-btn--outline {
  background: var(--dec-card);
  border-color: var(--dec-border);
  color: var(--dec-text);
}

.dec-btn--outline:hover {
  border-color: var(--dec-navy);
  color: var(--dec-navy);
  background: var(--dec-navy-soft);
}

.dec-btn--outline.dec-is-disabled,
.dec-btn--outline:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.dec-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--dec-border);
  border-radius: var(--dec-radius-sm);
  background: var(--dec-card);
  color: var(--dec-muted);
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.dec-iconbtn svg {
  width: 16px;
  height: 16px;
}

.dec-iconbtn:hover {
  background: var(--dec-navy-soft);
  color: var(--dec-navy);
  border-color: var(--dec-navy);
}

/* ------------------------------------------------------------
   Calendar
   ------------------------------------------------------------ */
.dec-calendar {
  overflow: hidden;
}

.dec-calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-bottom: 1px solid var(--dec-border);
}

.dec-calendar__nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dec-calendar__jump {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.dec-calendar__select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2367718b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  font-size: 20px;
  font-weight: 700;
  color: var(--dec-text);
  padding: 6px 26px 6px 10px;
  border-radius: var(--dec-radius-sm);
  cursor: pointer;
  transition: background-color .16s ease;
}

.dec-calendar__select:hover {
  background-color: var(--dec-navy-soft);
}

.dec-calendar__select:focus {
  outline: none;
  background-color: var(--dec-navy-soft);
}

.dec-calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--dec-panel);
  border-bottom: 1px solid var(--dec-border);
}

.dec-calendar__weekday {
  padding: 11px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dec-muted);
  text-align: center;
}

.dec-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.dec-calendar__day {
  min-height: 116px;
  padding: 8px;
  border-right: 1px solid var(--dec-border);
  border-bottom: 1px solid var(--dec-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dec-calendar__day:nth-child(7n) {
  border-right: none;
}

.dec-calendar__day:nth-child(n+36) {
  border-bottom: none;
}

.dec-calendar__daynum {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: var(--dec-text);
}

.dec-calendar__day.dec-is-today .dec-calendar__daynum {
  background: var(--dec-navy);
  color: #fff;
  width: 30px;
  height: 30px;
  font-size: 16px;
  font-weight: 700;
}

.dec-calendar__day.dec-is-other {
  background: var(--dec-panel);
}

.dec-calendar__day.dec-is-other .dec-calendar__daynum {
  color: #b6bfce;
}

.dec-calendar__events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dec-calendar__event {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  border: none;
  background: var(--dec-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  /* 1.55 keeps Thai tone marks / upper vowels fully inside the pill */
  line-height: 1.55;
  padding: 3px 8px 3px 18px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease;
}

/* Title truncates first; the "→ end" chip always stays readable */
.dec-calendar__event .dec-cal__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dec-calendar__event .dec-cal__range {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  opacity: .72;
}

.dec-calendar__event:hover {
  background: var(--dec-navy-dark);
}

.dec-calendar__dot {
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dec-calendar__more {
  border: none;
  background: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--dec-blue);
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  align-self: flex-start;
  white-space: nowrap;
}

.dec-calendar__more:hover {
  background: var(--dec-navy-soft);
  text-decoration: underline;
}

/* ------------------------------------------------------------
   Month event list (matches the "Upcoming Events" reference)
   ------------------------------------------------------------ */
.dec-monthlist {
  margin-top: 26px;
  padding: 22px 24px 16px;
}

.dec-monthlist__list {
  list-style: none;
  margin-top: 10px;
}

.dec-monthlist__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 10px;
  border-bottom: 1px solid var(--dec-border);
  cursor: pointer;
  transition: background .15s ease;
}

.dec-monthlist__item:last-child {
  border-bottom: none;
}

.dec-monthlist__item:hover {
  background: #f4f7fa;
}

.dec-monthlist__item:hover .dec-monthlist__title {
  color: var(--dec-blue);
}

.dec-monthlist__badge {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  background: var(--dec-navy);
  color: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dec-monthlist__day {
  font-size: 19px;
  font-weight: 800;
}

.dec-monthlist__mon {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  margin-top: 4px;
}

.dec-monthlist__title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--dec-text);
  /* generous line-height so Thai tone marks never collide or clip */
  line-height: 1.55;
  transition: color .15s ease;
}

.dec-monthlist__empty {
  padding: 36px 10px;
  text-align: center;
  font-size: 14px;
  color: var(--dec-muted);
}

/* ------------------------------------------------------------
   Directory layout (sidebar + content)
   ------------------------------------------------------------ */
.dec-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.dec-sidebar {
  padding: 20px;
  position: sticky;
  top: 20px;
}

.dec-search {
  position: relative;
}

.dec-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--dec-muted);
  pointer-events: none;
}

.dec-search__input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--dec-border);
  border-radius: var(--dec-radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--dec-text);
  background: var(--dec-card);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.dec-search__input::placeholder {
  color: #9aa4ba;
}

.dec-search__input:focus {
  outline: none;
  border-color: var(--dec-navy);
  box-shadow: 0 0 0 3px rgba(31, 56, 100, .12);
}

.dec-filter__group {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--dec-border);
}

.dec-filter__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dec-muted);
  margin-bottom: 10px;
}

.dec-filter__reset {
  border: none;
  background: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--dec-blue);
  letter-spacing: .02em;
  cursor: pointer;
  text-transform: none;
}

.dec-filter__reset:hover {
  text-decoration: underline;
}

.dec-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 400; /* theme-proof: reference uses normal weight */
  line-height: 1.5;
  color: var(--dec-text);
  cursor: pointer;
  user-select: none;
}

.dec-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--dec-navy);
  cursor: pointer;
  flex-shrink: 0;
}

.dec-check:hover {
  color: var(--dec-navy);
}

.dec-check__count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dec-muted);
  background: var(--dec-navy-soft);
  border-radius: 999px;
  padding: 2px 8px;
}

.dec-selectrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dec-select {
  width: 100%;
  padding: 9px 30px 9px 11px;
  border: 1px solid var(--dec-border);
  border-radius: var(--dec-radius-sm);
  background-color: var(--dec-card);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2367718b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  -webkit-appearance: none;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--dec-text);
  cursor: pointer;
  transition: border-color .16s ease;
}

.dec-select:hover {
  border-color: #c9d2e0;
}

.dec-select:focus {
  outline: none;
  border-color: var(--dec-navy);
  box-shadow: 0 0 0 3px rgba(31, 56, 100, .12);
}

.dec-daterange {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.dec-datefield {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  cursor: pointer;
}

.dec-datefield__label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dec-muted);
}

.dec-dateinput {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--dec-border);
  border-radius: var(--dec-radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--dec-text);
  background: var(--dec-card);
  transition: border-color .16s ease;
}

.dec-dateinput:hover {
  border-color: #c9d2e0;
}

.dec-dateinput:focus {
  outline: none;
  border-color: var(--dec-navy);
  box-shadow: 0 0 0 3px rgba(31, 56, 100, .12);
}

.dec-clearbtn {
  margin-top: 20px;
  width: 100%;
  justify-content: center;
}

/* ------------------------------------------------------------
   Category tree — subcategory support (up to 3 levels)
   ------------------------------------------------------------ */
.dec-tree__row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.dec-tree__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--dec-muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.dec-tree__toggle svg {
  width: 12px;
  height: 12px;
  transition: transform .15s ease;
}

.dec-tree__toggle.dec-is-open svg {
  transform: rotate(90deg);
}

.dec-tree__toggle:hover {
  background: var(--dec-navy-soft);
  color: var(--dec-navy);
}

.dec-tree__spacer {
  width: 20px;
  flex-shrink: 0;
}

.dec-tree__check {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
}

.dec-tree__check .dec-check__count {
  flex-shrink: 0;
}

.dec-tree__children {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--dec-border);
}

/* ------------------------------------------------------------
   Directory content
   ------------------------------------------------------------ */
.dec-content__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.dec-content__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--dec-text);
}

.dec-content__count {
  font-size: 13px;
  color: var(--dec-muted);
}

.dec-content__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Keyword search slot above the grid — mobile only (below 720px the sidebar
   search becomes the drawer's search, so the grid keeps its own synced copy). */
.dec-content__search {
  display: none;
}

.dec-content__search:not(:empty) {
  margin-bottom: 16px;
}

/* ------------------------------------------------------------
   Mobile filter button + drawer (see 720px breakpoint)
   ------------------------------------------------------------ */
.dec-filterbtn {
  display: none;
  position: relative;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--dec-border);
  background: var(--dec-card);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--dec-text);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}

.dec-filterbtn svg {
  width: 15px;
  height: 15px;
}

.dec-filterbtn:hover {
  border-color: var(--dec-navy);
  color: var(--dec-navy);
}

.dec-filterbtn__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--dec-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dec-filterbtn__badge[hidden] {
  display: none;
}

/* Drawer chrome lives inside the sidebar; hidden on desktop */
.dec-drawer__header,
.dec-drawer__footer {
  display: none;
}

/* ------------------------------------------------------------
   View toggle (Grid / List)
   ------------------------------------------------------------ */
.dec-viewtoggle {
  display: inline-flex;
  gap: 2px;
  background: var(--dec-card);
  border: 1px solid var(--dec-border);
  border-radius: 10px;
  padding: 3px;
}

.dec-viewtoggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dec-muted);
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.dec-viewtoggle__btn svg {
  width: 15px;
  height: 15px;
}

.dec-viewtoggle__btn:hover {
  color: var(--dec-navy);
}

.dec-viewtoggle__btn.dec-is-active {
  background: var(--dec-navy);
  color: #fff;
}

.dec-viewtoggle__btn.dec-is-active:hover {
  background: var(--dec-navy-dark);
}

.dec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* List layout — cards become horizontal rows. Declared after .dec-grid
   so the single column wins over the 3-column grid. */
.dec-grid--list {
  grid-template-columns: 1fr;
  gap: 14px;
}

.dec-grid--list .dec-eventcard {
  flex-direction: row;
}

.dec-grid--list .dec-eventcard__media {
  width: 230px;
  min-width: 230px;
  height: auto;
  min-height: 150px;
}

.dec-grid--list .dec-eventcard__body {
  padding: 16px 20px;
}

.dec-grid--list .dec-skelcard {
  flex-direction: row;
}

.dec-grid--list .dec-skelcard__img {
  width: 230px;
  height: auto;
  min-height: 150px;
  flex-shrink: 0;
}

.dec-grid--list .dec-skelcard__body {
  padding: 16px 20px 18px;
}

@media (max-width: 720px) {

  .dec-grid--list .dec-eventcard__media,
  .dec-grid--list .dec-skelcard__img {
    width: 118px;
    min-width: 118px;
  }

  .dec-grid--list .dec-eventcard__body,
  .dec-grid--list .dec-skelcard__body {
    padding: 12px 14px 14px;
  }
}

.dec-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.dec-tag--meeting {
  color: var(--dec-cat-meeting);
  background: rgba(47, 111, 237, .1);
}

.dec-tag--review {
  color: var(--dec-cat-review);
  background: rgba(124, 58, 237, .1);
}

.dec-tag--workshop {
  color: var(--dec-cat-workshop);
  background: rgba(5, 150, 105, .1);
}

.dec-tag--conference {
  color: var(--dec-cat-conference);
  background: rgba(234, 88, 12, .1);
}

.dec-tag--training {
  color: var(--dec-cat-training);
  background: rgba(219, 39, 119, .1);
}

.dec-eventcard {
  background: var(--dec-card);
  border: 1px solid var(--dec-border);
  border-radius: var(--dec-radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dec-eventcard:hover {
  transform: translateY(-3px);
  box-shadow: var(--dec-shadow-lg);
  border-color: #d7deea;
}

/* Image header with overlaid date badge + category tag */
.dec-eventcard__media {
  position: relative;
  height: 180px;
  /* Slightly taller for premium feel */
  background: var(--dec-navy-soft);
  overflow: hidden;
  flex-shrink: 0;
}

.dec-eventcard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(0.2, 1, 0.2, 1);
}

.dec-eventcard:hover .dec-eventcard__img {
  transform: scale(1.08);
}

.dec-eventcard__media.dec-is-hidden {
  display: none;
}

.dec-eventcard__media .dec-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Category tag on directory cards: click to filter by that category */
.dec-grid .dec-tag {
  cursor: pointer;
}

.dec-grid .dec-eventcard__media .dec-tag:hover {
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .2), 0 1px 4px rgba(16, 24, 40, .16);
}

.dec-eventcard__badge {
  position: absolute;
  left: 14px;
  bottom: 12px;
  width: 48px;
  height: 48px;
  background: var(--dec-navy);
  color: #fff;
  border-radius: 9px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dec-eventcard__day {
  font-size: 16px;
  font-weight: 800;
}

.dec-eventcard__mon {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  margin-top: 2px;
}

.dec-eventcard__body {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 16px 18px 18px;
  flex: 1;
  min-width: 0;
}

.dec-eventcard__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dec-text);
  line-height: 1.5;
}

.dec-eventcard__meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 13px;
  border-top: 1px solid var(--dec-border);
  font-size: 12.5px;
  color: var(--dec-muted);
}

.dec-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.dec-meta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #8b96ad;
}

.dec-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

/* ------------------------------------------------------------
   Highlighted ("featured") events — gold star + accent
   ------------------------------------------------------------ */
.dec-star {
  display: inline-flex;
  color: var(--dec-gold);
  margin-right: 6px;
  vertical-align: -2px;
}

.dec-star svg {
  width: 15px;
  height: 15px;
}

/* Calendar badge: gold star marker + ring */
.dec-calendar__event.dec-is-highlighted {
  box-shadow: inset 0 0 0 1.5px rgba(252, 211, 77, .95);
}

.dec-calendar__event.dec-is-highlighted:hover {
  box-shadow: inset 0 0 0 1.5px rgba(252, 211, 77, 1);
}

.dec-calendar__star {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  fill: #fcd34d;
}

/* Month / upcoming list rows */
.dec-monthlist__item.dec-is-highlighted .dec-monthlist__badge {
  box-shadow: 0 0 0 2px #fcd34d;
}

/* Directory card */
.dec-eventcard.dec-is-highlighted {
  border-color: var(--dec-gold-border);
  box-shadow: 0 0 0 4px var(--dec-gold-ring), var(--dec-shadow);
}

.dec-eventcard.dec-is-highlighted:hover {
  border-color: var(--dec-gold);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .18), var(--dec-shadow-lg);
}

.dec-eventcard__featured,
.dec-detail__featured {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--dec-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .16);
}

.dec-eventcard__featured svg,
.dec-detail__featured svg {
  width: 14px;
  height: 14px;
}

/* Detail page */
.dec-detail.dec-is-highlighted {
  border-color: var(--dec-gold-border);
  box-shadow: 0 0 0 4px var(--dec-gold-ring), var(--dec-shadow);
}

.dec-detail__featured {
  width: 32px;
  height: 32px;
  top: 16px;
  left: 16px;
}

.dec-detail__featured svg {
  width: 17px;
  height: 17px;
}

/* ------------------------------------------------------------
   Featured hero banner (events page)
   ------------------------------------------------------------ */
.dec-hero {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--dec-card);
  border: 1px solid var(--dec-gold-border);
  border-radius: var(--dec-radius);
  overflow: hidden;
  box-shadow: 0 0 0 4px var(--dec-gold-ring), var(--dec-shadow);
  margin-bottom: 22px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.dec-hero[hidden] {
  display: none;
}

.dec-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .18), var(--dec-shadow-lg);
}

.dec-hero.dec-media-hidden .dec-hero__media {
  display: none;
}

.dec-hero__media {
  position: relative;
  min-height: 210px;
  background: var(--dec-navy-soft);
}

.dec-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dec-hero__flag {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--dec-gold-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .16);
}

.dec-hero__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 26px;
  min-width: 0;
}

.dec-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dec-gold-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.dec-hero__title {
  font-size: 23px;
  font-weight: 800;
  color: var(--dec-text);
  line-height: 1.45;
}

.dec-hero__meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13.5px;
  color: var(--dec-muted);
}

.dec-hero__desc {
  font-size: 14px;
  color: var(--dec-muted);
  line-height: 1.6;
}

.dec-hero__cta {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--dec-blue);
}

.dec-hero:hover .dec-hero__cta {
  text-decoration: underline;
}

@media (max-width: 940px) {
  .dec-hero {
    grid-template-columns: 1fr;
  }

  .dec-hero__media {
    min-height: 190px;
  }
}

/* ------------------------------------------------------------
   Skeleton loading (directory)
   ------------------------------------------------------------ */
.dec-skel {
  position: relative;
  overflow: hidden;
  background: #edf0f6;
  border-radius: 6px;
}

.dec-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  animation: dec-shimmer 1.4s infinite;
}

@keyframes dec-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.dec-skelcard {
  background: var(--dec-card);
  border: 1px solid var(--dec-border);
  border-radius: var(--dec-radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 218px;
  pointer-events: none;
}

.dec-skelcard__img {
  height: 150px;
  border-radius: 0;
  flex-shrink: 0;
}

.dec-skelcard__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 18px;
  flex: 1;
}

.dec-skelcard__line {
  height: 12px;
}

.dec-skelcard__line--title {
  height: 14px;
  width: 92%;
}

.dec-skelcard__line--short {
  width: 56%;
}

.dec-skelcard__meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid var(--dec-border);
}

.dec-skelcard__meta .dec-skelcard__line {
  height: 11px;
  width: 62%;
}

@media (prefers-reduced-motion: reduce) {
  .dec-skel::after {
    animation: none;
  }
}

/* ------------------------------------------------------------
   Pagination
   ------------------------------------------------------------ */
.dec-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 30px;
}

.dec-pagination__btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--dec-border);
  border-radius: var(--dec-radius-sm);
  background: var(--dec-card);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dec-text);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.dec-pagination__btn svg {
  width: 14px;
  height: 14px;
}

.dec-pagination__btn:hover:not(:disabled):not(.dec-is-active) {
  background: var(--dec-navy-soft);
  border-color: var(--dec-navy);
  color: var(--dec-navy);
}

.dec-pagination__btn.dec-is-active {
  background: var(--dec-navy);
  border-color: var(--dec-navy);
  color: #fff;
  cursor: default;
}

.dec-pagination__btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.dec-pagination__ellipsis {
  padding: 0 3px;
  color: var(--dec-muted);
  font-weight: 700;
}

/* ------------------------------------------------------------
   Empty state
   ------------------------------------------------------------ */
.dec-empty {
  grid-column: 1 / -1;
  background: var(--dec-card);
  border: 1px dashed #d4dbe7;
  border-radius: var(--dec-radius);
  padding: 64px 24px;
  text-align: center;
}

.dec-empty__icon {
  display: inline-flex;
  color: #b6bfce;
  margin-bottom: 14px;
}

.dec-empty__icon svg {
  width: 44px;
  height: 44px;
}

.dec-empty__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dec-text);
}

.dec-empty__sub {
  font-size: 13.5px;
  color: var(--dec-muted);
  margin-top: 6px;
}

.dec-empty .dec-btn {
  margin-top: 18px;
}

/* ------------------------------------------------------------
   Event detail page
   ------------------------------------------------------------ */
.dec-backlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  padding: 8px 14px 8px 10px;
  border-radius: var(--dec-radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dec-muted);
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}

.dec-backlink svg {
  width: 15px;
  height: 15px;
}

.dec-backlink:hover {
  background: var(--dec-navy-soft);
  color: var(--dec-navy);
}

.dec-detail {
  max-width: 780px;
  margin: 0 auto;
  overflow: hidden;
}

.dec-detail__media {
  position: relative;
  height: 280px;
  background: var(--dec-navy-soft);
}

.dec-detail__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dec-detail__media.dec-is-hidden {
  display: none;
}

.dec-detail__media .dec-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 4px rgba(16, 24, 40, .16);
}

.dec-detail__badge {
  position: absolute;
  left: 20px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  background: var(--dec-navy);
  color: #fff;
  border-radius: 12px;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dec-detail__day {
  font-size: 22px;
  font-weight: 800;
}

.dec-detail__mon {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  margin-top: 3px;
}

.dec-detail__body {
  padding: 26px 28px 30px;
}

.dec-detail__title {
  font-size: 25px;
  font-weight: 800;
  color: var(--dec-text);
  line-height: 1.45;
  margin-bottom: 18px;
}

.dec-detail__meta {
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: var(--dec-panel);
  border: 1px solid var(--dec-border);
  border-radius: var(--dec-radius-sm);
  padding: 16px;
  font-size: 14px;
  color: #3c465c;
}

.dec-detail__desc {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.7;
  color: #3c465c;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .dec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .dec-layout {
    grid-template-columns: 1fr;
  }

  .dec-sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .dec-grid {
    grid-template-columns: 1fr;
  }

  .dec-calendar__day {
    min-height: 88px;
    padding: 6px;
  }

  .dec-calendar__select {
    font-size: 16px;
  }

  /* keep the category dot clear of the text: reserved left space */
  .dec-calendar__event {
    padding: 3px 6px 3px 16px;
    font-size: 10px;
  }

  .dec-calendar__event:nth-of-type(n+2) {
    display: none;
  }

  /* --- Filter button + full-screen filter drawer --- */
  .dec-content__header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
  }

  .dec-content__title {
    font-size: 20px;
  }

  .dec-content__right {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .dec-filterbtn {
    display: inline-flex;
    flex: 1;
    justify-content: center;
    padding: 8px 14px;
  }

  .dec-viewtoggle {
    flex-shrink: 0;
  }

  /* search lives above the grid on mobile; the drawer keeps its synced copy */
  .dec-content__search {
    display: block;
    margin-bottom: 8px;
  }

  /* the sidebar becomes the drawer */
  .dec-sidebar {
    position: fixed;
    inset: 0;
    z-index: 999990;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform .28s ease, visibility .28s ease;
  }

  /* Drawer visibility is scoped to the directory view root (multi-instance);
     body scroll lock is applied inline by JS. */
  .dec-view.dec-drawer-open .dec-sidebar {
    transform: none;
    visibility: visible;
  }

  .dec-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--dec-border);
    background: var(--dec-card);
  }

  .dec-drawer__title {
    font-size: 16px;
    font-weight: 800;
    color: var(--dec-text);
  }

  .dec-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--dec-radius-sm);
    background: none;
    color: var(--dec-muted);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
  }

  .dec-drawer__close svg {
    width: 17px;
    height: 17px;
  }

  .dec-drawer__close:hover {
    background: var(--dec-navy-soft);
    color: var(--dec-text);
  }

  .dec-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px 8px;
  }

  .dec-drawer__footer {
    display: flex;
    gap: 10px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--dec-border);
    background: var(--dec-card);
  }

  .dec-drawer__footer .dec-btn {
    flex: 1;
    justify-content: center;
  }

  /* footer has its own Clear button */
  .dec-drawer__body .dec-clearbtn {
    display: none;
  }
}

@media (max-width: 520px) {
  .dec-page {
    padding: 20px 12px 56px;
  }

  .dec-calendar__day {
    min-height: 66px;
    padding: 4px;
    gap: 3px;
  }

  .dec-calendar__daynum {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .dec-calendar__day.dec-is-today .dec-calendar__daynum {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  /* cells get too narrow for the marker: drop it, give text the full pill */
  .dec-calendar__event {
    padding: 3px 5px;
    font-size: 10px;
  }

  .dec-calendar__dot,
  .dec-calendar__star {
    display: none;
  }

  .dec-calendar__more {
    padding: 1px 4px;
    font-size: 10px;
  }

  .dec-monthlist__badge {
    width: 46px;
    height: 46px;
    border-radius: 8px;
  }

  .dec-monthlist__day {
    font-size: 16px;
  }

  .dec-modal {
    padding: 12px;
  }

  .dec-detail__media {
    height: 200px;
  }

  .dec-detail__body {
    padding: 20px 18px 24px;
  }

  .dec-detail__title {
    font-size: 21px;
  }

  .dec-calendar__header {
    padding: 14px;
  }
}

/* Flat list variant — sections without the card box. Declared last so it
   overrides the shared .dec-monthlist padding (calendar page lists sit
   directly on the page background). */
.dec-flatlist {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

/* ------------------------------------------------------------
   Day events modal (calendar "+N more")
   ------------------------------------------------------------ */
.dec-modal {
  position: fixed;
  inset: 0;
  /* Above fixed theme headers (Divi 99999) and the WP admin bar. */
  z-index: 999991;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dec-modal[hidden] {
  display: none;
}

.dec-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dec-modal__panel:focus {
  outline: none;
}

.dec-modal__panel {
  position: relative;
  background: var(--dec-card);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow: auto;
  padding: 26px;
  box-shadow: var(--dec-shadow-lg);
  animation: dec-pop .18s ease;
}

@keyframes dec-pop {
  from {
    transform: translateY(12px) scale(.98);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.dec-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--dec-radius-sm);
  background: none;
  color: var(--dec-muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.dec-modal__close svg {
  width: 17px;
  height: 17px;
}

.dec-modal__close:hover {
  background: var(--dec-navy-soft);
  color: var(--dec-text);
}

.dec-modal__title {
  font-size: 20px;
  font-weight: 800;
  color: var(--dec-text);
  line-height: 1.45;
  padding-right: 28px;
}

.dec-modal__count {
  font-size: 13px;
  color: var(--dec-muted);
  margin-top: 6px;
}

.dec-daylist {
  display: flex;
  flex-direction: column;
  margin-top: 14px;
}

.dec-daylist__item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: none;
  text-align: left;
  font-family: inherit;
  padding: 12px 10px;
  border-bottom: 1px solid var(--dec-border);
  cursor: pointer;
  transition: background .15s ease;
}

.dec-daylist__item:last-child {
  border-bottom: none;
}

.dec-daylist__item:hover {
  background: var(--dec-panel);
}

.dec-daylist__title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--dec-text);
  line-height: 1.5;
}

/* Long titles wrap instead of overflowing (calendar pills keep
   their single-line ellipsis by design) */
.dec-monthlist__title,
.dec-eventcard__title,
.dec-daylist__title,
.dec-detail__title,
.dec-hero__title,
.dec-modal__title {
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------
   Accessibility: focus-visible indicators for keyboard users
   ------------------------------------------------------------ */
.dec-eventcard:focus-visible,
.dec-hero:focus-visible,
.dec-monthlist__item:focus-visible,
.dec-daylist__item:focus-visible,
.dec-backlink:focus-visible {
  outline: 2px solid var(--dec-blue);
  outline-offset: 3px;
}

.dec-btn:focus-visible,
.dec-iconbtn:focus-visible,
.dec-filterbtn:focus-visible,
.dec-viewtoggle__btn:focus-visible,
.dec-pagination__btn:focus-visible,
.dec-tree__toggle:focus-visible,
.dec-drawer__close:focus-visible,
.dec-modal__close:focus-visible {
  outline: 2px solid var(--dec-blue);
  outline-offset: 2px;
}

/* Event archive (/events/): plugin canvas inside the theme's page frame.
   Own max-width so theme content constraints never squeeze the directory. */
.dec-archive {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
}
.dec-archive img { max-width: 100%; height: auto; }
