/*
Theme Name: My Knitting Era
Theme URI: https://myknittingera.com
Author: My Knitting Era
Author URI: https://myknittingera.com
Description: A cottagecore WordPress theme for showcasing handmade knitted charms — keychains, badge clips, bag and zipper pulls. Warm earth tones, soft greens, and a hand-stitched feel, with a gallery-first homepage and a cozy journal/blog.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: my-knitting-era
Tags: custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, blog, e-commerce

My Knitting Era is released under the GPLv2 (or later).
This theme bundles the Fraunces and Karla typefaces (OFL) loaded from Google Fonts.
*/

/* =========================================================
   DESIGN TOKENS
   Palette:
     --cream      #F6EFE3  page background, the "linen" base
     --paper      #FFFCF6  card background, slightly lighter
     --ink        #3E2C23  primary text, warm walnut brown
     --moss       #5C6E49  primary accent, sage/moss green
     --moss-dark  #45533A  hover/active green
     --honey      #C77B3F  secondary accent, honey/terracotta (the bee!)
     --rose       #C98B8B  tertiary accent, dusty rose (from the bunny charms)
     --sage-line  #A8B89A  hairline / divider tone
   Type:
     Display: 'Fraunces' (warm, slightly wonky serif — feels hand-set)
     Body:    'Karla' (clean humanist sans, easy to read for product copy)
     Script:  'Caveat' (used sparingly for little handwritten tags/labels)
   Signature element: a hand-drawn "yarn thread" wave divider (SVG, .yarn-divider)
   that stitches sections together, echoing the ball-of-yarn logo.
   ========================================================= */

:root {
  --cream: #F6EFE3;
  --paper: #FFFCF6;
  --ink: #3E2C23;
  --ink-soft: #6B5848;
  --moss: #5C6E49;
  --moss-dark: #45533A;
  --honey: #C77B3F;
  --rose: #C98B8B;
  --sage-line: #A8B89A;
  --radius: 18px;
  --radius-sm: 10px;
  --container: 1180px;
  --shadow-soft: 0 10px 30px -12px rgba(62, 44, 35, 0.18);
}

@media (prefers-color-scheme: dark) {
  /* Theme is intentionally light/cottage — no forced dark mode override. */
}

/* RESET / BASE */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(168,184,154,0.16) 0, transparent 40%),
    radial-gradient(circle at 92% 80%, rgba(199,123,63,0.10) 0, transparent 45%);
  color: var(--ink);
  font-family: 'Karla', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
a { color: var(--moss-dark); text-decoration: none; }
a:hover { color: var(--honey); }
h1, h2, h3, h4 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; line-height: 1.15; color: var(--ink); margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; color: var(--ink-soft); }
.tag-script { font-family: 'Caveat', cursive; font-size: 1.5rem; color: var(--honey); display: inline-block; transform: rotate(-2deg); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.visually-hidden { position: absolute !important; clip: rect(1px,1px,1px,1px); overflow: hidden; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 3px; border-radius: 6px; }
button, .btn { font-family: 'Karla', sans-serif; font-weight: 700; cursor: pointer; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(246,239,227,0.92); backdrop-filter: blur(6px); border-bottom: 1px solid rgba(92,110,73,0.18); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; max-width: var(--container); margin: 0 auto; gap: 24px; }
.site-branding { display: flex; align-items: center; gap: 12px; }
.site-branding img.custom-logo { max-height: 58px; width: auto; border-radius: 50%; }
.site-title { font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 600; margin: 0; color: var(--ink); }
.site-title a { color: inherit; }
.site-description { font-family: 'Caveat', cursive; font-size: 1.1rem; color: var(--moss-dark); margin: -4px 0 0; }
.main-navigation ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.main-navigation a { font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink); padding: 6px 2px; border-bottom: 2px solid transparent; }
.main-navigation a:hover, .main-navigation .current-menu-item > a { color: var(--moss-dark); border-bottom-color: var(--honey); }
.menu-toggle { display: none; background: none; border: none; font-size: 1.6rem; color: var(--ink); }
@media (max-width: 800px) {
  .main-navigation { display: none; width: 100%; }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { flex-direction: column; gap: 4px; padding: 14px 0; }
  .menu-toggle { display: block; }
  .site-header__inner { flex-wrap: wrap; }
}

.yarn-divider { display: block; width: 100%; height: 34px; margin: 0; color: var(--sage-line); }
.yarn-divider--honey { color: var(--honey); }
.yarn-divider svg { width: 100%; height: 100%; display: block; }

