/*
 * Vibemap single Event/Place template styles.
 *
 * SCOPING CONTRACT: rules here are scoped to `.vibemap-single`, the wrapper class
 * the plugin stamps on the root of its OWN single templates (see
 * templates/single-vibemap_*.php and templates/single-vibemap-*.html). They are
 * deliberately NOT scoped to the `.single-vibemap_event` / `.single-vibemap_place`
 * body classes: WordPress adds those by post type to EVERY single Event/Place page,
 * including ones rendered by a site owner's own custom template — so body-class
 * scoping leaked these styles (Columns `gap`, box-sizing, etc.) onto blocks we don't
 * own. Rules keyed on a plugin-owned class (`.wp-block-vibemap-*`, `.vibemap-*`,
 * `.hidden-vibe`, `.see-all-vibes`) are left unscoped: a plugin class can't match
 * host markup. Keep any new rule under `.vibemap-single` or a `.wp-block-vibemap-*`
 * block class — never a bare WordPress body/core-block class.
 */
.wp-site-blocks.vibemap-single {
  padding: var(--wp--style--root--padding-top, 0) 0 var(--wp--style--root--padding-bottom, 0) 0;
  width: 100%;
}
/*
 * CONTENT WIDTH: resolve against the theme's WIDE size, not its content size.
 *
 * Both single templates render their block with `"align" => "wide"`, but the
 * cap lives on this wrapper, so whatever this resolves to is the real ceiling —
 * `alignwide` inside it has nothing to expand into.
 *
 * The old value here was `--wp--style--global--content-size` — WordPress's
 * *prose* measure, not its layout width. Any theme shipping a theme.json with
 * `settings.layout` publishes both measures, and they differ: Hello Elementor
 * declares contentSize 800px / wideSize 1200px. So a template asking for wide
 * content was clamped to the prose measure and rendered at 800px inside a theme
 * that advertised 1200px for exactly this.
 *
 * (Core's own default theme.json declares no `settings.layout` at all, so a
 * theme with no theme.json emits neither variable and the 1200px literal below
 * is what applies. The bug only bites themes that DO ship one — which is most
 * of the popular classic themes.)
 *
 * `--vibemap-single-content-width` is the plugin-owned override, emitted by
 * VibeMap_Templates::single_content_width_css() only when the Global template
 * setting stores an explicit pixel width.
 */
.single-event-article,
.single-place-article {
  max-width: var(
    --vibemap-single-content-width,
    var(--wp--style--global--wide-size, 1200px)
  );
  margin-left: auto;
  margin-right: auto;
  padding: 32px 0;
}

.vibemap-single-post {
  padding: 40px 0;
}

.vibemap-single .entry-title {
  font-size: 35px;
}

/* Featured Image Handling */
.vibemap-single .featured-image-wide,
.vibemap-single .wp-block-vibemap-hero-image.featured-image-wide {
  display: none !important;
}

.vibemap-single .featured-image-narrow,
.vibemap-single .wp-block-vibemap-hero-image.featured-image-narrow {
  display: block !important;
}

.has-wide-image .vibemap-single .featured-image-wide,
.has-wide-image .vibemap-single .wp-block-vibemap-hero-image.featured-image-wide {
  display: block !important;
}

.has-wide-image .vibemap-single .featured-image-narrow,
.has-wide-image .vibemap-single .wp-block-vibemap-hero-image.featured-image-narrow {
  display: none !important;
}

/* Event Button Styles */
.wp-block-vibemap-meta-info .event-button-container {
  margin-top: 20px;
}

.wp-block-vibemap-meta-info .event-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.wp-block-vibemap-meta-info .event-button:hover {
  opacity: 0.85;
  text-decoration: none;
}

.wp-block-vibemap-meta-info .event-button-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
}

.wp-block-vibemap-meta-info .event-button-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* Minimap Styles */
.wp-block-vibemap-meta-info .minimap-container {
  margin-top: 20px;
}

.wp-block-vibemap-meta-info .address-after-map {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
}

.wp-block-vibemap-meta-info .address-after-map .meta-icon {
  flex-shrink: 0;
  margin-top: 3px;
  width: 18px;
  height: 18px;
}

/* Single Vibemap Event/Place Template Styles */
.vibemap-single .featured-image {
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  margin-bottom: 20px;
  border-radius: 10px;
}

/* Featured image when in content area (smaller images) */
.vibemap-single .featured-image.content-width {
  margin-bottom: 24px;
}

/* Content Layout */
.vibemap-single .content-wrapper {
  display: flex;
  flex-wrap: wrap;
  margin: 0 auto;
  max-width: 1200px;
}

