/* =========================
   INSIGHTS, clean drop-in
   Desktop: 3 cols
   Featured: 2 cols x 2 rows
   Right: Filters (row 1), Subscribe (row 2)
   Below: 3-up grid
   ========================= */

/* Parent grid */
.insights-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 360px;

  /* Control alignment: row1 + row2 define the featured height (2-row span) */
  grid-template-rows: 260px 260px auto;

  gap: 35px;
  margin-top: 20px;
}

/* Featured occupies two columns and two rows */
.insights-featured {
  grid-column: 1 / span 2;
  grid-row: 1 / span 2;
}

/* Pin right column blocks */
.insights-filters {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
}

.insights-subscribe-card {
  grid-column: 3;
  grid-row: 2;
  align-self: start;

  padding: 0px;
  background: #fff;
}

/* Remaining insights below, full width */
.insights-grid {
  grid-column: 1 / -1;
  grid-row: 3;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 260px;   /* this is the missing piece */
  gap: 30px;
  align-items: stretch;
}

.insights-grid .insight-card {
  height: 100%;
}

.insights-grid .insight-card .wrapper {
  height: 100%;
  min-height: 0;
}


/* Bottom CTA */
.insights-bottom-cta {
  grid-column: 1 / -1;
}


/* Force the Load More <button> to match the old CTA bar */
.insights-bottom-btn{
  -webkit-appearance: none !important;
  appearance: none !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;

  background: #ac1a2d !important;
  color: #fff !important;

  font-weight: 800 !important;
  text-decoration: none !important;

  display: block !important;
  width: 100% !important;
  text-align: center !important;

  padding: 14px 16px !important;
  margin: 0 !important;

  cursor: pointer !important;
  border-radius: 0 !important;
  line-height: 1 !important;
}

.insights-bottom-btn:hover,
.insights-bottom-btn:focus,
.insights-bottom-btn:active{
  background: #ac1a2d !important;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: none !important;
}



/* =========================
   Filters: View | Type layout
   ========================= */

.insights-filters {
  display: grid;
  grid-template-columns: 110px 1fr;
  column-gap: 24px;
  row-gap: 8px;
}

.insights-filters .view-toggle-alt {
  margin: 0;
}

.insights-filters .view-toggle-alt .view-label,
.insights-filters .filters-button-group .filter-label {
  display: block;
  margin: 0 0 8px;
  font-weight: 700;
}

/* Type list */
.insights-filters .filters-button-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insights-filters .filters-button-group button {
  text-align: left;
  padding: 0;
  background: none;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.insights-filters .filters-button-group button.is-checked {
  color: #ac1a2d;
}

/* =========================
   Subscribe card
   ========================= */

.insights-subscribe-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  color: #ac1a2d;
}

.insights-subscribe-card p {
  margin: 0 0 16px;
  font-size: 13px;
  color: #444;
}

