/*
Theme Name: Stitchnest
Author: Stitchnest
Description: A cozy, original crochet and yarn-craft blog theme with a soft lavender background, rounded white cards and a responsive three-column masonry post grid. Includes an author intro, trending topics, a single-post info sidebar, share links, coloured previous/next cards and related posts. All code and styling are original.
Version: 1.3.20
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stitchnest
Tags: blog, personal, crochet, yarn, masonry, three-columns, grid-layout, custom-logo, featured-images, threaded-comments, translation-ready, diy, craft, english
*/
/* Self-hosted Playfair Display (OFL) for the text logo only; no Google server call. */
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/playfair-display-700.woff2') format('woff2'); }


:root {
  --pm-text: #231c2e;
  --pm-muted: #6a6275;
  --pm-border: #e4d9f0;
  --pm-bg: #f6f1fa;
  --pm-card: #ffffff;
  --pm-accent: #7a4fb5;
  --pm-accent-dark: #5e3a94;
  --pm-rose: #b8456f;
  --pm-peri: #4361b8;
  --pm-sage: #2f8a84;
  --pm-dark: #231c2e;
  --pm-radius: 22px;
  --pm-max: 1180px;
  --pm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pm-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--pm-bg);
  color: var(--pm-text);
  font-family: var(--pm-font);
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pm-accent-dark); }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea { font: inherit; }
input, textarea { min-width: 0; }

.pm-skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: #111; color: #fff; padding: 10px 14px; }
.pm-skip-link:focus { left: 12px; top: 12px; }
.pm-container { width: min(var(--pm-max), calc(100% - 40px)); margin: 0 auto; }

/* Pill header - NOT sticky/fixed: it scrolls away with the page, so
   no card, badge or button can ever slide underneath it. */
