/* Cortney Event Calendar Manager */
.cecm-calendar-wrap{
  max-width: 100%;
  background: #fff;
}

.cecm-calendar-nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 0 0 10px 0;
}

.cecm-nav-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border:1px solid #000;
  background:#fff;
  color:#000;
  text-decoration:none;
  font-size:22px;
  line-height:1;
}

.cecm-nav-btn:hover,
.cecm-nav-btn:focus{
  outline:none;
  background:#000;
  color:#fff;
}

.cecm-month-label{
  flex:1;
  text-align:center;
  font-weight:800;
  font-size:36px;
  color: rgb(217,26,93);
}

.cecm-calendar{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  table-layout: fixed;
}

.cecm-calendar th,
.cecm-calendar td{
  border:1px solid #000;
}

.cecm-calendar thead th{
  background:#000;
  color:#fff;
  padding:10px 6px;
  font-weight:700;
  text-align:center;
}

.cecm-calendar td{
  vertical-align:top;
  height:110px;
  padding:6px;
  background:#fff;
}

.cecm-empty{
  background:#fff;
}

.cecm-day-num{
  font-weight:800;
  font-size:18px;
  margin-bottom:8px;
  color: rgb(217,26,93);
}

.cecm-events{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cecm-event{
  display:flex;
  align-items:flex-start;
  gap:6px;
  font-size:13px;
  line-height:1.2;
  white-space:normal;
}

.cecm-event-time{
  color:#000;
  margin-right:6px;
  font-weight:700;
  display:inline-block;
  width:75px;
  white-space:nowrap;
  flex-shrink:0;
}

.cecm-event-title{
  text-decoration:none;
  font-weight:700;
  display:inline;
  white-space:normal;
  overflow-wrap:anywhere;
}

.cecm-event-title:hover,
.cecm-event-title:focus{
  text-decoration:underline;
}

.cecm-event-title--nolink{
  text-decoration:none !important;
  cursor:default !important;
}
.cecm-event-title--nolink:hover,
.cecm-event-title--nolink:focus{
  text-decoration:none !important;
}

.cecm-event-titles{display:inline; white-space:normal; overflow-wrap:anywhere;}
.cecm-sep{color:#000;}




.cecm-calendar th,
.cecm-calendar td {
  width: 14.2857%; /* 100 / 7 columns */
}

.cecm-calendar td {
  height: 130px; /* uniform row height */
  vertical-align: top;
}




.cecm-day {
  height: 130px;
  max-height: 130px;
  overflow: hidden;
}

.cecm-day .cecm-events {
  /* leave room for the day number */
  max-height: calc(130px - 28px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px; /* space so scrollbar doesn't overlap text */
}



/* Mobile stacked calendar */
@media (max-width: 768px) {
  /* Make the calendar table behave like a vertical list */
  .cecm-calendar,
  .cecm-calendar thead,
  .cecm-calendar tbody,
  .cecm-calendar tr,
  .cecm-calendar th,
  .cecm-calendar td {
    display: block;
    width: 100% !important;
  }

  /* Hide the weekday header row */
  .cecm-calendar thead {
    display: none;
  }

  /* Remove table-like borders that can look odd in block mode */
  .cecm-calendar {
    border-collapse: separate;
    border-spacing: 0;
  }

  /* Each day becomes a card */
  .cecm-calendar td {
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    border: 1px solid #000;
    margin: 0 0 10px 0;
    background: #fff;
  }

  /* Inner day wrapper expands naturally */
  .cecm-day {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 10px !important;
  }

  /* Date number becomes a header-like line */
  .cecm-day-number {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
    line-height: 1.2;
  }

  /* Events list should not scroll on mobile; let it expand */
  .cecm-day .cecm-events {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }
}


/* Add consistent inner padding so content doesn't touch borders */
.cecm-calendar td {
  padding: 8px !important;
}

.cecm-day {
  padding: 8px !important;
}

@media (max-width: 768px) {
  .cecm-calendar td {
    padding: 12px !important;
  }

  .cecm-day {
    padding: 12px !important;
  }
}


/* Weekday label (shown on mobile only) */
.cecm-mobile-weekday{
  display:none;
}

@media (max-width: 768px) {
  .cecm-day-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:8px;
  }

  .cecm-mobile-weekday{
    display:block;
    font-weight:600;
    font-size:14px;
  }
}


/* ===== v1.3.7 Responsive layout (desktop fixed grid; mobile stacked auto-height) ===== */

/* DESKTOP/TABLET: force true table layout + uniform fixed-height cells with internal scroll */
@media (min-width: 769px){
  .cecm-calendar{ display: table !important; table-layout: fixed; width: 100%; }
  .cecm-calendar thead{ display: table-header-group !important; }
  .cecm-calendar tbody{ display: table-row-group !important; }
  .cecm-calendar tr{ display: table-row !important; }
  .cecm-calendar th{ display: table-cell !important; width: 14.2857% !important; }
  .cecm-calendar td{ display: table-cell !important; width: 14.2857% !important; }

  .cecm-calendar td.cecm-day{
    height: 130px !important;
    max-height: 130px !important;
    vertical-align: top;
    overflow: hidden !important;
    padding: 8px !important;
    box-sizing: border-box;
  }

  .cecm-calendar td.cecm-day .cecm-events{
    max-height: calc(130px - 32px) !important; /* room for header/date */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 2px;
  }

  /* Weekday label is mobile-only */
  .cecm-mobile-weekday{ display: none !important; }
}

/* MOBILE: stacked cards that shrink-wrap to content (no fixed heights, no blank filler days) */
@media (max-width: 768px){
  .cecm-calendar,
  .cecm-calendar thead,
  .cecm-calendar tbody,
  .cecm-calendar tr,
  .cecm-calendar th,
  .cecm-calendar td{
    display: block !important;
    width: 100% !important;
  }

  .cecm-calendar thead{ display:none !important; }

  /* Hide filler/empty days entirely */
  .cecm-calendar td.cecm-empty{ display:none !important; }

  /* Ensure day cards auto-size to their content */
  .cecm-calendar td.cecm-day{
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 12px !important;
    box-sizing: border-box;
    border: 1px solid #000;
    margin: 0 0 10px 0;
    background: #fff;
  }

  .cecm-calendar td.cecm-day .cecm-events{
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  /* Date left, weekday right, same font size */
  .cecm-day-header{
    display:flex !important;
    justify-content:space-between;
    align-items:center;
    margin-bottom: 8px;
  }
  .cecm-day-num,
  .cecm-mobile-weekday{
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.2;
  }
  .cecm-mobile-weekday{ display:block !important; }
}


/* ===== v1.4.0 base reset: day container should never force square sizing ===== */
.cecm-day{
  width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
}


/* ===== v1.4.1 Link distinction styling ===== */

/* Linked event titles (clickable) */
.cecm-event-title{
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Ensure hover keeps underline */
.cecm-event-title:hover{
  text-decoration: underline;
}

/* Explicitly remove underline for non-link titles */
.cecm-event-title--nolink{
  text-decoration: none !important;
}


/* ===== v1.4.2 Force underline on clickable titles (not hover-dependent) ===== */

/* Direct anchor inside event title */
.cecm-event a,
.cecm-events a{
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

/* Keep underline on hover as well */
.cecm-event a:hover,
.cecm-events a:hover{
  text-decoration: underline !important;
}

/* Non-linked titles (span or div, not anchor) should never have underline */
.cecm-event span{
  text-decoration: none !important;
}





/* ===== Front-end Event Manager UI (polished) ===== */
.cecm-manager{
  background:#fff;
  border:1px solid #000;
  border-radius:14px;
  padding:18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.cecm-manager h3{
  margin: 0 0 12px 0;
  font-size: 18px;
}

.cecm-manager__notice{
  background:#000;
  color:#fff;
  padding:10px 12px;
  margin:0 0 14px 0;
  border-radius:10px;
  font-weight:600;
}

.cecm-manager__actions{
  display:flex;
  justify-content:flex-end;
  margin-bottom:14px;
}

.cecm-manager__grid{
  display:grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap:16px;
  align-items:start;
}

.cecm-manager__list,
.cecm-manager__form{
  border:1px solid #000;
  border-radius:14px;
  padding:14px;
  background:#fff;
}

.cecm-manager__items{
  margin: 10px 0 0 0;
  padding-left: 18px;
}

.cecm-manager__items li{
  
  border-bottom:1px solid rgba(0,0,0,0.12);
}

.cecm-manager__items li:last-child{
  border-bottom:none;
}

.cecm-manager__item-actions{
  font-size: 13px;
  margin-top: 6px;
}

.cecm-manager__item-actions a{
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cecm-manager__thumb img{
  display:block;
  margin-top:10px;
  border:1px solid #000;
  border-radius:10px;
}

.cecm-manager label{
  display:inline-block;
  margin-bottom:6px;
}

.cecm-manager input[type="text"],
.cecm-manager input[type="date"],
.cecm-manager input[type="time"],
.cecm-manager select{
  width: 100%;
  max-width: 560px;
  border:1px solid #000;
  border-radius:10px;
  padding:10px 12px;
  background:#fff;
  box-sizing:border-box;
}

.cecm-manager .wp-editor-wrap{
  max-width: 760px;
}

.cecm-occurrence-table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  max-width: 560px;
  border:1px solid #000;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}

.cecm-occurrence-table th,
.cecm-occurrence-table td{
  border-bottom:1px solid rgba(0,0,0,0.12);
  padding:10px;
  text-align:left;
  vertical-align: middle;
}

.cecm-occurrence-table tr:last-child td{
  border-bottom:none;
}

.cecm-occurrence-table th{
  background:#000;
  color:#fff;
  font-weight:700;
}

.cecm-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid #000;
  background:#fff;
  color:#000;
  padding:10px 12px;
  border-radius:12px;
  text-decoration:none;
  cursor:pointer;
  font-weight:600;
}

.cecm-btn:hover{
  filter: brightness(0.97);
}

.cecm-btn--primary{
  background:#000;
  color:#fff;
}

.cecm-btn:focus{
  outline: 2px solid rgba(0,0,0,0.35);
  outline-offset: 2px;
}

.cecm-remove-occurrence{
  white-space: nowrap;
}

.cecm-manager__form-inner p{
  margin: 12px 0;
}

@media (max-width: 900px){
  .cecm-manager__grid{
    grid-template-columns: 1fr;
  }
  .cecm-manager__actions{
    justify-content: flex-start;
  }
}


/* ===== v1.4.5 Manager filters + blue buttons ===== */
.cecm-manager__actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
}

.cecm-manager__filters{
  display:flex;
  align-items:flex-end;
  gap:10px;
  margin-right:auto; /* push button to right */
}

.cecm-manager__filter-label{
  display:block;
  font-size:12px;
  font-weight:700;
  margin-bottom:4px;
}

.cecm-manager__filters select{
  width:auto;
  min-width:140px;
}

.cecm-manager__actions-spacer{ flex:1; }

.cecm-btn{
  border-color: rgb(15, 117, 188) !important;
  color: rgb(15, 117, 188) !important;
}

.cecm-btn--primary{
  background: rgb(15, 117, 188) !important;
  border-color: rgb(15, 117, 188) !important;
  color: #fff !important;
}

.cecm-manager__notice{
  background: rgb(15, 117, 188) !important;
}

@media (max-width: 900px){
  .cecm-manager__actions{
    flex-wrap:wrap;
    justify-content:flex-start;
  }
  .cecm-manager__filters{
    width:100%;
    margin-right:0;
  }
  .cecm-manager__filters select{
    width:100%;
  }
}


/* ===== v1.4.6 Manager: convert black UI accents to Blue (except text) ===== */
.cecm-manager,
.cecm-manager__list,
.cecm-manager__form,
.cecm-occurrence-table,
.cecm-occurrence-table th,
.cecm-occurrence-table td,
.cecm-manager input[type="text"],
.cecm-manager input[type="date"],
.cecm-manager input[type="time"],
.cecm-manager select,
.cecm-btn{
  border-color: rgb(15, 117, 188) !important;
}

.cecm-manager__notice{
  background: rgb(15, 117, 188) !important;
}

.cecm-occurrence-table th{
  background: rgb(15, 117, 188) !important;
}

.cecm-btn--primary{
  background: rgb(15, 117, 188) !important;
  border-color: rgb(15, 117, 188) !important;
}

.cecm-btn{
  color: rgb(15, 117, 188) !important;
}

.cecm-manager__filters select{
  border-color: rgb(15, 117, 188) !important;
}


/* v1.4.7: Manager list without bullets */
.cecm-manager__items{
  list-style: none;
  padding-left: 0;
}
.cecm-manager__items li{
  padding-left: 0;
}


/* v1.4.7: Make wp_editor toolbar/tabs match Blue */
.cecm-manager .wp-editor-tabs .wp-switch-editor,
.cecm-manager .wp-editor-tabs .wp-switch-editor:focus,
.cecm-manager .wp-editor-tabs .wp-switch-editor:hover{
  border-color: rgb(15, 117, 188) !important;
}

.cecm-manager .wp-editor-tabs .wp-switch-editor{
  background: rgb(15, 117, 188) !important;
  color: #fff !important;
}

.cecm-manager .wp-editor-tabs .wp-switch-editor.switch-tmce,
.cecm-manager .wp-editor-tabs .wp-switch-editor.switch-html{
  background: rgb(15, 117, 188) !important;
  color: #fff !important;
}

.cecm-manager .wp-editor-tabs .wp-switch-editor.wp-switch-editor{
  background: rgb(15, 117, 188) !important;
  color: #fff !important;
}

.cecm-manager .mce-panel,
.cecm-manager .mce-container,
.cecm-manager .mce-toolbar-grp,
.cecm-manager .mce-menubar,
.cecm-manager .mce-top-part{
  border-color: rgb(15, 117, 188) !important;
  background: rgb(15, 117, 188) !important;
}

.cecm-manager .mce-menubar .mce-menubtn button,
.cecm-manager .mce-toolbar .mce-btn button,
.cecm-manager .mce-toolbar .mce-btn .mce-txt,
.cecm-manager .mce-ico{
  color: #fff !important;
}

.cecm-manager .mce-btn:hover button,
.cecm-manager .mce-btn:focus button{
  background: rgba(255,255,255,0.12) !important;
}

.cecm-manager .quicktags-toolbar{
  border-color: rgb(15, 117, 188) !important;
  background: rgb(15, 117, 188) !important;
}

.cecm-manager .quicktags-toolbar input.button{
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.25) !important;
  color:#fff !important;
}


/* v1.4.8: Manager list layout - title left, actions right (same line) */
.cecm-manager__item-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.cecm-manager__item-title{
  flex: 1 1 auto;
}

.cecm-manager__item-actions{
  flex: 0 0 auto;
  white-space: nowrap;
  text-align:right;
}


/* ===== v1.4.9 Manager UI refinements ===== */

/* All manager button fonts black */
.cecm-manager .cecm-btn,
.cecm-manager .cecm-btn--primary{
  color: #000 !important;
}

/* Primary button stays blue but black text */
.cecm-manager .cecm-btn--primary{
  background: rgb(15,117,188) !important;
  border-color: rgb(15,117,188) !important;
}

/* Smaller buttons */
.cecm-manager .cecm-btn{
  padding: 6px 10px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}

/* Smaller inputs */
.cecm-manager input[type="text"],
.cecm-manager input[type="date"],
.cecm-manager input[type="time"],
.cecm-manager select,
.cecm-manager textarea{
  padding: 6px 8px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}

/* Smaller occurrence table cells */
.cecm-occurrence-table th,
.cecm-occurrence-table td{
  padding: 6px 8px !important;
  font-size: 13px !important;
}

/* Reduce vertical spacing */
.cecm-manager__form-inner p{
  margin: 8px 0 !important;
}


/* ===== v1.5.0 Manager typography + buttons ===== */

/* Reduce all manager titles */
.cecm-manager h3{
  font-size:16px !important;
  font-weight:600 !important;
}

.cecm-manager__item-title{
  font-size:14px !important;
  font-weight:600 !important;
}

/* All buttons blue background with black text */
.cecm-manager .cecm-btn,
.cecm-manager .cecm-btn--primary{
  background:rgb(15,117,188) !important;
  border-color:rgb(15,117,188) !important;
  color:#000 !important;
}

.cecm-manager .cecm-btn:hover{
  opacity:0.9;
}


/* ===== v1.5.1 Compact Manager Typography ===== */

/* Smaller section titles */
.cecm-manager h3{
  font-size:14px !important;
  font-weight:600 !important;
  margin-bottom:8px !important;
}

/* Smaller event titles */
.cecm-manager__item-title{
  font-size:13px !important;
  font-weight:600 !important;
}

/* Smaller field labels */
.cecm-manager label,
.cecm-manager__filter-label{
  font-size:12px !important;
  font-weight:600 !important;
  margin-bottom:4px !important;
}

/* Reduce table header font */
.cecm-occurrence-table th{
  font-size:12px !important;
}

/* Slightly reduce general manager font size */
.cecm-manager{
  font-size:13px !important;
}

/* Keep buttons blue background */
.cecm-manager .cecm-btn,
.cecm-manager .cecm-btn--primary{
  background:rgb(15,117,188) !important;
  border-color:rgb(15,117,188) !important;
  color:#000 !important;
}


/* ===== v1.5.8 Manager helper text ===== */
.cecm-manager__help{
  margin-top: 4px;
  font-size: 12px;
  font-style: italic;
  opacity: 0.75;
}


/* v1.6.0: Adjust helper spacing */
.cecm-manager__help{
  line-height: 0;
  margin-bottom: 25px;
}


/* ===== v1.6.4 Manager icon actions (hover) ===== */
.cecm-manager__item-actions{
  display:flex;
  gap:10px;
  opacity:0;
  visibility:hidden;
  transition: opacity .15s ease, visibility .15s ease;
}

.cecm-manager__items li:hover .cecm-manager__item-actions,
.cecm-manager__item-row:hover .cecm-manager__item-actions{
  opacity:1;
  visibility:visible;
}

.cecm-manager__iconlink{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border:1px solid rgb(15,117,188);
  border-radius:8px;
  text-decoration:none !important;
  background:rgb(15,117,188);
}

.cecm-manager__iconlink .dashicons{
  font-size:16px;
  width:16px;
  height:16px;
  color:#000;
}

.cecm-manager__iconlink:hover{
  filter: brightness(0.95);
}


/* ===== v1.6.6 Button text color adjustments ===== */
.cecm-manager button,
.cecm-manager .button,
.cecm-manager input[type="submit"],
.cecm-manager input[type="button"],
.cecm-manager__iconlink {
  color: #ffffff !important;
}

.cecm-manager__iconlink .dashicons {
  color: #ffffff !important;
}


/* ===== v1.6.7 Force white button & icon text ===== */
.cecm-manager .button,
.cecm-manager button,
.cecm-manager input[type="submit"],
.cecm-manager input[type="button"],
.cecm-manager a.button,
.cecm-manager__iconlink,
.cecm-manager__iconlink:link,
.cecm-manager__iconlink:visited,
.cecm-manager__iconlink:hover,
.cecm-manager__iconlink:active {
  color: #ffffff !important;
}

.cecm-manager .button *,
.cecm-manager button *,
.cecm-manager__iconlink *,
.cecm-manager__iconlink .dashicons {
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* Ensure hover does not revert color */
.cecm-manager .button:hover,
.cecm-manager button:hover,
.cecm-manager input[type="submit"]:hover,
.cecm-manager input[type="button"]:hover {
  color: #ffffff !important;
}


/* ===== v1.6.8 Force white text on custom manager buttons ===== */
.cecm-manager .cecm-btn,
.cecm-manager .cecm-btn--primary,
.cecm-manager .cecm-btn:link,
.cecm-manager .cecm-btn:visited,
.cecm-manager .cecm-btn:hover,
.cecm-manager .cecm-btn--primary:hover {
  color: #ffffff !important;
}

.cecm-manager .cecm-btn *,
.cecm-manager .cecm-btn--primary * {
  color: #ffffff !important;
}
