/* /static/css/common/sections_nav_grid.css */

/* --- Variables --- */
:root {
  --sng-primary: #2563eb;       /* Blue accent */
  --sng-hover: #1e40af;         /* Darker blue for hover */
  --sng-bg: #ffffff;            /* White card background */
  --sng-text: #1f2937;          /* Dark text */
  --sng-border: #e5e7eb;        /* Light grey border */
  --sng-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --sng-radius: 8px;
}

/* --- Main Container --- */
.sections-nav-grid {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
  box-sizing: border-box;
}

/* --- The Grid Wrapper --- */
.sections-nav-grid-item {
  display: grid;
  /* CHANGED: reduced min-width from 280px to 220px.
     This allows 4 items to fit in a row (4 x 220 = 880px + gaps). */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
}

/* Optional: Add 'compact-grid' to the wrapper to tighten gaps */
.sections-nav-grid-item.compact-grid {
  gap: 10px;
}

/* --- Spacing Utility --- */
.margin_bottom_50 {
  margin-bottom: 25px;
}

/* --- Standard Card/Button Style --- */
a.sections-nav-grid-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;

  background-color: var(--sng-bg);
  color: var(--sng-text);
  text-decoration: none;

  /* Standard Dimensions */
  min-height: 90px;
  padding: 20px;

  /* Visual Styling */
  border: 1px solid var(--sng-border);
  border-radius: var(--sng-radius);
  box-shadow: var(--sng-shadow);
  border-bottom: 4px solid var(--sng-primary);

  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.4;

  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* --- NARROW VARIANT --- */
/* Add class="sections-nav-grid-link narrow" to use this */
a.sections-nav-grid-link.narrow {
  min-height: 50px;       /* Much shorter height */
  padding: 10px 15px;     /* Reduced padding on all sides */
  font-size: 1rem;        /* Slightly smaller text */
  border-bottom-width: 3px;
}

/* --- Hover Effects --- */
a.sections-nav-grid-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
  border-bottom-color: var(--sng-hover);
  color: var(--sng-primary);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
  .sections-nav-grid {
    width: 95%;
  }

  .sections-nav-grid-item {
    /* Stacks vertically on mobile */
    grid-template-columns: 1fr;
  }

  a.sections-nav-grid-link {
    min-height: 70px;
    font-size: 1rem;
  }

  /* Ensure narrow stays narrow on mobile */
  a.sections-nav-grid-link.narrow {
    min-height: 45px;
    padding: 10px;
  }
}