/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Pagy pagination */
nav.pagy {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  font-size: 0.875rem;
}
nav.pagy a, nav.pagy span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #e7e5da;
  color: #221f1a;
  text-decoration: none;
}
nav.pagy a:hover { background-color: #f0eee5; }
nav.pagy span.active { background-color: #221f1a; color: white; border-color: #221f1a; }
nav.pagy span.disabled, nav.pagy span.gap { color: #8f8b81; cursor: default; }

/* Stop iOS Safari from auto-zooming when a form field smaller than 16px gains
 * focus (e.g. tapping the status/assignee/date fields while editing a task).
 * A 16px minimum on phones keeps the viewport put without disabling pinch-zoom. */
@media (max-width: 767.98px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px;
  }
}

/* The task title is a <textarea>, so the 16px rule above would otherwise shrink
 * it. Keep it heading-sized (a class beats the bare-element rule). */
.task-title {
  font-size: 1.75rem;
  line-height: 1.2;
}

/* Picker dropdowns (status / client / assignee): let the menu scroll on touch
 * without the scroll bleeding to the page behind it. */
[data-picker-target="menu"],
[data-labels-picker-target="menu"] {
  position: fixed;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* On phones, table/sidebar pickers keep the native <select> (OS sheet is
 * reliable on touch). Task chips pass force-menu so status / priority /
 * assignee stay pills you tap — this rule must not undo that. */
@media (max-width: 767.98px) {
  [data-controller="picker"]:not([data-picker-force-menu-value="true"]) [data-picker-target="button"],
  [data-controller="picker"]:not([data-picker-force-menu-value="true"]) [data-picker-target="menu"] {
    display: none !important;
  }
  [data-controller="picker"]:not([data-picker-force-menu-value="true"]) [data-picker-target="select"] {
    display: block !important;
  }
  [data-picker-force-menu-value="true"] > [data-picker-target="select"] {
    display: none !important;
  }
  [data-picker-force-menu-value="true"] > [data-picker-target="button"] {
    display: inline-flex !important;
  }
}

/* Kanban board on phones: scroll horizontally and snap one lane at a time,
 * like Slack's board. Desktop keeps the whole-page scroll behaviour. */
@media (max-width: 767.98px) {
  .kanban-scroll {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 1rem;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-lane {
    scroll-snap-align: start;
  }
}

/* Comment reaction + overflow: hide until hover on pointer desktops. Touch
 * devices and phones have no hover, so the bar (where Delete lives) stays
 * visible. Matches the 768px phone breakpoint used above. */
@media (hover: hover) and (min-width: 768px) {
  [data-comment-actions] {
    opacity: 0;
  }
  .group:hover [data-comment-actions],
  [data-comment-actions]:focus-within {
    opacity: 1;
  }
}

/* Task/guide description shares the title's left edge (Marker #126).
   Tiptap mounts .ProseMirror inside [data-markdown-edit-target="mount"], so
   this must be a descendant selector. Kept out of the Tailwind source so the
   compiled build cannot drop it. Comments keep the gutter next to the avatar. */
[data-controller="markdown-edit"]:not(.comment-form) .task-prose.ProseMirror {
  margin-left: -1.25rem;
}
@media (max-width: 640px) {
  [data-controller="markdown-edit"]:not(.comment-form) .task-prose.ProseMirror {
    padding-left: 0;
    margin-left: 0;
  }
}

/* Floating mobile navigation follows iOS control sizing and material behavior.
 * The translucent surfaces remain legible when backdrop-filter is unavailable. */
.mobile-nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 1.1rem;
  color: #8f8b81;
  transition: color 180ms ease, background-color 180ms ease, transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 180ms ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-action:active {
  transform: scale(0.94);
}
.mobile-nav-action.is-active {
  color: #221f1a;
  background: rgb(240 238 229 / 0.8);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.65);
}
.mobile-nav-backdrop {
  opacity: 0;
  transition: opacity 180ms ease;
}
.mobile-nav-backdrop.is-visible {
  opacity: 1;
}
.mobile-nav-sheet {
  transform-origin: bottom right;
  animation: mobile-nav-sheet-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-overflow-scrolling: touch;
}
.mobile-nav-sheet.is-closing {
  animation: mobile-nav-sheet-out 180ms cubic-bezier(0.4, 0, 1, 1) both;
}
@keyframes mobile-nav-sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes mobile-nav-sheet-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@media (max-width: 639.98px) {
  dialog.mobile-sheet-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0 !important;
  }
  dialog.mobile-sheet-dialog[open] {
    animation: mobile-dialog-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}
@keyframes mobile-dialog-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-sheet,
  .mobile-nav-sheet.is-closing,
  dialog.mobile-sheet-dialog[open] {
    animation: none;
  }
  .mobile-nav-action,
  .mobile-nav-backdrop,
  .desktop-nav-link {
    transition: none;
  }
}
