/* ═══════════════════════════════════════
   CricGuides SEO & Content — Frontend CSS
   ═══════════════════════════════════════ */

:root {
  --cg-green:   #1e4d32;
  --cg-green-l: #276043;
  --cg-green-bg:#f2f8f4;
  --cg-red:     #c8102e;
  --cg-amber:   #d4a017;
  --cg-amazon:  #ff9900;
  --cg-border:  #dde6e2;
  --cg-text:    #111814;
  --cg-muted:   #5e706a;
  --cg-white:   #ffffff;
  --cg-radius:  10px;
}

/* ── STAR RATING ── */
.cg-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}
.cg-rating__stars {
  position: relative;
  display: inline-block;
  width: 90px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 16'%3E%3Cpath d='M9 1l2.39 4.84L17 6.76l-4 3.9.94 5.5L9 13.47l-4.94 2.7.94-5.5L1 6.76l5.61-.92z' fill='%23dde6e2'/%3E%3C/svg%3E") repeat-x left center / 18px;
}
.cg-rating__fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 16'%3E%3Cpath d='M9 1l2.39 4.84L17 6.76l-4 3.9.94 5.5L9 13.47l-4.94 2.7.94-5.5L1 6.76l5.61-.92z' fill='%23d4a017'/%3E%3C/svg%3E") repeat-x left center / 18px;
  overflow: hidden;
}
.cg-rating__value { font-weight: 700; font-size: 14px; color: var(--cg-text); }
.cg-rating__label { font-size: 13px; color: var(--cg-muted); }
.cg-rating--sm .cg-rating__stars { width: 72px; height: 13px; background-size: 14.4px; }
.cg-rating--sm .cg-rating__fill  { background-size: 14.4px; }
.cg-rating--lg .cg-rating__stars { width: 110px; height: 20px; background-size: 22px; }
.cg-rating--lg .cg-rating__fill  { background-size: 22px; }

/* Used standalone (not inside .cg-rating) */
.cg-rating__stars { display: inline-block; }

