/* eSIMTweaks post skin — restyles the WordPress-rendered post body (Kadence category templates +
   Gutenberg/Kadence blocks) in the homepage design: Nunito, ink lines, lavender offset shadows,
   violet/pink accents. Frontend-only: nothing in WordPress (templates, blocks, editor) changes.
   Loaded on /draft/post/* with <body class="esx-skin">; ?skin=0 shows the post without it.
   Every rule is scoped to .esx-skin .element-single-replace (the Kadence template area). */

/* ───────── type ───────── */
.esx-skin .element-single-replace,
.esx-skin .element-single-replace :is(p, li, td, th, a, span, div, strong, em, b, figcaption, blockquote, label, small, cite) {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif !important;
}
/* Text colours are set ONCE on the post body and inherited, never forced per element: many posts contain their own
   styled boxes (coupon cards, dark callouts) whose white text must win. Headings get the brand ink at the lowest
   specificity (:where) so a post's own heading classes still beat it. */
.esx-skin .element-single-replace { color: #2c2858; -webkit-font-smoothing: antialiased; }
:where(.esx-skin .element-single-replace) :is(h1, h2, h3, h4, h5, h6) { color: var(--ink); }
.esx-skin .element-single-replace p { line-height: 1.7; }
.esx-skin .element-single-replace :is(h1, h2, h3, h4, h5, h6, .kt-adv-heading, .entry-title) {
  font-family: "Nunito", "Avenir Next", -apple-system, "Segoe UI", system-ui, sans-serif !important;
  font-style: italic; font-weight: 900 !important; letter-spacing: -.015em;
}
.esx-skin .element-single-replace h1 { font-size: clamp(32px, 4.4vw, 50px) !important; line-height: 1.04 !important; }
.esx-skin .element-single-replace h2.wp-block-heading { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.1; }
.esx-skin .element-single-replace h3.wp-block-heading { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.2; }
/* the template's pink-bar section headings, in brand pink with a soft lavender tail */
.esx-skin .element-single-replace h2.wp-block-heading[style*="border-left"] {
  border-left-color: var(--acc) !important; border-left-style: solid; border-radius: 3px;
  box-shadow: -4px 0 0 var(--soft); margin-left: 4px;
}
.esx-skin .element-single-replace p a:not(.kb-button):not([class*="btn"]),
.esx-skin .element-single-replace li a:not(.kb-button):not([class*="btn"]),
.esx-skin .element-single-replace td a {
  color: var(--violet); font-weight: 800; text-decoration: none; border-bottom: 2px solid var(--acc); transition: color .2s;
}
.esx-skin .element-single-replace p a:not(.kb-button):not([class*="btn"]):hover,
.esx-skin .element-single-replace li a:not(.kb-button):not([class*="btn"]):hover { color: #c2186b; }
.esx-skin .element-single-replace strong, .esx-skin .element-single-replace b { font-weight: 900; }
.esx-skin .element-single-replace code { font-family: ui-monospace, "SF Mono", Menlo, monospace !important; padding: 2px 6px; border-radius: 6px; background: var(--chip); color: var(--violet); font-weight: 800; }

/* ───────── tables (spec sheets, plan comparisons) ───────── */
.esx-skin .element-single-replace .wp-block-table {
  overflow-x: auto; border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); background: #fff; margin-block: 24px;
}
.esx-skin .element-single-replace .wp-block-table table { width: 100%; border-collapse: collapse; border: 0 !important; margin: 0; }
.esx-skin .element-single-replace .wp-block-table :is(th, td) {
  border: 0 !important; border-bottom: 2px solid var(--line) !important; padding: 12px 16px; font-size: 15px; vertical-align: top;
}
.esx-skin .element-single-replace .wp-block-table thead :is(th, td),
.esx-skin .element-single-replace .wp-block-table tr:first-child th {
  background: var(--ink) !important; color: #fff !important; font-weight: 900; font-style: italic; font-size: 14px; letter-spacing: .02em; border-bottom: 0 !important;
}
/* bold/links inside the dark header row (many posts wrap header text in <strong>) stay white, not the ink used for bold text */
.esx-skin .element-single-replace .wp-block-table thead :is(th, td) :is(strong, b, em, span, a, code),
.esx-skin .element-single-replace .wp-block-table tr:first-child th :is(strong, b, em, span, a, code) { color: inherit !important; }
.esx-skin .element-single-replace .wp-block-table tbody tr:nth-child(even) td { background: var(--chip); }
.esx-skin .element-single-replace .wp-block-table tbody tr:last-child td { border-bottom: 0 !important; }
.esx-skin .element-single-replace .wp-block-table td:first-child { font-weight: 800; color: var(--ink); }
.esx-skin .element-single-replace .wp-block-table figcaption { padding: 10px 16px; color: var(--mute); font-size: 13px; }

/* ───────── images ───────── */
.esx-skin .element-single-replace .wp-block-image img,
.esx-skin .element-single-replace .wp-post-image,
.esx-skin .element-single-replace .kb-image-is-ratio-size img {
  border-radius: var(--r) !important; border: var(--bw) solid var(--ink); box-shadow: var(--sh); box-sizing: border-box;
}
.esx-skin .element-single-replace .wp-block-image figcaption { color: var(--mute); font-size: 13.5px; text-align: center; margin-top: 12px; }

/* ───────── buttons ───────── */
.esx-skin .element-single-replace :is(.kb-button, .wp-block-button__link, .esr-btn, .epc-btn) {
  border: var(--bw) solid var(--ink) !important; border-radius: 12px !important; box-shadow: 4px 5px 0 var(--soft) !important;
  font-family: "Nunito", system-ui, sans-serif !important; font-style: italic; font-weight: 900 !important; letter-spacing: -.01em;
  transition: transform .35s var(--spring), box-shadow .35s var(--spring), background .2s;
}
.esx-skin .element-single-replace :is(.kb-button, .wp-block-button__link, .esr-btn, .epc-btn):hover {
  transform: translate(-2px, -2px); box-shadow: 6px 7px 0 var(--soft) !important;
}
.esx-skin .element-single-replace :is(.kb-button, .wp-block-button__link, .esr-btn, .epc-btn):active { transform: scale(.95, .9); }
.esx-skin .element-single-replace :is(.kb-button, .wp-block-button__link, .esr-btn, .epc-btn) * { font-style: italic; font-weight: 900 !important; }

/* ───────── FAQ (Rank Math) ───────── */
.esx-skin .element-single-replace .rank-math-list { display: grid; gap: 14px; }
.esx-skin .element-single-replace .rank-math-list-item {
  padding: 18px 20px; border: var(--bw) solid var(--ink); border-radius: var(--r); background: #fff; box-shadow: var(--sh); margin: 0 !important;
}
.esx-skin .element-single-replace .rank-math-question {
  margin: 0 0 8px !important; font-size: 19px !important; line-height: 1.25 !important;
}
.esx-skin .element-single-replace .rank-math-answer p { margin: 0; }

/* ───────── quotes, info boxes, tags ───────── */
.esx-skin .element-single-replace .wp-block-quote {
  margin: 24px 0; padding: 16px 20px; border: 0; border-left: 6px solid var(--acc); border-radius: 0 14px 14px 0; background: var(--acc-soft);
}
.esx-skin .element-single-replace .wp-block-quote p { font-style: italic; font-weight: 700; color: var(--ink); }
.esx-skin .element-single-replace .kt-blocks-info-box-link-wrap {
  border: var(--bw) solid var(--ink) !important; border-radius: var(--r) !important; box-shadow: var(--sh) !important; background: #fff;
}
.esx-skin .element-single-replace .kt-blocks-tags a, .esx-skin .element-single-replace .kt-blocks-tags .kt-blocks-tag-item {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--chip); color: var(--violet) !important;
  font-size: 12.5px; font-weight: 900; text-decoration: none; border: 0;
}

