/* Loose Ends — a crafts & knitting blog
   WordPress-flavoured theme, hand-tuned. Cream / sage / rust, soft and textured. */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=Nunito:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --cream: #faf5ea;
  --cream-deep: #f1e7d3;
  --paper: #fffdf8;
  --sage: #7f9473;
  --sage-deep: #5c6f52;
  --sage-pale: #e6ebdf;
  --rust: #b85c3a;
  --rust-deep: #96462a;
  --rust-pale: #f3ded3;
  --ink: #3c352c;
  --ink-soft: #6b6155;
  --line: #e4d9c3;
  --shadow: rgba(60, 50, 30, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  background-image:
    radial-gradient(circle at 15% 8%, rgba(184, 92, 58, 0.05), transparent 40%),
    radial-gradient(circle at 85% 0%, rgba(127, 148, 115, 0.07), transparent 45%);
}

a { color: var(--rust-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3, .display {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  color: var(--sage-deep);
  line-height: 1.15;
  margin: 0.4em 0 0.5em;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.1rem; color: var(--rust-deep); }
h3 { font-size: 1.6rem; }

p { margin: 0 0 1.1em; }

ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.4em; }

/* ---------- Header ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 3px solid var(--line);
  padding: 22px 0 0;
}

.site-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.site-branding { display: flex; align-items: baseline; gap: 14px; }

.site-title {
  font-family: 'Caveat', cursive;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--rust);
  margin: 0;
  transform: rotate(-1deg);
  display: inline-block;
}
.site-title a { color: inherit; }
.site-title a:hover { text-decoration: none; }

.site-tagline {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-style: italic;
}

.site-nav {
  margin: 14px 0 0;
  border-top: 1px solid var(--line);
}
.site-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--sage-deep);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.site-nav a:hover { color: var(--rust); text-decoration: none; }

/* ---------- Layout shells ---------- */

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  padding: 40px 0 64px;
}

@media (max-width: 860px) {
  .content-layout { grid-template-columns: 1fr; }
}

/* ---------- Home page ---------- */

.home-hero {
  position: relative;
  margin: 28px 0 40px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 28px var(--shadow);
}
.home-hero img { width: 100%; height: 340px; object-fit: cover; }
.home-hero-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(60,45,30,0.72), transparent);
  color: #fff8ec;
  padding: 30px 32px 18px;
}
.home-hero-caption h1 { color: #fff8ec; margin: 0 0 6px; }
.home-hero-caption p { margin: 0; font-style: italic; opacity: 0.92; max-width: 48ch; }

.post-list {
  display: grid;
  gap: 30px;
  padding: 0 0 48px;
}

.post-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 4px 14px var(--shadow);
}
@media (max-width: 620px) {
  .post-card { grid-template-columns: 1fr; }
}
.post-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
}
.post-card .post-eyebrow {
  font-family: 'Nunito', sans-serif;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--sage);
}
.post-card h2 {
  margin: 4px 0 8px;
  font-size: 1.7rem;
}
.post-card h2 a { color: var(--rust-deep); }
.post-card .post-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.post-card .post-excerpt { margin-bottom: 0; color: var(--ink); }
.post-card .read-more {
  font-weight: 700;
  font-size: 0.88rem;
}

/* ---------- Article / post page ---------- */

.breadcrumbs {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 18px 0 6px;
}
.breadcrumbs a { color: var(--sage-deep); }

.post .post-header { margin-bottom: 18px; }
.post .post-header h1 { font-size: 2.6rem; margin-bottom: 10px; }

.byline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.byline .byline-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--sage-pale);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  color: var(--sage-deep);
  font-size: 1rem;
}
.byline strong { color: var(--ink); }

.post-hero {
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 0 8px 22px var(--shadow);
}
.post-hero img { width: 100%; height: 420px; object-fit: cover; }

figure.post-figure { margin: 30px 0; }
figure.post-figure img { border-radius: 16px; }
figcaption {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 8px;
  font-style: italic;
}

.entry-content h2 { margin-top: 1.6em; }
.entry-content h2::before {
  content: "✂ ";
  color: var(--sage);
  font-size: 0.8em;
}
.entry-content ul li::marker { color: var(--rust); }
.entry-content ol li::marker { color: var(--sage-deep); font-weight: 700; }

.entry-content blockquote {
  border-left: 4px solid var(--sage);
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  color: var(--sage-deep);
}

/* ---------- Pattern card ---------- */

.pattern-card {
  background: var(--sage-pale);
  border: 1px solid #d7e1cc;
  border-radius: 18px;
  padding: 22px 26px;
  margin: 26px 0 32px;
}
.pattern-card h3 {
  margin-top: 0;
  color: var(--sage-deep);
}
.pattern-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px 24px;
  margin: 0;
}
.pattern-card dt {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sage-deep);
  margin: 0;
}
.pattern-card dd {
  margin: 2px 0 0;
  font-size: 0.98rem;
  color: var(--ink);
}

