/* ============================================================
   RESULTS / CASE STUDIES
   Two case studies behind tabs, one showing at a time:
   - Planning Permission Experts: Campaign 1 vs Campaign 2 column charts
     (grow when the section scrolls into view; js/results.js adds .is-in),
     with facts and a Google review quote beside them.
   - Fisher & Fisher: the site plus search visibility stats.
   The CTA sits under both.
   ============================================================ */

.results {
  padding: 90px 0;
  background: var(--white);
}

.rs-head { margin-bottom: 3rem; }
.rs-head .section-title span { display: block; }   /* second sentence on its own line */
.rs-head .section-subtitle { color: var(--text-muted); }

.rs-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue);
  transition: gap 0.25s ease;
}
.rs-link:hover, .rs-link:focus-visible { gap: 0.7rem; }
.rs-arrow { width: 16px; height: 16px; flex: none; }

/* --- Case study tabs --- */
.rs-tabs {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  width: max-content;
  max-width: 100%;
  margin: -1rem auto 2.5rem;
  padding: 0.35rem;
  background: var(--off-white);
  border-radius: 18px;
}
.rs-tabs button {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.1rem 0.6rem 0.7rem;
  font-family: var(--font);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.rs-tabs button[aria-selected="true"] { background: var(--white); box-shadow: 0 6px 18px rgba(13, 31, 66, 0.1); }
.rs-tabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.rs-tabs img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
/* Fisher & Fisher logo is white and gold, so it sits on their own navy (#1d2643) */
.rs-tabs .rs-tab-logo--wide { width: 62px; border-radius: 8px; object-fit: contain; background: #1d2643; padding: 4px 6px; }
.rs-tabs span { display: flex; flex-direction: column; font-size: 0.72rem; font-weight: 500; color: var(--text-muted); line-height: 1.35; }
.rs-tabs strong { font-size: 0.88rem; font-weight: 700; color: var(--text-muted); }
.rs-tabs button[aria-selected="true"] strong { color: var(--navy); }

.rs-panel { max-width: 1100px; margin: 0 auto; animation: rs-panel-in 0.4s ease; }
.rs-panel[hidden] { display: none; }
@keyframes rs-panel-in { from { opacity: 0; transform: translateY(8px); } }

/* PPE: chart left, facts + quote right */
.rs-panel--ppe {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: center;
  gap: 3rem;
}

/* --- Chart card --- */
.ch-card {
  margin: 0;
  padding: 1.5rem 1.75rem 1.75rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(13, 31, 66, 0.1);
}
.ch-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ch-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ch-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; flex: none;
  margin: 0; font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
}
.ch-chip img { width: 22px; height: auto; }
.ch-chip--google img { width: 15px; }   /* the square G reads the same size as the wide Meta mark */

.ch-cols-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
/* Each chart is a column; the title takes up any spare height, so the bars and
   the Campaign 1 / Campaign 2 line always sit level in both charts, even when
   one title wraps onto two lines */
.ch-cols { display: flex; flex-direction: column; padding: 1.25rem; background: var(--off-white); border-radius: 16px; }
.ch-cols-title { flex: 1 0 auto; margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--navy); }
.ch-cols-plot {
  display: grid; grid-template-columns: repeat(2, 1fr); align-items: end; gap: 1.5rem;
  height: 200px; margin-top: 2.75rem; padding: 0 1rem; border-bottom: 2px solid var(--border);   /* headroom for the value labels */
}
.ch-col {
  position: relative; height: 0; border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, var(--blue), var(--navy));
  transition: height 1.2s cubic-bezier(.2, .8, .2, 1);
}
.ch-col--muted { background: var(--light-blue); }
.results.is-in .ch-col--100 { height: 100%; }
.results.is-in .ch-col--31  { height: 31%; }   /* 28 of 91 leads */
.results.is-in .ch-col--29  { height: 29%; }   /* £6.14 of £21.15 */
.ch-col span {
  position: absolute; bottom: calc(100% + 0.4rem); left: 50%; transform: translateX(-50%);
  font-size: 1.1rem; font-weight: 800; color: var(--navy); white-space: nowrap;
}
.ch-col--muted span { color: var(--text-muted); }
.ch-cols-x { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; padding: 0.5rem 1rem 0; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-align: center; }

/* --- PPE aside: facts, client quote, case study link --- */
.rs-facts { margin: 0 0 1.75rem; border-top: 1px solid var(--border); }
.rs-facts p {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin: 0;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.rs-facts strong { flex: none; min-width: 6.5rem; font-size: 1.5rem; font-weight: 800; color: var(--navy); }

.rs-quote { margin: 0 0 1.5rem; }
.rs-quote blockquote {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--navy);
}
.rs-quote figcaption { margin-top: 0.5rem; font-size: 0.78rem; color: var(--text-muted); }

