/* ── Insights: listagem, artigo e partilha ─────────────────────────── */

.insight-hero .tx-hero__lead {
  margin-bottom: 20px;
}

.insight-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.insight-meta--light {
  color: rgba(255, 255, 255, 0.72);
}

.insight-meta__sep {
  opacity: 0.6;
}

/* Cards (baseados em .treatment-card) */
.insights-grid {
  margin-top: 0;
}

.insights-status {
  margin: 0 0 24px;
  color: var(--ink-soft);
  text-align: center;
}

/* Empty state (no published articles yet) */
.insights-empty {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  max-width: 1040px;
  margin: 0 auto;
}

.insights-empty[hidden] {
  display: none;
}

.insights-empty__media {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  background: var(--light-neutral);
  box-shadow: var(--shadow-sm);
}

.insights-empty__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.insights-empty__body {
  display: grid;
  gap: 16px;
  align-content: center;
}

.insights-empty__body h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 40px);
}

.insights-empty__body p {
  margin: 0;
}

.insights-empty__body .section-label {
  color: var(--gold);
}

.insights-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .insights-empty {
    grid-template-columns: 1fr;
  }

  .insights-empty__media {
    aspect-ratio: 4 / 3;
  }
}

.insight-card {
  display: flex;
  flex-direction: column;
}

.insight-card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--light-neutral);
}

.treatment-card .insight-card__media img {
  height: 100%;
  transition: transform 400ms ease;
}

.insight-card:hover .insight-card__media img {
  transform: scale(1.03);
}

.insight-card__media--placeholder {
  display: grid;
  place-items: center;
  background: var(--navy);
}

.treatment-card .insight-card__media--placeholder img {
  width: 38%;
  height: auto;
  object-fit: contain;
}

.insight-card__body {
  flex: 1;
  align-content: start;
}

.insight-card__category {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.treatment-card.insight-card h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.insight-card h3 a {
  color: inherit;
  text-decoration: none;
}

.insight-card h3 a:hover {
  color: var(--deep-blue);
}

.insight-card__excerpt {
  margin: 0;
}

.insight-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

/* Botões de ação (partilhar / descarregar) */
.insight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.insight-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.insight-action:hover {
  border-color: var(--gold);
  background: #fffdf9;
}

.insight-action:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.insight-action--icon {
  width: 44px;
  padding: 0;
}

.insight-share-menu {
  position: absolute;
  z-index: 80;
  display: grid;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.insight-share-menu a,
.insight-share-menu button {
  display: block;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--navy);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.insight-share-menu a:hover,
.insight-share-menu button:hover,
.insight-share-menu a:focus-visible,
.insight-share-menu button:focus-visible {
  background: var(--light-neutral);
  outline: none;
}

/* Artigo */
.insight-article {
  max-width: 820px;
}

.insight-article__cover {
  margin: 0 0 48px;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.insight-article__cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.insight-article__body {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.8;
}

.insight-article__body > * + * {
  margin-top: 1.1em;
}

.insight-article__body p {
  margin: 0;
  color: var(--ink);
  font-size: inherit;
}

.insight-article__body h2 {
  margin: 1.8em 0 0.2em;
  font-size: clamp(26px, 3vw, 32px);
}

.insight-article__body h3 {
  margin: 1.5em 0 0.2em;
  font-size: 22px;
}

.insight-article__body h4 {
  margin: 1.4em 0 0.2em;
  font-size: 18px;
}

.insight-article__body ul,
.insight-article__body ol {
  padding-left: 1.4em;
}

.insight-article__body li + li {
  margin-top: 0.4em;
}

.insight-article__body blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--gold);
  color: var(--deep-blue);
  font-family: var(--font-display);
  font-size: 21px;
  font-style: italic;
  line-height: 1.6;
}

.insight-article__body a {
  color: var(--deep-blue);
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}

.insight-article__body hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ── Editing mode (admin signed in) ─────────────────────────── */
.insights-admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 32px;
  padding: 14px 18px 14px 20px;
  border: 1px solid rgba(184, 155, 76, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(184, 155, 76, 0.08);
  font-size: 14px;
}

.insights-admin-bar[hidden] {
  display: none;
}

.insights-admin-bar__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--ink-soft);
}

.insights-admin-bar__info strong {
  color: var(--navy);
}

.insights-admin-bar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2e7d53;
  box-shadow: 0 0 0 4px rgba(46, 125, 83, 0.15);
}

.insights-admin-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}

.insights-admin-bar__notice {
  flex-basis: 100%;
  margin: 0;
  color: var(--navy);
  font-size: 13px;
}

.insights-admin-bar__notice[data-tone="error"] {
  color: #9b2c3d;
}

.insights-admin-bar__notice[hidden] {
  display: none;
}

.insights-admin-bar--article {
  margin-bottom: 40px;
}

.insight-admin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line-strong);
  font-size: 13px;
}

.insight-admin__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.insight-admin__badge--published {
  background: rgba(46, 125, 83, 0.12);
  color: #22603f;
}

.insight-admin__badge--draft {
  background: var(--light-neutral);
  color: var(--ink-soft);
}

.insight-admin__badge--featured {
  background: rgba(184, 155, 76, 0.18);
  color: #7a6224;
}

.insight-admin__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--deep-blue);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(184, 155, 76, 0.6);
  text-underline-offset: 3px;
  cursor: pointer;
}

.insight-admin__link:hover {
  color: var(--navy);
}

.insight-admin__link:disabled {
  opacity: 0.5;
  cursor: progress;
}

.insight-admin__link--edit {
  margin-left: auto;
}

