/* ==========================================
   Rankly Likes – CSS (bookmark + saved page)
   ========================================== */

/* Bas */
.rankly-like-wrap { margin: 8px 0 14px; }

.rankly-like-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  font-weight: 550 ;
}

.rankly-like-btn:disabled{ opacity: 1; cursor: not-allowed; }

/* Dölj räknaren överallt */
.rankly-like-count{ display: none !important; }

/* Icon-only */
.rankly-like-wrap.is-icon-only{ margin: 10px 0 0; }

/* Ikonstorlek */
.rankly-bookmark{ width: 16px; height: 16px; }

/* Overlay */
.rankly-like-wrap.is-overlay{
  position:absolute;
  top:8px;
  right:8px;
  margin:0;
  z-index:10;
}

/* Hosts som behöver relative */
.post-item-image.rankly-like-host,
.post-grid-wrapper .post-item.post-grid .post-item-image,
.theme-archive-layout .post-item.post-grid .post-item-image,
.wp-block-post-featured-image,
figure.wp-block-post-featured-image{
  position: relative;
}

/* =========================================
   ICON-VARIANT (cirkeln + bokmärke states)
   ========================================= */
.rankly-like-btn.is-icon{
  width:32px !important;
  height:32px !important;
  min-width:32px !important;
  min-height:32px !important;

  padding:0 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;

  border-radius:50% !important;
  box-sizing:border-box !important;
  line-height:0 !important;

  background:#E0E1E2 !important;
  border:none !important;
  box-shadow:none !important;

  opacity:1 !important;
  filter:none !important;
}

.rankly-like-btn.is-icon .rankly-bookmark-outline{
  stroke:#000 !important;
  stroke-width:6 !important;
  opacity:1 !important;
}

/* Ej sparad: ljusgrå fyll */
.rankly-like-btn.is-icon:not(.is-liked) .rankly-bookmark-fill{
  fill:#E0E1E2 !important;
  opacity:1 !important;
}

/* Ej sparad hover: mörkare grå bakgrund + fyll */
.rankly-like-btn.is-icon:not(.is-liked):hover{
  background:#CCD3DD !important;
}
.rankly-like-btn.is-icon:not(.is-liked):hover .rankly-bookmark-fill{
  fill:#CCD3DD !important;
}

/* Sparad: svart fyll */
.rankly-like-btn.is-icon.is-liked .rankly-bookmark-fill{
  fill:#000 !important;
  opacity:1 !important;
}

/* Sparad hover: mörkare grå bakgrund, svart fyll */
.rankly-like-btn.is-icon.is-liked:hover{
  background:#CCD3DD !important;
}
.rankly-like-btn.is-icon.is-liked:hover .rankly-bookmark-fill{
  fill:#000 !important;
}

/* Ingen genomskinlighet vid hover */
.rankly-like-btn.is-icon:hover,
.rankly-like-btn.is-icon:hover svg,
.rankly-like-btn.is-icon:hover path{ opacity:1 !important; }

/* =========================================
   Default-knapp (inne i inlägg)
   ========================================= */
.rankly-like-wrap:not(.is-icon-only) .rankly-like-btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  border:0;
  background:#E0E1E2;
  opacity:1 !important;
}

.rankly-like-wrap:not(.is-icon-only) .rankly-bookmark{ width:18px; height:18px; }
.rankly-like-wrap:not(.is-icon-only) .rankly-bookmark-outline{ stroke-width:6; }

