/* ETSPIL pattern library page
   Grid of 4 columns, portrait 3:4 thumbnails generated at 600x800. */

.pattern-hero {
  display: grid;
  grid-template-columns: 0.98fr 1.02fr;
  gap: 24px;
  min-height: 68vh;
}

.pattern-hero-copy,
.pattern-hero-media,
.pattern-card {
  box-shadow: var(--shadow);
}

.pattern-hero-copy {
  padding: 42px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(250, 241, 225, 0.98), rgba(242, 228, 202, 0.96));
  border: 2px solid rgba(255, 255, 255, 0.88);
}

.pattern-title {
  max-width: 820px;
}

.pattern-hero-media {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: rgba(255, 248, 235, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.84);
}

.pattern-hero-media img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.pattern-library-section {
  padding-bottom: 36px;
}

/* ---------- collection groups ---------- */

.pattern-groups {
  display: grid;
  gap: 62px;
  margin-top: 34px;
}

.pattern-group-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.pattern-group-head h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 0;
  font-weight: 700;
}

.pattern-group-label {
  color: var(--plum);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pattern-group-name {
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  letter-spacing: -0.03em;
  color: #6a5346;
}

.pattern-group-head > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.pattern-group-head .pattern-group-desc {
  max-width: 760px;
  margin-top: 6px;
}

/* ---------- cards ---------- */

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.pattern-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 250, 239, 0.96), rgba(248, 234, 205, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.84);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.pattern-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px rgba(133, 101, 65, 0.18);
  border-color: rgba(195, 138, 47, 0.22);
}

.pattern-thumb {
  display: block;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.82);
}

/* Thumbnails are pre-rendered as 600x800 white canvases (3:4),
   so no cropping is applied here — the whole line art sheet stays visible. */
.pattern-thumb img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 500ms ease;
}

.pattern-card:hover .pattern-thumb img {
  transform: scale(1.03);
}

.pattern-card-copy {
  display: grid;
  align-content: start;
  gap: 6px;
}

.pattern-label {
  margin: 0;
  color: var(--plum);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pattern-card-copy h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: #6a5346;
}

.pattern-download {
  min-height: 46px;
  padding: 0 18px;
  font-size: 0.9rem;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .pattern-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .pattern-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .pattern-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .pattern-groups {
    gap: 46px;
  }
}

@media (max-width: 420px) {
  .pattern-card {
    padding: 10px;
    border-radius: 20px;
  }

  .pattern-download {
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.84rem;
  }
}

