/* ================================================================
   ED DAVIES — GLOBAL DESIGN SYSTEM
   All design tokens, resets, shared components (nav, footer),
   and utility classes. Page-specific styles live in each template.
================================================================ */

/* ---------------------------------------------------------------
   TOKENS
--------------------------------------------------------------- */
:root {
  --ink:          #1a1a18;
  --ink-mid:      #4a4a45;
  --ink-light:    #8a8a82;
  --paper:        #f5f2eb;
  --paper-dark:   #ede9df;
  --accent:       #2c4a3e;
  --accent-light: #e8f0ed;
  --rule:         rgba(26,26,24,0.12);

  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-body:    'DM Sans', sans-serif;

  --max-w: 1100px;
  --gutter: 5vw;
}

/* ---------------------------------------------------------------
   RESET & BASE
--------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------------
   NAVIGATION
--------------------------------------------------------------- */
.ed-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.ed-nav__logo {
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.ed-nav__links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.ed-nav__links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-mid);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.ed-nav__links a:hover,
.ed-nav__links a[aria-current="page"] { color: var(--ink); }

.ed-nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.ed-nav__toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}

/* Mobile nav */
@media (max-width: 768px) {
  .ed-nav__toggle { display: flex; }

  .ed-nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

  .ed-nav__links.is-open { display: flex; }

  .ed-nav__links a {
    display: block;
    padding: 14px var(--gutter);
    font-size: 16px;
    border-bottom: 1px solid var(--rule);
  }

  .ed-nav__links li:last-child a { border-bottom: none; }
}

/* ---------------------------------------------------------------
   FOOTER
--------------------------------------------------------------- */
.ed-footer {
  background: var(--ink);
  border-top: 1px solid rgba(245,242,235,0.1);
  padding: 32px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.ed-footer__logo {
  font-family: var(--ff-display);
  font-size: 16px;
  color: var(--paper);
  opacity: 0.7;
  text-decoration: none;
}

.ed-footer__links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.ed-footer__links a {
  font-size: 13px;
  color: rgba(245,242,235,0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.ed-footer__links a:hover { color: var(--paper); }

@media (max-width: 768px) {
  .ed-footer { flex-direction: column; align-items: center; text-align: center; }
}

/* ---------------------------------------------------------------
   SHARED SECTION UTILITIES
--------------------------------------------------------------- */
.ed-section {
  padding: 80px var(--gutter);
}

.ed-section--dark {
  background: var(--paper-dark);
}

.ed-section--ink {
  background: var(--ink);
}

.ed-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.ed-section-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ed-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 200px;
}

/* ---------------------------------------------------------------
   SHARED BUTTON STYLES
--------------------------------------------------------------- */
.btn-primary {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 14px 28px;
  font-family: var(--ff-body);
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.2s;
  line-height: 1;
}

.btn-primary:hover { background: var(--accent); color: var(--paper); }

.btn-secondary {
  display: inline-block;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-mid);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.btn-secondary:hover { color: var(--ink); border-color: var(--ink); }

.btn-light {
  display: inline-block;
  background: var(--paper);
  color: var(--ink);
  padding: 16px 36px;
  font-family: var(--ff-body);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: background 0.2s;
}

.btn-light:hover { background: var(--accent-light); color: var(--ink); }

.btn-ghost {
  display: inline-block;
  border: 1px solid rgba(245,242,235,0.4);
  color: var(--paper);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  border-color: var(--paper);
  background: rgba(245,242,235,0.1);
  color: var(--paper);
}

/* ---------------------------------------------------------------
   RULED GRID (pain points, writing cards)
--------------------------------------------------------------- */
.ruled-grid {
  display: grid;
  gap: 1px;
  background: var(--rule);
}

.ruled-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ruled-grid--2 { grid-template-columns: repeat(2, 1fr); }

.ruled-grid__cell {
  background: var(--paper);
  padding: 32px 28px;
}

.ruled-grid__cell--dark { background: var(--paper-dark); }

@media (max-width: 768px) {
  .ruled-grid--3,
  .ruled-grid--2 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------
   FADE-UP ANIMATION
--------------------------------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------------
   BLOG POST STYLES (used in writing.php and single.php)
--------------------------------------------------------------- */
.ed-post-content {
  max-width: 680px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-mid);
}

.ed-post-content h2 {
  font-family: var(--ff-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
  margin: 48px 0 20px;
  line-height: 1.3;
}

.ed-post-content h3 {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  margin: 36px 0 16px;
}

.ed-post-content p { margin-bottom: 24px; }

.ed-post-content strong { font-weight: 500; color: var(--ink); }

.ed-post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ed-post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 24px;
  margin: 32px 0;
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
  line-height: 1.5;
}
