/* =========================================================
   Writers Hub Dashboard / Auth Styles
   ========================================================= */

:root {
  --dashboard-cream: #fffaf1;
  --dashboard-bg: #f8f3ea;
  --dashboard-ink: #1e1b18;
  --dashboard-ink-soft: #504840;
  --dashboard-muted: #7b7065;
  --dashboard-line: rgba(45, 36, 27, 0.14);
  --dashboard-line-soft: rgba(45, 36, 27, 0.1);
  --dashboard-rust: #a85224;
  --dashboard-rust-soft: rgba(168, 82, 36, 0.12);
  --dashboard-shadow: 0 28px 70px rgba(51, 40, 28, 0.13);
  --dashboard-shadow-soft: 0 18px 40px rgba(54, 43, 33, 0.07);
  --dashboard-radius-xl: 34px;
  --dashboard-radius-lg: 28px;
  --dashboard-radius-md: 24px;
  --wr-muted: #7b7065;
  --wr-line: rgba(45, 36, 27, 0.14);
}

/* =========================================================
   Shared page background
   ========================================================= */

.dashboard-body,
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(216, 168, 93, 0.24), transparent 27rem),
    radial-gradient(circle at 88% 14%, rgba(102, 116, 130, 0.18), transparent 31rem),
    linear-gradient(135deg, #f8f3ea 0%, #efe3d1 48%, #f7f0e7 100%);
  color: var(--dashboard-ink);
}

/* =========================================================
   Auth pages
   ========================================================= */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(100%, 560px);
  padding: clamp(1.75rem, 4vw, 3rem);
  border: 1px solid var(--dashboard-line);
  border-radius: var(--dashboard-radius-xl);
  background: rgba(255, 250, 241, 0.72);
  box-shadow: var(--dashboard-shadow);
  backdrop-filter: blur(14px);
}

.auth-card--narrow {
  width: min(100%, 520px);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  color: var(--dashboard-ink);
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.auth-brand:hover {
  color: var(--dashboard-ink);
}

.auth-brand-mark,
.dashboard-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--dashboard-cream);
  background: linear-gradient(135deg, var(--dashboard-rust), #2f2b28);
  box-shadow: 0 12px 26px rgba(168, 82, 36, 0.22);
}

