/* ------------------------------------------------------------------
   1. GLOBAL LAYOUT & TYPOGRAPHY
   ------------------------------------------------------------------ */

.ae-events {
  max-width: var(--content-width, 1200px);
  margin: 0 auto;
}

/* Advisor Tool Title + Heading Styles */
.ae-advisor-tool .ae-page-title,
.ae-advisor-tool label,
.ae-registration h2,
.ae-calendar-links h3 {
  color: #003366;
  font-family: Montserrat, Arial, sans-serif;
}

/* Body font for form fields & Meta */
.ae-advisor-tool,
.ae-form input,
.ae-form textarea,
.ae-form select,
.ae-form button,
.ae-event-meta {
  font-family: Helvetica, Arial, sans-serif;
}

/* ------------------------------------------------------------------
   2. EVENTS LIST VIEW (/events page)
   ------------------------------------------------------------------ */

.ae-event {
  display: grid;
  grid-template-columns: 280px 1fr; /* Fixed width for card, rest for content */
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  align-items: start;
}

.ae-event-title {
  margin-top: 15px !important;
  margin-bottom: 10px;
}

.ae-event-title a {
  text-decoration: none;
  color: #102d53;
}

.ae-event-meta-top {
  color: #666;
  margin-bottom: 10px;
  font-size: 0.95em;
}

/* Location Link Hover Effect */
.ae-meta-item a:hover {
  color: #032f60 !important;
  border-bottom-color: #032f60 !important;
}

/* Mobile Stack for List View */
@media (max-width: 768px) {
  .ae-event {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------
   3. HOST CARD STYLES
   ------------------------------------------------------------------ */

.ae-host-card {
  width: 100%;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background: #f0f0f0;
  
  /* FORCE PORTRAIT SHAPE */
  aspect-ratio: 3 / 4; 
  min-height: 400px; 
}

.ae-card-image {
  width: 100%;
  height: 100%;
  position: absolute; 
  top: 0;
  left: 0;
  background-size: cover;
  background-position: center top;
  z-index: 1;
}

.ae-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(16, 45, 83, 0.95) 0%, rgba(16, 45, 83, 0.8) 50%, rgba(16, 45, 83, 0) 100%);
  padding: 100px 20px 20px;
  color: #fff;
  font-family: Montserrat, sans-serif;
  z-index: 2;
}

.ae-card-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.ae-card-title {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 400;
  margin-bottom: 12px;
}

/* Social Icons */
.ae-card-icons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.ae-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  text-decoration: none;
  transition: 0.2s;
}

.ae-icon:hover {
  background: #fff;
  color: #102d53;
  border-color: #fff;
}

.ae-icon .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* Fallback Date Box (if no host) */
.ae-date-box {
  background: #f4f4f4;
  padding: 20px;
  text-align: center;
  border-radius: 8px;
  font-weight: bold;
  color: #333;
}

/* Office Image Only (No overlay) */
.ae-host-image-only img {
  width: 100%;
  border-radius: 12px;
  display: block;
}


/* ------------------------------------------------------------------
   4. SINGLE EVENT PAGE LAYOUT
   ------------------------------------------------------------------ */

.ae-single-wrapper {
  display: grid;
  grid-template-columns: 300px 1fr; /* Fixed sidebar, flexible content */
  gap: 50px;
  align-items: start;
  margin-top: 30px;
}

/* Sidebar (Host Card) */
.ae-single-sidebar {
  position: sticky;
  top: 40px; 
}

.ae-single-sidebar .ae-host-card {
  max-width: 100%; 
  width: 100%;
}

/* Main Content */
.ae-single-main {
  min-width: 0;
}

/* Divi Compatibility */
.et_pb_module .ae-single-wrapper {
   width: 100%;
   max-width: 100%;
}

/* Responsive Single Page */
@media (max-width: 900px) {
  .ae-single-wrapper {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .ae-single-sidebar {
    position: static;
    max-width: 350px;
    margin-bottom: 20px;
  }
}

/* Single Page Meta */
.ae-event-meta {
  margin: 20px 0 30px;
}
.ae-event-meta-row {
  margin-bottom: 6px;
  font-size: 16px;
}
.ae-event-meta strong {
  color: #003366;
  font-family: Montserrat, Arial, sans-serif;
}

/* Force Divi to show shortcode-rendered meta */
.et_pb_text_inner .ae-event-meta {
  display: block !important;
  height: auto !important;
  min-height: 1px !important;
  overflow: visible !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ------------------------------------------------------------------
   5. FORMS (Registration & Advisor Tool)
   ------------------------------------------------------------------ */

.ae-form-row {
  margin-bottom: 22px;
}
.ae-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

/* Inputs */
.ae-form input,
.ae-form textarea,
.ae-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  font-size: 16px;
  line-height: 1.2;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  min-height: 54px;
}

.ae-form textarea {
  min-height: 180px;
}

/* WYSIWYG Editor Container */
.ae-advisor-form .wp-editor-wrap {
  border: 1px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

/* Fix WYSIWYG Toolbar Buttons (Prevent stretching) */
.ae-form .quicktags-toolbar input[type="button"] {
  width: auto !important;
  min-height: 0 !important;
  display: inline-block !important;
  margin: 2px !important;
  padding: 4px 8px !important;
  font-size: 13px !important;
  line-height: normal !important;
  background: #f7f7f7 !important;
  border: 1px solid #ccc !important;
  color: #555 !important;
  box-shadow: none !important;
}

.ae-form .quicktags-toolbar input[type="button"]:hover {
  background: #fafafa !important;
  border-color: #999 !important;
  color: #23282d !important;
}

/* Registration Form Spacing */
.ae-form-title,
.ae-registration h2 {
  margin-bottom: 25px !important;
  padding-bottom: 10px;
}

/* ------------------------------------------------------------------
   6. BRANDED BUTTONS
   ------------------------------------------------------------------ */

.ae-form button, 
.ae-map-btn {
  background-color: #032f60 !important; /* Brand Blue */
  color: #ffffff !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 12px 24px !important;
  cursor: pointer !important;
  transition: background-color 0.3s ease !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 14px !important;
}

.ae-form button:hover, 
.ae-map-btn:hover {
  background-color: #d6b556 !important; /* Gold Hover */
  color: #ffffff !important;
}

/* Divi Override */
.et_pb_module .ae-form button {
  margin-top: 10px;
}

/* ------------------------------------------------------------------
   7. CALENDAR & THANK YOU PAGE
   ------------------------------------------------------------------ */

.ae-calendar-links {
  margin-top: 40px;
}
.ae-calendar-table {
  width: 100%;
  border-collapse: collapse;
}
.ae-calendar-table td {
  text-align: center;
  padding: 20px;
}
.ae-calendar-table a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  font-weight: 600;
}
.ae-calendar-table img {
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
}
.ae-calendar-table span {
  display: block;
}

@media (max-width: 768px) {
  .ae-calendar-table tr {
    display: flex;
    flex-direction: column;
  }
}

/* --- NO HOST PLACEHOLDER IMAGE --- */
.ae-no-host-image {
    width: 100%;
    max-width: 448px; /* Restrict width as requested */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* Match host card shadow */
}

.ae-no-host-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}