.insight-card--draft,
.insight-card--inactive {
  position: relative;
}

/* Draft: dashed outline, faded image */
.insight-card--draft {
  border: 2px dashed rgba(31, 42, 68, 0.35);
}

.insight-card--draft .insight-card__media img {
  opacity: 0.65;
}

/* Inactive: burgundy outline, translucent card, greyscale image */
.insight-card--inactive {
  border: 2px solid rgba(155, 44, 61, 0.55);
  opacity: 0.72;
}

.insight-card--inactive .insight-card__media img {
  filter: grayscale(1);
}

.insight-card--inactive:hover {
  opacity: 1;
}

.insight-card__flag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(20, 28, 46, 0.2);
  pointer-events: none;
}

.insight-card__flag--draft {
  background: var(--white);
  color: var(--navy);
  border: 1.5px dashed rgba(31, 42, 68, 0.5);
}

.insight-card__flag--inactive {
  background: #9b2c3d;
  color: var(--white);
}

.insight-admin__badge--inactive {
  background: rgba(155, 44, 61, 0.12);
  color: #7a1f3f;
}

@media (max-width: 720px) {
  .insight-article__cover {
    margin-bottom: 32px;
    border-radius: var(--radius-sm);
  }

  .insight-article__body {
    font-size: 16px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .cta-panel,
  .insight-actions,
  .tx-breadcrumb {
    display: none !important;
  }

  .tx-hero {
    padding: 0 0 24px;
    background: none;
    color: var(--navy);
  }

  .tx-hero h1,
  .tx-hero__lead,
  .insight-meta--light {
    color: var(--navy);
  }
}

/* Paragraph indentation (Tab in the editor) */
.insight-article__body .indent-1 {
  margin-left: 2em;
}

.insight-article__body .indent-2 {
  margin-left: 4em;
}

.insight-article__body .indent-3 {
  margin-left: 6em;
}

.insight-article__body .indent-4 {
  margin-left: 8em;
}

.insight-article__body ul ul,
.insight-article__body ol ol,
.insight-article__body ul ol,
.insight-article__body ol ul {
  margin: 0.4em 0;
}

@media (max-width: 720px) {
  .insight-article__body .indent-1 {
    margin-left: 1.25em;
  }

  .insight-article__body .indent-2 {
    margin-left: 2.5em;
  }

  .insight-article__body .indent-3 {
    margin-left: 3.75em;
  }

  .insight-article__body .indent-4 {
    margin-left: 5em;
  }
}

/* Insights management panel (signed in) */
.insights-panel {
  display: grid;
  gap: 22px;
  margin-bottom: 40px;
  padding: 28px;
  border: 1px solid rgba(184, 155, 76, 0.35);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(184, 155, 76, 0.07), rgba(255, 255, 255, 0.9));
  box-shadow: var(--shadow-sm);
}

.insights-panel[hidden] {
  display: none;
}

.insights-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.insights-panel__head .section-label {
  margin: 0 0 6px;
  color: var(--gold);
}

.insights-panel__title {
  margin: 0;
  color: var(--navy);
  font-size: clamp(26px, 3vw, 34px);
}

.insights-panel__create {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.insights-panel__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.insights-panel__stat {
  display: grid;
  gap: 2px;
  justify-items: start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.insights-panel__stat:hover {
  border-color: rgba(184, 155, 76, 0.6);
  transform: translateY(-1px);
}

.insights-panel__stat.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 10px 24px rgba(184, 155, 76, 0.18);
}

.insights-panel__stat:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.insights-panel__stat-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insights-panel__stat-value {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 600;
  line-height: 1.1;
}

.insights-panel__stat.is-active .insights-panel__stat-value {
  color: var(--gold);
}

.insights-panel__stat-hint {
  color: var(--ink-soft);
  font-size: 12px;
}

.insights-panel__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.insights-panel__filter {
  display: grid;
  gap: 6px;
  min-width: 170px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.insights-panel__filter select {
  min-height: 42px;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.insights-panel__filter select:focus {
  border-color: var(--gold);
  outline: 2px solid rgba(184, 155, 76, 0.25);
}

.insights-panel__clear {
  min-height: 42px;
  font-size: 13px;
}

.insights-panel__clear[hidden] {
  display: none;
}

.insights-panel__count {
  margin: 0 0 0 auto;
  line-height: 42px;
  color: var(--ink-soft);
  font-size: 13px;
}

.insights-panel__featured {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--ink-soft);
  font-size: 14px;
}

.insights-panel__featured strong {
  color: var(--navy);
}

.insights-panel__featured a {
  color: var(--navy);
}

.insights-panel__featured-star {
  color: var(--gold);
}

/* Empty state for the management list (no records or no results) */
.insights-panel__empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 0;
  padding: 40px 24px 48px;
  border: 1px dashed rgba(184, 155, 76, 0.45);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--ink-soft);
  text-align: center;
}

.insights-panel__empty img {
  display: block;
  width: min(300px, 70vw);
  height: auto;
  margin-bottom: 4px;
}

.insights-panel__empty h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(22px, 2.4vw, 28px);
}

.insights-panel__empty p {
  max-width: 460px;
  margin: 0 0 8px;
}

.insights-panel__empty[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .insights-panel__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .insights-panel {
    padding: 20px;
  }

  .insights-panel__create {
    width: 100%;
    justify-content: center;
  }

  .insights-panel__filter {
    flex: 1 1 100%;
  }

  .insights-panel__count {
    margin-left: 0;
  }
}

/* In editing mode, the "Book a consultation" block at the end of Insights pages is hidden. */
.has-edit-bar .cta-panel {
  display: none;
}
