/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none !important;
  padding: 10px 18px;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--mc-olive); border-color: var(--mc-olive); color: #fff; }

.btn--outline {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn--outline:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn--ghost:hover { color: var(--fg); }

.btn--danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--danger:hover { filter: brightness(1.08); }

.btn--sm { padding: 6px 12px; font-size: 11.5px; }
.btn--block { width: 100%; }

/* ---------- Tag pills ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none !important;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  padding: 4px 9px;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.tag::before { content: "#"; color: var(--accent-ink); }
.tag:hover { border-color: var(--accent-ink); color: var(--fg); }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ---------- Status pills (workflow) ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-1);
  white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--draft { background: var(--surface); color: var(--muted); }
.status--pending_review { background: var(--warning-soft); color: var(--warning); }
.status--published { background: var(--success-soft); color: var(--success); }
.status--archived { background: var(--surface); color: var(--muted); }

/* ---------- Article card ---------- */

.article-card {
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: inherit;
  height: 100%;
  /* This is itself a grid item inside .article-index-grid/.home-grid etc. Those grids already use
     minmax(0, 1fr) tracks, but that only lets the *track* shrink - a grid item's own default
     min-width is still "auto" (its content's intrinsic size), so a long nowrap eyebrow (see
     .article-card__eyebrow) deep inside was still forcing this card, and the column it sits in,
     wider than the grid (same family of bug as every other minmax(0, ...) fix in this file). */
  min-width: 0;
}

.article-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}
.article-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 400ms ease;
}
.article-card:hover .article-card__media img { transform: scale(1.03); }
/* Empty-cover placeholder: a faint dot-grid (the "technical" half of the brand) plus the
   brand mark itself bleeding off the corner, oversized and low-opacity - reads as a deliberate
   graphic rather than a blank grey box, and needs no per-post asset. */
.article-card__media--empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--surface);
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 16px 16px;
}
.article-card__media--empty::before {
  content: "";
  position: absolute;
  right: -16%;
  bottom: -24%;
  width: 62%;
  aspect-ratio: 1;
  background: url("/Content/images/brand/mestreclique-mark.svg") center / contain no-repeat;
  opacity: 0.14;
  transform: rotate(-8deg);
  pointer-events: none;
}
.article-card__media-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 6px 10px;
}
.article-card__media-label::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
}

.article-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: var(--sp-2);
  /* All of the post's tags now render here (not just the first), so this needs its own
     single-line truncation instead of just relying on whatever happened to clip it before.
     min-width: 0 is required too: .article-card is a column flex container, whose items default
     to min-width:auto (their content's intrinsic size) - with white-space:nowrap that intrinsic
     size is the full untruncated line, which would otherwise stretch this item (and the card
     itself) wider rather than ever actually triggering the ellipsis. Same family of bug as the
     grid min-width fixes elsewhere in this file/responsive.css. */
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 var(--sp-2);
  transition: color var(--transition-fast);
}
.article-card:hover .article-card__title { color: var(--accent-ink); }

.article-card__desc {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 var(--sp-3);
  flex: 1;
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: auto;
}

.article-card--featured .article-card__title { font-size: 30px; line-height: 1.15; }
.article-card--featured .article-card__desc { font-size: 16px; }

/* ---------- Author byline / card ---------- */

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.byline {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.byline__name { font-weight: 600; font-size: 14px; }
.byline__role { color: var(--muted); font-size: 12.5px; }

.author-card {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  text-decoration: none !important;
  color: inherit;
  transition: border-color var(--transition-fast);
}
.author-card:hover { border-color: var(--accent-ink); }
.author-card__name { font-family: var(--font-display); font-weight: 600; font-size: 17px; margin: 0; }
.author-card__role { color: var(--muted); font-size: 13px; margin: 2px 0 var(--sp-2); }
.author-card__count { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent-ink); text-transform: uppercase; letter-spacing: 0.06em; }

.social-links { display: flex; gap: var(--sp-3); margin-top: var(--sp-3); }
.social-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none !important;
  color: var(--muted);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
}
.social-links a:hover { color: var(--accent-ink); border-color: var(--accent-ink); }

/* ---------- Forms ---------- */

.field { margin-bottom: var(--sp-5); }
.field__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.field__hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.field__error { font-size: 12.5px; color: var(--danger); margin-top: 6px; }

.input, .textarea, .select {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  color: var(--fg);
  border-radius: var(--r-2);
  padding: 10px 12px;
  font-size: 14.5px;
  transition: border-color var(--transition-fast);
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent-ink); }
.textarea { resize: vertical; min-height: 120px; font-family: var(--font-mono); }
.field--invalid .input, .field--invalid .textarea { border-color: var(--danger); }

.checkbox-row { display: flex; align-items: center; gap: var(--sp-2); font-size: 14px; }

/* ---------- Alerts / callout-style banners for admin ---------- */

.banner {
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  padding: var(--sp-4);
  border-radius: var(--r-2);
  font-size: 14px;
  margin-bottom: var(--sp-5);
}
.banner--danger { border-left-color: var(--danger); background: var(--danger-soft); }
.banner--success { border-left-color: var(--success); background: var(--success-soft); }
.banner--warning { border-left-color: var(--warning); background: var(--warning-soft); }

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: var(--sp-9) var(--sp-5);
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-2);
}
.empty-state__title { font-family: var(--font-display); font-size: 18px; color: var(--fg); margin-bottom: var(--sp-2); }

/* ---------- Pagination / load more ---------- */

.load-more { display: flex; justify-content: center; margin: var(--sp-7) 0; }

/* ---------- Toast (copy feedback) ----------
   Named .mc-toast, not .toast: Bootstrap (loaded on every page) ships its own .toast component
   with ".toast:not(.show) { display: none; }" - higher specificity than our plain ".toast" rule,
   and since this element never gets Bootstrap's "show" class, that rule always won and kept it
   display:none no matter what we did with opacity/is-visible (reported bug: copy-link gave no
   feedback, while copy-code - which never touches this element - worked fine). */
.mc-toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-6);
  transform: translate(-50%, 12px);
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--r-2);
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 300;
}
.mc-toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* ---------- Command palette / search overlay ---------- */

.palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 8, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 20px 20px;
  z-index: 250;
}
.palette-overlay[hidden] { display: none; }

.palette {
  width: 100%;
  max-width: 620px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.palette__input-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.palette__input-row .eyebrow { flex-shrink: 0; }
.palette__input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: var(--fg);
  flex: 1;
  font-family: var(--font-mono);
}
.palette__close { flex-shrink: 0; }

.palette__results { max-height: 55vh; overflow-y: auto; padding: var(--sp-3); }
.palette__group-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--sp-3) var(--sp-2) var(--sp-1);
}
.palette__item {
  display: block;
  padding: var(--sp-3);
  border-radius: var(--r-2);
  text-decoration: none !important;
  color: var(--fg);
}
.palette__item:hover, .palette__item.is-active { background: var(--surface); }
.palette__item-title { font-weight: 600; font-size: 14.5px; }
.palette__item-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.palette__empty { padding: var(--sp-6); text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Copy link ---------- */

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--fg);
  padding: 8px 14px;
  border-radius: var(--r-2);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.share-btn:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

/* ---------- Theme toggle ---------- */

.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
