@import url('https://fonts.googleapis.com/css?family=Lato:300,400,700&display=swap');

:root {
  --pink: #f58bb8;
  --pink-dark: #d96b9b;
  --pink-deep: #b8507f;
  --blush: #ffdce9;
  --cream: #fff8fb;
  --lavender: #e7d8ff;
  --ink: #44313d;
  --muted: #7d6470;
  --line: #f0d1df;
  --ok: #3f9a6e;
  --warn: #c98a1e;
  --danger: #c94f6a;
  --radius: 20px;
  --shadow: 0 14px 35px rgba(68, 49, 61, 0.07);
  --shadow-hover: 0 22px 50px rgba(213, 107, 155, 0.22);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: 'Lato', sans-serif;
  background: linear-gradient(135deg, var(--cream) 0%, #ffffff 100%);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
}

a {
  color: var(--pink-dark);
}

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 2rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--pink-dark);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  padding: 0.35rem 0.1rem;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--pink-dark);
}

.site-nav .nav-account {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--blush);
  color: var(--pink-dark);
  transition: background 0.2s, border-color 0.2s;
}

.site-nav .nav-account:hover,
.site-nav .nav-account.active {
  background: var(--blush);
  border-color: var(--pink);
}

/* ---------------------------------------------------------------------------
   Layout
--------------------------------------------------------------------------- */
main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
}

main.narrow {
  max-width: 560px;
}

main.wide {
  max-width: 1240px;
}

.hero {
  background: linear-gradient(120deg, var(--blush), var(--cream));
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 20px 45px rgba(213, 107, 155, 0.12);
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0.3rem 0 1rem;
  line-height: 1.15;
}

.hero-copy {
  max-width: 700px;
  font-size: 1.05rem;
  color: var(--muted);
}

.eyebrow {
  color: var(--pink-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin: 0 0 0.3rem;
}

.page-intro {
  margin-bottom: 1.75rem;
}

.page-intro h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0.2rem 0 0.6rem;
  line-height: 1.15;
}