.auth-card h1 {
  margin: 0;
  color: var(--dashboard-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.auth-intro {
  margin: 1.2rem 0 2rem;
  color: var(--dashboard-ink-soft);
  font-size: 1.05rem;
  line-height: 1.75;
}

.auth-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: var(--dashboard-ink);
  color: var(--dashboard-cream);
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.auth-button:hover {
  background: var(--dashboard-rust);
  box-shadow: 0 20px 45px rgba(168, 82, 36, 0.18);
  transform: translateY(-2px);
}

.auth-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.auth-message {
  min-height: 1.5rem;
  margin-top: 1rem;
  color: var(--dashboard-rust);
  font-size: 0.95rem;
}

.auth-footer {
  margin-top: 1.5rem;
  color: var(--dashboard-muted);
  font-size: 0.95rem;
  text-align: center;
}

.auth-footer a {
  color: var(--dashboard-rust);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--dashboard-ink);
}

.slug-preview {
  margin-top: 0.5rem;
  color: var(--dashboard-muted);
  font-size: 0.9rem;
}

/* =========================================================
   Forms
   ========================================================= */

.dashboard-form .form-label,
.auth-card .form-label {
  color: var(--dashboard-ink-soft);
  font-weight: 700;
  font-size: 0.9rem;
}

.dashboard-form .form-control,
.dashboard-form .form-select,
.auth-card .form-control,
.auth-card .form-select {
  min-height: 52px;
  border: 1px solid rgba(45, 36, 27, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding-inline: 1.1rem;
}

.dashboard-form textarea.form-control {
  min-height: 150px;
  border-radius: 24px;
  padding-block: 1rem;
}

.dashboard-form .form-control:focus,
.dashboard-form .form-select:focus,
.auth-card .form-control:focus,
.auth-card .form-select:focus {
  border-color: rgba(168, 82, 36, 0.58);
  box-shadow: 0 0 0 4px rgba(168, 82, 36, 0.08);
}

/* =========================================================
   Dashboard layout
   ========================================================= */

.dashboard-shell {
  min-height: 100vh;
  padding: 1rem;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 1380px;
  margin: 40px auto !important;
}

.dashboard-sidebar {
  position: sticky;
  top: 1rem;
  min-height: calc(100vh - 2rem);
  padding: 1.25rem;
  border: 1px solid var(--dashboard-line);
  border-radius: 30px;
  background: rgba(255, 250, 241, 0.72);
  box-shadow: var(--dashboard-shadow);
  backdrop-filter: blur(14px);
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(45, 36, 27, 0.12);
  color: var(--dashboard-ink);
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.dashboard-brand:hover {
  color: var(--dashboard-ink);
}

.dashboard-nav {
  display: grid;
  gap: 0.4rem;
}

.dashboard-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 0.95rem;
  border-radius: 999px;
  color: var(--dashboard-ink-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
  background: var(--dashboard-rust-soft);
  color: var(--dashboard-rust);
  transform: translateX(2px);
}

.dashboard-nav .logout-link {
  margin-top: 1rem;
  color: #8a2f1a;
}

.dashboard-main {
  min-width: 0;
  padding: 0 clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem);
}

.dashboard-hero {
  padding: clamp(1.75rem, 4vw, 3rem);
  border: 1px solid var(--dashboard-line);
  border-radius: var(--dashboard-radius-xl);
  background:
    radial-gradient(circle at 90% 10%, rgba(168, 82, 36, 0.12), transparent 20rem),
    rgba(255, 250, 241, 0.72);
  box-shadow: var(--dashboard-shadow);
}

.dashboard-kicker {
  margin: 0 0 1rem;
  color: var(--dashboard-rust);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-weight: 700;
}

.dashboard-hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.dashboard-copy {
  max-width: 760px;
  margin: 1.25rem 0 0;
  color: var(--dashboard-ink-soft);
  font-size: 1.08rem;
  line-height: 1.75;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

/* =========================================================
   Dashboard buttons
   ========================================================= */

.dashboard-button,
.dashboard-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-button {
  border: 0;
  background: var(--dashboard-ink);
  color: var(--dashboard-cream);
  box-shadow: 0 18px 38px rgba(31, 27, 24, 0.16);
}

.dashboard-button:hover {
  background: var(--dashboard-rust);
  color: var(--dashboard-cream);
  transform: translateY(-2px);
}

.dashboard-button-secondary {
  border: 1px solid rgba(45, 36, 27, 0.16);
  background: rgba(255, 255, 255, 0.48);
  color: var(--dashboard-ink);
}

.dashboard-button-secondary:hover {
  background: var(--dashboard-cream);
  color: var(--dashboard-ink);
  transform: translateY(-2px);
}

/* =========================================================
   Dashboard cards and panels
   ========================================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.dashboard-card {
  position: relative;
  min-height: 210px;
  padding: 1.5rem;
  border: 1px solid var(--dashboard-line);
  border-radius: var(--dashboard-radius-lg);
  background: rgba(255, 250, 241, 0.66);
  box-shadow: 0 22px 60px rgba(56, 44, 31, 0.08);
  overflow: hidden;
}

.dashboard-card::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(168, 82, 36, 0.08);
}

.dashboard-card > * {
  position: relative;
  z-index: 1;
}

.dashboard-card span {
  display: block;
  margin-bottom: 1rem;
  color: var(--dashboard-rust);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 700;
}

.dashboard-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.dashboard-card p {
  margin: 1rem 0 0;
  color: var(--dashboard-ink-soft);
  line-height: 1.65;
}

.dashboard-card a {
  display: inline-flex;
  margin-top: 1.25rem;
  color: var(--dashboard-rust);
  font-weight: 700;
  text-decoration: none;
}

.dashboard-card a:hover {
  color: var(--dashboard-ink);
}

.dashboard-panel,
.dashboard-status {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--dashboard-line);
  border-radius: 26px;
  background: rgba(255, 250, 241, 0.58);
  box-shadow: var(--dashboard-shadow-soft);
}

.status-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
}

.status-item {
  padding: 1rem;
  border: 1px solid var(--dashboard-line-soft);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.38);
}

.status-item span {
  display: block;
  color: var(--dashboard-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.status-item strong {
  display: block;
  margin-top: 0.4rem;
  color: var(--dashboard-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 500;
  word-break: break-word;
}

/* =========================================================
   Loading state
   ========================================================= */

.loading-cover {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--dashboard-bg);
  color: var(--dashboard-ink-soft);
  font-family: Arial, Helvetica, sans-serif;
}

.loading-cover.is-hidden {
  display: none;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 991.98px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    min-height: auto;
  }

  .dashboard-grid,
  .status-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .dashboard-shell {
    padding: 0.7rem;
  }

  .dashboard-actions a,
  .dashboard-button,
  .dashboard-button-secondary {
    width: 100%;
  }
}






/* =========================================================
   Profile page
   ========================================================= */

.form-help {
  margin-top: 0.45rem;
  color: var(--dashboard-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.profile-side-card {
  padding: 1.35rem;
  border: 1px solid var(--dashboard-line);
  border-radius: var(--dashboard-radius-md);
  background: rgba(255, 250, 241, 0.62);
  box-shadow: var(--dashboard-shadow-soft);
}

.profile-side-card span {
  display: inline-block;
  color: var(--dashboard-rust);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 700;
}

.profile-side-card p {
  color: var(--dashboard-ink-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}

.profile-side-card hr {
  margin: 1.25rem 0;
  border-color: var(--dashboard-line);
  opacity: 1;
}

/* .profile-image-placeholder {
  position: relative;
  display: grid;
  place-items: center;
}

.profile-image-placeholder img[hidden] {
  display: none;
} */

.profile-image-css-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 70% 20%, rgba(168, 82, 36, 0.16), transparent 8rem),
    linear-gradient(145deg, #2a2521, #4b3326);
  color: #fffaf1;
  text-align: center;
}

.profile-image-css-placeholder span {
  max-width: 80%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.05;
}

.profile-image-placeholder {
  overflow: hidden;
  border: 1px solid var(--dashboard-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.42);
  aspect-ratio: 4 / 5;
}

.profile-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--dashboard-line);
}

.dashboard-message {
  min-height: 1.5rem;
  margin: 0;
  color: var(--dashboard-rust);
  font-size: 0.95rem;
}

.dashboard-message.success {
  color: #2f6f3e;
}

.dashboard-message.error {
  color: #9a2f1d;
}

@media (max-width: 767.98px) {
  .dashboard-form-footer {
    align-items: stretch;
  }

  .dashboard-form-footer .dashboard-actions {
    width: 100%;
  }
}




/* =========================================================
   Books page
   ========================================================= */

.dashboard-section-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.books-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.books-count {
  margin: 0;
  color: var(--dashboard-muted);
  font-weight: 700;
}

.books-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.book-tile {
  appearance: none;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}


.book-cover-frame {
  width: 100%;
  flex: 0 0 auto;
}

.book-meta {
  min-height: 95px;
}

.book-cover-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(45, 36, 27, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,250,241,0.8), rgba(255,250,241,0.45)),
    rgba(255, 255, 255, 0.35);
  box-shadow: 0 20px 44px rgba(31, 27, 24, 0.16);
  aspect-ratio: 2 / 3;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.book-tile:hover .book-cover-frame {
  transform: translateY(-5px);
  box-shadow: 0 28px 58px rgba(31, 27, 24, 0.22);
}

