/* ──────────────────────────────────────────────────────────────────────────
   Piggie — main.css
   A clean, dependency-free stylesheet for the static scaffold. Swap the
   brand variables below to re-theme the whole site.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --brand:        #ff1493;
  --brand-dark:   #d6107b;
  --brand-light:  #ffc2e2;
  --ink:          #1a1a1a;
  --ink-soft:     #4a4a4a;
  --muted:        #767676;
  --line:         #f3cdda;
  --bg:           #ffe4ee;
  --bg-alt:       #ffd6e7;
  --bg-dark:      #1a1014;
  --radius:       12px;
  --maxw:         1100px;
  --font-sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif:   "Iowan Old Style", Georgia, "Times New Roman", serif;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

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

h1, h2, h3 { line-height: 1.2; font-weight: 700; }

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

.hidden { display: none !important; }

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand em { color: var(--brand); font-style: normal; }
.nav-brand { display: inline-flex; align-items: center; gap: .5rem; }
.nav-brand-icon {
  display: inline-block;
  width: 2rem; height: 1.6rem; flex: none;
  background-color: var(--brand);
  -webkit-mask: url("/assets/img/piggie-logo.svg") center / contain no-repeat;
  mask: url("/assets/img/piggie-logo.svg") center / contain no-repeat;
}
.nav-links {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-links a {
  color: var(--ink-soft);
  font-size: .95rem;
  font-weight: 500;
}
.nav-links a.active, .nav-links a:hover { color: var(--brand); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 4px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); display: block; }

.nav-auth { display: flex; align-items: center; }
.btn-signin {
  border: 1px solid var(--brand);
  color: var(--brand);
  border-radius: 999px;
  padding: .4rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
}
.btn-signin:hover { background: var(--brand); color: #fff; text-decoration: none; }

@media (max-width: 760px) {
  .nav-toggle { display: flex; margin-left: auto; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1rem;
  }
  .nav-links.open { display: flex; }
}

/* ── Buttons ── */
.btn-primary, .btn-outline {
  display: inline-block;
  border-radius: 999px;
  padding: .7rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid var(--brand);
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--brand); }
.btn-outline:hover { background: var(--brand-light); text-decoration: none; }

/* ── Hero ── */
.hero {
  background: linear-gradient(160deg, var(--bg-alt) 0%, var(--bg) 70%);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: 740px;
  margin: 0 auto;
  padding: 5rem 1.25rem 4rem;
  text-align: center;
}
.hero-overline {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 1rem;
}
.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin: 0 0 1rem;
  letter-spacing: -.02em;
}
.hero-headline em { color: var(--brand); font-style: italic; }
.hero-sub { font-size: 1.15rem; color: var(--ink-soft); margin: 0 auto 1.5rem; max-width: 560px; }
.hero-kicker { font-size: .9rem; color: var(--muted); margin-bottom: 1.5rem; }