/* ---------------------------------------------------------------------------
   Buttons & links
--------------------------------------------------------------------------- */
.button,
.text-link {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  line-height: 1.2;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.button {
  background: var(--pink);
  color: white;
  box-shadow: 0 8px 20px rgba(245, 139, 184, 0.35);
}

.button:hover {
  background: var(--pink-dark);
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.button.ghost {
  background: white;
  color: var(--pink-dark);
  border: 2px solid var(--blush);
  box-shadow: none;
}

.button.ghost:hover {
  background: var(--blush);
}

.button.danger {
  background: white;
  color: var(--danger);
  border: 2px solid #f6d5dd;
  box-shadow: none;
}

.button.danger:hover {
  background: #fdeef2;
}

.button.small {
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  margin-top: 0;
}

.button.block {
  display: block;
  width: 100%;
  text-align: center;
}

.text-link {
  color: var(--pink-dark);
  padding-left: 0;
}

.back-link a,
.edit-link a {
  text-decoration: none;
  font-weight: 700;
}

/* ---------------------------------------------------------------------------
   Cards
--------------------------------------------------------------------------- */
.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.featured-card,
.sidebar-card,
.blog-card,
.about-card,
.blog-list-card,
.card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.featured-card h2 {
  margin: 0.2rem 0 0.6rem;
  font-size: 1.7rem;
  line-height: 1.2;
}

.featured-card h2 a,
.recent-list a {
  color: inherit;
  text-decoration: none;
}

.featured-card h2 a:hover,
.recent-list a:hover {
  color: var(--pink-dark);
}

.featured-card .meta {
  margin-bottom: 0.8rem;
}

.sidebar-card ul,
.recent-list {
  padding-left: 1rem;
  color: var(--muted);
  margin: 0.6rem 0 0;
}

.recent-list {
  list-style: none;
  padding-left: 0;
}

.recent-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.recent-list li:last-child {
  border-bottom: 0;
}

.recent-list a {
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.recent-list .meta {
  font-size: 0.85rem;
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.info-strip > div {
  background: var(--lavender);
  padding: 1.2rem;
  border-radius: 16px;
}

.info-strip h3 {
  margin: 0 0 0.3rem;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.2rem 0;
}

.about-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: start;
}

.about-card p,
.blog-list-card p {
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Blog collection — large, fully clickable cards
--------------------------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-height: 380px;
  background: white;
  border-radius: 24px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover,
.post-card:focus-visible {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  outline-offset: 0;
}

.post-card:active {
  transform: translateY(-2px);
}

.post-card-media {
  height: 190px;
  background: linear-gradient(135deg, var(--blush), var(--lavender));
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card-media img {
  transform: scale(1.04);
}

.post-card-media .initial {
  font-size: 4rem;
  font-weight: 700;
  color: rgba(217, 107, 155, 0.45);
  letter-spacing: 0.05em;
}

.post-card-body {
  padding: 1.5rem 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.post-card-body .eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.post-card h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.22;
  color: var(--pink-deep);
  transition: color 0.2s;
}

.post-card:hover h2 {
  color: var(--pink-dark);
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.post-card .card-foot {
  margin-top: auto;
  padding-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.post-card .read-more {
  font-weight: 700;
  color: var(--pink-dark);
  white-space: nowrap;
}

.post-card.featured {
  grid-column: 1 / -1;
  min-height: 300px;
}

@media (min-width: 800px) {
  .post-card.featured {
    flex-direction: row;
  }

  .post-card.featured .post-card-media {
    height: auto;
    width: 46%;
  }

  .post-card.featured .post-card-body {
    padding: 2.2rem 2.4rem;
    justify-content: center;
  }

  .post-card.featured h2 {
    font-size: 2.1rem;
  }
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--blush);
  color: var(--pink-deep);
}

.badge.draft {
  background: #fff1d6;
  color: #8a5a00;
}

.badge.published {
  background: #dff5e9;
  color: #1f6b47;
}

.badge.new {
  background: var(--lavender);
  color: #5a3f8f;
}

.badge.used {
  background: #dff5e9;
  color: #1f6b47;
}

.badge.saved {
  background: #fff1d6;
  color: #8a5a00;
}

.badge.dismissed {
  background: #eee;
  color: #666;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.chip {
  border: 2px solid var(--blush);
  background: white;
  color: var(--pink-deep);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.chip[aria-pressed="true"],
.chip:hover {
  background: var(--blush);
  border-color: var(--pink);
}

/* ---------------------------------------------------------------------------
   Single post
--------------------------------------------------------------------------- */
.post-article {
  max-width: 760px;
  margin: 0 auto;
}

.post-head h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  margin: 0.2rem 0 0.6rem;
}

.post-cover {
  margin: 1.5rem 0 0;
}

.post-cover img {
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.post-body {
  background: white;
  border-radius: 24px;
  padding: clamp(1.4rem, 4vw, 2.6rem);
  margin-top: 1.5rem;
  box-shadow: var(--shadow);
  font-size: 1.08rem;
  line-height: 1.8;
}

.post-body > :first-child {
  margin-top: 0;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  color: var(--pink-deep);
  line-height: 1.25;
  margin: 1.8em 0 0.5em;
}

.post-body h2 {
  font-size: 1.6rem;
}

.post-body h3 {
  font-size: 1.3rem;
}

.post-body p {
  margin: 0 0 1.1em;
}

.post-body blockquote {
  margin: 1.4em 0;
  padding: 0.8em 1.2em;
  border-left: 4px solid var(--pink);
  background: var(--cream);
  border-radius: 0 16px 16px 0;
  color: var(--muted);
  font-style: italic;
}

.post-body blockquote p:last-child {
  margin-bottom: 0;
}

.post-body ul,
.post-body ol {
  padding-left: 1.4em;
  margin: 0 0 1.1em;
}

.post-body li {
  margin-bottom: 0.35em;
}

.post-body img {
  border-radius: 16px;
  display: block;
  margin: 0.5em auto;
}

.post-body figure {
  margin: 1.5em 0;
}

.post-body figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.4em;
}

.post-body hr {
  border: 0;
  border-top: 2px dashed var(--line);
  margin: 2em 0;
}

.post-body code {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  font-size: 0.92em;
}

.post-body pre {
  background: #fdf3f7;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1em 1.2em;
  overflow-x: auto;
}

.post-body pre code {
  border: 0;
  padding: 0;
  background: none;
}

.post-foot {
  text-align: center;
  margin: 2rem 0 1rem;
}

.notice {
  background: #fff1d6;
  color: #8a5a00;
  border-radius: 14px;
  padding: 0.8rem 1.1rem;
  margin: 0 0 1.2rem;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Forms
--------------------------------------------------------------------------- */
.field {
  display: block;
  margin-bottom: 1rem;
  font-weight: 700;
}

.field .hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.3rem;
}

.field .hint strong {
  color: var(--pink-deep);
  font-weight: 700;
}

.field .hint code {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 0.3em;
  font-size: 0.95em;
}

/* An invalid field only turns pink once the visitor has actually typed. */
.input:not(:placeholder-shown):invalid {
  border-color: var(--danger);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  margin-top: 0.35rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  background: var(--cream);
  color: var(--ink);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(245, 139, 184, 0.2);
  background: white;
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.textarea.editor {
  min-height: 46vh;
  font-size: 1.02rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  margin: 0.4rem 0 1rem;
  cursor: pointer;
}

.check input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--pink-dark);
}

.form-error {
  color: var(--danger);
  font-weight: 600;
  margin: 0.3rem 0 0.8rem;
  min-height: 1.2em;
}

.tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: var(--blush);
  margin-bottom: 1.4rem;
}

.tabs button {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pink-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.tabs button[aria-selected="true"] {
  background: white;
  box-shadow: 0 6px 16px rgba(213, 107, 155, 0.18);
}

.auth-shell h1 {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  margin: 0.2rem 0 0.4rem;
  text-align: center;
}

.auth-shell .lede {
  text-align: center;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.tiny {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-top: 1.2rem;
}

.row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.row.between {
  justify-content: space-between;
}

.stack > * + * {
  margin-top: 1rem;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

.empty .big {
  font-size: 2.4rem;
  margin-bottom: 0.4rem;
}

.skeleton {
  background: linear-gradient(90deg, #fbe9f1 0%, #fff4f9 50%, #fbe9f1 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--radius);
  min-height: 120px;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------------------------------------------------------------------------
   Account & admin
--------------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  background: var(--lavender);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}

.stat .n {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--pink-deep);
}

.stat .l {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.list-item:last-child {
  border-bottom: 0;
}

.list-item .title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  display: block;
}

.list-item .title:hover {
  color: var(--pink-dark);
}

.list-item .grow {
  flex: 1;
  min-width: 0;
}

.list-item .actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.admin-bar h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.5rem;
  align-items: start;
}

.editor-side {
  position: sticky;
  top: 5.5rem;
}

.preview-pane {
  max-height: 75vh;
  overflow: auto;
}

.preview-pane .post-body {
  margin-top: 0;
  box-shadow: none;
  padding: 0;
  font-size: 1rem;
}

.editor-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
}

.editor-actions .button {
  margin-top: 0;
}

.md-help {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.4rem 0 0;
}

.md-help code {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 0.3em;
}

.upload-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.upload-row input[type="file"] {
  display: none;
}

.cover-preview {
  margin-top: 0.6rem;
  max-height: 180px;
  border-radius: 14px;
  object-fit: cover;
  width: 100%;
}

/* ---------------------------------------------------------------------------
   Toasts
--------------------------------------------------------------------------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  display: grid;
  gap: 0.5rem;
  z-index: 100;
  width: min(92vw, 420px);
}

.toast {
  background: var(--ink);
  color: white;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  box-shadow: 0 14px 35px rgba(68, 49, 61, 0.25);
  font-weight: 600;
  animation: toast-in 0.25s ease;
  cursor: pointer;
}

.toast.ok { background: var(--pink-deep); }
.toast.err { background: var(--danger); }
.toast.out { opacity: 0; transition: opacity 0.25s; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------------
   Footer — compact "share a new idea" box + credits
--------------------------------------------------------------------------- */
.site-footer {
  margin-top: 2rem;
  padding: 1.6rem 2rem 1.4rem;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid #f6dce7;
  color: var(--muted);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem 3rem;
  align-items: center;
}

.idea-form {
  margin: 0;
}

.idea-label {
  display: block;
  font-weight: 700;
  color: var(--pink-deep);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.idea-row {
  display: flex;
  gap: 0.5rem;
}

.idea-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font: inherit;
  background: var(--cream);
  color: var(--ink);
}

.idea-row input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(245, 139, 184, 0.2);
  background: white;
}

.idea-row .button {
  margin-top: 0;
  padding: 0.65rem 1.1rem;
}

.idea-status {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  min-height: 1.2em;
}

.idea-status.ok {
  color: var(--ok);
  font-weight: 700;
}

.idea-status.err {
  color: var(--danger);
  font-weight: 700;
}

.footer-meta {
  text-align: right;
  font-size: 0.92rem;
}

.footer-meta p {
  margin: 0.15rem 0;
}

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */
@media (max-width: 800px) {
  .featured-grid,
  .about-content,
  .info-strip,
  .editor-layout,
  .field-row {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    position: static;
  }

  .site-nav {
    justify-content: center;
    gap: 0.8rem 1rem;
  }

  main {
    padding: 1.4rem 1.1rem;
  }

  .hero {
    padding: 2rem 1.5rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .post-card {
    min-height: 0;
  }

  .post-card h2 {
    font-size: 1.45rem;
  }

  .editor-side {
    position: static;
  }

  .site-footer {
    grid-template-columns: 1fr;
    padding: 1.4rem 1.2rem;
    gap: 1rem;
  }

  .footer-meta {
    text-align: center;
  }

  .list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-item .actions {
    justify-content: flex-start;
  }
}