.book-cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-placeholder-cover {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 70% 20%, rgba(168, 82, 36, 0.16), transparent 8rem),
    linear-gradient(145deg, #2a2521, #4b3326);
  color: #fffaf1;
  text-align: center;
}

.book-placeholder-cover strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.1;
}

.book-featured-badge,
.book-status-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.book-featured-badge {
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.35rem 0.55rem;
  background: rgba(255, 250, 241, 0.86);
  color: var(--dashboard-rust);
}

.book-status-badge {
  right: 0.65rem;
  bottom: 0.65rem;
  max-width: calc(100% - 1.3rem);
  padding: 0.35rem 0.55rem;
  background: rgba(30, 27, 24, 0.82);
  color: var(--dashboard-cream);
}

.book-meta {
  padding: 0.85rem 0.2rem 0;
}

.book-meta h3 {
  margin: 0;
  color: var(--dashboard-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.book-meta p {
  margin: 0.35rem 0 0;
  color: var(--dashboard-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.empty-state {
  padding: 3rem 1.5rem;
  border: 1px dashed rgba(45, 36, 27, 0.22);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.28);
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.empty-state p {
  max-width: 460px;
  margin: 1rem auto 1.5rem;
  color: var(--dashboard-ink-soft);
}

/* =========================================================
   Writer modal
   ========================================================= */

.modal-dialog-scrollable {
  height: calc(100vh - 3.5rem);
}

.modal-dialog-scrollable .modal-content {
  max-height: 100%;
}

.writer-modal {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  border: 1px solid var(--dashboard-line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 90% 8%, rgba(168, 82, 36, 0.12), transparent 22rem),
    #fffaf1;
  box-shadow: 0 36px 90px rgba(26, 22, 18, 0.25);
  overflow: hidden;
}

.writer-modal > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
}

.writer-modal-header,
.writer-modal-footer {
  flex: 0 0 auto;
  border-color: var(--dashboard-line);
}

.writer-modal-header {
  padding: 1.5rem;
}

.writer-modal-header .modal-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.writer-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem;
}

.writer-modal-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(80, 72, 64, 0.38) transparent;
}

.writer-modal-body::-webkit-scrollbar {
  width: 8px;
}

.writer-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.writer-modal-body::-webkit-scrollbar-thumb {
  border: 2px solid #fffaf1;
  border-radius: 999px;
  background: rgba(80, 72, 64, 0.32);
}

.writer-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 82, 36, 0.58);
}

