/* post-card.css  (CORE: the card itself. Required.)
   Re-theme every card from the DESIGN TOKENS block just below. */

/* =====================================================================
   DESIGN TOKENS
   Change these variables to re-theme every card at once.
   ===================================================================== */
:root {
  --post-card-background:        #0d0e12;   /* card surface */
  --post-card-border:            #1c1e26;   /* thin outline and divider lines */
  --post-card-text:              #f1f2f6;   /* main text */
  --post-card-text-secondary:    #aeb2c0;   /* description text, author name */
  --post-card-text-muted:        #6c7080;   /* timestamps, counters, small labels */
  --post-card-accent:            #a974f5;   /* purple used for tags, icons, progress */
  --post-card-chip-background:   #232933;   /* grey pill behind the post type */
  --post-card-radius:            16px;      /* card corner rounding */
  --post-card-padding:           20px;      /* inner spacing */
  --post-card-section-gap:       12px;      /* vertical gap between card sections */
  --post-card-font:              system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* =====================================================================
   CARD SHELL
   A card is a vertical stack: body (text) -> media (optional) -> footer (buttons).
   ===================================================================== */
.post-card {
  background: var(--post-card-background);
  border: 1px solid var(--post-card-border);
  border-radius: var(--post-card-radius);
  color: var(--post-card-text);
  font-family: var(--post-card-font);
  display: flex; flex-direction: column;
}
/* flex: 1 lets the body absorb spare height, so in a multi-column row the footers line up at the bottom */
.post-card-body { flex: 1; padding: var(--post-card-padding); display: flex; flex-direction: column; gap: var(--post-card-section-gap); }

/* ----- header row: avatar, author name, time ago, sensitive theme, "..." menu ----- */
.post-card-header { display: flex; align-items: center; gap: 10px; min-width: 0; }
.post-card-avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--post-card-chip-background) center / cover no-repeat;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--post-card-text-secondary);
}
.post-card-header-details { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; min-width: 0; flex: 1;
                            font-size: 14px; color: var(--post-card-text-muted); }
.post-card-author-name { color: var(--post-card-text-secondary); font-weight: 600; text-decoration: none; }
a.post-card-author-name:hover { text-decoration: underline; }
/* automatic small dot between the author, the time and the theme */
.post-card-header-details > * + *::before { content: "\2022"; margin-right: 10px; color: #3a3d4a; }
.post-card-sensitive-theme { display: inline-flex; align-items: center; gap: 5px; }
.post-card-sensitive-theme svg { width: 13px; height: 13px; flex: none; }
.post-card-menu-button {
  all: unset; cursor: pointer; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px; color: var(--post-card-accent);
}
.post-card-menu-button:hover { background: #ffffff0d; }
.post-card-menu-button:focus-visible, .post-card-text-button:focus-visible, .post-card-action-button:focus-visible { outline: 2px solid var(--post-card-accent); outline-offset: 2px; }

/* ----- title and description ----- */
.post-card-title { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.post-card-title-link { color: inherit; text-decoration: none; }
.post-card-title-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-card-title-link:focus-visible { outline: 2px solid var(--post-card-accent); outline-offset: 3px; border-radius: 4px; }
/* The description is cut to N lines using -webkit-line-clamp (works in all current browsers).
   N comes from the --post-card-description-lines variable that JavaScript sets from options.descriptionLines. */
.post-card-description {
  margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--post-card-text-secondary);
  white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--post-card-description-lines, 3); overflow: hidden;
}
/* when the reader presses "Show more", JavaScript sets data-description-expanded="true" and the clamp is lifted */
.post-card[data-description-expanded="true"] .post-card-description { display: block; -webkit-line-clamp: unset; }

/* small grey text buttons: "Show more", "Show less", "+3 more" */
.post-card-text-button {
  all: unset; cursor: pointer; align-self: flex-start;
  font-size: 13px; font-weight: 600; color: var(--post-card-text-muted);
}
.post-card-text-button:hover { color: var(--post-card-text-secondary); }
/* "all: unset" above would otherwise make the hidden attribute stop working */
.post-card [hidden] { display: none !important; }

/* ----- badges and tags (every one is a rounded pill) ----- */
.post-card-badges-and-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.post-card-badges-and-tags .post-card-text-button { font-size: 12.5px; }
/* Each pill reads its colour from --pill-color; the background and border are tinted versions of it. */
.post-card-badge, .post-card-tag {
  --pill-color: var(--post-card-text-secondary);
  display: inline-flex; align-items: center;
  padding: 4px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  color: var(--pill-color);
  background: color-mix(in srgb, var(--pill-color) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill-color) 30%, transparent);
}
.post-card-badge { font-weight: 700; }
.post-card-badge[data-type] { --pill-color: var(--post-card-text); background: var(--post-card-chip-background); border-color: transparent; }
/* >>> ADD YOUR OWN COLOURS HERE: one line per category or audience value <<< */
.post-card-badge[data-category="SFW"]  { --pill-color: #5ad69a; }
.post-card-badge[data-category="NSFW"] { --pill-color: #f0a63a; }
.post-card-badge[data-category="PAID"] { --pill-color: #f26d9a; }
.post-card-badge[data-audience]        { --pill-color: #4fd6c8; }
.post-card-tag { --pill-color: var(--post-card-accent); font-weight: 500; }
/* A pill becomes a real <button> only when you pass a click handler; these rules style that case. */
button.post-card-badge, button.post-card-tag { font-family: inherit; cursor: pointer; }
.is-clickable:hover { background: color-mix(in srgb, var(--pill-color) 26%, transparent); }
.is-clickable:focus-visible { outline: 2px solid var(--post-card-accent); outline-offset: 2px; }

/* ----- footer: like, dislike, comments ----- */
.post-card-footer { border-top: 1px solid var(--post-card-border); padding: 14px var(--post-card-padding); display: flex; gap: 8px; }
.post-card-action-button {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 8px; color: var(--post-card-accent);
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.post-card-action-button svg { width: 18px; height: 18px; }
.post-card-action-button:hover { background: #ffffff0d; }
.post-card-action-button[aria-pressed="true"] { background: #a974f522; }          /* the user's own vote */
.post-card-action-button[aria-pressed="true"] svg { fill: currentColor; }
.post-card-action-button[aria-busy="true"] { opacity: .6; pointer-events: none; } /* waiting for the server */

/* phones: tighter padding and a slightly smaller title */
@media (max-width: 520px) {
  :root { --post-card-padding: 14px; }
  .post-card-title { font-size: 18px; }
}