.hero { padding: 64px 28px 40px; text-align: center; position: relative; }
.hero__eyebrow { font-family: 'Caveat', cursive; font-size: 1.4rem; color: var(--honey); display: block; margin-bottom: 6px; }
.hero h1 { max-width: 760px; margin: 0 auto 0.4em; }
.hero p.lede { max-width: 560px; margin: 0 auto 1.6em; font-size: 1.1rem; }
.hero__ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-block; padding: 13px 28px; border-radius: 999px; border: 2px solid transparent; font-size: 0.95rem; letter-spacing: 0.02em; transition: transform .15s ease, background .2s ease; }
.btn--primary { background: var(--moss); color: #fff; }
.btn--primary:hover { background: var(--moss-dark); transform: translateY(-1px); color: #fff; }
.btn--ghost { border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.charm-intro { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.charm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px; padding: 0 0 50px; }
.charm-card { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); transition: transform .2s ease, box-shadow .2s ease; border: 1px solid rgba(92,110,73,0.12); }
.charm-card:hover { transform: translateY(-5px) rotate(-0.3deg); box-shadow: 0 18px 36px -14px rgba(62,44,35,0.28); }
.charm-card__media { aspect-ratio: 1/1; overflow: hidden; background: #ECE4D2; position: relative; }
.charm-card__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.charm-card__body { padding: 16px 18px 20px; }
.charm-card__body h3 { margin-bottom: 4px; font-size: 1.15rem; }
.charm-card__meta { font-size: 0.85rem; color: var(--moss-dark); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.charm-card__price { font-family: 'Fraunces', serif; color: var(--honey); font-size: 1.05rem; margin-top: 6px; }
.charm-card a.shop-link { display: inline-block; margin-top: 10px; font-weight: 700; font-size: 0.88rem; color: var(--moss-dark); border-bottom: 1px dashed var(--moss); }
.charm-card a.shop-link:hover { color: var(--honey); border-color: var(--honey); }
.badge-etsy { position: absolute; top: 10px; right: 10px; background: var(--honey); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; letter-spacing: 0.03em; }

.story-strip { background: var(--moss); color: #fff; padding: 56px 28px; border-radius: var(--radius); margin: 10px auto 60px; max-width: var(--container); }
.story-strip .container { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 0; }
.story-strip h2 { color: #fff; }
.story-strip p { color: rgba(255,255,255,0.88); }
.story-strip img { border-radius: var(--radius); box-shadow: var(--shadow-soft); }
@media (max-width: 760px) { .story-strip .container { grid-template-columns: 1fr; } }

.journal-section { padding: 10px 0 70px; }
.journal-section .section-heading { text-align: center; max-width: 600px; margin: 0 auto 40px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 28px; }
.post-card { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); border: 1px solid rgba(92,110,73,0.12); }
.post-card__media { aspect-ratio: 16/10; overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.post-card__body { padding: 18px 20px 22px; }
.post-card__date { font-family: 'Caveat', cursive; color: var(--honey); font-size: 1.1rem; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--moss-dark); }
.post-card p { font-size: 0.96rem; }
.read-more { font-weight: 700; font-size: 0.88rem; }

.single-wrap, .page-wrap { max-width: 760px; margin: 0 auto; padding: 50px 28px 80px; }
.single-wrap .entry-header, .page-wrap .entry-header { margin-bottom: 28px; }
.entry-meta { font-family: 'Caveat', cursive; font-size: 1.15rem; color: var(--honey); }
.entry-content figure { margin: 28px 0; }
.entry-content blockquote { border-left: 4px solid var(--moss); margin: 24px 0; padding: 4px 0 4px 20px; color: var(--ink-soft); font-style: italic; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.post-tags { margin-top: 30px; font-size: 0.9rem; }
.post-tags a { background: var(--cream); border: 1px solid var(--sage-line); padding: 4px 12px; border-radius: 999px; margin: 0 6px 6px 0; display: inline-block; }

.archive-wrap { max-width: var(--container); margin: 0 auto; padding: 40px 28px 80px; }

.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 40px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--sage-line); font-size: 0.9rem; }
.pagination .current { background: var(--moss); color: #fff; border-color: var(--moss); }

.comment-list { list-style: none; padding: 0; margin: 30px 0; }
.comment-list li { background: var(--paper); border-radius: var(--radius-sm); padding: 18px; margin-bottom: 14px; border: 1px solid rgba(92,110,73,0.12); }
.comment-form input, .comment-form textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--sage-line); border-radius: var(--radius-sm); font-family: 'Karla', sans-serif; margin-bottom: 14px; background: var(--paper); }
.comment-form label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; }

.search-form { display: flex; gap: 10px; margin: 0 0 20px; }
.search-form input[type="search"] { flex: 1; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--sage-line); font-family: 'Karla', sans-serif; }
.search-form button { background: var(--moss); color: #fff; border-radius: 999px; padding: 10px 22px; border: none; }

.widget-area { margin-top: 50px; }
.widget { background: var(--paper); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 24px; border: 1px solid rgba(92,110,73,0.12); }
.widget h2.widget-title { font-size: 1.05rem; margin-bottom: 14px; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 6px 0; border-bottom: 1px dashed var(--sage-line); }
.widget li:last-child { border-bottom: none; }

.cta-strip { text-align: center; padding: 60px 28px; background: var(--paper); border-top: 1px solid rgba(92,110,73,0.15); border-bottom: 1px solid rgba(92,110,73,0.15); }
.cta-strip h2 { margin-bottom: 0.3em; }
.cta-strip p { max-width: 480px; margin: 0 auto 22px; }

.site-footer { background: var(--ink); color: rgba(255,255,255,0.85); padding: 50px 28px 30px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; max-width: var(--container); margin: 0 auto 30px; }
.footer-grid h2, .footer-grid h3 { color: #fff; }
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: var(--honey); }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-brand img { max-height: 46px; border-radius: 50%; }
.footer-socials { display: flex; gap: 14px; margin-top: 14px; }
.footer-socials a { font-weight: 700; border: 1px solid rgba(255,255,255,0.3); border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 4px 0; }
.footer-bottom { max-width: var(--container); margin: 0 auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.15); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.85rem; color: rgba(255,255,255,0.6); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: none; width: 100%; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