/* ───────── template panels: "Why trust eSIMTweaks" + "About the author" (same ids in all 5 templates) ───────── */
.esx-skin .element-single-replace :is(#Why-you-can-trust-us, #author) {
  /* the templates paint a black gradient image over the row colour — replace both with brand navy */
  background: linear-gradient(160deg, #1d1a4a 0%, #2a2566 100%) !important;
  border: var(--bw) solid var(--ink); border-radius: var(--r) !important; box-shadow: var(--sh); overflow: hidden;
}
.esx-skin .element-single-replace :is(#Why-you-can-trust-us, #author) :is(p, li) { color: #e9e7ff; }
.esx-skin .element-single-replace :is(#Why-you-can-trust-us, #author) :is(strong, b, em) { color: inherit; }
.esx-skin .element-single-replace :is(#Why-you-can-trust-us, #author) :is(h2, h3, h4, .kt-adv-heading):not(p) { color: #fff !important; }
.esx-skin .element-single-replace :is(#Why-you-can-trust-us, #author) :is(h2, h3, h4) .kb-svg-icon-wrap { color: var(--acc) !important; }
.esx-skin .element-single-replace :is(#Why-you-can-trust-us, #author) a { color: #fff !important; border-bottom-color: var(--acc); }
/* the white stat pills ("59 providers tested.") — dark text, brand chip shadow */
.esx-skin .element-single-replace #Why-you-can-trust-us p.wp-block-kadence-advancedheading {
  color: var(--ink) !important; font-weight: 900 !important; font-style: italic; border-radius: 999px !important;
  box-shadow: 3px 4px 0 var(--acc);
}
.esx-skin .element-single-replace #author :is(h2, h3, h4, .kt-adv-heading):not(p) { color: #fff !important; }

/* ───────── related posts (Kadence post grid / carousel) ───────── */
.esx-skin .element-single-replace .kt-blocks-post-grid-item {
  border: var(--bw) solid var(--ink) !important; border-radius: var(--r) !important; box-shadow: var(--sh) !important; background: #fff !important;
  overflow: hidden; transition: transform .45s var(--spring), box-shadow .45s var(--spring);
}
.esx-skin .element-single-replace .kt-blocks-post-grid-item:hover { transform: translate(-3px, -3px) rotate(-.4deg); box-shadow: var(--sh-hi) !important; }
/* equal-height cards, compact left-aligned titles, at most two tag chips, arrows on the image area */
.esx-skin .element-single-replace .kt-post-grid-layout-carousel-wrap .splide__slide { height: auto; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item { height: 100%; display: flex; flex-direction: column; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item-inner-wrap { display: flex; flex-direction: column; flex: 1; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item-inner { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 14px !important; text-align: left !important; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item header { border: 0 !important; padding: 0 !important; margin: 0 0 10px !important; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item .entry-title {
  font-size: 17px !important; line-height: 1.25 !important; text-align: left !important; margin: 0 !important;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  max-height: calc(3 * 1.25em); padding: 0 !important; border: 0 !important; box-shadow: none !important;
}
.esx-skin .element-single-replace .kt-blocks-post-grid-item .entry-title a { display: inline; border: 0 !important; box-shadow: none !important; text-decoration: none !important; background: none !important; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item .kt-blocks-post-footer { margin-top: auto !important; padding: 0 !important; border: 0 !important; background: none !important; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item .kt-blocks-tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0; justify-content: flex-start; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item .kt-blocks-tags-icon { display: none; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item .kt-blocks-tags a { font-size: 12px !important; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item .kt-blocks-tags a:nth-of-type(n+3) { display: none; }
.esx-skin .element-single-replace .kt-post-grid-layout-carousel-wrap .splide__arrow {
  top: 26%; width: 40px; height: 40px; border-radius: 50%; background: #fff !important; border: var(--bw) solid var(--ink) !important;
  box-shadow: 3px 4px 0 var(--soft); opacity: 1 !important;
}
.esx-skin .element-single-replace .kt-post-grid-layout-carousel-wrap .splide__arrow svg { fill: var(--ink) !important; width: 16px; height: 16px; }
.esx-skin .element-single-replace .kt-post-grid-layout-carousel-wrap .splide__arrow--prev { left: -14px; }
.esx-skin .element-single-replace .kt-post-grid-layout-carousel-wrap .splide__arrow--next { right: -14px; }
.esx-skin .element-single-replace .kt-post-grid-layout-carousel-wrap .splide__pagination__page { background: var(--line); }
.esx-skin .element-single-replace .kt-post-grid-layout-carousel-wrap .splide__pagination__page.is-active { background: var(--acc); transform: scale(1.3); }
.esx-skin .element-single-replace .kt-blocks-post-grid-item .entry-title a { color: var(--ink) !important; text-decoration: none; border: 0; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item .kadence-post-image-inner-wrap img { border: 0; box-shadow: none; border-radius: 0 !important; }
/* The featured covers are 2:1, including their related-post thumbnails. */
.esx-skin .element-single-replace .kt-blocks-post-grid-item .kadence-post-image-intrisic { padding-bottom: 50% !important; }
.esx-skin .element-single-replace .kt-blocks-post-grid-item .kadence-post-image-inner-wrap img { object-fit: contain; }
.esx-skin .element-single-replace .kt-blocks-post-footer a { color: var(--violet) !important; font-weight: 900; text-decoration: none; }

/* ───────── plugin blocks (review VS cells, plan tables) ───────── */
.esx-skin .element-single-replace :is(.esr-vs-row, .epc-vsp-cell) { border-color: var(--line); }

/* ───────── layout safety on phones ───────── */
@media (max-width: 680px) {
  .esx-skin .element-single-replace .wp-block-table :is(th, td) { padding: 10px 12px; font-size: 14px; }
  .esx-skin .element-single-replace .rank-math-list-item { padding: 14px 16px; }
}