/* Remove horizontal padding */
.vibemap-single-post {
  padding: 40px 0;
}

/* Ensure main content and sidebar maintain fixed widths */
.vibemap-single .wp-block-column {
  flex: 1;
}

/* Ensure box-sizing is applied to all elements */
.vibemap-single * {
  box-sizing: border-box;
}

.vibemap-single .wp-block-column:first-child {
  width: 65%;
}

.vibemap-single .wp-block-column.sidebar {
  width: 35%;
}

/* Vibe Chips */
.vibemap-single .vibe-chips {
  margin-bottom: 15px;
}

.vibemap-single .vibe-chip {
  display: inline-block;
  background-color: #f0f0f0;
  color: #333;
  padding: 5px 10px;
  margin: 2px;
  border-radius: 20px;
  font-size: 16px;
  text-decoration: none;
}

.vibemap-single a.vibe-chip:hover {
  background-color: #e0e0e0;
  color: #333;
  text-decoration: none;
}

/* Post Content */
.vibemap-single .entry-content-text {
  font-size: 16px;
  line-height: 1.6;
}

.vibemap-single .meta-info-title,
.vibemap-single .sidebar-title {
  margin: 10px 0 20px;
  font-size: 19px;
  border-bottom: 2px solid #ddd;
}

/* Meta Info List */
.vibemap-single .meta-info-list,
.vibemap-single .sidebar-details {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Meta Info Items */
.vibemap-single .meta-info-item,
.vibemap-single .sidebar-details li {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

/* Icon Styling */
.vibemap-single .meta-info-item .meta-icon,
.vibemap-single .sidebar-details li .meta-icon {
  margin-right: 10px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* Text Styling */
.vibemap-single .meta-info-item span,
.vibemap-single .sidebar-details li span {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* Price Field Styling */
.vibemap-single .meta-info-item.price span {
  font-weight: bold;
}

/* Remove Underlines from Links within Meta Info List */
.vibemap-single .meta-info-list li a.meta-link,
.vibemap-single .sidebar-details li a.meta-link,
.wp-block-vibemap-meta-info .meta-link,
.wp-block-vibemap-meta-info .venue-link {
  text-decoration: none !important;
  color: inherit;
}

/* Add Underline on Hover for Links */
.vibemap-single .meta-info-list li a.meta-link:hover,
.vibemap-single .sidebar-details li a.meta-link:hover,
.wp-block-vibemap-meta-info .meta-link:hover,
.wp-block-vibemap-meta-info .venue-link:hover {
  text-decoration: underline !important;
}

/* Remove Bullets from List Items */
.vibemap-single .meta-info-list li,
.vibemap-single .sidebar-details li {
  list-style: none;
}

.wp-block-vibemap-meta-info .event-button-container {
  margin-top: 20px;
}

.wp-block-vibemap-meta-info .event-button {
  background-color: #2c5282;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s;
}

.wp-block-vibemap-meta-info .event-button:hover {
  background-color: #1a365d;
  color: white;
}

.wp-block-vibemap-meta-info .event-button:active {
  background-color: #1a365d;
  color: white;
}

.wp-block-vibemap-meta-info .event-button:focus {
  background-color: #1a365d;
  color: white;
}

.wp-block-vibemap-meta-info .event-button:visited  {
  color: white;
}

.vibemap-meta-wrapper {
  /* Padding moved to ProfileSidebar.scss in ui-components */
}

.vibemap-meta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.vibemap-meta-bookmark-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: transform 0.2s ease;
}

.vibemap-meta-bookmark-icon:hover {
  transform: scale(1.1);
}

.vibemap-meta-bookmark-icon .icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vibemap-meta-bookmark-icon .outline,
.vibemap-meta-bookmark-icon .filled {
  position: absolute;
  transition: opacity 0.2s ease;
}

.vibemap-meta-bookmark-icon .hidden {
  opacity: 0;
}

/* Lightbox Styling */
.vibemap-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.vibemap-lightbox .lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.vibemap-lightbox img {
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.lightbox-close {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #fff;
  color: #000;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .vibemap-single .content-wrapper {
    flex-direction: column;
    gap: 0;
  }

  /* Override WordPress core styles */
  .vibemap-single .wp-block-columns.is-not-stacked-on-mobile {
    flex-wrap: wrap !important;
  }

  .vibemap-single .wp-block-columns.is-not-stacked-on-mobile > .wp-block-column {
    flex-basis: 100% !important;
    margin-left: 0 !important;
  }

  .vibemap-single .wp-block-column {
    width: 100% !important;
    flex-basis: 100% !important;
  }

  /* Main content column */
  .vibemap-single .wp-block-column:first-child {
    order: 2;
    margin-top: 16px;
  }

  /* Sidebar column */
  .vibemap-single .wp-block-column.sidebar {
    order: 1;
  }

  .vibemap-single .entry-content {
    margin-right: 0;
  }

  .vibemap-single .meta-info-wrapper,
  .vibemap-single .sidebar {
    margin-top: 0;
    margin-bottom: 0;
  }

  .vibemap-single .meta-info-title,
  .vibemap-single .sidebar-title {
    width: 100%;
  }
}

/* Block Editor Specific Styles */
.vibemap-single .wp-block-post-featured-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 10px;
}

.vibemap-single .wp-block-columns {
  gap: 20px;
}

/* Term Styling for Vibes */
.vibemap-single .wp-block-post-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.vibemap-single .wp-block-post-terms a {
  display: inline-block;
  background-color: #f0f0f0;
  color: #333;
  padding: 5px 10px;
  margin: 2px;
  border-radius: 20px;
  font-size: 14px;
  text-decoration: none;
  text-transform: capitalize;
}

.vibemap-single .wp-block-post-terms.no-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.vibemap-single .wp-block-post-terms.no-links a {
  pointer-events: none;
  text-decoration: none;
  color: #333;
}

/* Remove Separator */
.vibemap-single .wp-block-post-terms__separator {
  display: none;
}

/* Category and Price Styling */
.vibemap-single .category-price {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  flex-wrap: wrap;
}

.vibemap-single .category-price .price-level {
  color: #2c5282;
  font-weight: 600;
}

.vibemap-single .category-link {
  color: inherit;
  text-decoration: none;
}

.vibemap-single .category-link:hover {
  text-decoration: underline;
}

/* Adjust icon alignment for category */
.vibemap-single .meta-info-item:first-child .meta-icon {
  color: #4a5568;
}

/* Meta Info Header */
.vibemap-single .meta-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #ddd;
  padding-bottom: 5px;
}

.vibemap-single .meta-info-title {
  margin: 0;
  border-bottom: none;
}

.vibemap-single .save-calendar-btn {
  background: #2c5282;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-left: 10px;
}

.vibemap-single .save-calendar-btn:hover {
  background: #1a365d;
}

/* Event DateTime Styling */
.vibemap-single .event-datetime {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vibemap-single .primary-datetime {
  font-weight: 500;
}

.vibemap-single .recurrence-info {
  font-size: 14px;
  color: #666;
}

/* Vibe Chips */
.hidden-vibe {
  display: none !important;
}

.see-all-vibes {
  cursor: pointer;
  background-color: #e0e0e0 !important;
}

.see-all-vibes:hover {
  background-color: #d0d0d0 !important;
}

.show-all-vibes .hidden-vibe {
  display: inline-block !important;
}

/* Similar Items Block */
.wp-block-vibemap-similar-items {
  margin: 32px 0;
}

.wp-block-vibemap-similar-items .similar-items-title {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 600;
}

.wp-block-vibemap-similar-items .similar-items-loading {
  padding: 16px;
  text-align: center;
  color: #666;
}

/* Venue Events Block */
.wp-block-vibemap-venue-events {
  margin: 32px 0 64px;
}

.wp-block-vibemap-venue-events .venue-events-title {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 600;
}

.wp-block-vibemap-venue-events .venue-events-loading {
  padding: 16px;
  text-align: center;
  color: #666;
}

.vibemap-single .meta-info-item:has(.hours) {
  align-items: flex-start;
}

.vibemap-single .meta-info-item:has(.hours) .meta-icon {
  margin-top: 8px;
}

/* Remove the fixed height clamps since we're using aspect ratio */
.vibemap-single .featured-image,
.vibemap-single .featured-image.content-width {
  position: static;
  height: auto;
}

/* Fix background image positioning with padding-top method */
.vibemap-single .featured-image,
.vibemap-single .featured-image.content-width {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Ensure images fill their containers properly */
.vibemap-single .wp-block-post-featured-image {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
}

.vibemap-single .wp-block-post-featured-image figure {
  margin: 0;
  height: 100%;
}

/* Hero Image Grid Specific Styles */
.wp-block-vibemap-hero-image {
  margin: 0 0 32px 0;
  width: 100%;
}

.wp-block-vibemap-hero-image .hero-image-grid {
  width: 100%;
  border-radius: 10px;
}

/* Ensure proper spacing in WordPress context */
.wp-block-vibemap-hero-image.alignwide {
  max-width: var(--wp--style--global--wide-size, 1200px);
  margin-left: auto;
  margin-right: auto;
}

.wp-block-vibemap-hero-image.alignfull {
  max-width: 100%;
}