.pm-header { padding: 16px 0 0; position: static; }
.pm-header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border: 1px solid var(--pm-border); border-radius: 999px;
  padding: 10px 12px 10px 20px; box-shadow: 0 10px 30px rgba(122,79,181, 0.08);
}
.pm-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; flex-shrink: 0; }
.pm-brand .custom-logo-link { display: flex; align-items: center; flex-shrink: 0; }
.pm-brand .custom-logo, .pm-brand img.custom-logo { height: 44px !important; width: auto !important; max-width: 220px; max-height: 44px; }
.pm-site-title { margin: 0; font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 1.55rem; letter-spacing: 0.2px; line-height: 1.1; white-space: nowrap; }
.pm-site-title a { text-decoration: none; }
.pm-tagline { display: none; }
.pm-header-search { display: flex; align-items: center; gap: 6px; max-width: 260px; }
.pm-nav { flex: 1; }
.pm-menu-toggle { display: none; }
.pm-header-search input[type="search"] { flex: 1; border: 0; outline: none; padding: 8px 4px; background: transparent; }
.pm-header-search button { border: 0; background: transparent; cursor: pointer; font-size: 1.05rem; }
.pm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.pm-header-inner.pm-menu-centered .pm-nav ul { justify-content: center; }
.pm-nav a { text-decoration: none; font-size: 0.92rem; font-weight: 600; white-space: nowrap; }
/* Dropdown sub-menus (e.g. "Our Projects" > categories) */
.pm-nav li { position: relative; }
.pm-nav .menu-item-has-children > a::after { content: " ▾"; font-size: 0.8em; }
.pm-nav ul.sub-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 50;
  flex-direction: column; gap: 0; min-width: 190px; padding: 8px 0;
  background: #fff; border: 1px solid var(--pm-border); border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
}
.pm-nav ul.sub-menu li { width: 100%; }
.pm-nav ul.sub-menu a { display: block; padding: 10px 16px; white-space: nowrap; }
.pm-nav li:hover > ul.sub-menu, .pm-nav li:focus-within > ul.sub-menu { display: flex; }
.pm-nav .current-menu-item > a, .pm-nav .current_page_item > a { color: var(--pm-accent-dark); }
.pm-subscribe { background: var(--pm-accent); color: #fff !important; text-decoration: none; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; white-space: nowrap; flex-shrink: 0; }
.pm-subscribe:hover { background: var(--pm-accent-dark); color: #fff !important; }

/* Home author intro + trending topics */
.pm-intro { text-align: center; padding: 44px 0 8px; }
.pm-intro-avatar img { border-radius: 50%; margin: 0 auto 14px; width: 96px; height: 96px; object-fit: cover; }
.pm-intro h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.02em; }
.pm-intro h1 span { color: var(--pm-accent-dark); }
.pm-intro p { color: #4b5563; max-width: 620px; margin: 0 auto; }
.pm-newsletter-inline { display: flex; gap: 8px; max-width: 480px; margin: 22px auto 0; background: #fff; padding: 6px; border-radius: 999px; border: 1px solid var(--pm-border); }
.pm-newsletter-inline input[type="email"] { flex: 1; border: 0; outline: none; padding: 8px 12px; background: transparent; }
.pm-newsletter-inline button { border: 0; border-radius: 999px; background: var(--pm-accent); color: #fff; font-weight: 700; padding: 10px 18px; cursor: pointer; white-space: nowrap; }
.pm-trending { background: #fff; border: 1px solid var(--pm-border); border-radius: var(--pm-radius); padding: 24px; margin: 36px 0 8px; }
.pm-trending h2 { text-align: center; margin: 0 0 20px; font-size: 1.25rem; }
.pm-topics { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; list-style: none; margin: 0; padding: 0; }
.pm-topic { text-align: center; flex: 0 0 104px; }
.pm-topic a { text-decoration: none; display: block; }
.pm-topic-wrap { position: relative; display: block; width: 72px; margin: 0 auto 8px; }
.pm-topic-circle {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: #fff;
  background: linear-gradient(135deg, var(--pm-accent), var(--pm-rose)); position: relative;
  overflow: hidden;
}
.pm-topic-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.pm-topic-count {
  position: absolute; top: -6px; right: -6px; z-index: 3; background: var(--pm-accent); color: #fff;
  font-size: 0.7rem; font-weight: 700; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; border: 2px solid #fff; box-sizing: border-box;
}
.pm-topic-name { font-size: 0.9rem; font-weight: 600; }
.pm-archive-title { font-size: 2rem; margin: 40px 0 8px; }
.pm-archive-desc { color: var(--pm-muted); margin: 0 0 28px; }

/* Masonry grid: 3 columns desktop, 2 tablet, 1 phone */
.pm-grid { column-count: 3; column-gap: 24px; padding: 24px 0 48px; }
.pm-card {
  break-inside: avoid; margin: 0 0 24px; background: var(--pm-card);
  border: 1px solid var(--pm-border); border-radius: var(--pm-radius); overflow: hidden;
  box-shadow: 0 6px 20px rgba(122,79,181, 0.05); transition: transform .18s ease, box-shadow .18s ease;
}
.pm-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(122,79,181, 0.12); }
.pm-card-media { position: relative; background: #efe6f7; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.pm-card-media img { width: 100%; height: 100%; object-fit: cover; }
.pm-card-media span { color: var(--pm-muted); font-size: 0.9rem; padding: 20px; text-align: center; }
.pm-media-placeholder { display: block; width: 100%; height: 100%; padding: 0 !important; background: linear-gradient(135deg, #d7c0f0, #fbc9b5); }
.pm-badge {
  position: absolute; top: 14px; left: 0; color: #fff; font-size: 0.8rem; font-weight: 700;
  padding: 7px 16px 7px 14px; border-radius: 0 999px 999px 0; text-decoration: none; z-index: 2;
}
.pm-badge-0 { background: var(--pm-rose); } .pm-badge-1 { background: var(--pm-sage); }
.pm-badge-2 { background: var(--pm-accent); } .pm-badge-3 { background: var(--pm-peri); }
.pm-card-body { padding: 22px 22px 26px; text-align: center; }
.pm-card-title { font-size: 1.3rem; line-height: 1.3; margin: 8px 0 10px; letter-spacing: -0.01em; }
.pm-card-title a { text-decoration: none; }
.pm-card-excerpt { color: #4b5563; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pm-card-meta { color: var(--pm-muted); font-size: 0.85rem; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.pm-card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.pm-card-meta img { display: inline-block; flex-shrink: 0; border-radius: 50%; width: 26px; height: 26px; object-fit: cover; }
.pm-read-more { display: inline-block; margin-top: 14px; font-weight: 700; font-size: 0.92rem; text-decoration: none; color: var(--pm-accent-dark); }

/* Single post: info sidebar on desktop, stacked on mobile */
.pm-single-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; padding: 36px 0 48px; }
.pm-single-sidebar { order: 1; }
.pm-single-main { order: 2; min-width: 0; background: #fff; border: 1px solid var(--pm-border); border-radius: var(--pm-radius); padding: 36px 38px 40px; }
.pm-info-author { display: flex; align-items: center; gap: 8px; }
.pm-info-author img { border-radius: 50%; width: 32px; height: 32px; object-fit: cover; }
.pm-info-box { background: #fff; border: 1px solid var(--pm-border); border-radius: var(--pm-radius); padding: 20px; margin-bottom: 24px; }
.pm-info-box h2, .pm-toc h2 { font-size: 1rem; margin: 0 0 14px; }
.pm-info-box dl { margin: 0; }
.pm-info-box dt { color: var(--pm-muted); font-size: 0.85rem; }
.pm-info-box dd { margin: 0 0 12px; font-weight: 600; }
.pm-toc { background: transparent; padding: 4px 4px 0; }
.pm-toc ol { margin: 0; padding-left: 20px; }
.pm-toc li { margin-bottom: 8px; }
.pm-toc a { text-decoration: none; font-size: 0.92rem; }
.pm-single-main h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 10px; text-align: center; letter-spacing: -0.02em; }
.pm-single-meta { color: var(--pm-muted); text-align: center; margin-bottom: 26px; font-size: 0.92rem; }
.pm-featured { border-radius: 14px; overflow: hidden; margin-bottom: 28px; }
.pm-content h2, .pm-content h3 { line-height: 1.3; scroll-margin-top: 90px; }
.pm-content blockquote { border-left: 3px solid var(--pm-accent); margin: 24px 0; padding: 4px 0 4px 20px; color: #4b5563; font-size: 1.1rem; font-style: italic; }
.pm-content figure { margin: 24px 0; max-width: 100%; }
.pm-content table { display: block; overflow-x: auto; max-width: 100%; }
.pm-content iframe, .pm-content video, .pm-content embed { max-width: 100%; }
.pm-tags { margin-top: 30px; color: var(--pm-muted); text-align: center; }
.pm-tags a { text-decoration: none; color: var(--pm-accent-dark); font-weight: 600; }

/* Share + copy link */
.pm-share { border-top: 1px solid var(--pm-border); border-bottom: 1px solid var(--pm-border); margin-top: 32px; padding: 20px 0; text-align: center; }
.pm-share-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0 16px; }
.pm-share-links a.pm-share-pinterest { background: #e60023; color: #fff; border-color: #e60023; }
.pm-share-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; background: #fff; border: 1px solid var(--pm-border); border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 0.9rem; }
.pm-copy { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; }
.pm-copy input { flex: 1; padding: 10px 12px; border: 1px solid var(--pm-border); border-radius: 8px; background: #f6f1fa; color: #4b5563; font-size: 0.88rem; }
.pm-copy button { border: 0; border-radius: 8px; background: var(--pm-accent); color: #fff; font-weight: 700; padding: 10px 16px; cursor: pointer; white-space: nowrap; }

/* Previous / next coloured cards */
.pm-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.pm-post-nav a { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; border-radius: 14px; padding: 18px 20px; min-width: 0; }
.pm-post-nav a:hover { color: #fff; opacity: 0.92; }
.pm-post-nav .pm-prev { background: var(--pm-rose); }
.pm-post-nav .pm-next { background: #3d2a66; text-align: right; justify-content: flex-end; }
.pm-post-nav small { display: block; font-size: 0.8rem; opacity: 0.85; }
.pm-post-nav strong { display: block; font-size: 0.95rem; line-height: 1.35; overflow-wrap: break-word; }
.pm-post-nav .pm-arrow { font-size: 1.4rem; flex-shrink: 0; }

/* Related posts */
.pm-related { background: #fff; border: 1px solid var(--pm-border); border-radius: var(--pm-radius); padding: 24px; margin-top: 28px; }
.pm-related-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.pm-related-head h2 { margin: 0; font-size: 1.3rem; }
.pm-related ol { list-style: none; margin: 0; padding: 0; }
.pm-related li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--pm-border); }
.pm-related li:last-child { border-bottom: 0; }
.pm-related-num { background: var(--pm-dark); color: #fff; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; flex-shrink: 0; }
.pm-related a { text-decoration: none; font-weight: 600; }
.pm-related-list { display: grid; gap: 4px; }
.pm-related-item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--pm-border); }
.pm-related-item:last-child { border-bottom: 0; }
.pm-related-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.pm-related-thumb-empty { background: linear-gradient(135deg, var(--pm-accent), var(--pm-rose)); }
.pm-related-item-title { font-weight: 600; }
.pm-btn { display: inline-block; background: var(--pm-peri); color: #fff !important; text-decoration: none; padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

/* Comments */
.pm-comments { margin-top: 36px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--pm-border); border-radius: 10px; background: #fff;
}
.comment-form textarea { min-height: 120px; }
.comment-form .submit { border: 0; border-radius: 8px; background: var(--pm-accent); color: #fff; font-weight: 700; padding: 11px 20px; cursor: pointer; }
.comment-reply-link { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 12px; font-weight: 700; text-decoration: none; }
.comment-form-cookies-consent input[type="checkbox"] { width: 20px; height: 20px; vertical-align: middle; accent-color: var(--pm-accent); }
.comment-form-cookies-consent label { line-height: 1.5; }
.comment-list { list-style: none; padding: 0; }
.comment-body { border: 1px solid var(--pm-border); border-radius: 12px; padding: 16px; margin-bottom: 14px; background: #fff; }

/* Pagination, search, 404 */
.pm-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 0 0 56px; flex-wrap: wrap; }
.pm-pagination a, .pm-pagination span { background: #fff; border: 1px solid var(--pm-border); border-radius: 8px; padding: 9px 16px; text-decoration: none; font-weight: 700; font-size: 0.92rem; }
.pm-pagination .current { background: var(--pm-accent); color: #fff; border-color: var(--pm-accent); }
.pm-pagination .next { background: var(--pm-accent); color: #fff; border-color: var(--pm-accent); }
.pm-search-form { display: flex; gap: 8px; max-width: 460px; margin: 20px auto 0; }
.pm-search-form input[type="search"] { flex: 1; padding: 11px 14px; border: 1px solid var(--pm-border); border-radius: 999px; background: #fff; }
.pm-search-form button { padding: 11px 18px; border: 0; border-radius: 999px; background: var(--pm-dark); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pm-empty { text-align: center; padding: 56px 0; color: var(--pm-muted); }

/* Newsletter CTA + footer */
.pm-cta { background: #fff; border-top: 1px solid var(--pm-border); padding: 48px 0; text-align: center; }
.pm-cta h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 0 0 10px; }
.pm-cta p { color: #4b5563; max-width: 560px; margin: 0 auto 20px; }
.pm-cta .pm-btn-dark { background: var(--pm-dark); color: #fff !important; text-decoration: none; padding: 12px 24px; border-radius: 8px; font-weight: 800; display: inline-block; }
.pm-social { display: flex; gap: 10px; margin: 0 0 16px; }
.pm-social-link { width: 40px; height: 40px; border-radius: 50%; background: #e60023; color: #fff !important; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; text-decoration: none; }
.pm-footer { background: var(--pm-bg); padding: 40px 0 28px; color: var(--pm-muted); font-size: 0.92rem; }
.pm-footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 32px; margin-bottom: 28px; }
.pm-footer-grid h3 { color: var(--pm-text); margin: 0 0 14px; font-size: 1.05rem; }
.pm-footer-grid ul { list-style: none; margin: 0; padding: 0; }
.pm-footer-grid li { padding: 7px 0; border-bottom: 1px solid var(--pm-border); }
.pm-footer-grid li:last-child { border-bottom: 0; }
.pm-footer-grid a { text-decoration: none; }
.pm-footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--pm-border); padding-top: 20px; }
.pm-back-top { background: var(--pm-accent); color: #fff !important; text-decoration: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; position: fixed; right: 18px; bottom: 18px; z-index: 40; box-shadow: 0 8px 20px rgba(122,79,181,.25); }

.wp-caption { max-width: 100%; }
.wp-caption-text { color: var(--pm-muted); font-size: 0.85rem; text-align: center; }
.aligncenter { margin-left: auto; margin-right: auto; }

/* Responsive breakpoints */
@media (max-width: 900px) {
  .pm-grid { column-count: 2; }
  .pm-single-layout { grid-template-columns: 1fr; }
  .pm-single-sidebar { order: 2; }
  .pm-single-main { order: 1; padding: 28px 24px 32px; }
  .pm-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 580px) {
  .pm-container { width: calc(100% - 28px); }
  .pm-header { position: static; top: auto; padding-top: 12px; }
  .pm-header-inner { flex-wrap: wrap; border-radius: 24px; padding: 12px 14px; }
  .pm-brand { flex-shrink: 1; }
  .pm-site-title { font-size: 1.2rem; white-space: normal; overflow-wrap: anywhere; }
  .pm-header-search { display: flex; order: 3; width: 100%; max-width: none; border-top: 1px solid var(--pm-border); padding-top: 8px; }
  .pm-header-search button { min-width: 44px; min-height: 44px; }
  .pm-menu-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; margin-left: auto; border: 0; background: transparent; cursor: pointer; min-width: 44px; min-height: 44px; align-items: center; }
  .pm-menu-toggle span { display: block; width: 24px; height: 2.5px; background: var(--pm-text); border-radius: 2px; }
  .pm-nav { display: none; width: 100%; order: 2; }
  .pm-nav.pm-nav-open { display: block; }
  /* Tidy opened mobile menu: one clean stacked list, not a wrapped mess */
  .pm-nav.pm-nav-open ul { flex-direction: column; gap: 0; justify-content: flex-start; }
  .pm-nav.pm-nav-open > ul > li { width: 100%; border-bottom: 1px solid var(--pm-border); }
  .pm-nav.pm-nav-open > ul > li:last-child { border-bottom: 0; }
  .pm-nav.pm-nav-open a { display: flex; width: 100%; padding: 12px 0; min-height: 44px; }
  .pm-nav.pm-nav-open ul.sub-menu { padding: 0 0 8px 20px; background: transparent; }
  .pm-nav.pm-nav-open ul.sub-menu li { border-bottom: 0; }
  .pm-nav.pm-nav-open ul.sub-menu a { padding: 10px 0; font-weight: 500; }
  .pm-nav.pm-nav-open ul.sub-menu a::before { content: "\2014\00a0"; }
  .pm-nav ul { justify-content: flex-start; gap: 14px; }
  /* Mobile: sub-menus always visible, indented under their parent (no hover on touch) */
  .pm-nav ul.sub-menu {
    display: flex; position: static; flex-direction: column; width: 100%;
    border: 0; box-shadow: none; padding: 4px 0 4px 18px; border-radius: 0;
  }
  .pm-nav ul.sub-menu a { padding: 8px 0; }
  .pm-nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .pm-subscribe { padding: 8px 12px; min-height: 44px; display: inline-flex; align-items: center; }
  .pm-footer-bottom { padding-right: 56px; }
  .pm-back-top { right: 12px; bottom: 12px; width: 44px; height: 44px; }
  .pm-grid { column-count: 1; }
  .pm-intro { padding-top: 32px; }
  .pm-single-main { padding: 24px 18px 28px; }
  .pm-post-nav { grid-template-columns: 1fr; }
  .pm-post-nav .pm-next { text-align: left; justify-content: flex-start; }
  .pm-footer-grid { grid-template-columns: 1fr; }
  .pm-newsletter-inline { flex-wrap: wrap; border-radius: 18px; }
  .pm-newsletter-inline button { width: 100%; }
  .pm-copy { flex-wrap: wrap; }
  .pm-copy button { width: 100%; }
}


/* Project card: image header, purple head, meta boxes, numbered steps */
.sn-project-card { background: #fff; border: 1px solid #e2d6ee; border-radius: 24px; overflow: hidden; margin: 32px 0; box-shadow: 0 10px 30px rgba(122,79,181, 0.10); }
.sn-project-image img { display: block; width: 100%; height: 280px; object-fit: cover; }
.sn-project-head { background: #f8f3fc; padding: 28px 28px 22px; text-align: center; }
.sn-project-card .sn-project-title { margin: 0 0 8px; font-size: 1.7rem; line-height: 1.25; }
.sn-project-author { margin: 0 0 16px; color: #666; font-size: 0.92rem; }
.sn-project-stars { color: #f5a623; letter-spacing: 1px; }
.sn-project-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.sn-project-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.sn-project-print { background: #fff; color: #222; border-color: #d6c6e6; }
.sn-project-pin { background: #e60023; color: #fff; }
.sn-project-meta { display: flex; flex-wrap: wrap; border-bottom: 1px solid #e2d6ee; }
.sn-meta-box { flex: 1 1 120px; text-align: center; padding: 16px 8px; border-right: 1px solid #e2d6ee; }
.sn-meta-box:last-child { border-right: 0; }
.sn-meta-label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: #888; margin-bottom: 4px; }
.sn-project-body { padding: 28px; }
.sn-project-body h3 { margin: 26px 0 12px; font-size: 1.25rem; }
.sn-project-body h3:first-child { margin-top: 0; }
.sn-project-materials { margin: 0; padding: 0; list-style: none; }
.sn-project-materials li { border-bottom: 1px solid #e2d6ee; }
.sn-project-materials li:last-child { border-bottom: 0; }
.sn-project-materials label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; line-height: 1.6; }
.sn-project-materials input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; accent-color: #7a4fb5; cursor: pointer; }
.sn-project-materials input[type="checkbox"]:checked ~ .sn-mat-text { text-decoration: line-through; opacity: 0.55; }
.sn-mat-amount { color: #7a4fb5; font-weight: 800; }
.sn-project-tips-list { margin: 10px 0 0; padding-left: 20px; line-height: 1.7; }
.sn-project-tips-list li { margin-bottom: 10px; }
.sn-project-tips-list li:last-child { margin-bottom: 0; }
.pm-project-top-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 20px; }
.sn-top-jump { background: #7a4fb5; color: #fff; }
.sn-top-jump:hover { color: #fff; }
.sn-project-steps { margin: 0; padding: 0; list-style: none; counter-reset: sn-step; }
.sn-project-steps li { counter-increment: sn-step; display: flex; gap: 14px; margin-bottom: 16px; line-height: 1.65; }
.sn-project-steps li::before { content: counter(sn-step); flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: #7a4fb5; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.sn-project-tips { background: #f8f3fc; border-left: 4px solid #7a4fb5; padding: 14px 16px; margin-top: 24px; border-radius: 0 12px 12px 0; line-height: 1.65; }
@media (max-width: 580px) {
  .sn-project-image img { height: 200px; }
  .sn-project-head, .sn-project-body { padding: 20px 18px; }
  .sn-meta-box { flex-basis: 50%; border-bottom: 1px solid #e2d6ee; }
}
@media print {
  body:has(.sn-project-card) * { visibility: hidden; }
  body:has(.sn-project-card) .sn-project-card, body:has(.sn-project-card) .sn-project-card * { visibility: visible; }
  body:has(.sn-project-card) .sn-project-card { position: absolute; top: 0; left: 0; width: 100%; box-shadow: none; margin: 0; }
  body:has(.sn-project-card) .sn-project-actions, body:has(.sn-project-card) .pm-project-top-actions { display: none !important; }
}

/* Ameyi: TOC moved to top of article */
.pm-toc-top { margin: 0 0 26px; }
