/* ============================================================
   MyYarnStore – Yarn Guide Page
   Matches Martis theme aesthetic: clean, feminine, yarn-store UX
   Full RTL support for Hebrew
   ============================================================ */

/* ── Variables (override with Martis theme vars if available) ── */
.yarn-guide-wrapper {
  --guide-primary: #212326;
  --guide-primary-light: #f4f4f4;
  --guide-accent: #404040;
  --guide-accent-light: #f0f0f0;
  --guide-border: #e3e3e3;
  --guide-bg: #ffffff;
  --guide-shadow: 0 1px 8px rgba(0,0,0,.08);
  --guide-radius: 12px;
  --guide-font: inherit;          /* inherits site font */
  font-family: var(--guide-font);
  color: var(--guide-dark);
  background: var(--guide-bg);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ── RTL ── */
.yarn-guide-wrapper.rtl {
  direction: rtl;
  text-align: right;
}
.yarn-guide-wrapper.rtl .guide-toc,
.yarn-guide-wrapper.rtl .wc-badge {
  left: auto;
  right: 16px;
}

/* ── Language switch ── */
.guide-lang-switch {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0 0;
}
.yarn-guide-wrapper.rtl .guide-lang-switch {
  justify-content: flex-start;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--guide-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s;
}
.lang-btn:hover {
  background: #404040;
  transform: translateY(-1px);
  color: #fff;
}

/* ── Hero ── */
.guide-hero {
  text-align: center;
  padding: 48px 20px 36px;
}
.yarn-guide-wrapper.rtl .guide-hero {
  text-align: center;
}
.guide-hero__icon {
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: 12px;
  animation: bobble 3s ease-in-out infinite;
}
@keyframes bobble {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.guide-hero__title {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--guide-primary);
  margin: 0 0 12px;
  line-height: 1.2;
}
.guide-hero__sub {
  font-size: 1.05rem;
  color: var(--guide-mid);
  max-width: 640px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.toc-link {
  background: var(--guide-white);
  border: 1.5px solid var(--guide-primary);
  color: var(--guide-primary);
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.toc-link:hover {
  background: #404040;
  color: #fff;
}

/* ── Sections ── */
.guide-section {
  margin-bottom: 64px;
  scroll-margin-top: 80px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2.5px solid var(--guide-primary-light);
}
.yarn-guide-wrapper.rtl .section-header {
  flex-direction: row-reverse;
  justify-content: flex-end;
}
.section-emoji {
  font-size: 2rem;
  line-height: 1;
}
.guide-section h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--guide-dark);
  margin: 0;
}
.section-intro {
  font-size: 0.97rem;
  color: var(--guide-mid);
  line-height: 1.7;
  margin: 0 0 22px;
  max-width: 780px;
}

/* ── Tables ── */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--guide-radius);
  box-shadow: var(--guide-shadow);
  margin-bottom: 20px;
}
.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--guide-white);
  min-width: 480px;
}
.guide-table thead tr {
  background: var(--guide-primary);
  color: #fff;
}
.guide-table th {
  padding: 13px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.87rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.yarn-guide-wrapper.rtl .guide-table th,
.yarn-guide-wrapper.rtl .guide-table td {
  text-align: right;
}
.guide-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--guide-border);
}
.guide-table tbody tr:last-child td { border-bottom: none; }
.guide-table tbody tr:hover { background: var(--guide-primary-light); }