.writer-modal-footer {
  padding: 1rem 1.5rem;
}

.book-modal-cover {
  overflow: hidden;
  border: 1px solid var(--dashboard-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.42);
  aspect-ratio: 2 / 3;
  box-shadow: 0 22px 60px rgba(56, 44, 31, 0.12);
}

.book-modal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-check .form-check-input {
  border-color: rgba(45, 36, 27, 0.26);
}

.dashboard-check .form-check-input:checked {
  background-color: var(--dashboard-rust);
  border-color: var(--dashboard-rust);
}

.dashboard-check .form-check-label {
  color: var(--dashboard-ink-soft);
  font-weight: 700;
}

.dashboard-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.2rem;
  border: 1px solid rgba(154, 47, 29, 0.24);
  border-radius: 999px;
  background: rgba(154, 47, 29, 0.1);
  color: #9a2f1d;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.dashboard-danger-button:hover {
  background: rgba(154, 47, 29, 0.16);
  transform: translateY(-2px);
}

@media (max-width: 575.98px) {
  .books-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .writer-modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .writer-modal-footer .dashboard-message {
    width: 100%;
  }

  .writer-modal-footer button {
    width: 100%;
  }
}




/* =========================================================
   Posts / Journal page
   ========================================================= */

.posts-panel-spaced {
  margin-top: 2rem;
}

.posts-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.posts-count {
  margin: 0;
  color: var(--dashboard-muted);
  font-weight: 700;
}

.posts-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(1rem, 2vw, 1.35rem);
}

.post-card {
  appearance: none;
  width: 100%;
  min-height: 230px;
  padding: 1.4rem;
  border: 1px solid var(--dashboard-line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(168, 82, 36, 0.08), transparent 14rem),
    rgba(255, 250, 241, 0.68);
  box-shadow: 0 22px 60px rgba(56, 44, 31, 0.08);
  text-align: left;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  background:
    radial-gradient(circle at 100% 0%, rgba(168, 82, 36, 0.12), transparent 14rem),
    rgba(255, 250, 241, 0.88);
  box-shadow: 0 30px 70px rgba(56, 44, 31, 0.14);
}

.post-card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 1rem;
}

.post-card-body {
  flex: 1 1 auto;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(45, 36, 27, 0.1);
}

.post-card-footer .homepage-feature-button,
.post-card-footer .post-card-status {
  flex: 0 0 auto;
}

.post-card-type,
.post-card-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.post-card-type {
  color: var(--dashboard-rust);
}

.post-card-status {
  padding: 0.3rem 0.55rem;
  background: rgba(30, 27, 24, 0.08);
  color: var(--dashboard-ink-soft);
}

.post-card-status.is-published {
  background: rgba(47, 111, 62, 0.12);
  color: #2f6f3e;
}

