/* ============================================================
   FURRR EVENT CALENDAR — Stylesheet
   Aesthetic: clean, minimal, modern pet-retail (matching furrr.ca)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Karla:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

/* ── Design tokens — matched exactly to www.furrr.ca ── */
:root {
  /* Backgrounds */
  --bg:             #fcfbf9;   /* furrr.ca cream/off-white */
  --surface:        #f5f2ec;   /* furrr.ca --COLOR-BG-ACCENT */
  --surface-alt:    #f4f0e8;   /* furrr.ca --COLOR-BG-BRIGHTER */

  /* Borders */
  --border:         rgb(209, 205, 196);   /* furrr.ca --COLOR-BORDER */
  --border-strong:  #a49c8b;              /* furrr.ca --COLOR-BORDER-DARK */
  --border-light:   #e2dfd9;             /* furrr.ca --COLOR-BORDER-LIGHT */

  /* Text */
  --text-primary:   #212121;             /* furrr.ca --COLOR-TEXT */
  --text-secondary: #636262;             /* furrr.ca --COLOR-TEXT-LIGHT */
  --text-muted:     rgba(33,33,33,0.35); /* furrr.ca text at 35% opacity */

  /* Buttons */
  --btn-bg:         #212121;
  --btn-text:       #ffffff;
  --btn-hover:      #000000;

  /* Accent — furrr.ca warm bronze */
  --accent:         #ab8c52;   /* furrr.ca --COLOR-ACCENT */
  --accent-hover:   #806430;   /* furrr.ca --COLOR-ACCENT-HOVER */
  --accent-light:   #e8d4ae;   /* furrr.ca --COLOR-ACCENT-LIGHT */

  /* Status */
  --success:        #4A7C59;
  --error:          #B94A48;

  /* Event category palette */
  --cat-adoption:     #E07070;
  --cat-moms-group:   #9575CD;
  --cat-art-gallery:  #4A90D9;
  --cat-dental:       #3DAA99;
  --cat-caricature:   #E8A020;
  --cat-pet-portrait: #6AAF6A;
  --cat-grooming:     #D96B9A;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14);

  --font: 'Karla', sans-serif;   /* furrr.ca --FONT-STACK-BODY */
  --transition: 150ms ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 18px;   /* furrr.ca --FONT-SIZE-BASE */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }

/* ── Utility ── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   HEADER / NAV — furrr.ca "logo above nav" layout
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

/* ── Logo row (centred logo, back-link pinned right) ── */
.header-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px 12px;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}
.site-logo-img {
  width: 145px;      /* furrr.ca --logo-width-mobile */
  height: auto;
  display: block;
}
@media (min-width: 768px) {
  .site-logo-img { width: 195px; }  /* furrr.ca --logo-width-desktop */
}
.header-back-link {
  position: absolute;
  right: 24px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
  white-space: nowrap;
}
.header-back-link:hover { color: var(--text-primary); }

/* ── Nav row (horizontal scrollable, centred) ── */
.header-nav-row {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.header-nav-row::-webkit-scrollbar { display: none; }
.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  padding: 0 16px;
  margin: 0;
  gap: 0;
}
.site-nav li a {
  display: block;
  padding: 11px 14px;
  font-size: 15px;          /* furrr.ca nav ~15-16px */
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--text-primary);
  transition: color var(--transition);
  white-space: nowrap;
}
.site-nav li a:hover   { color: var(--accent); }
.site-nav li a.active  { color: var(--accent); border-bottom: 2px solid var(--accent); }
.site-nav li a.nav-sale { color: #d02e2e; }  /* furrr.ca SALE highlight */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
}
.btn-primary:hover { background: var(--btn-hover); }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
}
.btn-outline:hover { border-color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--surface-alt); }

.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-accent {
  background: var(--accent);   /* #ab8c52 furrr.ca bronze */
  color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); }

/* ============================================================
   CALENDAR SECTION
   ============================================================ */
.calendar-section { padding: 40px 0 60px; }

.calendar-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.calendar-title {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.month-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.month-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  transition: all var(--transition);
  background: var(--bg);
}
.month-nav-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: var(--surface);
}
#month-year-label {
  font-size: 22px;
  font-weight: 700;
  min-width: 200px;
  text-align: center;
  letter-spacing: -.01em;
}