/* Row colour coding */
.row-lace   { --row-dot: #b0d0e8; }
.row-3ply   { --row-dot: #90c0e0; }
.row-4ply   { --row-dot: #70a8d0; }
.row-dk     { --row-dot: #60b860; }
.row-aran   { --row-dot: #e8a030; }
.row-chunky { --row-dot: #d06030; }
.row-super  { --row-dot: #b04020; }

.guide-table tbody tr td:first-child {
  font-weight: 700;
  color: var(--guide-primary);
}
.guide-table tbody tr td:first-child::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--row-dot, var(--guide-primary));
  margin-inline-end: 8px;
  vertical-align: middle;
}

/* Terms table — no colour coding */
.terms-table tbody tr td:first-child::before { display: none; }
.terms-table tbody tr td:first-child { color: var(--guide-dark); font-weight: 600; }

/* ── Tip boxes ── */
.guide-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--guide-primary-light);
  border-left: 4px solid var(--guide-primary);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--guide-mid);
  margin-top: 4px;
}
.yarn-guide-wrapper.rtl .guide-tip {
  border-left: none;
  border-right: 4px solid var(--guide-primary);
  text-align: right;
}
.guide-tip--green {
  background: var(--guide-accent-light);
  border-color: var(--guide-accent);
}
.tip-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }

/* ── Weight Cards ── */
.weight-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.weight-card {
  background: var(--guide-white);
  border-radius: var(--guide-radius);
  box-shadow: var(--guide-shadow);
  padding: 22px 20px 20px;
  position: relative;
  border-top: 5px solid var(--card-color, var(--guide-primary));
  transition: transform 0.2s, box-shadow 0.2s;
}
.weight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.wc-number {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 2rem;
  font-weight: 900;
  color: var(--card-color, var(--guide-primary));
  opacity: 0.25;
  line-height: 1;
}
.yarn-guide-wrapper.rtl .wc-number {
  right: auto;
  left: 16px;
}
.weight-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--guide-dark);
  margin: 0 0 14px;
  padding-inline-end: 30px;
}
.weight-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  font-size: 0.87rem;
}
.weight-card dt {
  color: var(--guide-mid);
  font-weight: 600;
  white-space: nowrap;
}
.weight-card dd {
  margin: 0;
  color: var(--guide-dark);
  line-height: 1.5;
}

/* Swatch visual #}*/
.wc-swatch {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  margin-bottom: 14px;
  opacity: 0.6;
}
.wc-lace   { background: repeating-linear-gradient(90deg,#b0d0e8 0,#b0d0e8 2px,transparent 2px,transparent 6px); }
.wc-3ply   { background: repeating-linear-gradient(90deg,#80b8e0 0,#80b8e0 3px,transparent 3px,transparent 7px); }
.wc-4ply   { background: repeating-linear-gradient(90deg,#60a0d0 0,#60a0d0 4px,transparent 4px,transparent 8px); }
.wc-dk     { background: repeating-linear-gradient(90deg,#50b050 0,#50b050 6px,transparent 6px,transparent 10px); }
.wc-aran   { background: repeating-linear-gradient(90deg,#d89020 0,#d89020 8px,transparent 8px,transparent 12px); }
.wc-chunky { background: repeating-linear-gradient(90deg,#c05828 0,#c05828 10px,transparent 10px,transparent 14px); }
.wc-super  { background: repeating-linear-gradient(90deg,#a03818 0,#a03818 13px,transparent 13px,transparent 17px); }
.wc-jumbo  { background: repeating-linear-gradient(90deg,#802010 0,#802010 18px,transparent 18px,transparent 22px); }

/* Popular badge */
.wc-badge {
  position: absolute;
  bottom: 14px;
  right: 16px;
  background: var(--guide-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 10px;
  padding: 3px 10px;
}

/* ── Back to top ── */
.guide-back-top {
  text-align: center;
  margin-top: 40px;
}
.back-top-btn {
  display: inline-block;
  color: var(--guide-primary);
  border: 2px solid var(--guide-primary);
  border-radius: 20px;
  padding: 8px 22px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.back-top-btn:hover {
  background: #404040;
  color: #fff;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .yarn-guide-wrapper { padding: 0 12px 48px; }
  .guide-hero { padding: 30px 12px 24px; }
  .weight-cards { grid-template-columns: 1fr; }
  .guide-table { font-size: 0.84rem; }
  .guide-table th, .guide-table td { padding: 9px 12px; }
}
