select[multiple].w-full {
    width: 100%;
    box-sizing: border-box;
}

/* ===================================================================
   DUAL LAYOUT SYSTEM: Mobile Flexbox + Desktop Masonry
   ===================================================================
   Mobile (<768px): Natural flexbox flow for stability
   Tablet (768-1023px): 2-column grid (projects + feed)
   Desktop (≥1024px): 3-column grid (filters + projects + feed)
*/

/* FIXED DUAL LAYOUT: Proper scroll hierarchy */
.project-container {
  /* @apply w-full min-h-0 flex-1 bg-stone-100; */
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  /* Tailwind stone-100 */
  background-color: #f5f5f4;
  /* No overflow here - parent container should handle scroll */
}

/* MOBILE LAYOUT: Simple flexbox (higher priority) */
@media (max-width: 767px) {
  .project-container {
    /* @apply flex flex-col gap-4 p-4; */
    display: flex !important; /* Override any grid display */
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;

    /* Override any grid settings from desktop */
    grid-template-columns: none !important;
    grid-auto-rows: auto !important;
  }

  .project-container .item {
    /* @apply w-full mb-0; */
    width: 100%;
    margin-bottom: 0;
    /* Force grid items to behave like flex items */
    grid-row-end: auto !important;
    grid-row-start: auto !important;
  }
}

/* OPTIONAL: Large-phone dual column (non-grid, Pinterest-like)
   Activate by adding class .mobile-cols-2 to #project-list (project-container)
   We use CSS multi-column for simple, staggered visual; reading order is per-column. */
@media (min-width: 480px) and (max-width: 767px) {
  .project-container.mobile-cols-2 {
    /* override mobile flex layout */
    display: block !important;
    column-count: 2;
    column-gap: 1rem;
    padding: 0 1rem; /* similar horizontal padding */
  }
  .project-container.mobile-cols-2 .item {
    break-inside: avoid;
    width: 100%;
    display: inline-block; /* needed inside multi-column */
    margin: 0 0 1rem; /* vertical spacing between items */
  }
}

/* DESKTOP DEFAULT: Prevent single-column flash on desktop */
@media (min-width: 768px) {
  .project-container {
    display: grid;
    grid-gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: auto; /* Use auto initially, JavaScript sets to 2px */
  }
}

/* DESKTOP LAYOUT: Only when JavaScript adds .desktop-masonry */
.project-container.desktop-masonry {
  display: grid;
  grid-gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 2px;
  /* No overflow here - parent handles scroll */
}

