/* ============================================================
   WEBBAS COMMUNITY PLUS  v1.2.3  (2026-11-06)  –  stilar
   Laddas via <link rel="stylesheet"> i sajtens head-kod.
   Alla regler är låsta till forum-widgeten (.walls-widget), inläggets popupvy (.large-popup-wrapper) eller
   sökrutan (.wcp-search) och påverkar inget annat på sajten.
   ============================================================ */
  :is(.walls-widget, .large-popup-wrapper) .wcp-link { text-decoration: underline; word-break: break-all; }

  :is(.walls-widget, .large-popup-wrapper) .wcp-embeds { display: block; width: 100%; clear: both; margin: 10px 0 4px; }
  /* Inläggets textkolumn är bara så bred som texten; spelarna kräver därför egen bredd (max 720 px, på mobil skärmens bredd) */
  :is(.walls-widget, .large-popup-wrapper) .wcp-embeds { min-width: min(720px, calc(100vw - 72px)); }
  :is(.walls-widget, .large-popup-wrapper) .circle-post-content > .f-left:has(.wcp-embeds) { flex: 1 1 auto; min-width: 0; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-embed {
    position: relative; width: 100%; max-width: 720px; margin: 0 0 12px;
    background: #0e1316; border-radius: 10px; overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
  }
  :is(.walls-widget, .large-popup-wrapper) .wcp-embed[data-ratio] { aspect-ratio: var(--wcp-ratio, 16 / 9); }
  :is(.walls-widget, .large-popup-wrapper) .wcp-embed.wcp-narrow { max-width: 360px; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-embed iframe,
  :is(.walls-widget, .large-popup-wrapper) .wcp-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-embed.wcp-fixed { aspect-ratio: auto; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-embed.wcp-fixed iframe { position: static; height: var(--wcp-h, 152px); }
  :is(.walls-widget, .large-popup-wrapper) .wcp-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-play {
    position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
    border: 0; background: rgba(0,0,0,.25); color: #fff; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    font: 600 14px/1.3 inherit; font-family: inherit;
  }
  :is(.walls-widget, .large-popup-wrapper) .wcp-play:hover { background: rgba(0,0,0,.40); }
  :is(.walls-widget, .large-popup-wrapper) .wcp-play-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--color-primary, #ff6b6b); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 26px;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
  }
  :is(.walls-widget, .large-popup-wrapper) .wcp-play-icon::before { content: ""; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; margin-left: 5px; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-play span:last-child { opacity: .92; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
  :is(.walls-widget, .large-popup-wrapper) .wcp-fixed .wcp-play { position: static; height: var(--wcp-h, 152px); }
  :is(.walls-widget, .large-popup-wrapper) .wcp-link-hidden, :is(.walls-widget, .large-popup-wrapper) .wcp-p-hidden { display: none !important; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-title {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px; pointer-events: none;
    color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; text-align: left;
    background: linear-gradient(transparent, rgba(0,0,0,.65)); text-shadow: 0 1px 2px rgba(0,0,0,.6);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* PDF-kort */
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf { background: #1b1f23; }
  /* Utan förhandsbild är kortet en enda rad; visningsytan öppnas först vid "Visa här" */
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-top {
    position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 440px; overflow: hidden;
    display: none; align-items: center; justify-content: center; cursor: pointer; background: #e9e9e9;
  }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-top.wcp-has-thumb, :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-top.wcp-pdf-viewer { display: flex; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-name::before {
    content: "PDF"; display: inline-block; vertical-align: middle; margin-right: 10px;
    padding: 3px 7px; border-radius: 6px; background: #d0342c; color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: .06em; line-height: 1.2;
  }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-top.wcp-has-thumb ~ .wcp-pdf-bar .wcp-pdf-name::before { display: none; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-top.wcp-has-thumb { align-items: flex-start; background: #fff; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-top.wcp-has-thumb::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; pointer-events: none;
    background: linear-gradient(transparent, rgba(0,0,0,.35));
  }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-thumb { width: 100%; height: auto; display: block; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-icon {
    font-weight: 700; font-size: 18px; line-height: 1; letter-spacing: .06em; color: #fff;
    background: #d0342c; padding: 14px 18px; border-radius: 10px;
  }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-top.wcp-pdf-viewer { aspect-ratio: auto; height: 640px; max-height: 80vh; cursor: default; background: #525659; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-viewer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; font-size: 13px; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pdf-btn {
    flex: none; padding: 6px 13px; border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
    background: var(--color-primary, #ff6b6b); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4; font-family: inherit;
  }
  :is(.walls-widget, .large-popup-wrapper) a.wcp-pdf-open { background: rgba(255,255,255,.16); color: #fff; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-image-box { aspect-ratio: 16 / 9; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-image-box.wcp-image-open { aspect-ratio: auto; background: transparent; box-shadow: none; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-image-box .wcp-play span:last-child { max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-image { display: block; max-width: 100%; max-height: 520px; width: auto; height: auto; border-radius: 10px; margin: 0 0 12px; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-audio { display: block; width: 100%; max-width: 720px; margin: 0 0 12px; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-consent { padding: 14px; color: #fff; font-size: 14px; line-height: 1.4; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-consent a { color: #fff; text-decoration: underline; }

  /* GIF-knapp och väljare */
  .wcp-gif-btn { font-size: 11px !important; font-weight: 700; letter-spacing: .04em; font-family: inherit; border: 0; cursor: pointer; }
  .wcp-gif-btn.wcp-gif-type { font-size: inherit !important; font-weight: inherit; letter-spacing: normal; cursor: pointer; }
  .wcp-gif-btn.wcp-gif-type svg { width: 20px; height: 20px; margin-right: 6px; fill: currentColor; }
  .wcp-gif-picker {
    position: relative; z-index: 20; width: 100%; max-width: 420px; box-sizing: border-box; margin: 8px 0 4px; padding: 10px;
    background: #ffffff; color: #1a1a1a; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.28);
  }
  .wcp-gif-picker input {
    width: 100%; box-sizing: border-box; padding: 9px 12px; margin: 0 0 8px; border: 1px solid #d6d6d6; border-radius: 8px;
    background: #fff; color: #1a1a1a; font: inherit; font-size: 14px; outline: none;
  }
  .wcp-gif-picker input:focus { border-color: var(--color-primary, #ff6b6b); }
  .wcp-gif-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 300px; overflow-y: auto; }
  .wcp-gif-item { padding: 0; border: 0; background: #eee; border-radius: 6px; overflow: hidden; cursor: pointer; aspect-ratio: 1; }
  .wcp-gif-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .wcp-gif-item:hover { outline: 2px solid var(--color-primary, #ff6b6b); }
  .wcp-gif-item.wcp-gif-loading { opacity: .4; }
  .wcp-gif-empty { grid-column: 1 / -1; padding: 20px; text-align: center; color: #666; font-size: 13px; }
  .wcp-gif-foot { margin-top: 8px; font-size: 11px; color: #777; text-align: right; }

  /* Pinnade inlägg – ordningen styrs med flex/order, inga DOM-flyttar */
  :is(.walls-widget, .large-popup-wrapper) .multi-wall-sidebar-wrapper.wcp-has-pinned { display: flex; flex-direction: column; }
  :is(.walls-widget, .large-popup-wrapper) .multi-wall-sidebar-wrapper.wcp-has-pinned > .circle-post-start { order: -2; }
  :is(.walls-widget, .large-popup-wrapper) .multi-wall-sidebar-wrapper.wcp-has-pinned > .circle-post-wrapper.wcp-pinned { order: -1; }
  :is(.walls-widget, .large-popup-wrapper) .multi-wall-sidebar-wrapper.wcp-has-pinned > .post-more-comments-wrapper { order: 1; }
  /* Pinnat: primärfärgen från sajtens palett. Textfärgen (--wcp-pin-fg) sätts av scriptet
     utifrån hur ljus primärfärgen är, så den blir läsbar på både ljusa och mörka paletter. */
  :is(.walls-widget, .large-popup-wrapper) .circle-post-wrapper.wcp-pinned {
    box-shadow: inset 4px 0 0 var(--color-primary, #ff6b6b);
  }
  :is(.walls-widget, .large-popup-wrapper) .wcp-marker { display: none; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pin-li a { cursor: pointer; }
  /* Pinn-kommentaren ("📌 Pinnat" av admin) är bara lagringen av pinningen och döljs helt.
     "Lossa" i menyn raderar den i bakgrunden. */
  :is(.walls-widget, .large-popup-wrapper) .circle-post-comment.wcp-pin-comment { display: none !important; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pin-li svg { margin-right: 8px; flex: none; }
  :is(.walls-widget, .large-popup-wrapper) .wcp-pin-chip {
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; margin-left: 14px;
    padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4;
    background: var(--color-primary, #ff6b6b); color: var(--wcp-pin-fg, #fff);
  }

  /* Sök – fasta färger (vit ruta, mörk text) så den syns på både ljusa och mörka sajter */
  .wcp-search { display: block; width: 100%; margin: 0 0 14px; }
  .wcp-search-row { position: relative; display: flex; align-items: center; }
  .wcp-search input {
    width: 100%; box-sizing: border-box; padding: 11px 40px 11px 42px;
    border-radius: 999px; border: 1px solid #d6d6d6;
    background: #ffffff; color: #1a1a1a; font: inherit; font-size: 15px; outline: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
  }
  .wcp-search input:focus { border-color: var(--color-primary, #ff6b6b); box-shadow: 0 0 0 3px rgba(128,128,128,.18); }
  .wcp-search input::placeholder { color: #6b6b6b; opacity: 1; }
  .wcp-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
  .wcp-search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #555; pointer-events: none; }
  .wcp-search-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 26px; height: 26px; border: 0; border-radius: 50%; background: #e4e4e4;
    color: #333; cursor: pointer; font-size: 15px; line-height: 26px; padding: 0; display: none;
  }
  .wcp-search-clear:hover { background: #d0d0d0; }
  .wcp-search.wcp-active .wcp-search-clear { display: block; }
  .wcp-search-count {
    display: inline-block; margin: 8px 0 0 16px; padding: 2px 10px; border-radius: 999px;
    background: #ffffff; color: #333; font-size: 12px; line-height: 1.6;
  }
  .wcp-search-count:empty { display: none; }
  :is(.walls-widget, .large-popup-wrapper) .circle-post-wrapper.wcp-hide { display: none !important; }
