/**
 * PROJECTS PAGE - RESPONSIVE FIX
 * Fixes double scrollbar + makes page fully responsive
 * Add this to: themes/custom/cif_theme/css/projects-responsive.css
 */

/* ============================================
   FIX DOUBLE SCROLLBAR ISSUE
   ============================================ */

/* Override any conflicting overflow rules */
.projects-page {
  overflow-x: visible !important;
  overflow-y: visible !important;
  width: 100% !important;
  max-width: 100vw !important;
}

.projects-page .bg-gray-50 {
  overflow-x: visible !important;
  overflow-y: visible !important;
}

.projects-page .container {
  max-width: 1280px !important;
  margin: 0 auto !important;
  overflow-x: visible !important;
}

/* Ensure main content area doesn't create extra scrollbar */
main.cif-main {
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

/* ============================================
   HERO SECTION - RESPONSIVE
   ============================================ */

.projects-page .page-hero {
  padding: 2rem 1rem !important;
}

@media (min-width: 640px) {
  .projects-page .page-hero {
    padding: 2.5rem 1.5rem !important;
  }
}

@media (min-width: 768px) {
  .projects-page .page-hero {
    padding: 3rem 1.5rem !important;
  }
}

/* Hero container */
.projects-page .page-hero .container {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

@media (min-width: 640px) {
  .projects-page .page-hero .container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

/* Breadcrumb navigation */
.projects-page .page-hero nav {
  font-size: 0.75rem !important;
  margin-bottom: 0.75rem !important;
}

@media (min-width: 640px) {
  .projects-page .page-hero nav {
    font-size: 0.875rem !important;
    margin-bottom: 1rem !important;
  }
}

/* Hero heading */
.projects-page .page-hero h1 {
  font-size: 1.875rem !important;
  margin-bottom: 0.5rem !important;
  line-height: 1.2 !important;
}

@media (min-width: 640px) {
  .projects-page .page-hero h1 {
    font-size: 2.5rem !important;
  }
}

@media (min-width: 768px) {
  .projects-page .page-hero h1 {
    font-size: 3rem !important;
  }
}

@media (min-width: 1024px) {
  .projects-page .page-hero h1 {
    font-size: 3.5rem !important;
  }
}

/* Hero flex container */
.projects-page .page-hero .flex {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 1rem !important;
}

@media (min-width: 768px) {
  .projects-page .page-hero .flex {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
}

/* ============================================
   CONTENT AREA - RESPONSIVE
   ============================================ */

.projects-page .bg-gray-50 {
  padding: 2rem 0 !important;
  min-height: auto !important;
}

@media (min-width: 768px) {
  .projects-page .bg-gray-50 {
    padding: 3rem 0 !important;
  }
}

@media (min-width: 1024px) {
  .projects-page .bg-gray-50 {
    padding: 1rem 0 !important;
  }
}

.projects-page .bg-gray-50 .container {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

@media (min-width: 640px) {
  .projects-page .bg-gray-50 .container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

/* ============================================
   NEW PROJECT BUTTON - RESPONSIVE
   ============================================ */

.projects-page .bg-orange-500 {
  width: 100% !important;
  justify-content: center !important;
  padding: 0.625rem 1rem !important;
  font-size: 0.875rem !important;
}

@media (min-width: 640px) {
  .projects-page .bg-orange-500 {
    width: auto !important;
    padding: 0.75rem 1.25rem !important;
  }
}

@media (min-width: 768px) {
  .projects-page .bg-orange-500 {
    padding: 0.5rem 1rem !important;
  }
}

.projects-page .flex.justify-end {
  justify-content: center !important;
  margin-bottom: 1rem !important;
}

@media (min-width: 640px) {
  .projects-page .flex.justify-end {
    justify-content: flex-end !important;
    margin-bottom: 1.5rem !important;
  }
}

/* ============================================
   SEARCH/FILTER BOX - RESPONSIVE
   ============================================ */

.projects-page .bg-white.rounded-lg.shadow-sm {
  padding: 1rem !important;
  margin-bottom: 1rem !important;
}

@media (min-width: 640px) {
  .projects-page .bg-white.rounded-lg.shadow-sm {
    padding: 1.25rem !important;
  }
}

@media (min-width: 768px) {
  .projects-page .bg-white.rounded-lg.shadow-sm {
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
  }
}

/* Search heading */
.projects-page h6 {
  font-size: 0.75rem !important;
  margin-bottom: 0.75rem !important;
}

@media (min-width: 640px) {
  .projects-page h6 {
    font-size: 0.875rem !important;
    margin-bottom: 1rem !important;
  }
}

/* ============================================
   FILTER FORM - RESPONSIVE GRID
   ============================================ */

.projects-page .views-exposed-form {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0.75rem !important;
  align-items: end !important;
}

@media (min-width: 480px) {
  .projects-page .views-exposed-form {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
}

@media (min-width: 768px) {
  .projects-page .views-exposed-form {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (min-width: 1024px) {
  .projects-page .views-exposed-form {
    grid-template-columns: 2fr 1fr 1fr 1fr !important;
  }
}

/* Form items */
.projects-page .views-exposed-form .form-item {
  margin: 0 !important;
}

/* Labels */
.projects-page .views-exposed-form label {
  font-size: 0.75rem !important;
  margin-bottom: 0.375rem !important;
}

@media (min-width: 768px) {
  .projects-page .views-exposed-form label {
    font-size: 0.875rem !important;
    margin-bottom: 0.5rem !important;
  }
}

/* Inputs and selects */
.projects-page .views-exposed-form input[type="text"],
.projects-page .views-exposed-form select {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.8125rem !important;
}

@media (min-width: 768px) {
  .projects-page .views-exposed-form input[type="text"],
  .projects-page .views-exposed-form select {
    padding: 0.625rem 0.875rem !important;
    font-size: 0.875rem !important;
  }
}

/* ============================================
   RESULTS COUNT - RESPONSIVE
   ============================================ */

.projects-page .mb-4.text-sm {
  font-size: 0.75rem !important;
  margin-bottom: 0.75rem !important;
  padding: 0 0.25rem !important;
}

@media (min-width: 768px) {
  .projects-page .mb-4.text-sm {
    font-size: 0.875rem !important;
    margin-bottom: 1rem !important;
  }
}

/* ============================================
   TABLE CONTAINER - FIX SCROLLBAR
   ============================================ */

.projects-page .bg-white.rounded-lg.shadow-sm.overflow-hidden {
  overflow: visible !important;
  margin-bottom: 1.5rem !important;
}

@media (min-width: 768px) {
  .projects-page .bg-white.rounded-lg.shadow-sm.overflow-hidden {
    margin-bottom: 2rem !important;
  }
}

/* Table wrapper - horizontal scroll on mobile only */
.projects-page .overflow-x-auto {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
  margin: 0 !important;
}

@media (min-width: 1024px) {
  .projects-page .overflow-x-auto {
    overflow-x: visible !important;
  }
}

/* ============================================
   TABLE - RESPONSIVE
   ============================================ */

.projects-page .projects-table {
  min-width: 900px !important;
  width: 100% !important;
}

@media (min-width: 1024px) {
  .projects-page .projects-table {
    min-width: 100% !important;
  }
}

/* Table headers */
.projects-page .projects-table th {
  padding: 0.625rem 0.75rem !important;
  font-size: 0.6875rem !important;
}

@media (min-width: 640px) {
  .projects-page .projects-table th {
    padding: 0.75rem 0.875rem !important;
    font-size: 0.75rem !important;
  }
}

@media (min-width: 1024px) {
  .projects-page .projects-table th {
    padding: 1rem !important;
  }
}

/* Table cells */
.projects-page .projects-table td {
  padding: 0.625rem 0.75rem !important;
  font-size: 0.8125rem !important;
}

@media (min-width: 640px) {
  .projects-page .projects-table td {
    padding: 0.75rem 0.875rem !important;
    font-size: 0.875rem !important;
  }
}

@media (min-width: 1024px) {
  .projects-page .projects-table td {
    padding: 1rem !important;
  }
}

/* ============================================
   PAGINATION - RESPONSIVE
   ============================================ */

.projects-page .mt-8 {
  margin-top: 1.5rem !important;
}

@media (min-width: 768px) {
  .projects-page .mt-8 {
    margin-top: 2rem !important;
  }
}

.projects-page .pager__items {
  flex-wrap: wrap !important;
  gap: 0.25rem !important;
  justify-content: center !important;
}

@media (min-width: 640px) {
  .projects-page .pager__items {
    gap: 0.5rem !important;
  }
}

.projects-page .pager__item a {
  min-width: 1.875rem !important;
  height: 1.875rem !important;
  padding: 0 0.375rem !important;
  font-size: 0.75rem !important;
}

@media (min-width: 640px) {
  .projects-page .pager__item a {
    min-width: 2.25rem !important;
    height: 2.25rem !important;
    padding: 0 0.625rem !important;
    font-size: 0.8125rem !important;
  }
}

@media (min-width: 768px) {
  .projects-page .pager__item a {
    min-width: 2.5rem !important;
    height: 2.5rem !important;
    padding: 0 0.75rem !important;
    font-size: 0.875rem !important;
  }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 479px) {
  /* Very small screens - stack everything */
  .projects-page .views-exposed-form {
    grid-template-columns: 1fr !important;
  }
  
  /* Smaller table text */
  .projects-page .projects-table {
    min-width: 800px !important;
  }
  
  .projects-page .projects-table th,
  .projects-page .projects-table td {
    padding: 0.5rem 0.625rem !important;
    font-size: 0.6875rem !important;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .projects-page .page-hero,
  .projects-page .views-exposed-form,
  .projects-page .pager,
  .projects-page .bg-orange-500 {
    display: none !important;
  }
  
  .projects-page .projects-table {
    min-width: 100% !important;
  }
}