/* Yarn & Materials Knowledge Center — components.
 * Extends the existing DALANG design system. Light theme, quiet-luxury rules:
 * no gradients, no decorative effects, one accent (--green), serif headings.
 */

/* ------------------------------------------------------------------ hero */

.yarn-hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(560px, 62vw);
  overflow: hidden;
  background: #eceee9;
}

.yarn-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding-block: clamp(58px, 8vw, 104px);
}

.yarn-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(42px, 6vw, 76px);
  text-wrap: balance;
}

.yarn-hero p {
  max-width: 62ch;
  color: #35443b;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.62;
}

.yarn-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.yarn-hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: clamp(38px, 5vw, 62px);
  border-top: 1px solid #cdd3cd;
}

.yarn-hero-meta div {
  padding: 18px 0 0;
}

.yarn-hero-meta strong {
  display: block;
  color: var(--green);
  font: 400 clamp(24px, 2.6vw, 34px) var(--serif);
}

.yarn-hero-meta span {
  display: block;
  color: #46534b;
  font-size: 13px;
}

/* --------------------------------------------------------- module listing */

.yarn-modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.yarn-module {
  display: flex;
  flex-direction: column;
  min-height: 244px;
  padding: 26px 24px;
  background: var(--paper);
  text-decoration: none;
  transition: background 0.2s ease;
}

.yarn-module:hover {
  background: #fff;
}

.yarn-module-index {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.yarn-module h3 {
  margin: 16px 0 8px;
  font: 400 clamp(22px, 2.2vw, 27px) var(--serif);
}

.yarn-module p {
  margin: 0;
  color: #46534b;
  font-size: 14px;
  line-height: 1.62;
}

.yarn-module span {
  margin-top: auto;
  padding-top: 18px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

/* ---------------------------------------------------------- fiber browsing */

.yarn-fiber-group {
  margin-bottom: 40px;
}

.yarn-fiber-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.yarn-fiber-group-head h3 {
  margin: 0;
  font: 400 clamp(24px, 2.6vw, 32px) var(--serif);
}

.yarn-fiber-group-head span {
  color: var(--muted);
  font-size: 13px;
}

.yarn-fiber-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.yarn-fiber-links a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 15px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 14px;
}

.yarn-fiber-links a:hover {
  border-color: var(--green);
}

.yarn-fiber-links a b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

/* ------------------------------------------------------------ library grid */

.yarn-library-layout {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 54px);
  align-items: start;
}

.yarn-filter-panel {
  position: sticky;
  top: 20px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.yarn-filter-panel h2 {
  margin: 0 0 16px;
  font: 400 22px var(--serif);
}

.yarn-filter-panel label {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
}

.yarn-filter-panel select,
.yarn-filter-panel input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 14px;
  font-weight: 400;
}

.yarn-filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.yarn-filter-actions .btn {
  flex: 1;
  min-height: 42px;
  padding: 0 12px;
  font-size: 10px;
}

.yarn-filter-actions .btn.outline {
  flex: 0 0 auto;
}

.yarn-count {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.yarn-count[data-filtered="true"] {
  color: var(--green);
  font-weight: 700;
}

.yarn-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.yarn-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e0e2dd;
}

.yarn-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
}

.yarn-card-figure {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: flex-end;
  padding: 0;
  background: #eef0ea;
  overflow: hidden;
}

.yarn-card-figure .yarn-diagram {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.yarn-card-fibre {
  position: relative;
  z-index: 1;
  margin: 0 0 12px 14px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.yarn-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 18px 20px;
}

.yarn-card h3 {
  margin: 7px 0 6px;
  font: 400 20px var(--serif);
  line-height: 1.2;
}

.yarn-card-composition {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.yarn-card-summary {
  margin: 0;
  color: #46534b;
  font-size: 13px;
  line-height: 1.6;
}

.yarn-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 15px;
}

.yarn-card-apps {
  color: var(--muted);
  font-size: 11px;
  text-transform: capitalize;
}

.yarn-card-status {
  display: block;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed #d9ddd8;
  color: #7a6a3f;
  font-size: 11px;
  line-height: 1.45;
}

.yarn-tier {
  display: inline-block;
  padding: 4px 9px;
  background: #e8ece7;
  color: #314e41;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.yarn-tier-luxury {
  background: #2b3b33;
  color: #f2f0e8;
}

.yarn-tier-premium {
  background: #dde4dc;
  color: #24483b;
}

.yarn-tier-economy {
  background: #eceae4;
  color: #55605a;
}

/* ------------------------------------------------------------ detail pages */

.yarn-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: clamp(34px, 5vw, 72px);
  align-items: start;
}

