/* Optimized-Styles - MERGED VERSION */
/* This single file styles both the grid page and the banner page. */

/* --- 1. Style Reset Bubble --- */
#splash-page-container,
#splash-page-container * {
    margin: 0;
    padding: 0;
    border: 0;
    font: inherit;
    color: inherit;
    background: transparent;
    box-sizing: border-box;
    text-align: left;
}

/* --- 2. Basic Page Setup --- */
#splash-page-container {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f2f5;
    padding: 1rem;
}

/* --- 3. Content Container --- */
#splash-page-container .content-wrapper {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 1.5rem;
    max-width: 1400px;
    margin: 1rem auto;
    overflow: hidden;
}

/* --- 4. Typography (For Grid Page) --- */
#splash-page-container .page-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

#splash-page-container .page-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.5;
}


/* --- 5. Tile Grid Layout --- */
#splash-page-container .tile-grid {
    display: grid;
    /* Mobile-first: 1 column */
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* --- 6. Base Tile Styling (For All Tiles) --- */
#splash-page-container .tile {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-decoration: none;
    height: 250px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

#splash-page-container .tile figure {
    width: 100%;
    height: 100%;
}

#splash-page-container .tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-out;
}

#splash-page-container .tile figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    background: rgba(45, 69, 103, 0.75);
    transition: background-color 0.3s ease;
}

#splash-page-container .tile p {
    position: absolute;
    bottom: 3.5rem; /* Adjust as needed to sit above figcaption */
    left: 0;
    right: 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    z-index: 2;
}

#splash-page-container .tile:hover p {
    opacity: 1;
}


/* --- 7. Banner Tile Specific Styles (For Banner Page) --- */
#splash-page-container .tile-banner {
    /* This will make the banner span the full width of the grid */
    grid-column: 1 / -1;
    height: 350px;
}

#splash-page-container .tile-banner h2 {
    font-size: 3rem;
    font-weight: 700;
text-align: center;
    margin-bottom: 0.5rem;
}

#splash-page-container .tile-banner p {
    font-size: 1.2rem;
    bottom: .5rem;
}

#splash-page-container .tile-banner figcaption {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    padding: 1.5rem 1rem 0.5rem 1rem;
    background: rgba(45, 69, 103, 0.75); /* Optional background */
    z-index: 2;
}

/* --- 8. Hover & Focus Effects --- */
#splash-page-container .tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

#splash-page-container .tile:hover img {
    transform: scale(1.05);
}

#splash-page-container .tile:hover figcaption {
    background: rgba(45, 69, 103, 0.9);
}

/* --- 9. Responsive Design --- */
@media (min-width: 600px) {
    /* For tablets, use a 2-column grid */
    #splash-page-container .tile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    /* For desktops, create a flexible grid that adds columns as space allows */
    #splash-page-container .tile-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 600px) {
    /* Specific mobile overrides for banner text */
    #splash-page-container .tile-banner h2 {
        font-size: 1.8rem;
    }
    #splash-page-container .tile-banner p {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    #splash-page-container .tile p {
        opacity: 1;
        position: static;
        background: rgba(0, 0, 0, 0.7);
        color: #fff;
        padding: 0.5rem 1rem;
        pointer-events: auto;
    }
}

@media (max-width: 768px) {
  /* Show descriptions for non-banner tiles in normal flow */
  #splash-page-container .tile:not(.tile-banner) {
    height: auto; /* let it grow to fit content */
  }

  #splash-page-container .tile:not(.tile-banner) figure {
    display: flex;
    flex-direction: column;
  }

  #splash-page-container .tile:not(.tile-banner) p {
    position: static !important;
    opacity: 1 !important;
    background: none;
    color: #333;
    padding: 0.5rem 1rem;
    margin: 0;
    text-align: left;
    pointer-events: auto;
  }

  /* Optional: adjust figcaption so title doesn’t compete with the description */
  #splash-page-container .tile:not(.tile-banner) figcaption {
    position: static;
    background: rgba(45, 69, 103, 0.85);
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
}
