/* ───────────────────────────────────────────────────────── */
/* 1) TOOL GRID & CARDS  */

/* 3-column grid that wraps into unlimited rows */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1400px;
  padding: 0 1rem;
}

/* responsively reduce columns */
@media (max-width: 900px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}
@media (max-width: 600px) {
  .tool-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* each card fills its cell */
.tool-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tool-card:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* logo inside card */
.tool-logo img {
  max-width: 80%;
  height: auto;
  margin-bottom: 1rem;
}

/* title */
.tool-card h3 {
  margin: 0.5rem 0 1rem;
  font-size: 1.25rem;
  line-height: 1.2;
}

/* categories (“bubbles”) */
.tool-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.cat-bubble {
  background: #eee;
  color: #333;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1;
}

/* buttons */
.tool-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}
.tool-btns .btn {
  background: #fff;
  color: #333;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.tool-btns .btn:hover {
  background: #fff;
  color: #333;
}
/* hide any old “Details” button */
.tool-btns .btn.details { display: none; }

/* ───────────────────────────────────────────────────────── */
/* 2) POPUP OVERLAY & CONTAINER */

/* Popup wrapper */
#insites-tool-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#insites-tool-popup.is-active {
  display: flex;
}

/* Overlay */
#insites-tool-popup .insites-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

#insites-tool-popup .insites-popup-content {
  position: relative;
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  max-width: 60%;
  width: 80vw;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 10000;
}

/* close button */
#insites-tool-popup .insites-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* ───────────────────────────────────────────────────────── */
/* 3) POPUP CONTENT STYLING */

.insites-popup-inner {
  position: relative;
}

/* center and shrink logo in popup */
.insites-popup-inner .tool-logo {
  text-align: center;
  margin: 0 auto 1.5rem;
  position: relative;  /* establish positioning context for badge */
}
.insites-popup-inner .tool-logo img {
  display: inline-block;
  max-width: 50%;
  height: auto;
}

/* thin grey divider under logo + categories */
.popup-divider {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 1.5rem 0;
}

/* position department/tool-group bubbles under logo */
.insites-popup-inner .tool-cats {
  justify-content: center;
  margin-bottom: 1rem;
}

/* title */
.insites-popup-inner h2 {
  margin-top: 0;
}

/* best/worst grid */
.tool-ratings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: 2rem;
  margin: 1.5rem 0;
}
.best-wrap, .worst-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.best-wrap strong,
.worst-wrap strong {
  flex: 0 0 100%;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.tool-ratings .cat-bubble {
  margin: 0.25rem 0;
}

/* optional: stack on mobile */
@media (max-width: 500px) {
  .tool-ratings { grid-template-columns: 1fr; }
}

/* short/long descriptions */
.insites-popup-inner p,
.insites-popup-inner .long-desc {
  margin: 1rem 0;
  line-height: 1.5;
  color: #333;
}

/* “Rating:” plain text (in case you still render it somewhere) */
.in-site-rating {
  margin: 1rem 0;
  font-size: 0.9rem;
  color: #555;
}
.in-site-rating strong { color: #333; }

/* ───────────────────────────────────────────────────────── */
/* 4) IN-SITES SCORE BADGE */

/* ───────────────────────────────────────────────────────── */
/* 4b) Logo centering & badge positioning tweak */

.insites-popup-inner .tool-logo {
  position: relative;   /* for the badge */
  width: 100%;          /* stretch full width of popup */
  text-align: center;   /* center whatever’s inside */
  margin-bottom: 1.5rem;
}

.insites-popup-inner .tool-logo img {
  display: inline-block; /* so text-align:center on parent can center it */
  max-width: 50%;        /* whatever size you like */
  height: auto;
}

/* the badge already absolutely positions itself inside .tool-logo */
.insites-popup-inner .tool-logo .insites-badge {
  top: -0.75rem;
  left: -0.75rem;
}

/* badge styling */
.insites-badge {
  position: absolute;
  top: -0.75rem;
  left: -0.75rem;
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  z-index: 10;

  /* two-layer box-shadow: subtle glow, colored ring, drop shadow */
  box-shadow:
    0   0   0   4px rgba(0,0,0,0.05),            /* outer glow */
    inset 0   0   0   3px var(--badge-color, #aaa), /* inner colored ring */
    0   4px 12px rgba(0,0,0,0.15);               /* drop shadow */

  transform: rotate(-3deg);
  transition: transform .2s ease, box-shadow .2s ease;
}

/* hover “pop” */
.insites-badge:hover {
  transform: rotate(0deg) scale(1.05);
  box-shadow:
    0   0   0   4px rgba(0,0,0,0.05),
    inset 0   0   0   3px var(--badge-color, #aaa),
    0   6px 18px rgba(0,0,0,0.25);
}

/* small uppercase label */
.insites-badge small {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  margin-bottom: 0.2rem;
  line-height: 1.1;
}

/* large score number */
.insites-badge strong {
  font-size: 3rem;
  line-height: 1;
  color: var(--badge-color, #000);
  font-weight: 700;
}

/* color variants (sets the CSS variable above) */
.insites-badge--poor    { --badge-color: #c0392b; } /* 1–3 */
.insites-badge--okay    { --badge-color: #e67e22; } /* 4–6 */
.insites-badge--good    { --badge-color: #27ae60; } /* 7–9 */
.insites-badge--perfect { --badge-color: #2980b9; } /* 10 */

/* ───────────────────────────────────────────────────────── */
/* 5) Best/Worst as bullet lists with icon markers */

.best-list,
.worst-list {
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding-left: 1.8rem;   /* room for the icon */
}

.best-list li,
.worst-list li {
  position: relative;
  padding-left: 1.2rem;   /* shift text right of the icon */
  margin-bottom: 0.5rem;
  line-height: 1.4;
  color: #333;
}

/* ensure the <strong> heading sits above the list */
.best-wrap strong,
.worst-wrap strong {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* green check for Best items */
.best-list li::before {
  content: "✔";
  color: #27ae60;         /* “good” green */
  position: absolute;
  left: 0;
  top: 0.2em;             /* vertically center */
  font-size: 1rem;
  line-height: 1;
}

/* red X for Worst items */
.worst-list li::before {
  content: "✖";
  color: #c0392b;         /* “poor” red */
  position: absolute;
  left: 0;
  top: 0.2em;             /* vertically center */
  font-size: 1rem;
  line-height: 1;
}