.post-card-status.is-draft {
  background: rgba(168, 82, 36, 0.12);
  color: var(--dashboard-rust);
}

.post-card-status.is-archived {
  background: rgba(80, 72, 64, 0.12);
  color: var(--dashboard-muted);
}

.post-card h3 {
  margin: 0;
  color: var(--dashboard-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.post-card p {
  margin: 1rem 0 0;
  color: var(--dashboard-ink-soft);
  font-size: 0.96rem;
  line-height: 1.62;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.25rem;
  color: var(--dashboard-muted);
  font-size: 0.82rem;
}

.post-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.post-featured-pill {
  color: var(--dashboard-rust);
  font-weight: 800;
}

.essays-grid .post-card {
  min-height: 270px;
  background:
    linear-gradient(145deg, rgba(255,250,241,0.78), rgba(255,250,241,0.52)),
    radial-gradient(circle at 100% 0%, rgba(168, 82, 36, 0.1), transparent 16rem);
}

@media (max-width: 575.98px) {
  .posts-section-heading {
    align-items: start;
    flex-direction: column;
  }

  .posts-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .post-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .post-card-footer .homepage-feature-button,
  .post-card-footer .post-card-status {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   Homepage feature buttons
   ========================================================= */

.post-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.homepage-feature-button {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 30px;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(168, 82, 36, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--dashboard-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.homepage-feature-button:hover {
  border-color: rgba(168, 82, 36, 0.38);
  background: rgba(168, 82, 36, 0.1);
  color: var(--dashboard-rust);
  transform: translateY(-1px);
}

.homepage-feature-button.is-featured {
  border-color: rgba(168, 82, 36, 0.34);
  background: rgba(168, 82, 36, 0.14);
  color: var(--dashboard-rust);
}

.homepage-feature-star {
  font-size: 0.9rem;
  line-height: 1;
}

.posts-notice {
  position: sticky;
  top: 1rem;
  z-index: 80;
  display: none;
  margin-bottom: 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--dashboard-line);
  border-radius: 18px;
  background: rgba(255, 250, 241, 0.94);
  color: var(--dashboard-ink-soft);
  box-shadow: 0 18px 44px rgba(31, 27, 24, 0.14);
  backdrop-filter: blur(12px);
  font-weight: 700;
}

.posts-notice.is-visible {
  display: block;
}

.posts-notice.success {
  color: #2f6f3e;
}

.posts-notice.error {
  color: #9a2f1d;
}


/* =========================================================
   Essay editor
   ========================================================= */

.essay-body-field {
  min-height: 520px;
  resize: vertical;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.75;
}

.dashboard-form .essay-body-field {
  border-radius: 28px;
}




/* =========================================================
   Formatting help popup
   ========================================================= */

.field-help-button {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(168, 82, 36, 0.24);
  border-radius: 50%;
  background: rgba(168, 82, 36, 0.1);
  color: var(--dashboard-rust);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.field-help-button:hover {
  background: var(--dashboard-rust);
  color: var(--dashboard-cream);
  transform: translateY(-1px);
}

.formatting-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(30, 27, 24, 0.46);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.48s ease, visibility 0.48s ease;
}

.formatting-help-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.formatting-help-card {
  width: min(100%, 680px);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 1px solid var(--dashboard-line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 90% 8%, rgba(168, 82, 36, 0.12), transparent 22rem),
    var(--dashboard-cream);
  box-shadow: 0 36px 90px rgba(26, 22, 18, 0.28);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 0.48s ease, transform 0.48s ease;
}

.formatting-help-overlay.is-visible .formatting-help-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.formatting-help-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.formatting-help-card p {
  color: var(--dashboard-ink-soft);
  line-height: 1.7;
}

.formatting-help-example {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid rgba(45, 36, 27, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.42);
}

.formatting-help-example span {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--dashboard-rust);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.formatting-help-code {
  margin: 0;
  white-space: pre-wrap;
  color: var(--dashboard-ink);
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.65;
}

.formatting-help-preview {
  padding: 1.2rem;
  border: 1px solid rgba(45, 36, 27, 0.12);
  border-radius: 20px;
  background: rgba(255, 250, 241, 0.72);
}

.formatting-help-preview h3 {
  margin: 0 0 1rem;
  color: var(--dashboard-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.formatting-help-preview blockquote {
  margin: 1.25rem 0;
  padding: 1rem 0 1rem 1.2rem;
  border-left: 3px solid var(--dashboard-rust);
  color: var(--dashboard-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.35;
}

.formatting-help-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.formatting-help-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--dashboard-ink-soft);
  font-weight: 700;
}

.formatting-help-checkbox input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--dashboard-rust);
}

@media (max-width: 575.98px) {
  .formatting-help-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .formatting-help-actions button {
    width: 100%;
  }
}


#formattingHelpOverlay .formatting-help-preview {
  margin-bottom: 2rem;
}

#formattingHelpOverlay .formatting-help-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  margin-top: 0;
}

#formattingHelpOverlay .formatting-help-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: var(--dashboard-ink-soft);
  font-weight: 700;
}

#formattingHelpOverlay .formatting-help-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 120px;
  margin-left: auto;
  padding: 0.75rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--dashboard-ink);
  color: var(--dashboard-cream);
  font-weight: 700;
  box-shadow: 0 18px 38px rgba(31, 27, 24, 0.16);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#formattingHelpOverlay .formatting-help-close-button:hover {
  background: var(--dashboard-rust);
  color: var(--dashboard-cream);
  transform: translateY(-2px);
}

