/**
 * SMDM – Conference Index (Annual Meeting)
 * Typography + icons aligned with Events CSS
 */

/* ---------- Row wrapper (optional alt bg) ---------- */
.custom-conference-row {
  position: relative;
  padding: 40px 0;
}
.custom-conference-row.alt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--wp--preset--color--cultured);
  width: 98vw;
  left: 50%;
  transform: translateX(-50%);
}

/* ---------- Two-/three-column layout ---------- */
.custom-conference.wp-block-columns {
  margin: 0;
  column-gap: 32px;
  align-items: stretch;
}
.custom-conference .wp-block-column {
  display: flex;
}

/* Content stack */
.custom-conference__stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* Title */
.custom-conference__title {
  margin: 0;
  font-weight: 600 !important;
}

/* Meta rows (location, dates, host, info) */
.smdm-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: .25rem 0;
}
.smdm-meta-row .smdm-meta-icon {
  color: var(--paolo-veronese-green);
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Summary */
.smdm-evt-summary {
  margin-top: 8px;
  max-width: 65ch;
}

/* Buttons */
.custom-conference .wp-block-buttons {
  margin-top: auto;
  padding-top: 10px;
}

/* Images (shared) */
.custom-conference__image {
  margin: 0;
}
.custom-conference__image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: fill;
  border-radius: 5px;
}

/* Left icon column (big category icon if present) */
.custom-conference__iconcol {
  flex: 0 0 44px;
  max-width: 44px;
  display: flex;
  justify-content: flex-start;
}
.smdm-evt-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  margin-top: 4px;
}

/* Stack behavior (tablet-ish) */
@media (max-width: 960px) {
  .custom-conference__iconcol {
    max-width: none;
    flex: 0 0 auto;
    margin-bottom: 6px;
  }
}

/* ---------- Events card typography block (unchanged except tokens) ---------- */
.smdm-evt-info {
  display: grid;
  grid-template-rows: auto auto;
  row-gap: 20px;
  background: var(--platinum);
  border-radius: 5px;
  box-sizing: border-box;
  padding: 50px 60px;
  margin: 0;
}
.wp-block-group .smdm-evt-info {
  margin: 40px 0;
}

.smdm-evt-info > .smdm-evt-cols,
.smdm-evt-info > .smdm-summary-wide,
.smdm-evt-info > .smdm-summary-card {
  width: 100%;
  max-width: none;
  justify-self: stretch;
  margin: 0;
}

.smdm-evt-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  align-items: stretch;
}
.smdm-col {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 280px;
  min-width: 0;
}
.left-top,
.right-top {
  grid-row: 1;
  min-height: 0;
}
.left-bottom,
.right-bottom {
  grid-row: 2;
}

.left-top {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.evt-actions {
  margin-top: auto;
}

.evt-titlebar {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 0 0 8px;
}

.smdm-evt-info .meta-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: .25rem 0;
}
.smdm-evt-info .meta-row .icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.wp-block-button.smdm-primary.smdm-btn-register {
  margin-right: 10px;
}

.left-bottom > .wp-block-group {
  margin: 0;
}

.right-top {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
}
.right-top figure {
  margin: 0;
  height: 100%;
  display: flex;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(10, 92, 131, .08);
}
.smdm-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  flex: 1 1 auto;
  max-width: none;
  cursor: auto;
}
.smdm-hero-img:hover {
  transform: none !important;
  filter: none !important;
}

.smdm-evt-cols.no-hero {
  grid-template-rows: auto auto auto;
}
.smdm-evt-cols.no-hero .right-top {
  grid-column: 1 / -1;
}
.smdm-evt-cols.no-hero .right-bottom {
  display: none;
}
.smdm-evt-cols.no-hero .left-bottom {
  grid-row: 3;
}

.smdm-archive.using-single-template > * + * {
  margin-top: 80px !important;
}

/* Responsive for event layout */
@media (max-width: 900px) {
  .smdm-evt-info {
    grid-template-rows: auto auto auto;
    padding: 30px 20px;
  }
  .smdm-evt-cols {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }
  .right-top,
  .right-top figure,
  .smdm-hero-img {
    height: auto;
  }
  .evt-actions {
    margin-top: 16px;
  }
}

/* =====================================
   Conference index – desktop vs mobile images
   ===================================== */

/* Base: desktop – show side image, hide stacked image */
.custom-conference__image--stack {
  display: none;
}
.custom-conference__image--side {
  display: block;
}

/* Mobile: icon → title → stacked image → meta → button */
@media (max-width: 700px) {
  /* Stack the three columns vertically in source order:
     1) icon col
     2) text col (title + stacked image + meta + button)
     3) image col (hidden image)
   */
  .custom-conference.wp-block-columns {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    row-gap: 16px;
    column-gap: 0;
    margin: 0;
  }

  /* Each column full width */
  .custom-conference .wp-block-column {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  /* Icon row spacing */
  .custom-conference__iconcol {
    justify-content: flex-start;
    margin-bottom: 4px;
    flex: 0 0 auto;
  }

  .custom-conference__iconcol .smdm-evt-icon {
    margin-top: 0;
  }

  /* Text stack full-width */
  .custom-conference__textcol {
    width: 100%;
  }

  .custom-conference__stack {
    width: 100%;
  }

  /* Show stacked image under title */
  .custom-conference__image--stack {
    display: block;
    margin-top: 8px;
  }

  /* Hide side image on mobile */
  .custom-conference__imagecol {
    width: 100%;
  }
  .custom-conference__image--side {
    display: none;
  }

  .custom-conference__image--stack img,
  .custom-conference__image--side img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
  }
}
