/*
  _homepage.css: This stylesheet contains styles specific to the homepage.
*/

/*
  ==========================================================================
  HOMEPAGE HEADER SPACING FIX - COMPLETELY REVISED
  ==========================================================================
  The homepage uses a special layout that needs different spacing than other pages.
  We need to account for the fixed header height properly.
*/

/* Remove the default padding-top for homepage only, we'll handle it in the layout */
main.main.homepage-main {
    padding-top: 0 !important;
}

/* Add proper top margin to the homepage-layout container */
.homepage-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--padding-lg);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--padding);
  
  /* Add top margin to clear the fixed header */
  margin-top: calc(var(--header-height-mobile) + 10px); /* 140px + 10px = 150px */
}

@media (min-width: 48em) {
  .homepage-layout {
    grid-template-columns: 1fr;
    margin-top: calc(var(--header-height-tablet) + 10px); /* 180px + 10px = 190px */
  }
}

@media (min-width: 64em) {
  .homepage-layout {
    margin-top: calc(var(--header-height-desktop) + 10px); /* 200px + 10px = 210px */
  }
}

/* === DYNAMIC HERO SECTION STYLES === */
.homepage-layout .hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 50vh;
    padding: 2rem;
    color: var(--color-white);
    background: linear-gradient(to bottom, #4A0B09, #A82C22);
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.homepage-layout .hero > * {
    position: relative;
    z-index: 2;
}

.homepage-layout .hero h1,
.homepage-layout .hero h2 {
    color: inherit;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}


/* Styling for the two main columns */
.homepage-columns .column {
    padding: 1.5rem 0;
}

.homepage-columns .column h2 {
    font-size: 2.2rem;
    color: var(--color-process-black);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-primary-red);
    padding-bottom: 0.5rem;
}


/* === HOMEPAGE MINI GRIDS (Used in sidebar) === */
.events-grid-mini,
.news-grid-mini {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.events-grid-mini li,
.news-grid-mini li {
    background-color: var(--color-white);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out;
}

.events-grid-mini li:hover,
.news-grid-mini li:hover {
    transform: translateY(-2px);
}

.events-grid-mini h3,
.news-grid-mini h3 {
    font-size: 1.1rem;
    color: var(--color-primary-red);
    margin: 0 0 0.25rem 0;
}

.events-grid-mini p,
.news-grid-mini p {
    font-size: 0.9rem;
    color: var(--color-grey);
    margin: 0;
}


/* === CONTENT BLOCKS (Bottom Section) === */
.content-blocks {
    padding: var(--padding-lg) 0;
    max-width: 1200px;
    margin: 0 auto;
}

.content-blocks h2 {
    text-align: center;
    margin-bottom: var(--padding-lg);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary-red);
}

.content-blocks-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--padding);
    padding: 0 var(--padding);
}

.content-block-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: var(--color-mh-dark-grey, #2a2a2a);
    color: var(--color-white);
    padding: var(--padding);
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-block-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.5);
}

.content-block-item .block-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.content-block-item .block-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.3s ease;
}

.content-block-item:hover .block-image img {
    transform: scale(1.05);
}

.content-block-item .block-text {
    padding: 1.5rem;
}

.content-block-item h3 {
    font-size: 1.5rem;
    color: var(--color-primary-red);
    margin-top: 0;
}

.content-block-item p {
    font-size: 1rem;
    line-height: 1.6;
}


/* === FEATURED EVENT BLOCK FIX (CRITICAL) === */
.events-grid-featured {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}

@media (min-width: 64em) {
    .events-grid-featured {
        grid-template-columns: 2fr 1fr; 
    }
}

.important-feature {
    display: block;
}

@media (min-width: 64em) {
    .events-grid-featured > li:first-child {
        grid-column: 1 / 3;
    }
}

/* === FLEXIBLE FEATURED CONTENT CARD STYLES === */
.featured-card {
    list-style: none;
    background-color: var(--color-white);
    border: 1px solid var(--color-light, #ddd);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    margin-bottom: 1.5rem;
    width: 100%;
}

.featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.featured-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.featured-card-media {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin: 0;
}

.featured-card-media img,
.featured-card-media-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    background-color: var(--color-mh-dark-grey, #2a2a2a);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-white);
    font-size: 1.2rem;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.featured-card:hover .featured-card-media img {
    transform: scale(1.05);
}

.featured-card-text {
    padding: 1rem 1.5rem;
}

.featured-card-text h3 {
    font-size: 1.4rem;
    color: var(--color-primary-red);
    margin: 0 0 0.5rem 0;
}

.featured-card-meta {
    font-size: 0.9rem;
    color: var(--color-grey);
    margin-bottom: 0.75rem;
}

.featured-card-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-process-black);
}


/* ============================================================
  HOMEPAGE CONTENT GRID COLUMNS (Flexible Content Columns Block)
  ============================================================ */

.column-structure-block {
    padding-top: var(--padding);
    padding-bottom: var(--padding-lg);
}

.column-section-heading {
    text-align: center;
    margin-bottom: var(--padding-lg);
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--color-white);
}

.column-layout-container {
    display: flex;
    flex-wrap: wrap; 
    margin: calc(-1 * var(--padding) / 2); 
}

.column-item {
    flex-basis: 100%;
    max-width: 100%;
    padding: calc(var(--padding) / 2);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex-grow: 1;
}

.column-content-inner {
    display: flex;
    flex-direction: column;
    padding: 0; 
    background-color: var(--color-mh-dark-grey);
    border: 1px solid var(--color-medium-grey);
    border-radius: 8px;
    height: 100%;
    overflow: hidden; 
    text-decoration: none; 
    color: inherit; 
    transition: all 0.3s ease; 
}

.feature-card:hover {
    box-shadow: 0 0 25px rgba(210, 35, 42, 0.5);
    transform: translateY(-5px);
    border-color: var(--color-primary-red);
}

.feature-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin: 0;
    background-color: var(--color-process-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-grey);
    border-radius: 8px 8px 0 0;
}

.feature-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 6px 6px 0 0;
    transition: transform 0.4s ease;
}

.feature-card:hover .feature-image-wrapper img {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .feature-image-wrapper {
        height: 250px;
    }
}

@media (min-width: 1024px) {
    .feature-image-wrapper {
        height: 280px;
    }
}

.feature-text-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.column-item-heading {
    margin-top: 0 !important; 
    margin-bottom: var(--padding-sm);
    color: var(--color-white);
    font-weight: 600;
}

.feature-item-text {
    color: var(--color-grey); 
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .column-layout-container {
        align-items: stretch;
    }
    
    .column-item.col-1-1 {
        flex-basis: 100%;
        max-width: 100%;
    }

    .column-item.col-1-2 {
        flex-basis: 50%;
        max-width: 50%;
    }

    .column-item.col-1-3 {
        flex-basis: 33.3333%;
        max-width: 33.3333%;
    }
    
    .column-item.col-1-4 {
        flex-basis: 25%;
        max-width: 25%;
    }
}