/* --- Main action, under both case studies --- */
.rs-actions {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

/* --- Fisher & Fisher: the site + search visibility --- */
.rs-ff {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0;
  padding: 1.5rem 2.25rem 1.5rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(13, 31, 66, 0.08);
}
/* Devices: the hero's laptop + phone frames (.device rules in css/hero.css),
   sized here from the panel's width. The group is 2.0774x as wide as it is
   high, so --dev-h is the panel's inner width divided by that. */
.rs-ff-media {
  container-type: inline-size;
  padding: 2.25rem 1.5rem;
  background: var(--off-white);
  border-radius: 18px;
}
.rs-devices {
  --dev-h: calc(100cqw / 2.0774);
  display: flex;
  align-items: flex-start;
  height: var(--dev-h);
}
/* shadows on the frames only: a filter on the whole device flattened (and blurred) the screenshot inside */
.rs-devices .device-mac,
.rs-devices .device-phone { filter: none; }
.rs-devices .device-mac .device-frame   { filter: drop-shadow(0 18px 28px rgba(13, 31, 66, 0.22)); }
.rs-devices .device-phone .device-frame { filter: drop-shadow(0 14px 22px rgba(13, 31, 66, 0.28)); }
/* dark backing a hair bigger than the cut-outs, so no white shows at the screen edges */
.rs-devices .device-screen { background: #10131c; }
.rs-devices .device-mac .device-screen { left: 11.1%; top: 3.7%; width: 77.8%; height: 86.3%; }
.rs-devices .device-phone .device-screen { left: 5.8%; top: 2.2%; width: 88.4%; height: 95.6%; border-radius: 9% / 4.2%; }
.rs-device-shot { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.rs-ff-top { grid-column: 1 / -1; margin-bottom: -1rem; }   /* same label row as the PPE chart card */
.rs-ff h3 { margin: 0 0 0.75rem; }
.rs-ff-body > p { margin-bottom: 1.25rem; }

.rs-ff-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}
.rs-ff-stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rs-ff-stats--3 div { padding: 0.85rem 0.8rem; }
.rs-ff-stats--3 dd { font-size: 1.3rem; overflow-wrap: anywhere; }
@media (max-width: 560px) { .rs-ff-stats--3 { grid-template-columns: minmax(0, 1fr); } }
.rs-ff-stats div {
  padding: 0.9rem 1rem;
  background: var(--off-white);
  border-radius: 14px;
}
.rs-ff-stats dt { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.rs-ff-stats dd { margin: 0.2rem 0 0; font-size: 1.45rem; font-weight: 800; line-height: 1.1; color: var(--navy); }
.rs-ff-stats small { display: block; margin-top: 0.25rem; font-size: 0.68rem; font-weight: 500; letter-spacing: 0; color: var(--text-muted); }
.rs-ff-source { margin: 0 0 1.25rem; font-size: 0.72rem; color: var(--text-muted); }
/* What we do for them, as three ticked lines under the numbers */
.rs-ff-done { display: grid; gap: 0.55rem; margin: 0 0 1.4rem; padding: 0; list-style: none; }
.rs-ff-done li {
  position: relative;
  padding-left: 1.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--navy);
}
.rs-ff-done li::before {
  content: "";
  position: absolute;
  top: 0.12rem;
  left: 0;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 70% no-repeat;
}

/* "See all our results": an outlined pill with an arrow, so it reads as
   "more of this" rather than the solid audit buttons elsewhere */
.rs-all {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  transition: background var(--transition), color var(--transition), gap var(--transition);
}
.rs-all-arrow { width: 1.1rem; height: 1.1rem; }
.rs-all:hover,
.rs-all:focus-visible { gap: 0.9rem; background: var(--navy); color: var(--white); }
.rs-all:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* --- Smaller screens --- */
@media (max-width: 1000px) {
  .rs-panel--ppe { grid-template-columns: minmax(0, 1fr); gap: 2rem; max-width: 700px; }
  .rs-ff { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: 1.25rem; }
}

@media (max-width: 560px) {
  .rs-tabs { width: 100%; }
  .rs-tabs button { flex: 1; flex-direction: column; gap: 0.35rem; padding: 0.6rem 0.5rem; text-align: center; }
  .rs-tabs span { align-items: center; }
  .rs-tabs strong { font-size: 0.78rem; }
}

@media (max-width: 700px) {
  .ch-card { padding: 1.25rem 1rem 1.25rem; }
  .ch-top { flex-wrap: wrap; row-gap: 0.4rem; }
  .ch-cols-pair { gap: 0.6rem; }                 /* keep the two charts side by side */
  .ch-cols { padding: 0.9rem 0.6rem; }
  .ch-cols-plot { height: 140px; gap: 0.6rem; padding: 0 0.3rem; margin-top: 2.25rem; }
  .ch-col span { font-size: 0.9rem; }
  .ch-cols-x { gap: 0.6rem; padding: 0.4rem 0.3rem 0; font-size: 0.62rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-col { transition: none; }
  .rs-panel { animation: none; }
}