.rankly-like-wrap:not(.is-icon-only) .rankly-like-btn:not(.is-liked){
  color:#000;
}
.rankly-like-wrap:not(.is-icon-only) .rankly-like-btn:not(.is-liked) .rankly-bookmark-fill{ fill:#E0E1E2; }

.rankly-like-wrap:not(.is-icon-only) .rankly-like-btn:not(.is-liked):hover{
  background:#CCD3DD;
}
.rankly-like-wrap:not(.is-icon-only) .rankly-like-btn:not(.is-liked):hover .rankly-bookmark-fill{
  fill:#CCD3DD;
}

.rankly-like-wrap:not(.is-icon-only) .rankly-like-btn.is-liked{
  color:#000;
  background:#E0E1E2;
}
.rankly-like-wrap:not(.is-icon-only) .rankly-like-btn.is-liked .rankly-bookmark-fill{ fill:#000; }

.rankly-like-wrap:not(.is-icon-only) .rankly-like-btn.is-liked:hover{
  background:#CCD3DD;
}

/* =========================================
   SPARADE-SIDAN – återställ "gamla" kort-look
   (ingen vit box + ingen ram)
   ========================================= */

/* Grid (behåll som din) */
.rankly-liked-grid{
  display:grid;
  grid-template-columns: repeat(var(--rankly-cols, 3), minmax(0, 1fr));
  gap:16px;
}

/* Datumrubrik */
.rankly-date-heading{
  grid-column: 1 / -1;
  margin: 0 0 12px;
  padding: 12px 0;
  font-size: 22px;
  font-weight: 550 ;
}
.rankly-date-heading::after{
  content:"";
  display:block;
  height:1px;
  opacity:1;
  background: currentColor;
  margin-top:10px;
}

/* Kort – gammal känsla */
.rankly-card{
  margin-bottom:14px;
  position:relative;
}

/* VIKTIGT: ta bort vit bakgrund + border */
.rankly-liked-card{
  border:0 !important;
  background:transparent !important;
  padding:0 !important;
  border-radius:0 !important;
}

/* Bild + titel */
.rankly-thumb img{
  width:100%;
  height:auto;
  display:block;
  border-radius:12px;
}

.rankly-title{ margin: 8px 0 10px; }
.rankly-excerpt{ opacity:1; }

/* Ta bort “Sparad” i excerpt-fältet om det råkar komma in */
.rankly-excerpt:empty{ display:none; }

/* =========================================================
   Filter (samma som din gamla)
   ========================================================= */
.rankly-filterbar{
  grid-column: 1 / -1;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  margin:0 0 0px;
}

.rankly-filter{ position:relative; }

.rankly-filter > summary{
  list-style:none;
  cursor:pointer;
  user-select:none;
  padding:10px 12px;
  border-radius:999px;
  background:#000;
  font-size:14px;
  color:#fff;
 /* border:0.1px solid rgba(0,0,0,0.0)!important;*/
 /* box-shadow:0 4px 8px rgba(0,0,0,0)!important;*/
}

.rankly-filter > summary:hover{
  transform:scale(1.07)!important;
  background-color:#ffffff!important;
}

.rankly-filter > summary::-webkit-details-marker{ display:none; }

.rankly-filter-hint{
  opacity:1;
  margin-left:6px;
  font-size:14px;
  color:#fff;
}

.rankly-filter-panel{
  position:absolute;
  top: calc(100% + 0px);
  left: 0;
  min-width: 200px;
  padding:12px;
  border-radius:20px;
  background:#fff;
  box-shadow:0 12px 30px rgba(0,0,0,.18);
  z-index:50;
  font-size:14px;
  color:#000;
}

.rankly-filter-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.rankly-filter-close{
  width:20px;
  height:20px;
  border-radius:999px;
  border:0;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#000;
  border:0.1px solid rgba(0,0,0,0.1)!important;
  box-shadow:0 4px 8px rgba(0,0,0,0.5)!important;
  padding:0;
  font-size:0;
  line-height:0;
  transition: background-color .15s ease, transform .15s ease;
}
.rankly-filter-close::before{
  content:"";
  width:16px;
  height:16px;
  display:block;
  background:#fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") no-repeat center / contain;
}
.rankly-filter-close:hover{ background:#DE2F29; transform:scale(1.07); }
.rankly-filter-close:active{ transform:scale(.95); }

.rankly-filter-clear{
  border:0;
  border-radius:999px;
  padding:6px 8px;
  font-size:12px;
  cursor:pointer;
  background:#000;
  border:0.1px solid rgba(0,0,0,0.1)!important;
  box-shadow:0 4px 8px rgba(0,0,0,0.5)!important;
}
.rankly-filter-clear:hover{ background:#3A884D; transform:scale(1.07); }
.rankly-filter-clear:disabled{ opacity:1; cursor:default; }

.rankly-filter-list{
  display:flex;
  flex-direction:column;
  gap:2px;
  max-height:450px;
  overflow:auto;
  padding-right:4px;
}

.rankly-filter-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:7px 10px;
  cursor:pointer;
  border-radius:999px;
  transition: background-color .3s ease, color .3s ease;
}
.rankly-filter-item:hover{
  background-color: rgba(0,0,0,0);
  color:#000;
}

.rankly-filter-left{
  display:inline-flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.rankly-filter-name{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:185px;
}

.rankly-filter-count{
  font-size:10px;
  opacity:1;
  background:#E0E1E4;
  padding:3px 9px;
  border-radius:999px;
  color:#000;
}

/* checkbox runda */
.rankly-filter-left input[type="checkbox"]{
  -webkit-appearance:none;
  appearance:none;
  width:20px;
  height:20px;
  flex:0 0 20px;
  border-radius:999px;
  border:1px solid #000;
  background:transparent;
  display:inline-grid;
  place-content:center;
  cursor:pointer;
  outline:none;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
  box-shadow:0 4px 8px rgba(0,0,0,0.5)!important;
}
.rankly-filter-left input[type="checkbox"]::after{
  content:"";
  width:6px;
  height:10px;
  border-right:2px solid #fff;
  border-bottom:2px solid #fff;
  transform: rotate(45deg) scale(0);
  transition: transform .12s ease;
}
.rankly-filter-left input[type="checkbox"]:checked{
  background:#008B46;
  border-color:#008B46;
}
.rankly-filter-left input[type="checkbox"]:checked::after{
  transform: rotate(45deg) scale(1);
}
.rankly-filter-left input[type="checkbox"]:hover{ transform:scale(1.07); }

/* Filtrering */
.rankly-card.is-filter-hidden{ display:none; }
.rankly-date-heading.is-filter-hidden{ display:none; }

@media (max-width: 480px){
  .rankly-filter{ position: static; }

  .rankly-filter-panel{
    position: fixed;
    left: 12px;
    right: 12px;
    top: 72px;
    min-width: 0;
    width: auto;
    max-width: none;
    border-radius: 18px;
    padding: 12px;
    max-height: calc(100vh - 100px);
    overflow: hidden;
    z-index: 9999;
  }

  .rankly-filter-list{
    max-height: calc(100vh - 170px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .rankly-filter-close{ width:36px; height:36px; }
  .rankly-filter-close::before{ width:18px; height:18px; }

  .rankly-filter-clear{
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .rankly-filter-item{ padding: 8px 10px; }
  .rankly-filter-name{ max-width: 100%; }
}



.rankly-like-wrap:not(.is-icon-only) .rankly-like-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  border:0;
  background:#E0E1E2;
  opacity:1 !important;

  white-space:nowrap;      /* texten får inte brytas */
  flex-shrink:0;           /* knappen får inte pressas ihop */
  min-width:max-content;   /* behåll bredd efter innehållet */
}