/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@keyframes toast-in-out {
  0%   { opacity: 0; transform: translateX(1rem); }
  4%   { opacity: 1; transform: translateX(0); }
  75%  { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(0.5rem); }
}

.flash-alert {
  animation: toast-in-out 6s 200ms both;
}

/* Override popover default positioning */
.flash-alert:popover-open {
  inset: auto;
  top: 1.25rem;
  right: 1.25rem;
}

/* Preview mode banner spacing */
body.preview-mode-active main {
  padding-top: 3.5rem;
}

@media (min-width: 640px) {
  body.preview-mode-active main {
    padding-top: 3.5rem;
  }
}


/* Blog editor and content styles */
.ProseMirror h2 { font-size: 1.5em; font-weight: 700; margin-top: 1em; margin-bottom: 0.5em; }
.ProseMirror h3 { font-size: 1.25em; font-weight: 600; margin-top: 0.75em; margin-bottom: 0.5em; }
.ProseMirror h4 { font-size: 1.1em; font-weight: 600; margin-top: 0.5em; margin-bottom: 0.25em; }
.ProseMirror blockquote { border-left: 4px solid #d1d5db; padding-left: 1em; margin-left: 0; margin-bottom: 0.5em; color: #4b5563; }
.ProseMirror pre { background-color: #1f2937; color: #e5e7eb; border-radius: 0.5em; padding: 1em; margin-bottom: 0.5em; overflow-x: auto; }
.ProseMirror code { background-color: #f3f4f6; padding: 0.15em 0.3em; border-radius: 0.25em; font-size: 0.875em; }
.ProseMirror pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; }
.ProseMirror img { max-width: 100%; height: auto; border-radius: 0.5em; margin: 1em 0; }
.ProseMirror a { color: #2563eb; text-decoration: underline; }
.ProseMirror hr { border: none; border-top: 2px solid #e5e7eb; margin: 1.5em 0; }

/* ProseMirror dark mode */
@media (prefers-color-scheme: dark) {
  .ProseMirror,
  .ProseMirror p,
  .ProseMirror li,
  .ProseMirror h1,
  .ProseMirror h2,
  .ProseMirror h3,
  .ProseMirror h4,
  .ProseMirror strong,
  .ProseMirror b,
  .ProseMirror em,
  .ProseMirror ol,
  .ProseMirror ul { color: #e5e7eb !important; }
  .ProseMirror blockquote { border-left-color: #4b5563; color: #9ca3af !important; }
  .ProseMirror code { background-color: #374151; color: #e5e7eb !important; }
  .ProseMirror a { color: #60a5fa !important; }
  .ProseMirror hr { border-top-color: #4b5563; }
}

/* ── Date Picker ───────────────────────────────────────────────────── */

.dp-popover {
  position: absolute;
  z-index: 50;
  width: 304px;
  background: #fff;
  border: 1px solid #EFEAE3; /* warm-gray-200 */
  border-radius: 12px;
  box-shadow: 0 8px 24px -4px rgba(35, 31, 26, 0.12), 0 2px 8px -2px rgba(35, 31, 26, 0.06);
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  font-family: 'IBM Plex Sans', sans-serif;
}
.dp-popover--open { opacity: 1; pointer-events: auto; }

/* Header row: ← label → */
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dp-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  border-radius: 8px;
  color: #625D57; /* warm-gray-900 */
  cursor: pointer;
  transition: background-color 0.15s;
}
.dp-nav-btn:hover { background-color: #F8F3ED; } /* warm-gray-100 */

.dp-header-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #231F1A; /* warm-gray-950 */
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background-color 0.15s;
}
.dp-header-label:hover { background-color: #F8F3ED; }
.dp-header-label--static { cursor: default; }
.dp-header-label--static:hover { background-color: transparent; }

/* Weekday headers */
.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 4px;
}
.dp-weekdays span {
  font-size: 12px;
  font-weight: 600;
  color: #8B8680; /* warm-gray-800 */
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Shared cell base */
.dp-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  color: #231F1A; /* warm-gray-950 */
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

/* Day cells — circular, 7-col grid */
.dp-grid--days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-grid--days .dp-cell {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border-radius: 50%;
}
.dp-grid--days .dp-cell:hover:not(.dp-cell--selected):not(.dp-cell--disabled):not(.dp-cell--outside) {
  background-color: #F8F3ED; /* warm-gray-100 */
}

/* Month cells — rounded rect, 4-col grid */
.dp-grid--months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 8px;
}
.dp-grid--months .dp-cell {
  height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.dp-grid--months .dp-cell:hover:not(.dp-cell--selected):not(.dp-cell--disabled) {
  background-color: #F8F3ED;
}

/* Year cells — rounded rect, 2-col (5 rows) grid */
.dp-grid--years {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-top: 8px;
}
.dp-grid--years .dp-cell {
  height: 44px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
}
.dp-grid--years .dp-cell:hover:not(.dp-cell--selected):not(.dp-cell--disabled) {
  background-color: #F8F3ED;
}

/* Cell states */
.dp-cell--outside {
  color: #C7C2BB; /* warm-gray-600 */
  cursor: default;
}
.dp-cell--today {
  border: 1.5px solid #44B59F; /* mint-700 */
  font-weight: 600;
}
.dp-cell--selected {
  background-color: #44B59F; /* mint-700 */
  color: #fff;
  font-weight: 600;
}
.dp-cell--selected:hover {
  background-color: #007261; /* mint-800 */
}
.dp-cell--disabled {
  color: #D7D2CB; /* warm-gray-500 */
  cursor: default;
}

/* Footer with "Today" button */
.dp-footer {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid #EFEAE3; /* warm-gray-200 */
}
.dp-today-btn {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #44B59F; /* mint-700 */
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 8px;
  transition: background-color 0.15s;
}
.dp-today-btn:hover {
  background-color: #EEF7F4; /* mint-100 */
}