/* DESKTOP LAYOUT: Responsive masonry columns */
@media (min-width: 768px) and (max-width: 1023px) {
  .project-container.desktop-masonry {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* SINGLE-COLUMN SAFETY: At narrow tablet widths the project column (~475px) only fits
   1 card column. With grid-auto-rows:2px and no spans yet applied cards collapse and
   overlap. Override to auto rows so the grid displays cleanly before JS calculates spans. */
@media (min-width: 768px) and (max-width: 900px) {
  .project-container.desktop-masonry {
    grid-auto-rows: auto !important;
  }
  .project-container.desktop-masonry .item {
    grid-row-end: auto !important;
  }
}

/* LEGACY SUPPORT: Maintain .masonry-grid class for backwards compatibility */
.masonry-grid {
  /* @apply w-full min-h-0 flex-1 bg-stone-100 overflow-y-auto; */
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  background-color: #f5f5f4;
  overflow-y: auto;
}

@media (min-width: 768px) {
  .masonry-grid {
    display: grid;
    grid-gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 2px;
  }
}


/*div {*/
/*    border: solid 1px red;*/
/*}*/

/*.inner-card {*/
/*}*/

.month-container {
    display: grid;
    grid-template-rows: 1fr 6fr;
    justify-content: space-between;
    border: solid 2px var(--first-color);
    width: auto;
    border-radius: 5px;
    margin-bottom: .5rem;
}


.comment {
    /*border: 1px solid lightslategray;*/
    /*border-radius: 5px;*/
    margin-bottom: 10px;
    padding: 5px;
}

.media {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.media-body {
    flex: 1;
    padding: 5px;
}

.media-list {
    width: 100%;
    max-width: 800px;
    margin-left: 0;
}

.step-primary::before {
    background-color: #D97706;
    color: white;
    border-color: #D97706;
}


/* TinyMCE editor styles (migrated from django-quill Dec 2025) */
.tinymce-editor-container {
    width: 100%;
}

/* Make sure form controls in modals have appropriate spacing */
#modal-content .form-control {
    margin-bottom: 1rem;
}

/* Specific styles for smaller screens */
@media (max-width: 767px) {
    /* Mobile form improvements */
  .form-control,
  input:not([type="checkbox"]):not([type="radio"]),
  textarea,
  select {
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
    }

  /* Keep save-default checkbox square in mobile filters drawer */
  #mobile-filters .filter-default-save-row input[type="checkbox"] {
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem;
    min-height: 1rem;
    max-width: 1rem !important;
    flex: 0 0 auto;
  }

    /* Mobile-friendly button spacing */
    .btn {
        min-height: 44px; /* iOS minimum touch target */
        margin: 0.25rem 0;
    }

    /* Better spacing for mobile forms */
    .form__field {
        margin-bottom: 1rem;
    }

    /* Mobile button improvements */
    .btn {
        min-height: 44px; /* iOS minimum touch target */
        margin: 0.25rem 0;
    }
}

/*Alpine js style*/

[x-cloak] {
    display: none !important;
}


/*positiondate avatar*/
/* Add to your CSS */
.team-member-avatar {
    position: relative;
    display: inline-block;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar.grayscale {
    filter: grayscale(100%);
}

.name-plate-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.status-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.status-none {
  background-color: var(--color-neutral-300);
  color: var(--color-text-muted);
}

.status-pending {
  background-color: var(--color-warning);
    color: white;
}

.status-accepted {
  background-color: var(--color-success);
    color: white;
}

.status-changes {
  background-color: var(--color-primary);
    color: white;
}

.contact-options-link {
    margin-left: 5px;
}

/*ITEM MODAL STYLES*/
.form-control {
    width: 100%;
}

input:not([type="checkbox"]):not([type="radio"]), textarea, select {
    max-width: 100%;
}

/* Custom textarea width overrides */
.textarea {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* More specific override for comment forms */
.comment-form .textarea {
  width: 100% !important;
}

/* ----------------------------------------------------------
   Avatar utilities (ProjShare)
   ----------------------------------------------------------
   Purpose: Provide consistent, responsive, and round avatar
   styling across the app while avoiding one-off styles.

   Usage:
     <img class="ps-avatar ps-avatar--sm" ...>
     <div class="ps-profile-avatar-frame"><img class="ps-avatar" ...></div>
*/

.ps-avatar {
  display: inline-block;
  border-radius: 9999px; /* rounded-full */
  object-fit: cover;
  object-position: center;
  background-color: #f3f4f6; /* gray-100 fallback */
  aspect-ratio: 1 / 1;
}

/* Common sizes */
.ps-avatar--sm { width: 32px; height: 32px; }
.ps-avatar--md { width: 40px; height: 40px; }
.ps-avatar--lg { width: 64px; height: 64px; }
.ps-avatar--xl { width: 96px; height: 96px; }
/* Parity size with Tailwind w-11/h-11 (44px) */
.ps-avatar--44 { width: 44px; height: 44px; }

/* Profile page avatar frame: consistent but responsive */
.ps-profile-avatar-frame { width: 180px; aspect-ratio: 1 / 1; }
@media (min-width: 640px) { .ps-profile-avatar-frame { width: 200px; } }
@media (min-width: 768px) { .ps-profile-avatar-frame { width: 240px; } }
@media (min-width: 1024px) { .ps-profile-avatar-frame { width: 280px; } }

.ps-profile-avatar-frame > img.ps-avatar { width: 100%; height: 100%; }

/* ----------------------------------------------------------
   Performance & Accessibility Improvements
   ----------------------------------------------------------

   ROLLBACK INSTRUCTIONS:
   To restore original colors, delete this entire section
   from "Performance & Accessibility Improvements" to the end
   and keep only the original css above.
*/

/* Enhanced color contrast for accessibility compliance */
/* Original brand accent -> standardized to primary brand color */
/* Original amber-600: #d97706 -> Enhanced to slightly darker amber-700: #b45309 */

/* Apply enhanced contrast to key elements - ROLLBACK: Remove this section */

/* Enhanced text readability - more conservative */

/* Performance & Layout Shift Improvements */
/* Image optimization with aspect ratio preservation */
.aspect-ratio-img {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.aspect-ratio-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Avatar containers with fixed dimensions */
.avatar-container {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
}

/* Prevent layout shift during loading */
.loading-skeleton {
  background: linear-gradient(90deg, rgba(228, 228, 231, 0.8) 25%, rgba(250, 250, 250, 0.8) 50%, rgba(228, 228, 231, 0.8) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Minimize content jump */
.content-container {
  min-height: 100vh;
  padding-top: 80px; /* Account for fixed navbar */
}

/* Grid container stability - merged into main .masonry-grid rule above */

/*!*js-tree*!*/
/*!* Tailwind-based custom styles for jstree *!*/
/*.jstree-node {*/
/*    @apply inline-flex items-center space-x-2 p-2 rounded hover:bg-gray-100;*/
/*}*/

/*.jstree-anchor {*/
/*    @apply text-blue-600 font-medium hover:underline;*/
/*}*/

/*.jstree-children {*/
/*    @apply ml-4 mt-2 border-l border-gray-300 pl-4;*/
/*}*/

/*!* Custom styles for jsTree to ensure proper spacing and indentation *!*/

/*!* Add vertical spacing between all nodes *!*/
/*.jstree-container-ul .jstree-node {*/
/*    margin-bottom: 0.5rem; !* Adjust as needed *!*/
/*}*/

/*!* Ensure nested lists (child nodes) are properly indented *!*/
/*.jstree-container-ul .jstree-children {*/
/*    padding-left: 1.5rem; !* Adjust indentation level as needed *!*/
/*}*/

/*!* Optional: Adjust the line height of the node text for better vertical alignment *!*/
/*.jstree-anchor {*/
/*    line-height: 24px !important; !* Match height of icons/buttons if any *!*/
/*}*/
