/**
 * modal-content.css
 * ContentModal styles for RateYourSeats.com
 * Units: px only. Colors: site vars. No u-skeleton definition.
 */

/* ─── Variables ──────────────────────────────────────────────────────────────── */

:root {
   --cm-rail-width:     clamp(320px, 36vw, 480px);
   --cm-max-width:      1280px;
   --cm-max-width-full: 2880px;
   --cm-radius:         10px;
   --cm-gap:            24px;
   --cm-thumb-w:        90px;
   --cm-thumb-h:        60px;

   /* Chrome heights */
   --cm-header-h:   56px;   /* Wide landing header */
   --cm-narrow-h:   44px;   /* Narrow top reserved space */
   --cm-cta-bar-h:  72px;   /* Photo narrow CTA bar */

   /* Z layers */
   --cm-z-chrome:   40;
   --cm-z-cta-bar:  50;

   /* Type */
   --cm-font-title:   28px;
   --cm-font-section: 22px;
   --cm-font-body:    16px;
   --cm-font-small:   14px;
   --cm-font-xsmall:  12px;
}

.cm-body {
   color: var(--color-primary);
}

/* ─── Dialog reset ────────────────────────────────────────────────────────────── */

.cm-dialog {
   width: 100%;
   height: 100%;
   max-width: 100vw;
   max-height: 100vh;
   background: transparent;
   border: 0;
   padding: 0;
   margin: 0;
   overflow: hidden;
   top: 0;
   left: 0;
}

.cm-dialog::backdrop {
   background-color: rgba(0, 0, 0, 0.65);
}


/* ─── Container ───────────────────────────────────────────────────────────────── */

/* Wide: centered, capped height */
.cm-container {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   width: calc(100% - 32px);
   max-width: var(--cm-max-width);
   max-height: 92vh;
   background: #fff;
   border-radius: var(--cm-radius);
   display: flex;
   flex-direction: column;
   overflow: hidden;
}

.cm-container--full {
   max-width: var(--cm-max-width-full);
   max-height: 94vh;
}


/* ─── Body (rail + scene) ─────────────────────────────────────────────────────── */

.cm-body {
   display: flex;
   flex: 1;
   min-height: 0;
   overflow: hidden;
}


/* ─── Chrome elements ─────────────────────────────────────────────────────────── */

/*
 * .cm-header      — wide landing: full-width header bar above cm-body
 * .cm-close--item — item/photo patterns: absolute top-right of container
 * .cm-close--narrow — narrow landing: absolute top-right
 * .cm-back--narrow  — narrow items: absolute top-left
 */

/* Wide landing header */
.cm-header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   height: var(--cm-header-h);
   padding: 0 var(--cm-gap);
   border-bottom: 1px solid var(--color-border, #e0e0e0);
   background: #fff;
   flex-shrink: 0;
   z-index: var(--cm-z-chrome);
}

.cm-header-title {
   font-size: 18px;
   font-weight: 600;
}

/* Close button shared styles */
.cm-close,
.cm-close--item,
.cm-close--narrow {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 32px;
   height: 32px;
   background: transparent;
   border: none;
   border-radius: 6px;
   cursor: pointer;
   color: var(--color-80, inherit);
   transition: background 0.2s, transform 0.2s;
}

