/* ===========================================================================
   me2free.com — warm & calming theme
   Palette: soft cream canvas, sage green, warm terracotta accent, slate ink.
   Light + dark via [data-theme] on <html>.
   =========================================================================== */

:root {
  /* Brand */
  --sage:        #6b8f71;
  --sage-deep:   #4f6f56;
  --terracotta:  #c9764f;
  --terracotta-deep: #b15f3a;

  /* Light theme surfaces & ink */
  --bg:          #faf6f0;
  --bg-alt:      #f1e9df;
  --surface:     #ffffff;
  --ink:         #2f3a33;
  --ink-soft:    #5d6b63;
  --muted:       #84908a;
  --border:      #e6dccf;
  --accent:      var(--terracotta);
  --accent-deep: var(--terracotta-deep);
  --brand:       var(--sage-deep);
  --link:        var(--terracotta-deep);
  --shadow:      0 1px 2px rgba(47,58,51,.05), 0 8px 24px rgba(47,58,51,.06);

  /* Type */
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --maxw: 1120px;
  --maxw-narrow: 720px;
  --radius: 14px;
  --radius-sm: 9px;
  --space: clamp(1rem, 2vw, 1.5rem);
}

[data-theme="dark"] {
  --bg:          #1c211e;
  --bg-alt:      #232925;
  --surface:     #262d28;
  --ink:         #e9e6df;
  --ink-soft:    #b9c0b8;
  --muted:       #8a948c;
  --border:      #353d37;
  --accent:      #e0916b;
  --accent-deep: #e8a585;
  --brand:       #9cbf9f;
  --link:        #e0916b;
  --shadow:      0 1px 2px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.3);
}

/* --------------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; color: var(--ink); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space); }
.container-narrow { max-width: var(--maxw-narrow); }
.muted { color: var(--muted); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font-sans); font-weight: 600; font-size: .975rem;
  padding: .7rem 1.3rem; border-radius: 100px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s ease, background-color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ------------------------------------------------------------------- Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.brand { text-decoration: none; margin-right: auto; display: inline-flex; align-items: center; gap: .55rem; }
.brand-logo { display: block; border-radius: 9px; width: 36px; height: 36px; }
.brand-mark {
  font-family: var(--font-serif); font-weight: 600; font-size: 1.5rem;
  color: var(--brand); letter-spacing: -.01em;
}
.brand-accent { color: var(--accent); }

.primary-nav { display: flex; align-items: center; gap: 1.25rem; }
.primary-nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.primary-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .975rem; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--accent); }

.nav-search input {
  font: inherit; font-size: .9rem; padding: .45rem .85rem; width: 9rem;
  border: 1.5px solid var(--border); border-radius: 100px; background: var(--surface); color: var(--ink);
  transition: width .2s ease, border-color .2s ease;
}
.nav-search input:focus { outline: none; width: 12rem; border-color: var(--brand); }

.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: transparent; border: 1.5px solid var(--border); border-radius: 50%;
  color: var(--ink-soft); cursor: pointer; transition: border-color .2s, color .2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }

/* --------------------------------------------------------------------- Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 4rem); text-align: center; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--brand); margin: 0 0 1rem; }
.hero-title { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0 0 1rem; letter-spacing: -.02em; }
.hero-lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--ink-soft); margin: 0 auto 2rem; max-width: 38rem; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ----------------------------------------------------------------- Sections */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1.8rem; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* -------------------------------------------------------------------- Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(47,58,51,.12); }
.card-media img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.card-body { padding: 1.4rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card-cat { font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); text-decoration: none; }
.card-title { font-size: 1.25rem; margin: 0; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-desc { color: var(--ink-soft); font-size: .95rem; margin: 0; flex: 1; }
.card-meta { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); margin: 0; }

/* ------------------------------------------------------------ Topic chips/cards */
.topic-chips { display: flex; flex-wrap: wrap; gap: .7rem; }
.topic-chip {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 100px;
  padding: .55rem 1.1rem; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .95rem;
  transition: border-color .2s, color .2s, background-color .2s;
}
.topic-chip:hover { border-color: var(--brand); color: var(--brand); }

.topic-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.8rem; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s;
}
.topic-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(47,58,51,.12); }
.topic-card-title { margin: 0 0 .6rem; font-size: 1.4rem; color: var(--brand); }
.topic-card-desc { margin: 0 0 1rem; color: var(--ink-soft); }
.topic-card-count { margin: 0; font-weight: 600; color: var(--accent); font-size: .9rem; }

/* ------------------------------------------------------------- Page headings */
.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 0; }
.page-title { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .8rem; letter-spacing: -.02em; }
.page-lede { font-size: 1.2rem; color: var(--ink-soft); margin: 0; }

.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--brand); text-decoration: none; }

/* ------------------------------------------------------------------ Article */
.article-header { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; }
.article-title { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 1rem; letter-spacing: -.02em; }
.article-lede { font-size: 1.25rem; color: var(--ink-soft); margin: 0 0 1.2rem; }
.article-meta { display: flex; gap: 1.2rem; color: var(--muted); font-size: .9rem; margin: 0; }
.article-hero { border-radius: var(--radius); margin: 1.5rem 0; width: 100%; }