/* Category Legend */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 20px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Calendar Grid */
.calendar-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
  /* Prevent the grid from ever exceeding the container */
  width: 100%;
  table-layout: fixed;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)); /* minmax(0) = no content blowout */
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.calendar-weekday {
  padding: 10px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  overflow: hidden;
}
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)); /* equal columns, never blown out */
}
.calendar-day {
  min-height: 100px;
  padding: 10px 6px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  transition: background var(--transition);
  /* Critical: allow cell to shrink below its content */
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
}
.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day.other-month   { background: var(--surface); }
.calendar-day.other-month .day-number { color: var(--text-muted); }
.calendar-day.today .day-number {
  background: var(--btn-bg);
  color: var(--btn-text);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-day.has-events { cursor: pointer; }
.calendar-day.has-events:hover { background: var(--surface); }

.day-number {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 5px;
  line-height: 1;
  flex-shrink: 0;
}
.day-events { display: flex; flex-direction: column; gap: 3px; }

/* Event pills — text wraps, never pushes column wider */
.event-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  transition: opacity var(--transition);
  /* Allow wrapping; grid column width stays fixed */
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.event-pill:hover { opacity: .82; }

/* ── Event Detail Modal ── */
.event-detail-modal {
  max-width: 520px;
  padding: 0;
  overflow: hidden;
}
.event-detail-color-bar {
  height: 6px;
  width: 100%;
  flex-shrink: 0;
}
.event-detail-body {
  padding: 24px 28px 28px;
}
.event-detail-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 10px;
}
.event-detail-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
  margin-bottom: 12px;
}
.event-detail-meta {
  display: flex;
  gap: 6px 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.event-detail-meta span { display: flex; align-items: center; gap: 5px; }
.event-detail-desc {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-primary);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-bottom: 20px;
  white-space: pre-wrap;
}
.event-detail-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Public Events List (below calendar) ── */
.events-list-section {
  padding: 36px 0 44px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.events-list-heading {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.event-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.event-list-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.event-list-color-bar {
  width: 4px;
  min-height: 44px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
}
.event-list-content { flex: 1; min-width: 0; }
.event-list-title {
  font-size: 14px;
  font-weight: 600;
  margin: 4px 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-list-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============================================================
   SUBSCRIBE STRIP
   ============================================================ */
.subscribe-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}
.subscribe-strip h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.subscribe-strip p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}
.subscribe-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.subscribe-form input[type="email"] {
  width: 280px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: var(--font);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
  background: var(--bg);
  color: var(--text-primary);
}
.subscribe-form input[type="email"]:focus { border-color: var(--text-primary); }
.subscribe-form input[type="email"]::placeholder { color: var(--text-muted); }
.subscribe-msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.subscribe-msg.success { color: var(--success); }
.subscribe-msg.error   { color: var(--error); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 32px;
  transform: translateY(20px);
  transition: transform 200ms ease;
  position: relative;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all var(--transition);
  background: var(--surface);
}
.modal-close:hover { background: var(--surface-alt); color: var(--text-primary); }
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.modal .modal-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.5; }
.modal-msg { font-size: 13px; margin-top: 12px; min-height: 18px; }
.modal-msg.success { color: var(--success); }
.modal-msg.error   { color: var(--error); }

/* Form fields */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg);
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--text-primary); }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--btn-bg); cursor: pointer; }
.form-check-label { font-size: 14px; color: var(--text-primary); }

/* ============================================================
   FOOTER — compact, light warm background so logo is visible
   ============================================================ */
.site-footer {
  background: var(--surface-alt);  /* warm cream — logo dark text is clearly readable */
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 28px 0 20px;
  font-size: 15px;
}

/* Main row: logo+tagline left, nav links right */
.footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-logo {
  width: 88px;
  height: auto;
  display: block;
  flex-shrink: 0;
}
.footer-tagline {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: nowrap;
}

/* Inline horizontal link row */
.footer-links-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.footer-links-row a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.footer-links-row a:hover { color: var(--accent); }
.footer-sep {
  color: var(--text-muted);
  font-size: 12px;
  user-select: none;
}

