/* =================================================== */
/* 1. Base Layout and Container (Unchanged)             */
/* =================================================== */

/* Ensure footer stays within viewport */
body, html {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  font-family: Arial, sans-serif;
  flex-direction: column;
  background: #f8f8f8; /* White background for the body */
}

footer {
  flex-shrink: 0; /* footer stays visible */
}

/* Two cards per row layout */
.division-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 cards per row */
  gap: 30px 2px; /* 30px row gap, 5px column gap */
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  margin-top: 20px;
  margin-left: 5%;
  margin-right: 5%;
  height: 100%; /* fill main height */
  max-width: 90%;
}


/* =================================================== */
/* 2. Button Styling (Option 2: Gradient, Icon Ready)  */
/* =================================================== */

.division-card {
  display: flex;
  /* Align items to the center left to make room for the icon */
  justify-content: left; 
  align-items: center;
  padding-left: 15%;
  color: #ffffff;
  font-size: 1.15rem;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  text-align: left; /* Align text to the left */
  
  /* Smoother transition for all effects */
  transition: transform 0.2s ease, background 0.25s ease, box-shadow 0.25s ease;
  
  min-height: 90px;
  
  /* Softer Shadow */
  box-shadow: 4px 4px 12px rgba(0,0,0,0.15);
  
  flex-wrap: nowrap;
  white-space: normal;
  max-width: 60%;
  margin-right: 0px;
  margin-left: 12%;
  
  /* --- Option 2 Gradient (Default State) --- */
  background: linear-gradient(to bottom, #5A8498 0%, #405E6D 100%);
}

/* Style for the Icon inside the card (Assumes icon is the first element) */
.division-card > i, .division-card > span:first-child {
    font-size: 1.8rem; /* Large icon size */
    margin-right: 15px; /* Space between icon and text */
    min-width: 30px; /* Ensures text doesn't overlap icon */
    text-align: center;
}

.division-card:hover {
  /* --- Option 2 Hover State (Reverse/Darkened Gradient) --- */
  background: linear-gradient(to bottom, #005B85 0%, #004A6D 100%);
  
  transform: translateY(-3px); /* Slightly more prominent lift */
  box-shadow: 8px 8px 20px rgba(0,0,0,0.25); /* Stronger hover shadow */
}

.division-card:active {
  transform: scale(0.97);
}


/* =================================================== */
/* 3. Last Card Override (Spans two columns and centers)*/
/* =================================================== */

.division-card:last-child {
  /* Merge two columns */
  grid-column: 1 / span 2; 
  justify-content: center;
  
  /* Center the card within the merged area */
  justify-self: center; 
  
  /* Align content (icon/text) inside the flex container back to center */
  /* justify-content: center;  */
  text-align: center;
  
  /* Max-width is kept to ensure the card maintains its size */
  min-width: 28%; 
  margin-left: 0%;
  padding-left: 0%;
  max-width: 60%;
}

/* =================================================== */
/* 4. Mobile Responsiveness (< 768px)                 */
/* =================================================== */

@media (max-width: 768px) {

    /* --- Container Changes: Switch to Single Column --- */
    .division-container {
        /* Change from 2 columns to 1 column */
        grid-template-columns: 1fr; 
        /* Increase the gap between the now stacked cards */
        gap: 20px; 
        /* Use full width for the container */
        max-width: 95%; 
        /* Center the container */
        margin-left: auto; 
        margin-right: auto;
        /* Reduce padding slightly */
        padding: 10px; 
    }

    /* --- General Card Adjustments for Mobile --- */
    .division-card {
        /* Use closer to full width for visibility */
        max-width: 100%; 
        /* Center the card content */
        justify-content: center; 
        /* Remove desktop-specific margin/padding overrides */
        margin-left: 0;
        padding-left: 0;
        /* Make text slightly smaller */
        font-size: 1.05rem; 
        /* Ensure text and icon align nicely in the center */
        text-align: center;
    }
    
    /* Ensure icon/text spacing is uniform when centered */
    .division-card > i, .division-card > span:first-child {
        /* Keep icon size the same for visual punch */
        font-size: 1.6rem; 
        /* Ensure there's space between icon and text */
        margin-right: 10px; 
        /* Override text alignment back to default (center) for the icon */
        text-align: center; 
    }

    /* --- Last Card Override for Mobile --- */
    .division-card:last-child {
        /* Reset to occupy only one column (standard behavior for mobile) */
        grid-column: auto; 
        /* Reset centering properties if they conflict with card centering */
        justify-self: stretch; /* Takes up the full grid column width */
        /* Reset minimum width to follow the standard card size */
        min-width: 100%; 
        /* Ensure text is centered inside the card (again) */
        text-align: center; 
    }
}