.yarn-detail-main h2 {
  margin: 0 0 16px;
  font-size: clamp(34px, 4.4vw, 54px);
}

.yarn-detail-main h3 {
  margin: 40px 0 12px;
  font: 400 clamp(23px, 2.4vw, 29px) var(--serif);
}

.yarn-detail-lead {
  max-width: 64ch;
  color: #35443b;
  font-size: 17px;
  line-height: 1.68;
}

.yarn-detail-figure {
  margin: 0 0 26px;
  border: 1px solid var(--line);
  background: #fff;
}

.yarn-detail-figure .yarn-diagram {
  display: block;
  width: 100%;
  height: auto;
}

.yarn-figure-caption {
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.yarn-verification {
  margin: 24px 0 0;
  padding: 15px 18px;
  font-size: 14px;
  line-height: 1.6;
}

.yarn-verified {
  background: #eef2ec;
  border-left: 3px solid var(--green);
  color: #31473c;
}

.yarn-draft {
  background: #f6f1e2;
  border-left: 3px solid #a8894a;
  color: #5c4d2c;
}

.yarn-spec-list {
  margin: 0;
  border-top: 1px solid var(--line);
}

.yarn-spec-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.yarn-spec-row dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.yarn-spec-row dd {
  margin: 0;
  color: #35443b;
  font-size: 14px;
  line-height: 1.6;
}

.yarn-list {
  margin: 0;
  padding-left: 20px;
  color: #35443b;
  font-size: 15px;
  line-height: 1.72;
}

.yarn-list li {
  margin-bottom: 7px;
}

.yarn-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.yarn-list-pro li::marker {
  color: var(--green);
}

.yarn-list-con li::marker {
  color: #a8894a;
}

.yarn-note {
  margin: 14px 0 0;
  padding: 14px 16px;
  background: #eceee9;
  color: #35443b;
  font-size: 14px;
  line-height: 1.62;
}

.yarn-aside {
  position: sticky;
  top: 20px;
}

.yarn-detail-aside {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 18px;
}

.yarn-fact-box {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.yarn-fact-box h3 {
  margin: 0 0 14px;
  font: 400 21px var(--serif);
}

.yarn-fact-box h4 {
  margin: 0 0 8px;
  font: 400 19px var(--serif);
}

.yarn-fact-box p {
  margin: 0 0 10px;
  color: #46534b;
  font-size: 13px;
  line-height: 1.62;
}

.yarn-fact-box dl {
  margin: 0;
}

.yarn-fact-box dl > div {
  padding: 9px 0;
  border-bottom: 1px solid #eceeeb;
}

.yarn-fact-box dl > div:last-child {
  border-bottom: 0;
}

.yarn-fact-box dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.yarn-fact-box dd {
  margin: 3px 0 0;
  color: #35443b;
  font-size: 14px;
}

.yarn-tier-caveat {
  padding-top: 10px;
  border-top: 1px solid #eceeeb;
  color: var(--muted) !important;
  font-size: 12px !important;
}

.yarn-related {
  margin: 0;
  padding: 0;
  list-style: none;
}

.yarn-related li {
  padding: 11px 0;
  border-bottom: 1px solid #eceeeb;
}

.yarn-related li:last-child {
  border-bottom: 0;
}

.yarn-related a {
  display: block;
  font: 400 17px var(--serif);
  text-decoration: none;
}

.yarn-related a:hover {
  color: var(--green);
}

.yarn-related span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.yarn-fact-cta {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.yarn-fact-cta h3 {
  color: #fff;
}

.yarn-fact-cta p {
  color: #dfe7e2;
}

.yarn-fact-cta .btn {
  width: 100%;
  margin-bottom: 6px;
  background: #fff;
  color: var(--green);
  border-color: #fff;
}

.yarn-fact-cta .text-link {
  color: #fff;
}

/* ------------------------------------------------------------ comparisons */

.yarn-comparison-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 54px);
  align-items: start;
}

.yarn-comparison-list {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.comparison-link {
  display: block;
  padding: 16px 18px;
  background: #fff;
  text-decoration: none;
}

.comparison-link:hover,
.comparison-link.is-active {
  background: #eceee9;
}

.comparison-link-title {
  display: block;
  font: 400 18px var(--serif);
}

.comparison-link-summary {
  display: block;
  margin-top: 6px;
  color: #46534b;
  font-size: 12px;
  line-height: 1.55;
}

.comparison-link-more {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th,
.comparison-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
  line-height: 1.62;
}

.comparison-table thead th {
  background: var(--green);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.comparison-table tbody th {
  width: 190px;
  background: #f1f2ee;
  color: #35443b;
  font-size: 13px;
  font-weight: 700;
}

.comparison-table tbody tr:last-child th,
.comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

.comparison-yarn-head {
  display: block;
  color: #fff;
  font: 400 18px var(--serif);
  letter-spacing: 0;
  text-transform: none;
}

.comparison-yarn-head span {
  display: block;
  margin-top: 5px;
  color: #dfe7e2;
  font-size: 12px;
  font-weight: 400;
}

.comparison-summary {
  max-width: 62ch;
  color: #35443b;
  font-size: 16px;
  line-height: 1.65;
}

/* ------------------------------------------------------ selection guide */

.selection-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: clamp(20px, 3vw, 32px);
  background: #eceee9;
}

.selection-field {
  display: grid;
  gap: 6px;
}

.selection-label {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selection-field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
}

.selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  grid-column: 1 / -1;
}

.selection-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: #46534b;
  font-size: 13px;
}

