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

/* Adopt Architecture Styles grid and cards for Paintings */
  .as-align { width: 100%; padding-left: var(--as-left, 24px); padding-right: var(--as-right, 24px); box-sizing: border-box; }
  .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; }

  .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; }

  /* Hero image styles */
  .pa-hero { border: 1px solid var(--panel-border, #D0E5FF); border-radius: var(--panel-radius-sm, 8px); overflow: hidden; margin-bottom: 10px; background: var(--panel-inner-bg, #fff); }
  .pa-hero img { width: 100%; height: 260px; object-fit: cover; display: block; }
  .pa-hero .pa-hero-cap { font-size: 0.85rem; color: #555; padding: 6px 8px; border-top: 1px solid var(--panel-border, #D0E5FF); background: transparent; }

  /* Monet carousel styles (scoped) */
  .pa-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; }
  .pa-slides { position: relative; width: 100%; height: 360px; }
  .pa-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .4s ease; }
  .pa-slide.active { opacity: 1; }
  .pa-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .pa-caption { padding: 6px 10px; background: transparent; border-top: 1px solid #E5EEF9; }
  .pa-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; }
  .pa-prev { left: 8px; }
  .pa-next { right: 8px; }
  .pa-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; }
  .pa-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; }
  .pa-dot.active { background: #7CAADC; border-color: #7CAADC; }

  /* Hover-expand for first hero image */
  .as-s1 .as-box.body { position: relative; }
  .pa-hero-expanded { position: absolute; top: 0; left: 0; width: calc(200% + 12px); z-index: 30; display: none; pointer-events: none; }
  .pa-hero-expanded .exp-inner { background: var(--panel-inner-bg, #fff); border: 1px solid var(--panel-border, #D0E5FF); border-radius: var(--panel-radius-sm, 8px); box-shadow: var(--panel-shadow, 0 8px 24px rgba(0,0,0,0.15)); overflow: hidden; }
  .pa-hero-expanded img { width: 100%; height: auto; display: block; }
  .pa-hero:hover + .pa-hero-expanded,
  .pa-hero:focus-within + .pa-hero-expanded { display: block; }

  @media (max-width: 768px) { .pa-hero-expanded { display: none !important; } }

  .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-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, #fff); }

  .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; }

  #pa-map { width: 100%; height: 300px; border: 0; display: block; }
  .sv-frame { width: 100%; height: 260px; border: 0; display: block; }

  /* Make Street View links gray like the surrounding text */
  #pa-sv-official a { color: inherit; }
  #pa-sv-official a:hover, #pa-sv-official a:focus { color: inherit; text-decoration: underline; }

  /* Make Further references links gray like the surrounding text */
  #pa-further-refs { color: #6c757d; }
  #pa-further-refs a { color: inherit; }
  #pa-further-refs a:hover, #pa-further-refs a:focus { color: inherit; text-decoration: underline; }

  /* Make Claude Monet — References links gray like the surrounding "Source" text */
  #pa-monet-refs { color: #6c757d; }
  #pa-monet-refs a { color: inherit; }
  #pa-monet-refs a:hover, #pa-monet-refs a:focus { color: inherit; text-decoration: underline; }

  /* Monet carousel caption (references/credits) in gray */
  #monet-carousel .pa-caption { color: #6c757d; }
  #monet-carousel .pa-caption a { color: inherit; }
  #monet-carousel .pa-caption a:hover, #monet-carousel .pa-caption a:focus { color: inherit; text-decoration: underline; }

  /* Helper typography similar to Explore the Style card */
  .pa-text { font-size: 0.9rem; line-height: 1.5; }

  /* Actions and comments (reused) */
  .as-actions { display:flex; flex-wrap:wrap; gap:6px; padding:6px 8px; border-top: 1px solid var(--panel-border, #D0E5FF); background: var(--panel-bg-tint, #F8FAFF); }
  .as-actions .btn { padding: .25rem .5rem; font-size: .8rem; border-radius: 6px; }
  .as-actions .btn .fa { margin-right: .35rem; }
  .as-comments { border-top:1px solid var(--panel-border, #D0E5FF); background: transparent; padding:8px; }
  .as-comments .comment-list { display:grid; gap:6px; margin-bottom:8px; max-height: 200px; overflow-y: auto; padding-right: 4px; scrollbar-gutter: stable; }
  .as-comments .comment-item { border:1px solid var(--panel-border, #D0E5FF); border-radius:6px; padding:6px 8px; background: var(--panel-bg-soft, #FAFCFF); }
  .as-comments .comment-headline { display:flex; align-items:flex-start; gap:8px; }
  .as-comments .comment-author { display:flex; align-items:center; gap:6px; font-size:.8rem; color:#444; }
  .as-comments .comment-author img { width:20px; height:20px; border-radius:50%; object-fit:cover; display:inline-block; }
  .as-comments .comment-text { font-size:.9rem; color:#222; }
  .as-comments .comment-meta { display:flex; gap:8px; align-items:center; justify-content:space-between; font-size: .75rem; color:#555; }
  .as-comments .comment-actions { display:flex; gap:6px; }
  .as-comments form { display:flex; gap:6px; align-items:center; }
  .as-comments input[type=text] { flex:1 1 auto; border:1px solid var(--panel-border, #D0E5FF); border-radius:6px; padding:6px 8px; }
  .as-comments .empty { color:#777; font-size: .8rem; }

  /* Artists overlay dropdown — same as Architecture Styles / Art Movements */
  .arch-styles-dropdown,
  #artists-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],
  #artists-dropdown.arch-styles-dropdown[hidden] {
    display: none !important;
  }
  #artists-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;
  }
  #artists-list .arch-style-btn,
  #artist-popup .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;
    cursor: pointer;
  }
  #artists-list .arch-style-btn:hover,
  #artists-list .arch-style-btn:focus,
  #artist-popup .arch-style-btn:hover,
  #artist-popup .arch-style-btn:focus {
    filter: brightness(0.95);
    color: #fff;
  }
  #artists-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;
  }
  .artists-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--panel-border, #D0E5FF);
  }
  .artists-submenu[hidden] { display: none !important; }

  @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"; } }
  /* Dropdown button styling to match Architecture Styles */
  .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; }
 
   /* 3-line clamp with expandable toggle for newly created paragraphs */
  .clamp-wrap { position: relative; }
  .clamp-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .clamp-wrap.expanded .clamp-text { display: block; overflow: visible; }
  .clamp-more-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: #6c757d; }
  .clamp-dots { letter-spacing: 2px; }
  .clamp-toggle { color: #0d6efd; background: none; border: 0; padding: 0; font-size: 0.85rem; cursor: pointer; }
  .clamp-toggle:focus { outline: 2px solid rgba(13,110,253,0.35); outline-offset: 2px; border-radius: 4px; }
  .clamp-wrap.expanded .clamp-dots { display: none; }
  /* Lightweight modal for the Paintings video popup */
  .pa-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1050; }
  .pa-modal-backdrop[aria-hidden="false"] { display: flex; }
  .pa-modal { background: #fff; color: #000; width: min(960px, 92vw); max-height: 92vh; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.35); overflow: hidden; display: flex; flex-direction: column; }
  .pa-modal-header { display:flex; align-items:center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #e6e6e6; }
  .pa-modal-title { margin:0; font-size: 1rem; font-weight: 600; }
  .pa-modal-close { border: none; background: transparent; font-size: 1.25rem; line-height: 1; padding: 6px 8px; cursor: pointer; }
  .pa-modal-body { position: relative; background: #000; }
  .pa-modal-body iframe { width: 100%; height: min(70vh, 540px); display: block; border: 0; }
  .pa-modal-footer { padding: 8px 12px; border-top: 1px solid #e6e6e6; background: #fafafa; font-size: .9rem; }
  .pa-modal-actions { padding: 8px 12px; display:flex; justify-content:flex-end; gap:8px; }
  .btn-open-popup { margin-top: 8px; }
