/* ============================================================
   WORTHY IDEAL — pillar overview cards, subsection entry cards,
   and the "add an entry" modal.
   ============================================================ */

/* ---------- subsection overview cards (pillar landing) ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.section-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.section-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--border-strong);
}

.section-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
}

.section-card-count {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-faint);
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  white-space: nowrap;
}

.section-card-desc {
  font-family: var(--font-body);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* ---------- entry cards ---------- */

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.entry-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-1);
  color: var(--ink);
}

.entry-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 10px;
  color: var(--ink);
}

.entry-card-body {
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-card-body.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.entry-card-body.short {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.entry-toggle {
  background: none;
  border: none;
  padding: 0 0 12px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-toggle:hover { color: var(--ink); }

.entry-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--ink-soft);
}

.status-pill[data-status="Published"] {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}

.tag-list {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-faint);
}

.add-entry-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 1.5px dashed var(--page-border-strong);
  border-radius: var(--radius-md);
  color: var(--page-text-soft);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.add-entry-card:hover {
  background: var(--card);
  border-color: var(--ink);
  color: var(--ink);
}

.plus-icon {
  display: inline-block;
  margin-right: 8px;
  font-size: 16px;
  line-height: 1;
}

/* ---------- modal (add entry) ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 20px;
  z-index: 50;
  overflow-y: auto;
}

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  width: 100%;
  max-width: 520px;
  padding: 30px 30px 26px;
  color: var(--ink);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--ink);
}

.modal-subtitle {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-faint);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover { color: var(--ink); }

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
}

.form-field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
  font-family: var(--font-body);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--ink);
}

.form-note {
  font-family: var(--font-ui);
  color: var(--ink-faint);
  font-size: 12.5px;
  margin: -6px 0 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