.selection-results {
  margin-top: clamp(28px, 4vw, 46px);
}

.selection-results h3 {
  margin: 0 0 20px;
  font: 400 clamp(24px, 2.6vw, 32px) var(--serif);
}

.selection-result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.selection-result {
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
}

.selection-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.selection-result-head h4 {
  margin: 0;
  font: 400 22px var(--serif);
}

.selection-result > p {
  margin: 0 0 12px;
  color: #35443b;
  font-size: 14px;
  line-height: 1.62;
}

.yarn-list-reasons {
  margin-top: 12px;
  font-size: 14px;
}

.yarn-list-reasons li::marker {
  color: var(--green);
}

.selection-caution {
  margin-top: 14px;
  padding: 13px 15px;
  background: #f6f1e2;
  border-left: 3px solid #a8894a;
  color: #5c4d2c;
  font-size: 13px;
  line-height: 1.6;
}

.selection-caution ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.selection-result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eceeeb;
}

.selection-results-cta {
  margin-top: 28px;
  padding: clamp(24px, 3vw, 36px);
  background: var(--green);
  color: #fff;
}

.selection-results-cta h3 {
  margin: 0 0 10px;
  color: #fff;
}

.selection-results-cta p {
  max-width: 66ch;
  margin: 0 0 18px;
  color: #dfe7e2;
}

/* ------------------------------------------------------------------- faq */

.yarn-faq-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.yarn-faq-nav {
  position: sticky;
  top: 20px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.yarn-faq-nav h2 {
  margin: 0 0 12px;
  font: 400 20px var(--serif);
}

.yarn-faq-nav select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 14px;
}

.yarn-faq-item {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}

.yarn-faq-item:last-child {
  border-bottom: 1px solid var(--line);
}

.yarn-faq-item summary {
  cursor: pointer;
  font: 400 clamp(19px, 2vw, 23px) var(--serif);
}

