/* Styles moved from inline attributes for CSP compliance */

/* Calendar embed iframe styling */
.calendar-embed {
  width: 100%;
  height: 300px;
  border: 1px solid #7b7b7b;
}

/* Full calendar embed (bkscal shortcode) */
.calendar-full-embed {
  width: 100%;
  height: 600px;
  border: 1px solid #7b7b7b;
}

/* Bot field honeypot styling */
.bot-field {
  display: none !important;
}

/* Chordle iframe styling */
#pageswitcher-content {
  display: block;
  width: 100%;
  height: 100%;
}

/* Instagram embed styling (CSP compliant) */
.instagram-media.instagram-embed {
  background: #FFF;
  border: 0;
  border-radius: 3px;
  box-shadow: 0 0 1px 0 rgba(0,0,0,0.5), 0 1px 10px 0 rgba(0,0,0,0.15);
  margin: 1px;
  max-width: 540px;
  min-width: 326px;
  padding: 0;
  width: 99.375%;
  width: -webkit-calc(100% - 2px);
  width: calc(100% - 2px);
}

.instagram-content {
  padding: 16px;
}

.instagram-content a {
  background: #FFFFFF;
  line-height: 0;
  padding: 0;
  text-align: center;
  text-decoration: none;
  width: 100%;
  color: #000;
}

.instagram-header {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.instagram-avatar {
  background-color: #F4F4F4;
  border-radius: 50%;
  flex-grow: 0;
  height: 40px;
  margin-right: 14px;
  width: 40px;
}

.instagram-user-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
}

.instagram-username {
  background-color: #F4F4F4;
  border-radius: 4px;
  flex-grow: 0;
  height: 14px;
  margin-bottom: 6px;
  width: 100px;
}

.instagram-time {
  background-color: #F4F4F4;
  border-radius: 4px;
  flex-grow: 0;
  height: 14px;
  width: 60px;
}

.instagram-media-container {
  padding: 19% 0;
}

.instagram-placeholder-content {
  display: block;
  height: 50px;
  margin: 0 auto 12px;
  width: 50px;
}

.instagram-text {
  padding-top: 8px;
}

.instagram-cta {
  color: #3897f0;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 550;
  line-height: 18px;
}

.instagram-footer {
  padding: 12.5% 0;
}

.instagram-engagement {
  display: flex;
  flex-direction: row;
  margin-bottom: 14px;
  align-items: center;
}

.instagram-like-bar {
  background-color: #F4F4F4;
  border-radius: 4px;
  flex-grow: 0;
  height: 14px;
  margin-bottom: 6px;
  width: 224px;
}

.instagram-like-bar-short {
  background-color: #F4F4F4;
  border-radius: 4px;
  flex-grow: 0;
  height: 14px;
  width: 144px;
}

.instagram-caption {
  color: #c9c8cd;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 17px;
  margin-bottom: 0;
  margin-top: 8px;
  overflow: hidden;
  padding: 8px 0 7px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instagram-caption a {
  color: #c9c8cd;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: normal;
  line-height: 17px;
  text-decoration: none;
}

/* Tooltip Styles with CSS Anchor Positioning */
.tooltip {
  position: absolute;
  background: var(--bks-blue);
  color: var(--white-element);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tooltip arrow */
.tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--bks-blue);
}

/* CSS Anchor Positioning for modern browsers */
@supports (anchor-name: --calendar) {
  #calendar-anchor {
    anchor-name: --calendar;
  }

  #calendar-tooltip {
    position-anchor: --calendar;
    bottom: anchor(top);
    left: anchor(center);
    transform: translateX(-50%) translateY(-8px);
  }

  #info-panel-trigger {
    anchor-name: --info;
  }

  #info-tooltip {
    position-anchor: --info;
    bottom: anchor(top);
    left: anchor(center);
    transform: translateX(-50%) translateY(-8px);
  }
}

/* Fallback positioning for browsers without anchor support */
@supports not (anchor-name: --calendar) {
  #calendar-tooltip {
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
  }

  #info-tooltip {
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
  }

  .masthead-utility {
    position: relative;
  }
}

/* Show tooltip on hover */
#calendar-anchor:hover + #calendar-tooltip,
#info-panel-trigger:hover + #info-tooltip {
  opacity: 1;
  pointer-events: none; /* Keep pointer-events none so tooltips don't block clicks */
}