.article-body { padding-bottom: 4rem; font-size: 1.1rem; }
.article-body > p:first-of-type { font-size: 1.18rem; }
.article-body h2 { font-size: 1.7rem; margin: 2.4rem 0 1rem; }
.article-body h3 { font-size: 1.3rem; margin: 2rem 0 .8rem; }
.article-body p { margin: 0 0 1.3rem; }
.article-body ul, .article-body ol { margin: 0 0 1.3rem; padding-left: 1.4rem; }
.article-body li { margin-bottom: .5rem; }
.article-body blockquote {
  margin: 2rem 0; padding: .5rem 0 .5rem 1.5rem; border-left: 4px solid var(--sage);
  color: var(--ink-soft); font-style: italic; font-size: 1.15rem;
}
.article-body img { border-radius: var(--radius); margin: 1.5rem 0; }
.article-body code {
  background: var(--bg-alt); padding: .15em .4em; border-radius: 5px; font-size: .9em;
}
.article-body pre { background: var(--bg-alt); padding: 1.2rem; border-radius: var(--radius-sm); overflow-x: auto; }
.article-body pre code { background: none; padding: 0; }
.article-body .headerlink { opacity: 0; margin-left: .4rem; text-decoration: none; }
.article-body h2:hover .headerlink, .article-body h3:hover .headerlink { opacity: .5; }
.article-body hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ------------------------------------------------------------- Book CTA block */
.book-cta {
  display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--bg-alt), color-mix(in srgb, var(--sage) 12%, var(--bg-alt)));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; margin: 2.8rem 0;
}
.book-cta-cover { flex: 0 0 130px; }
.book-cta-cover img { border-radius: var(--radius-sm); box-shadow: 0 10px 24px rgba(47,58,51,.18); width: 130px; }
.book-cta-body { flex: 1; min-width: 220px; }
.book-cta-eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 700; color: var(--brand); margin: 0 0 .4rem; }
.book-cta-title { font-size: 1.5rem; margin: 0 0 .2rem; }
.book-cta-subtitle { font-size: 1rem; color: var(--ink-soft); margin: 0 0 .8rem; font-style: italic; }
.book-cta-blurb { font-size: .98rem; color: var(--ink-soft); margin: 0 0 1.2rem; }

/* ------------------------------------------------------------- Share button */
.share-cta {
  display: inline-flex; align-items: center; gap: .6rem;
  margin: 2.8rem 0 0; padding: .85rem 1.4rem;
  font-family: var(--font-sans); font-size: 1rem; font-weight: 600;
  color: var(--brand); background: var(--bg-alt);
  border: 1.5px dashed var(--border); border-radius: 100px;
  cursor: pointer; transition: border-color .2s, color .2s, background-color .2s, transform .15s;
}
.share-cta:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.share-cta:active { transform: translateY(0); }
.share-cta-default { display: inline-flex; align-items: center; gap: .6rem; }
.share-cta-icon { flex: none; }
.share-cta-done { display: none; color: var(--sage-deep); }
.share-cta.is-copied { border-style: solid; border-color: var(--sage); color: var(--sage-deep); cursor: default; }
.share-cta.is-copied .share-cta-default { display: none; }
.share-cta.is-copied .share-cta-done { display: inline; }
[data-theme="dark"] .share-cta.is-copied { color: var(--brand); }

/* ------------------------------------------------------------------ Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: .6rem; margin: 2.5rem 0 0; }
.tag {
  font-size: .85rem; background: var(--bg-alt); border-radius: 100px; padding: .35rem .9rem;
  text-decoration: none; color: var(--ink-soft);
}
.tag:hover { color: var(--accent); }

/* ------------------------------------------------------------------ Search */
.search-page-form { display: flex; gap: .7rem; margin-top: 1.5rem; }
.search-page-form input {
  flex: 1; font: inherit; padding: .8rem 1.1rem; border: 1.5px solid var(--border);
  border-radius: 100px; background: var(--surface); color: var(--ink);
}
.search-page-form input:focus { outline: none; border-color: var(--brand); }
.search-results { display: flex; flex-direction: column; gap: 1.2rem; }
.search-result {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
}
.search-result h3 { margin: 0 0 .3rem; font-size: 1.2rem; }
.search-result h3 a { color: var(--ink); text-decoration: none; }
.search-result h3 a:hover { color: var(--accent); }
.search-result .sr-cat { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); font-weight: 600; }
.search-result p { margin: .3rem 0 0; color: var(--ink-soft); font-size: .95rem; }
.search-result mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 .1em; }

/* ------------------------------------------------------------------ Footer */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); margin-top: 2rem; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding: 3rem var(--space) 2rem; }
.footer-brand-row { display: inline-flex; align-items: center; gap: .55rem; }
.footer-brand-row .brand-logo { width: 34px; height: 34px; }
.footer-tagline { color: var(--ink-soft); margin: .7rem 0 0; max-width: 22rem; }
.footer-col h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 1rem; font-family: var(--font-sans); font-weight: 700; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.footer-col a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.5rem var(--space); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-bottom p { margin: 0; font-size: .85rem; color: var(--muted); }
.footer-fineprint { max-width: 30rem; }
.footer-fineprint a { color: var(--brand); }

/* ------------------------------------------------------------- Responsive */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 1rem; background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 1.5rem var(--space); transform: translateY(-130%); transition: transform .28s ease;
  }
  .primary-nav.open { transform: translateY(0); }
  .primary-nav ul { flex-direction: column; gap: 1rem; }
  .nav-search input, .nav-search { width: 100%; }
  .nav-search input { width: 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .book-cta { flex-direction: column; text-align: center; }
  .book-cta-cover { flex-basis: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