.cm-close:hover,
.cm-close--item:hover,
.cm-close--narrow:hover {
   background: var(--color-surface-2, #f0f0f0);
   transform: scale(1.1);
}

/* Close on item patterns: absolute to container, top-right */
.cm-close--item {
   position: absolute;
   top: 12px;
   right: 12px;
   z-index: var(--cm-z-chrome);
}

/* Close on narrow landing: same position */
.cm-close--narrow {
   position: absolute;
   top: 6px;
   right: 8px;
   z-index: var(--cm-z-chrome);
}

/* Back btn on narrow items: absolute top-left */
.cm-back--narrow {
   position: absolute;
   top: 6px;
   left: 8px;
   z-index: var(--cm-z-chrome);
}


/* ─── Rail ────────────────────────────────────────────────────────────────────── */

.cm-rail {
   width: var(--cm-rail-width);
   flex-shrink: 0;
   border-right: 1px solid var(--color-border, #e0e0e0);
   overflow-y: auto;
   display: flex;
   flex-direction: column;
   scrollbar-width: thin;
}

.cm-rail::-webkit-scrollbar       { width: 4px; }
.cm-rail::-webkit-scrollbar-track { background: transparent; }
.cm-rail::-webkit-scrollbar-thumb { background: var(--color-border, #ccc); border-radius: 2px; }

.cm-rail--hidden {
   display: none;
}

/* Back btn sticky at top of rail on wide items */
.cm-rail-back-wrap {
   position: sticky;
   top: 0;
   background: #fff;
   padding: 12px var(--cm-gap) 8px;
   z-index: 10;
   border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.cm-rail-inner {
   padding: var(--cm-gap);
   display: flex;
   flex-direction: column;
   gap: 24px;
}

.cm-rail-heading {
   font-size: var(--size-title-base);
   font-weight: 700;
}

.cm-rail-section {
   display: flex;
   flex-direction: column;
   gap: 12px;
}


/* ─── Scene ───────────────────────────────────────────────────────────────────── */

.cm-scene {
   flex: 1;
   overflow-y: auto;
   min-width: 0;
   scrollbar-width: thin;
   margin-block-start: 0;
}

.cm-scene::-webkit-scrollbar       { width: 6px; }
.cm-scene::-webkit-scrollbar-track { background: var(--color-surface-2, #f5f5f5); }
.cm-scene::-webkit-scrollbar-thumb { background: var(--color-border, #ccc); border-radius: 3px; }

.cm-scene-inner {
   padding: var(--cm-gap);
   display: flex;
   flex-direction: column;
   gap: 16px;
}

.cm-scene-title {
   font-weight: 700;
   margin: 0;
   line-height: 1.25;
   padding-right: 48px; /* space for close button */
}

.cm-scene-location {
   color: var(--color-80, inherit);
   line-height: 1.5;
}

.cm-scene-body {

}



.cm-scene-subquestion {
   font-size: var(--cm-font-body);
   color: var(--color-80, inherit);
   margin: 0;
}

.cm-scene-subsection {
   display: flex;
   flex-direction: column;
   gap: 8px;
}

.cm-scene-subheading {
   font-size: var(--cm-font-section);
   font-weight: 600;
   margin: 0;
}

.cm-divider {
   border: 0;
   border-top: 1px solid var(--color-border, #e0e0e0);
   margin: 4px 0;
}

.cm-answered-by {
   display: flex;
   align-items: center;
   gap: 6px;
   color: var(--color-80, inherit);
   font-style: italic;
}

/*
 * .cm-scene-ticket — ticket availability block placed in scene HTML
 * Wide: hidden (tickets live in rail)
 * Narrow: visible, flows naturally below scene content
 */
.cm-scene-ticket {
   display: none;
   border-top: 1px solid var(--color-border, #e0e0e0);
   padding-top: 16px;
   margin-top: 8px;
}


/* ─── Ticket rail ─────────────────────────────────────────────────────────────── */

.cm-ticket-rail {
   display: flex;
   flex-direction: column;
   gap: 12px;
   padding-top: 16px;
   border-top: 1px solid var(--color-border, #e0e0e0);
}


/* ─── Meta list ───────────────────────────────────────────────────────────────── */

.cm-meta-list {
   display: flex;
   flex-direction: column;
   gap: 6px;
   margin: 0;
   padding: 0;
}

.cm-meta-item {
   display: flex;
   align-items: baseline;
   gap: 6px;
}

.cm-meta-item dt {
   font-weight: 600;
   white-space: nowrap;
}

.cm-meta-item dd {
   color: var(--color-80, inherit);
   margin: 0;
}


/* ─── Tags ────────────────────────────────────────────────────────────────────── */

.cm-tag {
   display: inline-block;
   background: var(--color-surface-2, #f0f4f8);
   font-size: var(--cm-font-xsmall);
   font-weight: 500;
   padding: 3px 8px;
   border-radius: 4px;
}


/* ─── Expert badge ────────────────────────────────────────────────────────────── */

.cm-expert-badge {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   font-size: var(--cm-font-xsmall);
   font-weight: 600;
   padding: 4px 10px;
   border-radius: 20px;
   width: fit-content;
   background: var(--color-surface-2, #e8f0ff);
   color: var(--color-primary, inherit);
}


/* ─── Landing: cards ──────────────────────────────────────────────────────────── */

.cm-landing-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
   gap: 16px;
}

.cm-card {
   border: 1px solid var(--color-border, #e0e0e0);
   border-radius: 8px;
   padding: 14px;
   cursor: pointer;
   display: flex;
   flex-direction: column;
   gap: 8px;
   background: #fff;
   transition: border-color 0.15s, box-shadow 0.15s;
   outline-offset: 2px;
}

.cm-card:hover {
   border-color: var(--color-50, currentColor);
   box-shadow: 0 2px 8px rgba(0, 36, 72, 0.04);
}

.cm-card:focus-visible {
   outline: 2px solid var(--color-50, currentColor);
}

.cm-card-meta {
   display: flex;
   gap: 4px;
   align-items: center;
   font-size: var(--cm-font-xsmall);
   color: var(--color-70, inherit);
}

.cm-card-type {
   display: flex;
   align-items: center;
   gap: 4px;
   font-weight: 600;
}

.cm-card-body {
   display: flex;
   flex-direction: column;
   gap: 4px;
}

.cm-card-body strong {
   font-weight: 600;
   line-height: 1.3;
}

.cm-card-excerpt {
   color: var(--color-80, inherit);
   font-size: var(--cm-font-xsmall);
   line-height: 1.4;
}

.cm-card-footer {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 6px;
   margin-top: auto;
}

.cm-card-date {
   margin-left: auto;
   font-size: var(--cm-font-xsmall);
   color: var(--color-80, inherit);
}


/* ─── Landing: tabs ───────────────────────────────────────────────────────────── */

.cm-tabs {
   display: flex;
   font-size: var(--size-title);
}

.cm-tab {
   background: none;
   border: none;
   padding: 10px 18px;
   font-weight: normal;
   color: var(--color-80, inherit);
   cursor: pointer;
   transition: color 0.15s, border-color 0.15s;
}

.cm-tab.is-active {

}

.cm-tab:hover:not(.is-active) {
   color: var(--color-primary, inherit);
}

.cm-tab-panel {
   display: none;
}

.cm-tab-panel.is-active {
   display: block;
   padding-top: 16px;
}


/* ─── Photo pattern ───────────────────────────────────────────────────────────── */

.cm-photo-scene {
   padding: 0;
   gap: 0;
   flex: 1;
}

.cm-photo-img-wrap {
   position: relative;
   flex: 1;
   min-height: 0;
   background: #000;
   display: flex;
   align-items: center;
   justify-content: center;
}

.cm-photo-main {
   width: 100%;
   height: 100%;
   object-fit: contain;
   display: block;
}

.cm-photo-caption {
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   background: rgba(0, 0, 0, 0.75);
   color: #fff;
   font-size: 14px;
   line-height: 1.45;
   padding: 12px 16px;
   display: none;
   width: fit-content;
   max-width: min(600px, 80%);
   border-radius: 0 0 12px 0;
}

.cm-photo-caption.is-visible {
   display: block;
}

/* ─── Photo nav arrows ────────────────────────────────────────────────────────── */

.cm-photo-arrow {
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
   z-index: 10;
   display: flex;
   align-items: center;
   justify-content: center;
   width: 44px;
   height: 44px;
   background: rgba(0, 0, 0, 0.55);
   border: none;
   border-radius: 50%;
   color: #fff;
   cursor: pointer;
   transition: background 0.15s, opacity 0.15s, transform 0.15s;
   /* Keep arrows clear of caption bar */
   margin-top: 20px;
}

.cm-photo-arrow--prev { left: 12px; }
.cm-photo-arrow--next { right: 12px; }

.cm-photo-arrow:hover {
   background: rgba(0, 0, 0, 0.82);
}

.cm-photo-arrow:disabled {
   opacity: 0 !important;
   cursor: default;
   pointer-events: none;
}

.cm-photo-counter {
   color: var(--color-70, inherit);
}


/* ─── Thumbstrip ──────────────────────────────────────────────────────────────── */

.cm-thumb-strip {
   display: flex;
   gap: 6px;
   padding: 8px 16px;
   background: #111;
   overflow-x: auto;
   flex-shrink: 0;
   scrollbar-width: thin;
   scrollbar-color: #555 #111;
}

.cm-thumb-strip::-webkit-scrollbar        { height: 4px; }
.cm-thumb-strip::-webkit-scrollbar-track  { background: #111; }
.cm-thumb-strip::-webkit-scrollbar-thumb  { background: #555; border-radius: 2px; }

.cm-thumb {
   flex-shrink: 0;
   width: var(--cm-thumb-w);
   height: var(--cm-thumb-h);
   border: 2px solid transparent;
   border-radius: 4px;
   overflow: hidden;
   cursor: pointer;
   padding: 0;
   background: none;
   opacity: 0.55;
   transition: border-color 0.15s, opacity 0.15s;
}

.cm-thumb.is-active,
.cm-thumb:hover {
   border-color: #fff;
   opacity: 1;
}

.cm-thumb img {
   width: 90px;
   height: 60px;
   object-fit: cover;
   display: block;
}


/* ─── Photo CTA bar (narrow only) ────────────────────────────────────────────── */

.cm-photo-cta-bar {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 16px;
   background: #fff;
   border-top: 1px solid var(--color-border, #e0e0e0);
   padding: 12px var(--cm-gap);
   height: var(--cm-cta-bar-h);
   flex-shrink: 0;
}

.cm-cta-price {
   font-size: 12px;
   color: var(--color-80, inherit);
   line-height: 1.3;
}

.cm-cta-amount {
   font-size: 20px;
   font-weight: 700;
}

.cm-cta-section {
   font-size: 12px;
   text-decoration: underline;
   cursor: pointer;
   color: var(--color-primary, inherit);
}

.cm-cta-btn {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   font-size: 14px;
   font-weight: 600;
   padding: 10px 18px;
   border-radius: 6px;
   text-decoration: none;
   white-space: nowrap;
   background: var(--color-primary, currentColor);
   color: #fff;
   transition: opacity 0.15s;
}

.cm-cta-btn:hover {
   opacity: 0.85;
}

[data-trigger] {
   cursor: pointer;
}

/* ─── Wide: >= 800px ──────────────────────────────────────────────────────────── */

@media (min-width: 800px) {

   /* Rail + scene side by side */
   .cm-body {
      flex-direction: row;
      flex: 1;
      min-height: 0;
   }

   /* Scene ticket hidden — tickets live in rail on wide */
   .cm-scene-ticket {
      display: none !important;
   }

   /* Item pattern: scene needs top padding to clear the absolute close btn */
   .cm-scene-inner {
   }

   /* Landing wide: header takes the top space, no scene padding needed for chrome */
   .cm-pattern--rating.cm-has-landing  .cm-scene-inner,
   .cm-pattern--review.cm-has-landing  .cm-scene-inner,
   .cm-pattern--question.cm-has-landing .cm-scene-inner {
      padding-top: var(--cm-gap);
   }

   /* Photo wide: body overflow hidden, scene is flex column */
   .cm-pattern--photo .cm-body {
      overflow: hidden;
   }

   .cm-pattern--photo .cm-scene {
      overflow: hidden;
      display: flex;
      flex-direction: column;
   }

   .cm-pattern--photo .cm-photo-scene {
      flex: 1;
      overflow: hidden;
      display: flex;
      flex-direction: column;
   }

   .cm-pattern--photo .cm-photo-img-wrap {
      flex: 1;
      min-height: 0;
   }

   /* Photo scene: no top padding (fills edge to edge) */
   .cm-pattern--photo .cm-scene-inner {
      padding-top: 0;
   }

}


/* ─── Narrow: < 800px ─────────────────────────────────────────────────────────── */

@media (max-width: 799px) {

   /* Full height sheet from bottom, no radius */
   .cm-container,
   .cm-container--full {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      width: 100%;
      max-width: 100%;
      max-height: 100%;
      height: 100%;
      transform: none;
      border-radius: 0;
   }

   /* Rail hidden on all narrow — tickets flow in scene */
   .cm-rail {
      display: none;
   }

   /* Body stacks vertically */
   .cm-body {
      flex-direction: column;
      flex: 1;
      min-height: 0;
   }

   /* Scene scrolls, pad top to clear the close/back chrome buttons */
   .cm-scene {
      flex: 1;
      overflow-y: auto;
   }

   .cm-scene-inner {
      padding-top: calc(var(--cm-narrow-h) + 8px);
   }

   /* Ticket block visible in narrow scene */
   .cm-scene-ticket {
      display: block;
   }

   /* Photo narrow: no scroll on scene, CTA bar at bottom */
   .cm-pattern--photo .cm-scene {
      overflow: hidden;
      display: flex;
      flex-direction: column;
   }

   .cm-pattern--photo .cm-photo-scene {
      flex: 1;
      overflow: hidden;
      display: flex;
      flex-direction: column;
   }

   .cm-pattern--photo .cm-photo-img-wrap {
      flex: 1;
      min-height: 0;
   }

   /* Photo narrow: no scene-inner padding — image fills full */
   .cm-pattern--photo .cm-scene-inner {
      padding: 0;
   }

   /* Photo narrow: no ticket block */
   .cm-pattern--photo .cm-scene-ticket {
      display: none;
   }

}

button.cm-close,
button.cm-close--item{
   color: var(--color-primary);
   background: transparent;
   display: inline-grid;
}
button.cm-close i,
button.cm-close--item i{
   height: 28px;
   width: 28px;
}

button.cm-close:hover,
button.cm-close--item:hover{
   color:white;
}

.cm-pattern--photo button.cm-close--item{
   color: white;
   background: black;
}

button.cm-thumb{
   background: black;
   padding: 0;
   height: unset;
   line-height: unset;
}

.cm-dialog.cm-pattern--rating [data-is='icon-group'][data-group='stars']{
   font-size: calc(var(--size-title-section) * 1.15);
}

.cm-dialog.cm-pattern--rating .cm-landing-grid [data-is='icon-group'][data-group='stars']{
   font-size: 18px;
}