/* ── Signup form ── */
.signup-form {
  display: flex;
  gap: .5rem;
  max-width: 460px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.signup-form input {
  flex: 1 1 220px;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 1rem;
}
.signup-form button {
  padding: .8rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}
.signup-form button em { font-style: normal; }
.signup-form button:hover { background: var(--brand-dark); }
.hero-note, .form-note { font-size: .85rem; color: var(--muted); margin-top: .9rem; }
.form-msg { font-size: .95rem; margin-top: .75rem; font-weight: 600; }
.form-msg.ok { color: #1b7a3d; }
.form-msg.err { color: #b3261e; }

/* ── Sections ── */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-inner, .value-section-inner, .footer-inner, .auth-card, .article-wrap, .page-wrap, .dash-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section-label {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: .5rem;
}
.section-title { font-family: var(--font-serif); font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: 0 0 .5rem; }
.section-title em { color: var(--brand); font-style: italic; }
.section-desc { color: var(--ink-soft); max-width: 620px; margin: 0 0 2rem; }

/* ── News grid ── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-img { aspect-ratio: 16/9; background: var(--bg-alt); object-fit: cover; width: 100%; }
.card-body { padding: 1rem 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .4rem; }
.card-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); font-weight: 700; }
.card-title { font-family: var(--font-serif); font-size: 1.2rem; margin: 0; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); text-decoration: none; }
.card-summary { font-size: .92rem; color: var(--ink-soft); margin: 0; }
.card-meta { font-size: .8rem; color: var(--muted); margin-top: auto; }
.empty-state { color: var(--muted); padding: 2rem 0; }

/* ── Value props ── */
.value-section { padding: 3.5rem 0; }
.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.value-card { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.value-icon { font-size: 2rem; margin-bottom: .5rem; }
.value-card h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.value-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ── Article ── */
.article-wrap { max-width: 720px; padding-top: 2.5rem; padding-bottom: 4rem; }
.article-cat { color: var(--brand); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; }
.article-headline { font-family: var(--font-serif); font-size: clamp(2rem, 5vw, 3rem); margin: .5rem 0; }
.article-sub { font-size: 1.25rem; color: var(--ink-soft); margin: 0 0 1rem; }
.article-byline { font-size: .9rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.article-body { font-size: 1.12rem; }
.article-body p { margin: 0 0 1.25rem; }
.article-loading, .article-error { text-align: center; padding: 5rem 1.25rem; color: var(--muted); }
.article-error h2 { font-family: var(--font-serif); color: var(--ink); }

/* ── Generic page (about, dashboard) ── */
.page-wrap, .dash-wrap { padding-top: 3rem; padding-bottom: 4rem; max-width: 760px; }
.page-wrap h1, .dash-wrap h1 { font-family: var(--font-serif); font-size: clamp(2rem, 5vw, 2.8rem); }
.page-wrap p { color: var(--ink-soft); }

/* ── Auth pages ── */
.auth-page-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 3rem 1.25rem; }
.auth-card {
  max-width: 400px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-family: var(--font-serif); margin: 0 0 .5rem; }
.auth-card p { color: var(--ink-soft); margin: 0 0 1.5rem; }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; padding: .8rem; margin-bottom: .75rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font-weight: 600; font-size: 1rem; cursor: pointer;
}
.auth-btn:hover { background: var(--bg-alt); }
.auth-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--brand-light); border-top-color: var(--brand);
  margin: 0 auto 1rem; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dashboard ── */
.dash-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; }
.dash-card h2 { margin: 0 0 .75rem; font-size: 1.2rem; }
.dash-field { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.dash-field:last-child { border-bottom: 0; }
.dash-field span { color: var(--muted); }

/* ── Footer ── */
footer { background: var(--bg-dark); color: #e8dde2; margin-top: 4rem; }
.footer-inner { padding: 3rem 1.25rem 2rem; }
.footer-brand { font-family: var(--font-serif); font-size: 1.6rem; display: inline-flex; align-items: center; gap: .5rem; }
.footer-brand span { color: var(--brand-light); }
.footer-brand-icon {
  display: inline-block;
  width: 2.1rem; height: 1.7rem; flex: none;
  background-color: var(--brand-light);
  -webkit-mask: url("/assets/img/piggie-logo.svg") center / contain no-repeat;
  mask: url("/assets/img/piggie-logo.svg") center / contain no-repeat;
}
.footer-tagline { color: #b59aa4; margin: .25rem 0 1.5rem; }
.footer-divider { height: 1px; background: rgba(255,255,255,.12); margin: 1.5rem 0; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 3rem; }
.footer-col { display: flex; flex-direction: column; gap: .5rem; }
.footer-col-label { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: #b59aa4; font-weight: 700; }
.footer-col a { color: #e8dde2; font-size: .92rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { margin-top: 2rem; font-size: .82rem; color: #8d7681; }