.btn-subscribe {
  display: inline-block;
  padding: 10px 14px;
  background: #ac1a2d;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

/* Hide cards beyond the current visible limit (JS toggles inline display) */
.insights-grid .insight-card.is-hidden {
  display: none !important;
}


/* =========================
   Cards + overlay hover (single source of truth)
   Uses Portfolio-style overlay on .overlay-title
   ========================= */

/* Card base */
.insights-page .insight-card{
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* Wrapper and image fill their grid cell */
.insights-page .insight-card .wrapper{
  position: relative;
  overflow: hidden;
  background: #111;
  height: 100%;
}

.insights-page .insight-card img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 250ms ease;
}

/* IMPORTANT: portfolio overlay behavior
   projects.css likely sets .overlay-title { opacity:0; }
   This ensures it shows on hover for insights.
*/
.insights-page .insight-card .overlay-title{
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 1 !important;
  transition: opacity 0.3s ease;
  z-index: 5;
  text-align: left;
  pointer-events: none;
}

.insights-page .insight-card:hover .overlay-title{
  opacity: 1 !important;
}

.insights-page .insight-card:hover img{
  transform: none !important;
}

/* Overlay inner content: remove your gradient reveal system entirely */
.insights-page .insight-card .overlay-bottom{
  padding: 0;
  background: none;
  opacity: 1;
  transform: none;
}

/* Text styling inside overlay */
.insights-page .insight-card .overlay-title,
.insights-page .insight-card .overlay-title *{
  color: #fff;
}

.insights-page .insight-card .project-title{
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.insights-page .insight-card .project-sectors{
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.95;
}

.insights-page .insight-card .sector-name{
  margin: 0;
}

.insights-page .insight-card .project-link{
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  opacity: 1;
  font-size: 0.9rem;

}

/* Touch: always show overlay */
@media (hover: none){
  .insights-page .insight-card .overlay-title{
    opacity: 1;
  }
  .insights-page .insight-card img{
    transform: none;
  }
}
/* =========================
   Insights overlay typography, match Portfolio
   ========================= */

.insights-page .insight-card .overlay-title{
  padding: 1.25rem;              /* same as portfolio */
  background: rgba(0,0,0,0.35);  /* same as portfolio */
  text-align: left;
}

.insights-page .insight-card .project-title{
  font-size: 1.15rem;            /* portfolio shows ~1.25rem in your screenshot,
                                   but yours looked smaller. Adjust if needed. */
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.insights-page .insight-card .project-sectors{
  margin-top: 0.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  opacity: 1;
}

.insights-page .insight-card .sector-name{
  margin: 0;
}


/* =========================
   Tile sizing, match Portfolio “perfect cell”
   ========================= */

/* Featured: fills its 2-row area */
.insights-featured .insight-card,
.insights-featured .insight-card .wrapper{
  height: 100%;
}

/* Grid tiles: force consistent height */
.insights-grid{
  grid-auto-rows: 260px; /* adjust to match portfolio tile height */
}

.insights-grid .insight-card,
.insights-grid .insight-card .wrapper{
  height: 100%;
}

/* Ensure images always fill */
.insights-page .insight-card img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/*--Mobile--*/
@media (max-width: 960px) {
  .insights-page{
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    gap: 20px !important;
  }

  /* Force order: Filters, Subscribe, Featured, Grid, CTA */
  .insights-filters{
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  .insights-subscribe-card{
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }

  .insights-featured{
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
  }

  .insights-grid{
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
    gap: 18px !important;
  }

  .insights-bottom-cta{
    grid-column: 1 / -1 !important;
    grid-row: 5 !important;
  }

  /* Card sizing */
  .insights-page .insight-card .wrapper{
    height: 220px !important;
  }

  .insights-featured .wrapper{
    height: 260px !important;
  }

  /* Filters layout stays clean */
  .insights-filters{
    grid-template-columns: 1fr !important;
    row-gap: 12px !important;
  }

  /* Touch devices: show overlay */
  .insights-page .insight-card .overlay-title{
    opacity: 1 !important;
  }
}



/*-- hubspot slide-in panel --*/
/* Backdrop (full screen) */
.mmg-hs-panel__backdrop{
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

/* Drawer: apply to the Elementor container that holds the HubSpot Form widget */
.mmg-hs-panel__drawer{
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(420px, 92vw);
  z-index: 99999;
  background: #fff;

  transform: translateX(100%);
  transition: transform 260ms ease;

  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -12px 0 30px rgba(0,0,0,0.18);
}

/* Close button (HTML widget) */
.mmg-hs-panel__close{
  position: sticky;
  top: 0;
  margin-left: auto;
  display: block;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 44px;
  cursor: pointer;
  z-index: 1;
}

/* Open state (toggled on body) */
body.mmg-hs-panel-open{
  overflow: hidden;
}

body.mmg-hs-panel-open .mmg-hs-panel__backdrop{
  opacity: 1;
  pointer-events: auto;
}

body.mmg-hs-panel-open .mmg-hs-panel__drawer{
  transform: translateX(0);
}

/* HubSpot form inside drawer: prevent overflow */
.mmg-hs-panel__drawer .hs-form,
.mmg-hs-panel__drawer iframe{
  max-width: 100%;
}
