/* ------------------- */
/* Section nav container */
/* ------------------- */
.section-nav {
  display: flex;
  flex-direction: row;

  gap: 0.5rem;
  flex-wrap: wrap;  /* This will allow the buttons to wrap when space is tight */
}

/* Base tab item */
.tab-item {
  position: relative;
}

/* Base tab button */
.tab-btn {
  padding: 0.5rem 1rem;
  width: 133px;
  height: 50px;
  background: #f0f0f0;
  border: 2px solid #ddd; /* blue border button */
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

/* Hover and active states */
.tab-btn:hover {
  background: #363581;
  color: white;
  font-weight: bold;
}

.tab-btn.active {
  background: #363581;
  color: white;
  font-weight: bold;
}

/* Add arrow for dropdown */
.tab-item.has-children > .tab-btn::after {
  content: "▾";
  margin-left: 0.25rem;
  font-size: 0.8em;
}

/* ------------------- */
/* Dropdown submenu */
/* ------------------- */
.tab-submenu {
  display: flex;
  flex-direction: column;
  width: 118px;
  gap: 0;
  position: absolute;
  top: 100%;
  padding: 0.0rem 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  min-width: 140px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);

  /* Fade/slide effect */
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none; /* prevents invisible dropdown from blocking clicks */
  z-index: 100;
}

/* Show submenu on hover for desktop */
@media (min-width: 769px) {
  .tab-item.has-children:hover > .tab-submenu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Remove .open effect on desktop to prevent sticky menu */
  .tab-item.has-children.open > .tab-submenu {
    opacity: 0;
    transform: translateY(5px);
    pointer-events: none;
  }
}

/* Show submenu on click only for mobile */
@media (max-width: 768px) {
  .tab-item.has-children.open > .tab-submenu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* Dropdown buttons styling */
.tab-submenu .tab-btn {
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  border-radius: 0;
  background: transparent;
  color: #333;
}

.tab-submenu .tab-btn:hover {
  background: #f0f0f0;
}

/* ------------------- */
/* Section content styling */
/* ------------------- */
.section-panel {
  border-top: 1px solid #ddd;
  padding: 1rem;
}

/* Section inline image */
.image-link {
  text-decoration: none;
  color: inherit;
  display: inline-block; /* keeps the image layout intact */
}

.image-plus-wrapper {
  display: flex;
  justify-content: center; /* Horizontally center */
  align-items: center;     /* Vertically center if needed */
  width: 100%;             /* Take full width of the parent */
  max-width: 1200px;       /* Optional: Set a max width for the grid */
  margin: 0 auto;          /* Ensure it's centered inside its parent */
}

/* The grid container */
.image-plus-block {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); /* Responsive grid columns */
  gap: 10px; /* Space between grid items */
  width: 100%; /* Make sure it takes full width */
}

/* Styling for the images inside the grid */
.image-plus {
  width: 100%; /* Ensure images take the full width of their grid cells */
  height: auto; /* Maintain aspect ratio */
  display: block; /* Make images behave like block elements */
}

.image-plus-block p {
  margin: 0;
}

.image-plus-block a {
  display: block; /* Ensure links are block-level */
}


/* Grid for picword blocks */
.picword-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin: 2rem;
}

/* Individual picword block */
.picword-block {
  text-align: center;
  border: 1px solid #ccc; /* You can change this to a more subtle border or remove it */
  border-radius: 8px;
  background-color: #f9f9f9;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Enhanced shadow for depth */
  padding: 1.5rem; /* Added padding for a slightly larger feel */
  transition: box-shadow 0.3s ease, transform 0.3s ease; /* Smooth transition for shadow and lift effect */
}

.picword-block:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Darker shadow for hover effect */
  transform: translateY(-5px); /* Lift effect when hovered */
}

/* picword icon */
.picword-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 0;
}

/* Link inside picword block */
.picword-link {
  text-decoration: none;
  color: inherit;
  display: contents; /* keeps the grid layout intact */
}

/* Title text inside picword block */
.picword-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem; /* Slight margin for spacing */
  font-weight: bold; /* Bold text for better visibility */
}

/* Description text inside picword block */
.picword-text {
  font-size: 1rem;
  text-align: center;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive: single column grid for smaller screens */
@media (max-width: 1000px) {
  .picword-grid {
    grid-template-columns: 1fr;
  }
}