.abbrev-list {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 16px 22px;
  margin: 20px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 20px;
}
.abbrev-list dt { font-weight: 700; color: var(--rust-deep); display: inline; }
.abbrev-list dd { display: inline; margin: 0 0 0 6px; }
.abbrev-list div { margin-bottom: 4px; font-size: 0.92rem; }

ol.pattern-steps {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px 24px 46px;
  counter-reset: step;
}
ol.pattern-steps li {
  margin-bottom: 14px;
  font-size: 1rem;
}
ol.pattern-steps li::marker {
  color: var(--rust);
  font-family: 'Caveat', cursive;
  font-size: 1.2em;
  font-weight: 700;
}

.materials-list {
  background: var(--rust-pale);
  border-radius: 14px;
  padding: 18px 24px;
  margin: 16px 0 28px;
}
.materials-list li { margin-bottom: 6px; }

.pdf-box {
  background: var(--sage-deep);
  color: #fdf9ee;
  border-radius: 16px;
  padding: 22px 26px;
  margin: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.pdf-box p { margin: 0; }
.pdf-box .pdf-title {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 2px;
}
.pdf-box a.pdf-button {
  background: var(--rust);
  color: #fff8ec;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
}
.pdf-box a.pdf-button:hover { background: var(--rust-deep); text-decoration: none; }

/* ---------- Related posts ---------- */

.related-posts {
  margin-top: 46px;
  padding-top: 30px;
  border-top: 2px dashed var(--line);
}
.related-posts h2 { margin-top: 0; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 700px) {
  .related-grid { grid-template-columns: 1fr; }
}
.related-grid a.related-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  color: var(--ink);
}
.related-grid a.related-card:hover { text-decoration: none; border-color: var(--sage); }
.related-grid img { height: 120px; object-fit: cover; }
.related-grid .related-card-title {
  display: block;
  padding: 12px 14px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--rust-deep);
}

/* ---------- Sidebar ---------- */

.sidebar { display: flex; flex-direction: column; gap: 28px; }

.widget {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.widget h3 {
  margin-top: 0;
  font-size: 1.4rem;
  color: var(--sage-deep);
  border-bottom: 2px solid var(--sage-pale);
  padding-bottom: 8px;
}
.widget ul { list-style: none; padding-left: 0; margin: 0; }
.widget ul li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { font-weight: 700; color: var(--rust-deep); }

.shop-widget .shop-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.shop-widget .shop-item:last-child { border-bottom: none; }
.shop-widget .shop-thumb {
  width: 54px; height: 54px;
  border-radius: 10px;
  background: var(--sage-pale);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.shop-widget .shop-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  display: block;
}
.shop-widget .shop-price {
  font-size: 0.84rem;
  color: var(--rust-deep);
  font-weight: 700;
}
.shop-widget .shop-link {
  font-size: 0.8rem;
  text-decoration: underline;
}

.pin-image {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 16px var(--shadow);
  position: relative;
}
.pin-image img { width: 100%; height: 430px; object-fit: cover; }
.pin-image .pin-save {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--rust);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
}

/* ---------- Ad spaces ---------- */

.ad-space {
  background: repeating-linear-gradient(45deg, #efe8d8, #efe8d8 10px, #e7ddc8 10px, #e7ddc8 20px);
  border: 1px dashed #c9bb9a;
  border-radius: 12px;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a4987f;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 24px 0;
}
.ad-space::after { content: "advertisement"; }
.ad-space[data-ad="sidebar"] { min-height: 300px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--sage-deep);
  color: #ecf0e5;
  margin-top: 40px;
  padding: 40px 0 30px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer h4 {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  margin: 0 0 10px;
  color: #fff8ec;
}
.site-footer a { color: #d8e4cb; }
.site-footer .footer-note {
  font-size: 0.82rem;
  color: #c3d0b7;
  max-width: 420px;
}
.footer-bottom {
  text-align: center;
  font-size: 0.78rem;
  color: #a9bb9c;
  margin-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 16px;
}

/* ---------- About page ---------- */

.about-page .about-hero {
  display: flex;
  gap: 28px;
  align-items: center;
  margin: 30px 0 20px;
  flex-wrap: wrap;
}
.about-page .about-portrait {
  width: 160px; height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--paper);
  box-shadow: 0 6px 16px var(--shadow);
}

/* ---------- Skill level badges ---------- */

.skill-tag {
  display: inline-block;
  background: var(--sage);
  color: #fff;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-left: 6px;
}

/* Pubber: a filled ad container drops its placeholder styling */
.pb-filled{background:none !important;border:0 !important;min-height:0 !important;height:auto !important}
.pb-filled::before,.pb-filled::after{content:none !important;display:none !important}