/* Bottom bar */
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-body {
  background: var(--surface);
  min-height: 100vh;
}
.admin-header {
  background: var(--text-primary);
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}
.admin-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
}
.admin-main { max-width: 1000px; margin: 0 auto; padding: 32px 24px 60px; }
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  width: fit-content;
}
.admin-tab {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  border-radius: calc(var(--radius-md) - 2px);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.admin-tab.active {
  background: var(--btn-bg);
  color: var(--btn-text);
}
.admin-tab:hover:not(.active) { color: var(--text-primary); background: var(--surface); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-header h2 { font-size: 20px; font-weight: 700; }

/* Event cards in admin */
.event-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.event-card-color {
  width: 4px;
  border-radius: 2px;
  align-self: stretch;
  flex-shrink: 0;
}
.event-card-content { flex: 1; min-width: 0; }
.event-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.event-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.event-card-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.cat-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  color: #fff;
}

/* Subscribers / Interest list tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.data-table th {
  background: var(--surface);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface); }
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; }

/* Login screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 20px;
}
.login-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.login-logo {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.login-logo span { color: var(--accent); }
.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.login-error {
  font-size: 13px;
  color: var(--error);
  margin-top: 10px;
  min-height: 18px;
}

/* ============================================================
   CATEGORY ADMIN UI
   ============================================================ */
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg);
}
input[type="color"]:focus { border-color: var(--text-primary); outline: none; }
.color-hex-preview {
  font-size: 13px;
  font-family: monospace;
  color: var(--text-secondary);
  letter-spacing: .04em;
}
.category-list-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.category-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(0,0,0,.08);
}
.category-list-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.category-list-slug {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}
.category-list-actions { display: flex; gap: 6px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── Tablet (≤ 900px) ── */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .admin-main   { padding: 24px 16px 48px; }
}

/* ── Mobile landscape / small tablet (≤ 768px) ── */
@media (max-width: 768px) {
  body { font-size: 16px; }

  /* Calendar cells — shorter, tighter */
  .calendar-day {
    min-height: 72px;
    padding: 6px 4px 4px;
  }
  .event-pill {
    font-size: 10px;
    padding: 2px 4px;
    line-height: 1.2;
  }
  .day-number { font-size: 12px; }
  #month-year-label { font-size: 18px; min-width: 150px; }

  /* Month navigation buttons */
  .month-nav-btn { width: 32px; height: 32px; font-size: 14px; }

  /* Legend wraps tightly */
  .calendar-legend { gap: 8px 14px; }
  .legend-item     { font-size: 11px; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }

  /* Admin */
  .event-card { flex-direction: column; gap: 10px; }
  .event-card-actions { align-self: flex-end; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .site-logo-img { width: 145px; }
  .footer-tagline { white-space: normal; }
}

/* ── Phone portrait (≤ 520px) ── */
@media (max-width: 520px) {

  /* Header logo row */
  .header-logo-row { padding: 12px 16px 10px; }
  .site-logo-img   { width: 110px; }
  .header-back-link { font-size: 12px; right: 14px; }

  /* Calendar section */
  .calendar-section { padding: 20px 0 36px; }

  /* Weekday abbreviations: 3-letter → 1-letter via CSS */
  .calendar-weekday {
    font-size: 10px;
    letter-spacing: 0;
    padding: 8px 2px;
  }

  /* Day cells become compact squares */
  .calendar-day {
    min-height: 56px;
    padding: 5px 2px 3px;
  }
  .day-number {
    font-size: 11px;
    margin-bottom: 3px;
  }

  /* On small phones: hide pill text, show coloured dots only.
     Dots are still clickable — they open the event detail modal. */
  .event-pill {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    padding: 0;
    font-size: 0;        /* hide text */
    color: transparent;
    flex-shrink: 0;
    display: inline-block;
    margin: 1px;
    min-height: unset;
  }
  .day-events {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0 1px;
  }

  /* Month year label */
  #month-year-label { font-size: 16px; min-width: 130px; }

  /* Legend hidden on small phones — event list below calendar covers it */
  .calendar-legend { display: none; }

  /* Modals full-width on phone */
  .modal { padding: 20px 16px; border-radius: var(--radius-md); }
  .event-detail-body { padding: 18px 20px 22px; }
  .event-detail-title { font-size: 18px; }

  /* Event list items stack more cleanly */
  .event-list-item { padding: 12px 14px; gap: 10px; }
  .event-list-title { font-size: 13px; }
  .event-list-meta  { font-size: 11px; }

  /* Subscribe form stacks vertically */
  .subscribe-form { flex-direction: column; align-items: center; }
  .subscribe-form input[type="email"] { width: 100%; max-width: 340px; }

  /* Admin */
  .admin-tabs { flex-wrap: wrap; }
  .modal { max-width: 100% !important; }
}

/* ── Very small phones (≤ 380px) ── */
@media (max-width: 380px) {
  .calendar-day { min-height: 46px; }
  .day-number { font-size: 10px; }
  .event-pill { width: 6px; height: 6px; }
  #month-year-label { font-size: 14px; min-width: 110px; }
}
