/* Extracted from account/templates/pages/architecture_styles.html */

/* Aligned wrapper: spans between brand left edge and NOTES right edge */
  .as-align { width: 100%; padding-left: var(--as-left, 24px); padding-right: var(--as-right, 24px); box-sizing: border-box; max-width: none; }
  /* Ensure no nested container padding or max-width reduces available width */
  .as-align .container, .as-align .container-fluid { padding-left: 0 !important; padding-right: 0 !important; margin-left: 0; margin-right: 0; max-width: none; }
  .as-header-row { margin: 0.75rem 0 0.5rem 0; }

  /* Grid layout: 2x2 on left, Example panel on right spanning rows */
  .as-grid { display: grid; width: 100%; box-sizing: border-box; grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "s1 s2 s5a" "s3 s4 s5b"; gap: 12px; align-items: stretch; }
  .as-section { background: var(--panel-bg, #E6F2FF); border: 1px solid var(--panel-border-subtle, rgba(0,0,0,0.06)); border-radius: var(--panel-radius, 10px); padding: 8px; display: flex; flex-direction: column; min-height: 200px; }
  .as-s1 { grid-area: s1; }
  .as-s2 { grid-area: s2; }
  .as-s3 { grid-area: s3; }
  .as-s4 { grid-area: s4; }
  .as-s5a { grid-area: s5a; }
  .as-s5b { grid-area: s5b; }

  .as-box.header { background: var(--panel-inner-bg, #fff); border-radius: var(--panel-radius-sm, 8px); padding: 8px 10px; font-weight: 700; margin-bottom: 8px; }
  .as-box.body { background: var(--panel-inner-bg, #fff); border-radius: var(--panel-radius-sm, 8px); padding: 10px; flex: 1 1 auto; position: relative; }

  /* Section 1/3 tags */
  .as-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .as-tag { display: inline-block; background: var(--panel-inner-bg, #fff); border: 1px solid var(--panel-border, #D0E5FF); border-radius: 6px; padding: 2px 8px; font-size: 0.85rem; }
  .as-tags.grid2x2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }

  /* Aspects row */
  .as-aspects { display: grid; grid-template-columns: 1fr; grid-auto-rows: auto; gap: 8px; margin-bottom: 10px; }
  .as-aspect { background: var(--panel-bg-soft, #FAFCFF); border: 1px solid var(--panel-border, #D0E5FF); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; }
  .as-aspect h6 { font-size: 0.9rem; font-weight: 700; margin: 0; }
  .as-aspect .aspect-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
  .as-aspect .aspect-body { flex: 1 1 auto; font-size: 0.9rem; }
  .as-aspect .aspect-tag { display: inline-block; background: var(--panel-inner-bg, #fff); border: 1px solid var(--panel-border, #D0E5FF); border-radius: 6px; padding: 2px 8px; font-size: 0.85rem; color: #0d6efd; cursor: pointer; }
  .as-aspect.active { outline: 2px solid var(--blue-500, #7CAADC); background: var(--panel-inner-bg, #ffffff); }
  /* Keep one-column layout at narrower widths as well */
  @media (max-width: 1200px) { .as-aspects { grid-template-columns: 1fr; } }
  @media (max-width: 768px) { .as-aspects { grid-template-columns: 1fr; } }

  /* Thumbnails 3x2 */
  .as-thumbs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .as-thumb { background: var(--panel-bg-tint, #F2F6FF); border: 1px solid var(--panel-border, #D0E5FF); border-radius: 6px; overflow: hidden; cursor: pointer; }
  .as-thumb img { width: 100%; height: 110px; object-fit: cover; display: block; }
  .as-thumb .tcap { padding: 6px 8px; font-size: 0.85rem; }

  /* Map */
  .map-wrap { padding: 0; overflow: hidden; }
  #as-map { width: 100%; height: 300px; border: 0; display: block; }
  .map-controls { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }

  /* Street View frame */
  .sv-frame { width: 100%; height: 260px; border: 0; display: block; }

  /* Example panel */
  .ex-wrap { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .ex-image { width: 100%; height: 360px; object-fit: cover; border-radius: 6px; display: block; }
  .ex-source { font-size: 0.85rem; color: #555; }
  .ex-credit { font-size: 0.85rem; color: #555; margin-top: 2px; margin-bottom: 6px; }

  /* First card overview list: no bullets, match font-size of Explore the Style body (0.9rem) */
  #as-overview-list { list-style: none; padding-left: 0; margin: 0 0 8px 0; }
  #as-overview-list li { font-size: 0.9rem; margin: 2px 0; }
  /* Two-row layout: title on first row, text on second row */
  #as-overview-list li strong { display: block; margin-bottom: 2px; }

  /* Third card (Rolex case study) overview list: remove bullets, preserve rows, match font size */
  #ex-overview-list { list-style: none; padding-left: 0; margin: 0 0 8px 0; }
  #ex-overview-list li { font-size: 0.9rem; margin: 2px 0; }
  /* Two-row layout for third card as well */
  #ex-overview-list li strong { display: block; margin-bottom: 2px; }

  /* Section 3 (Study Case header) — force two-row layout: first row title, second row dynamic text */
  .as-section.as-s3 .as-box.header .h6 span:first-child { display: block; margin-bottom: 2px; }

  /* Responsive */
  @media (max-width: 1200px) {
    .as-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "s1 s2" "s3 s4" "s5a s5a" "s5b s5b"; }
  }
  @media (max-width: 768px) {
    .as-grid { grid-template-columns: 1fr; grid-template-areas: "s1" "s2" "s3" "s4" "s5a" "s5b"; }
    .as-aspect { flex: 1 1 48%; }
    #as-map { height: 240px; }
  }
  .section-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    min-width: 260px;
    background-color: var(--navbar-bg-color, #7CAADC);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: default;
  }
  .section-button:hover, .section-button:focus { filter: brightness(0.95); color: #fff; text-decoration: none; outline: none; }

  /* Architectural Styles overlay dropdown */
  .arch-styles-dropdown,
  #arch-styles-dropdown.arch-styles-dropdown,
  #art-movements-dropdown.arch-styles-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: min(320px, 85vw);
    max-width: min(420px, 92vw);
    max-height: min(440px, 62vh);
    overflow: hidden;
    margin: 0;
    padding: 0.4rem;
    background: var(--panel-inner-bg, #fff);
    border: 1px solid var(--panel-border, #D0E5FF);
    border-radius: var(--panel-radius, 10px);
    box-shadow: var(--panel-shadow, 0 14px 32px rgba(45, 55, 72, 0.18));
    z-index: 10001;
  }
  .arch-styles-dropdown[hidden],
  #arch-styles-dropdown.arch-styles-dropdown[hidden],
  #art-movements-dropdown.arch-styles-dropdown[hidden] {
    display: none !important;
  }
  #arch-styles-list,
  #art-movements-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: min(420px, 60vh);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.15rem 0.25rem 0.15rem 0.1rem;
  }
  #arch-styles-list .arch-style-btn,
  #art-movements-list .arch-style-btn {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    min-height: 2.65rem;
    padding: 0.7rem 0.9rem;
    background-color: rgba(124, 170, 220, 0.9);
    color: #fff;
    border: 1px solid #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #arch-styles-list .arch-style-btn:hover,
  #arch-styles-list .arch-style-btn:focus,
  #art-movements-list .arch-style-btn:hover,
  #art-movements-list .arch-style-btn:focus {
    filter: brightness(0.95);
    color: #fff;
  }
  #arch-styles-list .arch-style-btn.is-wip,
  #art-movements-list .arch-style-btn.is-wip {
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.55);
    border-color: #333;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.85;
  }

  /* Rolex Learning Center carousel */
  .rlc-carousel { position: relative; background: var(--panel-inner-bg, #fff); border: 1px solid var(--panel-border, #D0E5FF); border-radius: var(--panel-radius-sm, 8px); overflow: hidden; }
  .rlc-slides { position: relative; width: 100%; height: 360px; }
  .rlc-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .4s ease; }
  .rlc-slide.active { opacity: 1; }
  .rlc-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .rlc-caption { padding: 6px 10px; background: rgba(255,255,255,0.95); border-top: 1px solid #E5EEF9; }
  .rlc-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.4); color: #fff; border: none; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
  .rlc-prev { left: 8px; }
  .rlc-next { right: 8px; }
  .rlc-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; }
  .rlc-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.7); border: 1px solid rgba(0,0,0,0.2); cursor: pointer; }
  .rlc-dot.active { background: #7CAADC; border-color: #7CAADC; }

  /* Video section: ensure the video sits directly beneath the title */
  .as-section.as-s5b .as-box.body { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; padding-top: 8px; }
  .as-section.as-s5b .ratio { margin: 0 0 8px 0; }
  .as-section.as-s5b #as-video { display: block; }
  .as-section.as-s5b #as-video-ref { margin-top: 4px; }
  .as-section.as-s5b #video-actions { margin-top: 6px; }
