/* Yarn Resources — lead-magnet download card */
.yarn-resource-card {
  max-width: 720px;
  margin: 32px auto;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02), 0 10px 25px rgba(0,0,0,0.04);
  font-family: inherit;
}
.yarn-resource-card[dir="rtl"] { font-family: 'Noto Sans Arabic', inherit; }

.yarn-res-inner { display: flex; flex-direction: column; gap: 0; }
@media (min-width: 640px) {
  .yarn-res-inner { flex-direction: row; }
  .yarn-resource-card[dir="rtl"] .yarn-res-inner { flex-direction: row-reverse; }
}

.yarn-res-thumb {
  flex: 0 0 200px;
  background: #1e293b;
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
.yarn-res-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.yarn-res-body { flex: 1; padding: 28px 32px; }

.yarn-res-category {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 4px 10px; border-radius: 999px;
  margin-bottom: 10px;
}
.yarn-res-title {
  font-size: 22px; font-weight: 700;
  color: #0f172a; margin: 0 0 8px 0; line-height: 1.25;
}
.yarn-res-excerpt {
  color: #475569; font-size: 15px; line-height: 1.55;
  margin: 0 0 14px 0;
}
.yarn-res-meta-row {
  display: flex; gap: 20px; font-size: 13px; color: #64748b;
  margin-bottom: 18px;
  align-items: center;
}
.yarn-res-meta-row span {
  display: inline-flex; align-items: center; gap: 6px;
}
.yarn-resource-card[dir="rtl"] .yarn-res-meta-row { justify-content: flex-end; }

.yarn-res-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  stroke-width: 1.75;
  color: currentColor;
}
.yarn-res-toggle .yarn-res-icon { width: 18px; height: 18px; }

.yarn-res-toggle {
  appearance: none; border: none; cursor: pointer;
  background: #0f172a; color: #fff;
  padding: 12px 24px; border-radius: 8px;
  font-size: 15px; font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: inherit;
}
.yarn-res-toggle:hover { background: #1e293b; transform: translateY(-1px); }
.yarn-res-toggle[aria-expanded="true"] { display: none; }

.yarn-res-form {
  display: none;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}
.yarn-res-form.active { display: block; }

.yarn-res-row {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  margin-bottom: 12px;
}
@media (min-width: 640px) {
  .yarn-res-row { grid-template-columns: 1fr 1fr; }
}
.yarn-res-form label {
  display: block; font-size: 13px; font-weight: 600;
  color: #334155; text-align: left;
}
.yarn-resource-card[dir="rtl"] .yarn-res-form label { text-align: right; }
.yarn-res-form label span { color: #dc2626; }
.yarn-res-form input[type=text],
.yarn-res-form input[type=email],
.yarn-res-form input[type=tel] {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: #0f172a;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.yarn-res-form input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.yarn-res-consent {
  display: flex !important; gap: 10px;
  align-items: flex-start;
  margin: 14px 0;
  font-size: 13px; font-weight: 400;
  color: #475569; line-height: 1.45;
}
.yarn-res-consent input { margin-top: 3px; flex-shrink: 0; }

.yarn-res-submit {
  appearance: none; border: none; cursor: pointer;
  background: #2563eb; color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 15px; font-weight: 600;
  transition: background 0.15s ease;
  width: 100%;
  font-family: inherit;
}
.yarn-res-submit:hover:not(:disabled) { background: #1d4ed8; }
.yarn-res-submit:disabled { opacity: 0.6; cursor: wait; }

.yarn-res-status {
  margin-top: 12px; padding: 10px 14px;
  border-radius: 6px; font-size: 14px;
  display: none;
}
.yarn-res-status.show { display: block; }
.yarn-res-status.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.yarn-res-status.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