/* ── PROS / CONS ── */
.cg-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
@media (max-width: 600px) { .cg-pros-cons { grid-template-columns: 1fr; } }
.cg-pros-cons__col {
  border-radius: var(--cg-radius);
  overflow: hidden;
}
.cg-pros-cons__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
}
.cg-pros-cons__col--pros .cg-pros-cons__header { background: #dcfce7; color: #166534; }
.cg-pros-cons__col--cons .cg-pros-cons__header { background: #fee2e2; color: #991b1b; }
.cg-pros-cons__icon { font-weight: 900; font-size: 16px; }
.cg-pros-cons__list {
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  background: #f9fafb;
  border: 1px solid var(--cg-border);
  border-top: none;
  border-radius: 0 0 var(--cg-radius) var(--cg-radius);
}
.cg-pros-cons__list li {
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--cg-border);
  color: var(--cg-text);
  line-height: 1.5;
}
.cg-pros-cons__list li:last-child { border-bottom: none; }
.cg-pros-cons__col--pros .cg-pros-cons__list li::before { content: '✓ '; color: #16a34a; font-weight: 700; }
.cg-pros-cons__col--cons .cg-pros-cons__list li::before { content: '✗ '; color: #dc2626; font-weight: 700; }

/* ── BUTTONS ── */
.cg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
  border: none;
}
.cg-btn--amazon    { background: var(--cg-amazon); color: #111; }
.cg-btn--amazon:hover { background: #e68a00; color: #111; transform: translateY(-1px); }
.cg-btn--green     { background: var(--cg-green); color: #fff; }
.cg-btn--green:hover  { background: var(--cg-green-l); color: #fff; }
.cg-btn--outline   { border: 2px solid var(--cg-green); color: var(--cg-green); background: transparent; }
.cg-btn--outline:hover { background: var(--cg-green); color: #fff; }
.cg-btn--full      { display: flex; width: 100%; }
.cg-btn__price {
  background: rgba(0,0,0,.12);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* ── PRODUCT CARD ── */
.cg-product-card {
  position: relative;
  border: 1.5px solid var(--cg-border);
  border-radius: 16px;
  overflow: hidden;
  margin: 28px 0;
  background: var(--cg-white);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.cg-product-card__badge {
  background: var(--cg-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 14px;
  position: absolute;
  top: 0; left: 0;
  border-radius: 0 0 8px 0;
  z-index: 1;
}
.cg-product-card__inner {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 0;
}
@media (max-width: 700px) {
  .cg-product-card__inner { grid-template-columns: 1fr; }
}
.cg-product-card__image {
  background: var(--cg-green-bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  min-height: 160px;
}
.cg-product-card__image img { max-width: 140px; max-height: 140px; object-fit: contain; }
.cg-product-card__body { padding: 24px; border-left: 1px solid var(--cg-border); }
.cg-product-card__name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--cg-text);
  margin: 0 0 4px;
  line-height: 1.3;
}
.cg-product-card__subtitle { font-size: 13px; color: var(--cg-muted); margin: 0 0 12px; }
.cg-product-card__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 15px;
}
.cg-product-card__verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 700px) { .cg-product-card__verdict { grid-template-columns: 1fr; } }
.cg-product-card__pros, .cg-product-card__cons {
  list-style: none; margin: 0; padding: 0;
  font-size: 13px; line-height: 1.8;
}
.cg-product-card__pros li { color: #166534; }
.cg-product-card__cons li { color: #991b1b; }
.cg-check { font-weight: 700; color: #16a34a; }
.cg-cross  { font-weight: 700; color: #dc2626; }
.cg-product-card__summary { font-size: 14px; color: var(--cg-muted); font-style: italic; }
.cg-product-card__cta {
  padding: 24px;
  border-left: 1px solid var(--cg-border);
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 200px;
  text-align: center;
}
.cg-product-card__price { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cg-price-now { font-family: 'Playfair Display', Georgia, serif; font-size: 28px; font-weight: 900; color: var(--cg-text); }
.cg-price-was { font-size: 14px; color: var(--cg-muted); text-decoration: line-through; }
.cg-price-save {
  display: inline-block;
  background: #dcfce7; color: #166534;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid #bbf7d0;
}
.cg-product-card__disclaimer { font-size: 10px; color: var(--cg-muted); margin: 0; }

/* ── COMPARISON TABLE ── */
.cg-compare { margin: 28px 0; }
.cg-compare__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px; font-weight: 700;
  margin-bottom: 14px; color: var(--cg-text);
}
.cg-compare__wrap { overflow-x: auto; }
.cg-compare__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.cg-compare__table th,
.cg-compare__table td {
  padding: 12px 16px;
  border: 1px solid var(--cg-border);
  text-align: left;
  vertical-align: middle;
}
.cg-compare__table thead th {
  background: var(--cg-green);
  color: #fff;
  font-weight: 600;
}
.cg-compare__table tbody tr:nth-child(even) td { background: var(--cg-green-bg); }
.cg-compare__table .cg-compare__winner {
  background: #fef9e7 !important;
  border-color: var(--cg-amber) !important;
  font-weight: 700;
  color: var(--cg-text);
}
.cg-compare__table thead .cg-compare__winner {
  background: var(--cg-amber) !important;
  color: #111;
}

/* ── AFFILIATE BOX ── */
.cg-aff-box {
  border: 2px solid var(--cg-border);
  border-radius: 12px;
  overflow: hidden;
  margin: 24px 0;
  background: var(--cg-white);
}
.cg-aff-box__header {
  background: var(--cg-green);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cg-aff-box__badge {
  background: var(--cg-amber);
  color: #111;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.cg-aff-box__title { font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.cg-aff-box__body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}
.cg-aff-box__img { width: 80px; height: 80px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.cg-aff-box__product { font-weight: 700; font-size: 15px; margin: 0 0 6px; }
.cg-aff-box__pricing { display: flex; align-items: baseline; gap: 8px; }
.cg-aff-box > .cg-btn { margin: 0 16px 12px; }
.cg-aff-box__note { font-size: 10px; color: var(--cg-muted); padding: 0 16px 12px; margin: 0; }

/* ── AFFILIATE DISCLOSURE ── */
.cg-disclosure {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 28px;
  font-size: 13px;
  line-height: 1.6;
}
.cg-disclosure__icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.cg-disclosure p { margin: 0; color: #92400e; }
.cg-disclosure a { color: #92400e; }

/* ── GLOSSARY ── */
.cg-glossary { margin: 0; }
.cg-glossary__search-wrap { position: relative; margin-bottom: 24px; }
.cg-glossary__search {
  width: 100%;
  padding: 13px 18px;
  border: 1.5px solid var(--cg-border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.cg-glossary__search:focus {
  border-color: var(--cg-green);
  box-shadow: 0 0 0 3px rgba(30,77,50,.1);
}
.cg-glossary__no-results { padding: 12px; font-size: 14px; color: var(--cg-muted); }
.cg-glossary__az-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 32px;
}
.cg-glossary__az-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--cg-green-bg);
  color: var(--cg-green);
  font-weight: 700;
  font-size: 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: all .15s;
}
.cg-glossary__az-link:hover { background: var(--cg-green); color: #fff; }
.cg-glossary__section { margin-bottom: 40px; }
.cg-glossary__letter {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--cg-green);
  border-bottom: 2px solid var(--cg-border);
  padding-bottom: 8px;
  margin-bottom: 20px;
  position: relative;
}
.cg-glossary__letter::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 32px; height: 2px;
  background: var(--cg-red);
}
.cg-glossary__grid { display: grid; gap: 16px; }
.cg-glossary__grid--1col { grid-template-columns: 1fr; }
.cg-glossary__grid--2col { grid-template-columns: 1fr 1fr; }
.cg-glossary__grid--3col { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 768px) {
  .cg-glossary__grid--2col,
  .cg-glossary__grid--3col { grid-template-columns: 1fr; }
}
.cg-glossary__term {
  background: var(--cg-white);
  border: 1px solid var(--cg-border);
  border-radius: 10px;
  padding: 16px;
  transition: box-shadow .15s, border-color .15s;
}
.cg-glossary__term:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: var(--cg-green); }
.cg-glossary__term.hidden { display: none; }
.cg-glossary__term-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cg-glossary__term-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--cg-green);
  text-decoration: none;
}
.cg-glossary__term-title:hover { text-decoration: underline; }
.cg-glossary__also { font-size: 12px; color: var(--cg-muted); margin: 0 0 6px; font-style: italic; }
.cg-glossary__excerpt { font-size: 13.5px; color: var(--cg-text); line-height: 1.6; margin: 0 0 10px; }
.cg-glossary__read-more { font-size: 12px; font-weight: 600; color: var(--cg-green); text-decoration: none; }
.cg-glossary__read-more:hover { text-decoration: underline; }

/* Difficulty badges */
.cg-glossary__difficulty, .cg-term-card__diff {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.cg-diff--beginner     { background: #dcfce7; color: #166534; }
.cg-diff--intermediate { background: #fef9c3; color: #92400e; }
.cg-diff--advanced     { background: #fee2e2; color: #991b1b; }

/* Inline tooltip */
.cg-term { position: relative; display: inline; }
.cg-term--tooltip {
  border-bottom: 2px dotted var(--cg-green);
  cursor: help;
}
.cg-term__tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--cg-text);
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 8px;
  width: 280px;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.cg-term__tip strong { display: block; margin-bottom: 4px; color: var(--cg-amber); }
.cg-term__tip a { color: var(--cg-amber); }
.cg-term__tip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--cg-text);
}
.cg-term--tooltip:hover .cg-term__tip,
.cg-term--tooltip:focus .cg-term__tip { display: block; }

/* Term card */
.cg-term-card {
  border: 1.5px solid var(--cg-border);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  background: var(--cg-green-bg);
}
.cg-term-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cg-term-card__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px; font-weight: 700;
  color: var(--cg-green); margin: 0;
}
.cg-term-card__also { font-size: 13px; color: var(--cg-muted); font-style: italic; margin: 0 0 10px; }
.cg-term-card__def { font-size: 15px; line-height: 1.7; color: var(--cg-text); margin: 0 0 14px; }
.cg-term-card__related { font-size: 13px; margin: 0 0 12px; }
.cg-term-card__related a { color: var(--cg-green); text-decoration: underline; margin-right: 6px; }
.cg-term-card__link { font-size: 13px; font-weight: 700; color: var(--cg-green); text-decoration: none; }
.cg-term-card__link:hover { text-decoration: underline; }

/* Glossary related terms (injected at post bottom) */
.cg-glossary-related {
  background: var(--cg-green-bg);
  border: 1px solid var(--cg-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  margin-top: 28px;
  line-height: 1.8;
}
.cg-glossary-related a { color: var(--cg-green); text-decoration: underline; margin: 0 4px; }