@media (max-width: 575.98px) {
  #formattingHelpOverlay .formatting-help-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  #formattingHelpOverlay .formatting-help-close-button {
    width: 100%;
    margin-left: 0;
  }
}




/* =========================================================
   Media library
   ========================================================= */

.media-grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.35rem);
}

.author-media-grid {
  grid-template-columns: repeat(auto-fill, 170px);
  justify-content: start;
  align-items: start;
}

.cover-media-grid {
  grid-template-columns: repeat(auto-fill, 150px);
  justify-content: start;
  align-items: start;
}

.media-card {
  display: block;
  width: 100%;
  max-width: 100%;
}

.media-card {
  border: 0 !important;
  outline: none;
  background: transparent;
}

.media-card:focus,
.media-card:active {
  outline: none;
  border: 0 !important;
}

.media-card:focus-visible .media-thumb {
  outline: 3px solid rgba(168, 82, 36, 0.35);
  outline-offset: 4px;
}

.media-thumb {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: rgba(255, 250, 241, 0.66);
  box-shadow: 0 20px 44px rgba(31, 27, 24, 0.14);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.media-card:hover .media-thumb {
  transform: translateY(-5px);
  box-shadow: 0 28px 58px rgba(31, 27, 24, 0.2);
}

.media-thumb--author {
  border-radius: 24px;
  aspect-ratio: 4 / 5;
}

.media-thumb--cover {
  border-radius: 18px;
  aspect-ratio: 2 / 3;
}

.media-thumb img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.media-in-use-badge,
.media-type-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.media-in-use-badge {
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.35rem 0.55rem;
  background: rgba(255, 250, 241, 0.88);
  color: var(--dashboard-rust);
}

.media-type-badge {
  right: 0.65rem;
  bottom: 0.65rem;
  padding: 0.35rem 0.55rem;
  background: rgba(30, 27, 24, 0.82);
  color: var(--dashboard-cream);
}

.media-meta {
  padding: 0.85rem 0.2rem 0;
}

.media-meta h3 {
  margin: 0;
  color: var(--dashboard-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.media-meta p {
  margin: 0.35rem 0 0;
  color: var(--dashboard-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.media-modal-preview {
  overflow: hidden;
  border: 1px solid var(--dashboard-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.42);
  aspect-ratio: 4 / 5;
  box-shadow: 0 22px 60px rgba(56, 44, 31, 0.12);
}

.media-modal-preview.is-cover {
  aspect-ratio: 2 / 3;
}

.media-modal-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-usage-box {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--dashboard-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--dashboard-ink-soft);
  line-height: 1.55;
}

.media-usage-box strong {
  color: var(--dashboard-ink);
}

.media-usage-box ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
}

@media (max-width: 575.98px) {
  .author-media-grid,
  .cover-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Media image sizing override */

.media-card .media-thumb {
  width: 100%;
}

.media-card .media-thumb img,
.media-modal-preview img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  object-fit: cover;
}

.media-thumb--author {
  aspect-ratio: 4 / 5;
}

.media-thumb--cover {
  aspect-ratio: 2 / 3;
}



/* =========================================================
   Media cropper
   ========================================================= */

.cropper-modal-dialog {
  max-width: min(96vw, 980px);
}

.cropper-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.25rem;
  align-items: stretch;
}

.cropper-stage {
  position: relative;
  height: min(62vh, 620px);
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--dashboard-line);
  border-radius: 24px;
  background:
    linear-gradient(45deg, rgba(45, 36, 27, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(45, 36, 27, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(45, 36, 27, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(45, 36, 27, 0.06) 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.cropper-stage img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Force Cropper.js to use the available stage properly */
.cropper-container {
  width: 100% !important;
  height: 100% !important;
}

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-view-box {
  border-radius: 18px;
}

.cropper-side-panel {
  padding: 1.25rem;
  border: 1px solid var(--dashboard-line);
  border-radius: var(--dashboard-radius-md);
  background: rgba(255, 250, 241, 0.62);
  box-shadow: var(--dashboard-shadow-soft);
}

.cropper-side-panel > span {
  display: block;
  color: var(--dashboard-rust);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 700;
}

.cropper-side-panel p {
  color: var(--dashboard-ink-soft);
  line-height: 1.65;
}

.cropper-detail-list {
  display: grid;
  gap: 0.75rem;
}

.cropper-detail-list div {
  padding: 0.85rem;
  border: 1px solid var(--dashboard-line-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.36);
}

.cropper-detail-list strong {
  display: block;
  color: var(--dashboard-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 500;
}

.cropper-detail-list small {
  display: block;
  margin-top: 0.25rem;
  color: var(--dashboard-muted);
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .cropper-layout {
    grid-template-columns: 1fr;
  }

  .cropper-stage {
    height: 54vh;
    min-height: 360px;
  }
}

@media (max-width: 575.98px) {
  .cropper-stage {
    height: 46vh;
    min-height: 280px;
  }
}



/* =========================================================
   Sticky profile save footer
   ========================================================= */

.profile-save-footer {
  position: sticky;
  bottom: 1rem;
  z-index: 30;
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--dashboard-line);
  border-radius: 24px;
  background: rgba(255, 250, 241, 0.9);
  box-shadow: 0 20px 50px rgba(31, 27, 24, 0.16);
  backdrop-filter: blur(12px);
}

.profile-save-footer .dashboard-actions {
  margin-top: 0;
}

.profile-save-footer .dashboard-message {
  font-weight: 700;
}

@media (max-width: 767.98px) {
  .profile-save-footer {
    bottom: 0.7rem;
  }
}





.dashboard-danger-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.dashboard-danger-button:disabled:hover {
  background: rgba(154, 47, 29, 0.1);
  transform: none;
}






/* =========================================================
   Chip editor
   ========================================================= */

.chip-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  min-height: 52px;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(45, 36, 27, 0.16);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
}

.chip-editor:focus-within {
  border-color: rgba(168, 82, 36, 0.58);
  box-shadow: 0 0 0 4px rgba(168, 82, 36, 0.08);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  border: 1px solid rgba(168, 82, 36, 0.16);
  border-radius: 999px;
  background: rgba(168, 82, 36, 0.1);
  color: var(--dashboard-rust);
  font-size: 0.9rem;
  font-weight: 700;
}

.keyword-chip button {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(168, 82, 36, 0.14);
  color: var(--dashboard-rust);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.keyword-chip button:hover {
  background: var(--dashboard-rust);
  color: var(--dashboard-cream);
}

.chip-input {
  flex: 1 1 160px;
  min-width: 140px;
  height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--dashboard-ink);
  font: inherit;
}

.chip-input::placeholder {
  color: var(--dashboard-muted);
}







.public-container {
  width: 100% !important;
  max-width: 1180px !important;
  margin-inline: auto !important;
  padding-inline: 1rem !important;
}


.public-footer {
  padding-block: 1.75rem !important;
  border-top: 1px solid var(--wr-line) !important;
  color: var(--wr-muted) !important;
  font-size: 0.92rem !important;
  text-align: center !important;
}

.public-footer p {
  margin: 0 !important;
}