/* 页脚：与详情页保持一致（原本只写在 pattern-page.css，索引页没加载它） */
.site-footer {
  margin-top: 56px;
  padding: 30px 6px 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.site-footer a:hover { color: var(--gold-deep); }

/* ===== 图案库首页：横幅 + 两栏说明 ===== */
.lib-banner { margin-top: 18px; }

.lib-banner-img {
  margin: 0; border-radius: var(--radius-xl); overflow: hidden;
  border: 1px solid var(--line); background: #f7efe0;
}
.lib-banner-img img {
  display: block; width: 100%; height: auto; max-height: 360px;
  object-fit: cover; object-position: center 45%;
}

.lib-intro {
  display: grid; grid-template-columns: 1.12fr .88fr;
  gap: clamp(22px, 4vw, 64px); padding-top: clamp(18px, 2vw, 30px); align-items: start;
}
.lib-intro-copy .eyebrow {
  color: #8a6a3f; margin-bottom: 8px;
  font-size: clamp(10px, .95vw, 13px); letter-spacing: .18em; text-transform: uppercase;
}
.lib-intro-copy h1 {
  margin: 0 0 10px; color: #3b2a20;
  font-size: clamp(22px, 2.6vw, 40px); line-height: 1.14; letter-spacing: -.01em;
}
.lib-intro-copy h1 .h1-strong { font-weight: 800; }
.lib-intro-copy h1 .h1-light { font-weight: 300; }
.lib-banner-sub {
  color: #6a5346; font-size: clamp(12px, 1.05vw, 16px); line-height: 1.55;
  margin: 0 0 16px; max-width: 46ch;
}
.lib-banner-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lib-intro-copy .kw-row { margin-top: 16px; }

.lib-intro-how .eyebrow {
  color: #8a6a3f; font-size: clamp(10px, .95vw, 13px);
  letter-spacing: .18em; text-transform: uppercase;
}
.how-list { list-style: none; counter-reset: how; margin: 10px 0 0; padding: 0; display: grid; gap: 16px; }
.how-list li { counter-increment: how; position: relative; padding-left: 38px; }
.how-list li::before {
  content: "0" counter(how); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 999px; background: var(--gold); color: #fff;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 11px;
  line-height: 26px; text-align: center; letter-spacing: .04em;
}
.how-list strong { display: block; font-size: .93rem; color: #4a3529; margin-bottom: 3px; }
.how-list span { font-size: .82rem; line-height: 1.5; color: var(--muted); }

@media (max-width: 980px) {
  .lib-intro { grid-template-columns: 1fr; gap: 22px; }
  .lib-banner-img img { max-height: 220px; object-position: center 42%; }
  .lib-banner-actions .button { width: 100%; justify-content: center; }
  .how-list { gap: 12px; }
}

.kw-row { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 18px 0 0; padding: 0; }
.kw-row li {
  font-size: .8rem; color: #7a6353; background: #fffaf0; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px;
}

.how-steps { list-style: none; counter-reset: how; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 0; margin: 34px 0 0; }
.how-steps li {
  counter-increment: how; position: relative; background: #fffaf0; border: 1px solid var(--line);
  border-radius: 18px; padding: 24px 20px 20px;
}
.how-steps li::before {
  content: "0" counter(how); position: absolute; top: -12px; left: 18px;
  background: var(--gold); color: #fff; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; padding: 4px 10px; border-radius: 999px;
}
.how-steps strong { display: block; margin: 8px 0 6px; font-size: 1rem; color: #4a3529; }
.how-steps p { margin: 0; font-size: .88rem; line-height: 1.6; color: var(--muted); }

/* 卡片改成品照：4:3 横构图，不再显示竖版线稿 */
.pattern-thumb img { aspect-ratio: 4 / 3; object-fit: cover; }

@media (max-width: 980px) {
  .lib-banner { aspect-ratio: auto; }
  .lib-banner > img { position: static; height: auto; }
  .lib-banner-copy { position: static; width: auto; padding: 22px 20px 26px; }
  .how-steps { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .lib-banner { aspect-ratio: auto; display: block; min-height: 0; }
  .lib-banner > img { position: static; width: 100%; height: auto; }
  .lib-banner-copy { position: static; width: auto; padding: 20px 20px 26px; }
  .lib-banner-copy h1 { font-size: 1.55rem; }
  .lib-banner-sub { font-size: .9rem; max-width: none; }
  .lib-banner-actions .button { width: 100%; justify-content: center; }
  .lib-badge { top: 12px; right: 12px; }
}

/* 两栏：左文案 + 右三步 */
.lib-intro {
  display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(22px, 4vw, 64px);
  padding-top: clamp(18px, 2vw, 30px); align-items: start;
}
.lib-intro-copy .eyebrow { margin-bottom: 8px; }
.lib-intro-copy h1 { margin: 0 0 10px; }
.lib-intro-copy .lib-banner-sub { margin-bottom: 16px; max-width: 46ch; }
.lib-intro-copy .kw-row { margin-top: 16px; }

.lib-intro-how { padding-top: 2px; }
.how-list { list-style: none; counter-reset: how; margin: 10px 0 0; padding: 0; display: grid; gap: 16px; }
.how-list li { counter-increment: how; position: relative; padding-left: 38px; }
.how-list li::before {
  content: "0" counter(how); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 999px; background: var(--gold); color: #fff;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 11px;
  line-height: 26px; text-align: center; letter-spacing: .04em;
}
.how-list strong { display: block; font-size: .93rem; color: #4a3529; margin-bottom: 3px; }
.how-list span { font-size: .82rem; line-height: 1.5; color: var(--muted); }

@media (max-width: 980px) {
  .lib-intro { grid-template-columns: 1fr; gap: 22px; }
  .how-list { gap: 12px; }
}

/* 图案库区标题：一条横杠 */
.pattern-library-section { padding-top: 0; }
.lib-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px 32px; padding: 16px 0 14px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin: clamp(10px, 1.4vw, 18px) 0 clamp(8px, 1vw, 14px);
}
.lib-bar-left .eyebrow { margin: 0 0 5px; color: #8a6a3f; font-size: clamp(11px, .95vw, 13px); letter-spacing: .20em; text-transform: uppercase; font-weight: 600; }
.lib-bar-line { margin: 0; color: #3b2a20; font-size: clamp(15px, 1.45vw, 21px); font-weight: 300; letter-spacing: -.005em; line-height: 1.25; }

.lib-bar-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.lib-bar-nav a {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  border: 1px solid var(--line); background: #fffaf0; color: #5b4636;
  border-radius: 999px; padding: 10px 16px; font-size: clamp(12px, .98vw, 14px);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.lib-bar-nav a:hover { border-color: var(--gold); color: var(--gold-deep); background: #fff; }
.lib-bar-nav .num { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: .9em; color: #b0946a; letter-spacing: .05em; }
.lib-bar-nav em { font-style: normal; color: #a08a72; font-size: .9em; }

@media (max-width: 980px) {
  .lib-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .lib-bar-nav { width: 100%; }
}

/* 套件推荐区（原只在 pattern-page.css，图案库首页也要用） */
.pdp-next {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  padding: 34px 38px;
  margin-top: 8px;
  border-radius: var(--radius-xl);
  background: linear-gradient(120deg, rgba(131, 85, 126, 0.1), rgba(221, 179, 93, 0.16));
  border: 1px solid var(--line);
}
.pdp-next h2 {
  margin: 0 0 8px;
  font-family: "Oswald", sans-serif;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  letter-spacing: -0.01em;
  color: #5d4438;
}
.pdp-next p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.pdp-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .pdp-next { grid-template-columns: 1fr; padding: 24px 20px; }
  .pdp-next-actions { justify-content: flex-start; }
}

/* 品牌：文字标与标语分开 */
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-decoration: none; }
.brand-wordmark { height: 26px; width: auto; display: block; }
.brand-tagline {
  font-size: 7.5px; line-height: 1; letter-spacing: .10em; text-transform: lowercase;
  color: #8a6a3f; opacity: .85; white-space: nowrap;
}
@media (max-width: 980px) {
  .brand-wordmark { height: 22px; }
  .brand-tagline { font-size: 7px; letter-spacing: .12em; }
}

/* 手机上隐藏标语，只留文字标 */
@media (max-width: 720px) { .brand-tagline { display: none; } }