.yarn-faq-item p,
.yarn-faq-item ul {
  max-width: 76ch;
  margin: 12px 0 0;
  color: #35443b;
  font-size: 15px;
  line-height: 1.72;
}

/* -------------------------------------------------------------- articles */

.yarn-article-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.yarn-article-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
}

.yarn-article-card h3 {
  margin: 12px 0 10px;
  font: 400 21px var(--serif);
  line-height: 1.25;
}

.yarn-article-card p {
  margin: 0;
  color: #46534b;
  font-size: 14px;
  line-height: 1.62;
}

.yarn-article-card .yarn-article-meta {
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.yarn-article-body {
  max-width: 800px;
}

.yarn-article-body h2 {
  margin: 42px 0 12px;
  font: 400 clamp(24px, 2.6vw, 31px) var(--serif);
}

.yarn-article-body p {
  color: #35443b;
  font-size: 16px;
  line-height: 1.75;
}

/* ------------------------------------------------------------ cross links */

.yarn-crosslinks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.yarn-crosslink {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
}

.yarn-crosslink h3 {
  margin: 0 0 8px;
  font: 400 20px var(--serif);
}

.yarn-crosslink p {
  margin: 0;
  color: #46534b;
  font-size: 14px;
  line-height: 1.6;
}

.yarn-crosslink span {
  display: block;
  margin-top: 14px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
  .yarn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yarn-modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yarn-article-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yarn-library-layout,
  .yarn-comparison-layout,
  .yarn-faq-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .yarn-filter-panel,
  .yarn-comparison-list,
  .yarn-faq-nav {
    position: static;
  }

  .yarn-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .yarn-detail-aside {
    position: static;
  }

  .selection-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .yarn-hero-meta {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 0;
  }

  .yarn-grid,
  .yarn-modules,
  .yarn-article-list,
  .yarn-crosslinks,
  .yarn-two-col,
  .selection-result-list {
    grid-template-columns: 1fr;
  }

  .selection-form {
    grid-template-columns: 1fr;
  }

  .yarn-spec-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .comparison-table thead th,
  .comparison-table tbody th {
    position: sticky;
    left: 0;
  }

  .yarn-filter-actions {
    flex-direction: column;
  }

  .yarn-filter-actions .btn {
    width: 100%;
  }
}
/* ------------------------------------------------------------ editorial images */
.yarn-hero-visual {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 auto;
  width: min(49%, 760px);
  margin: 0;
  overflow: hidden;
}

.yarn-hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.yarn-hero-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, #eceee9 0%, rgba(236, 238, 233, 0.78) 12%, rgba(236, 238, 233, 0.08) 62%);
  pointer-events: none;
}

.yarn-hero-visual figcaption {
  position: absolute;
  z-index: 1;
  right: 22px;
  bottom: 16px;
  max-width: 80%;
  padding: 7px 10px;
  color: #26352d;
  background: rgba(247, 246, 242, 0.9);
  font-size: 11px;
  line-height: 1.4;
}

.yarn-hero-inner {
  max-width: 900px;
}

.yarn-module {
  min-height: 0;
}

.yarn-module-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 14px;
  overflow: hidden;
  background: #e9e9e3;
}

.yarn-module-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.yarn-module:hover .yarn-module-image img {
  transform: scale(1.025);
}

.yarn-module h3 {
  margin-top: 17px;
}

@media (max-width: 760px) {
  .yarn-hero-visual {
    width: 100%;
    opacity: 0.2;
  }

  .yarn-hero-visual::after {
    background: linear-gradient(90deg, rgba(236, 238, 233, 0.92), rgba(236, 238, 233, 0.62));
  }

  .yarn-hero-visual figcaption {
    right: 12px;
    bottom: 10px;
    font-size: 10px;
  }
}
.yarn-module .yarn-module-index {
  margin-top: 0;
  padding-top: 0;
}

.yarn-module .yarn-module-image {
  margin-top: 14px;
  padding: 0;
  color: inherit;
  font-weight: 400;
}
