.article-markdown { font-size: 1.08rem; line-height: 1.85; }
.article-markdown h2, .article-markdown h3 { font-family: Georgia, serif; line-height: 1.25; margin: 2rem 0 .8rem; }
.article-markdown blockquote { border-left: 4px solid #087b70; margin: 1.5rem 0; padding: .2rem 0 .2rem 1.2rem; color: #52615f; }
.article-markdown a, .article-identifiers a { color: #087b70; text-decoration: underline; text-underline-offset: 3px; }
.article-markdown table { width:100%; border-collapse:collapse; }
.article-markdown th, .article-markdown td { border: 1px solid #d8dfde; padding: .65rem; }
.article-identifiers, .article-references { border-top: 1px solid rgba(0,0,0,.14); margin-top: 2rem; padding-top: 1.5rem; }
.article-references h2 { font-family: Georgia, serif; font-size: 1.8rem; }


.article-markdown img { display:block; max-width:100%; height:auto; margin:1.5rem auto; border-radius:.75rem; }
.article-markdown pre { max-width:100%; overflow-x:auto; padding:1rem; border-radius:.75rem; background:#101820; color:#f8fafc; font-size:.9rem; }
.article-markdown code { overflow-wrap:anywhere; }
.article-markdown pre code { overflow-wrap:normal; white-space:pre; }
.article-markdown table { min-width:36rem; }
.article-markdown .table-wrapper { max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
@media (max-width:640px) {
  .article-markdown { font-size:1rem; line-height:1.75; }
  .article-markdown h2 { font-size:1.65rem; }
  .article-markdown h3 { font-size:1.3rem; }
  .article-markdown blockquote { margin:1.25rem 0; padding-left:.9rem; }
  .article-identifiers,.article-references { overflow-wrap:anywhere; }
}


/* Página de artigo: leitura confortável em qualquer ecrã */
.article-page{min-width:0}
.article-header{width:min(100%,56rem)}
.article-title{font-size:clamp(2.15rem,7vw,3.75rem);overflow-wrap:anywhere;text-wrap:balance}
.article-summary{font-size:clamp(1.08rem,3.5vw,1.25rem);line-height:1.6;text-wrap:pretty}
.article-byline{gap:.45rem .7rem}
.article-byline span{display:inline-flex;align-items:center}
.article-byline span+span::before{content:"·";margin-right:.7rem;opacity:.55}
.article-cover{overflow:hidden;background:#e5e7eb}
.article-cover img{display:block;width:100%;aspect-ratio:16/7;object-fit:cover}
.article-markdown p{margin:1rem 0}
.article-markdown ul,.article-markdown ol{padding-left:1.4rem;margin:1rem 0}
.article-markdown li+li{margin-top:.45rem}
.article-markdown hr{margin:2.25rem 0;border:0;border-top:1px solid rgba(0,0,0,.14)}
.article-markdown .table-wrapper{position:relative;margin:1.5rem 0;border:1px solid #d8dfde;border-radius:.75rem}
.article-markdown .table-wrapper table{margin:0}
.article-identifiers p,.article-references li,.article-references p{overflow-wrap:anywhere}
.article-related-grid>*{min-width:0}
@media(max-width:767px){
  .article-header{padding-top:2.25rem}
  .article-title{font-size:clamp(2rem,10vw,3rem);line-height:1.08}
  .article-summary{margin-top:1rem;line-height:1.55}
  .article-byline{display:grid;justify-items:center;gap:.3rem;margin-top:1rem;text-align:center}
  .article-byline span+span::before{display:none}
  .article-cover{margin-top:1.5rem}
  .article-cover img{aspect-ratio:4/3}
  .article-related{padding-top:2rem;padding-bottom:2.5rem}
  .article-related-grid{gap:1rem}
}
@media(max-width:420px){
  .article-header{padding-left:1rem;padding-right:1rem}
  .article-title{font-size:clamp(1.85rem,10vw,2.45rem)}
  .article-cover img{aspect-ratio:1/1}
  .article-markdown table{font-size:.9rem}
  .article-markdown th,.article-markdown td{padding:.55rem}
}

.article-video{margin:2rem 0}
.article-video-frame{position:relative;width:100%;aspect-ratio:16/9;overflow:hidden;border-radius:1rem;background:#101820}
.article-video-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.article-video video{display:block;width:100%;max-height:70vh;border-radius:1rem;background:#101820}
.article-video figcaption{margin-top:.65rem;font:400 .9rem/1.5 Inter,sans-serif;opacity:.68}
@media(max-width:640px){.article-video{margin:1.5rem 0}.article-video-frame,.article-video video{border-radius:.65rem}}


/* Enquadramento consistente das fotografias dos artigos */
.article-cover{width:min(100%,72rem);aspect-ratio:16/8;position:relative;border-radius:1.5rem;background:#e9eeee}
.article-cover-image,.article-cover>img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover;object-position:center;border-radius:inherit}
.article-author-avatar{display:block;flex:0 0 42px;width:42px!important;height:42px!important;max-width:42px;aspect-ratio:1;border-radius:50%;object-fit:cover}
.article-markdown figure{width:100%;margin:2rem 0}
.article-markdown figure img,.article-markdown>img{display:block;width:auto;max-width:100%;max-height:min(75vh,760px);height:auto;margin:1.5rem auto;object-fit:contain}
.article-markdown figcaption{max-width:42rem;margin:-.75rem auto 1.5rem;color:#687477;font:400 .88rem/1.5 Inter,sans-serif;text-align:center}
@media(max-width:767px){
  .article-cover{width:100%;aspect-ratio:4/3;border-radius:0}
  .article-cover-image,.article-cover>img{border-radius:0}
  .article-markdown figure{margin:1.5rem 0}
  .article-markdown figure img,.article-markdown>img{max-height:70vh;border-radius:.6rem}
}
@media(max-width:420px){
  .article-cover{aspect-ratio:4/3}
}

.article-chart{margin:2rem 0;padding:clamp(.65rem,2vw,1.25rem);border:1px solid #d8dfde;border-radius:1rem;background:#fff;overflow-x:auto}
.article-chart svg{display:block;width:100%;min-width:36rem;height:auto}
.article-chart figcaption{text-align:center;margin-top:.75rem;color:#52615f;font-size:.95rem;font-weight:600}
.article-chart .chart-axis{stroke:#64748b;stroke-width:1.5}
.article-chart .chart-grid{stroke:#e2e8f0;stroke-width:1}
.article-chart .chart-line{fill:none;stroke:#087f72;stroke-width:4;stroke-linejoin:round;stroke-linecap:round}
.article-chart .chart-value,.article-chart .chart-label,.article-chart .chart-legend{font-family:system-ui,sans-serif;fill:#334155}
.article-chart .chart-value{font-size:12px}.article-chart .chart-label{font-size:11px}.article-chart .chart-legend{font-size:13px}
@media(max-width:640px){.article-chart{margin-inline:-.5rem}.article-chart svg{min-width:32rem}}


/* Comentários */
.article-comments {
  scroll-margin-top: 6rem;
  border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent);
  background:
    radial-gradient(circle at 8% 5%, rgba(8, 139, 126, .08), transparent 28rem),
    color-mix(in srgb, #eef5f4 72%, white);
  padding: clamp(3.5rem, 7vw, 6rem) 1rem;
}
.article-comments-inner { width: min(1180px, 100%); margin: 0 auto; }
.comments-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; padding-bottom: 1.6rem; border-bottom: 2px solid currentColor; }
.comments-heading h2 { max-width: 720px; margin: .55rem 0 .45rem; font: 700 clamp(2.3rem, 5vw, 4.25rem)/.98 Georgia, serif; letter-spacing: -.035em; }
.comments-heading p { margin: 0; color: color-mix(in srgb, currentColor 62%, transparent); font-size: 1.05rem; }
.comments-count { display: inline-flex; align-items: center; gap: .55rem; flex: 0 0 auto; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 999px; background: color-mix(in srgb, white 78%, transparent); padding: .7rem 1rem; color: #067c70; font-weight: 900; }
.comments-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); align-items: start; gap: clamp(1.25rem, 3vw, 2.25rem); margin-top: 2rem; }
.comment-form-panel, .comments-list { min-width: 0; border: 1px solid color-mix(in srgb, currentColor 12%, transparent); border-radius: 1.15rem; background: color-mix(in srgb, white 92%, transparent); box-shadow: 0 18px 55px rgba(16, 24, 32, .07); }
.comment-form-panel { padding: clamp(1.25rem, 3vw, 2rem); }
.comment-form-intro { display: flex; align-items: flex-start; gap: 1rem; }
.comment-form-icon { display: grid; place-items: center; width: 3rem; height: 3rem; flex: 0 0 auto; border-radius: .85rem; background: #078b7e; color: white; font-size: 1.2rem; }
.comment-form-intro h3, .comments-list-heading h3, .comments-empty h3 { margin: 0; font: 700 1.55rem/1.15 Georgia, serif; }
.comment-form-intro p { margin: .45rem 0 0; color: color-mix(in srgb, currentColor 62%, transparent); line-height: 1.55; }
.comment-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.comment-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.comment-field { display: grid; gap: .45rem; }
.comment-form label { font-size: .85rem; font-weight: 800; letter-spacing: .02em; }
.comment-form label span { margin-left: .35rem; border-radius: 999px; background: #e1f2ef; color: #067c70; padding: .16rem .45rem; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.comment-form input, .comment-form textarea { width: 100%; border: 1px solid #ccd8d7; border-radius: .72rem; background: #fbfdfd; color: #101820; padding: .9rem 1rem; font: inherit; transition: border-color .18s, box-shadow .18s, background .18s; }
.comment-form input::placeholder, .comment-form textarea::placeholder { color: #7a8787; }
.comment-form textarea { resize: vertical; min-height: 10rem; line-height: 1.55; }
.comment-form input:hover, .comment-form textarea:hover { border-color: #91aaa7; }
.comment-form input:focus, .comment-form textarea:focus { outline: 0; border-color: #078b7e; background: white; box-shadow: 0 0 0 4px rgba(7, 139, 126, .13); }
.comment-field small { color: color-mix(in srgb, currentColor 54%, transparent); font-size: .76rem; }
.comment-form button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; justify-self: start; border: 0; border-radius: .72rem; background: #078b7e; color: white; padding: .9rem 1.2rem; font: 800 .92rem/1 Arial, sans-serif; cursor: pointer; box-shadow: 0 8px 20px rgba(7, 139, 126, .2); transition: transform .18s, background .18s, box-shadow .18s; }
.comment-form button:hover { background: #056f65; transform: translateY(-1px); box-shadow: 0 11px 24px rgba(7, 139, 126, .27); }
.comment-form button:active { transform: translateY(0); }
.comment-honeypot { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.comment-notice { display: flex; align-items: center; gap: .65rem; margin-top: 1rem; border-radius: .72rem; padding: .85rem 1rem; font-weight: 700; }
.comment-notice.success { background: #d9f7ed; color: #075e54; }
.comment-notice.error { background: #fee2e2; color: #991b1b; }
.comments-list { overflow: hidden; }
.comments-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent); padding: 1.35rem 1.5rem; }
.comments-list-heading span { display: grid; place-items: center; min-width: 2rem; height: 2rem; border-radius: 999px; background: #e1f2ef; color: #067c70; font-size: .82rem; font-weight: 900; }
.comment-card { padding: 1.35rem 1.5rem; }
.comment-card + .comment-card { border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent); }
.comment-card header { display: flex; align-items: center; gap: .85rem; }
.comment-avatar { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(135deg, #078b7e, #075a53); color: white; box-shadow: 0 4px 12px rgba(7, 139, 126, .18); font-weight: 900; }
.comment-author { display: grid; gap: .16rem; min-width: 0; }
.comment-author strong { overflow-wrap: anywhere; }
.comment-card time { display: inline-flex; align-items: center; gap: .35rem; color: color-mix(in srgb, currentColor 50%, transparent); font-size: .75rem; }
.comment-card > p { margin: 1rem 0 0 3.6rem; white-space: pre-wrap; overflow-wrap: anywhere; color: color-mix(in srgb, currentColor 82%, transparent); line-height: 1.68; }
.comments-empty { display: grid; justify-items: center; padding: clamp(2.5rem, 6vw, 4rem) 1.5rem; text-align: center; }
.comments-empty > span { display: grid; place-items: center; width: 4.25rem; height: 4.25rem; margin-bottom: 1rem; border-radius: 50%; background: #e1f2ef; color: #067c70; font-size: 1.55rem; }
.comments-empty p { max-width: 34ch; margin: .65rem 0 0; color: color-mix(in srgb, currentColor 58%, transparent); line-height: 1.55; }
.dark .article-comments { background: radial-gradient(circle at 8% 5%, rgba(8, 139, 126, .12), transparent 28rem), #0c1719; }
.dark .comment-form-panel, .dark .comments-list, .dark .comments-count { background: #111f22; border-color: rgba(255,255,255,.1); box-shadow: 0 18px 55px rgba(0,0,0,.2); }
.dark .comment-form input, .dark .comment-form textarea { background: #0c1719; border-color: #344547; color: #f5f7f7; }
.dark .comment-form input:focus, .dark .comment-form textarea:focus { background: #101d20; border-color: #2ab8aa; }
.dark .comment-form label span, .dark .comments-list-heading span, .dark .comments-empty > span { background: #123c36; color: #9de7dc; }
.dark .comment-notice.success { background: #123c36; color: #baf4e8; }
.dark .comment-notice.error { background: #4b1f24; color: #fecaca; }
@media (max-width: 900px) {
  .comments-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .article-comments { padding: 3rem .85rem; }
  .comments-heading { align-items: flex-start; }
  .comments-heading h2 { font-size: clamp(2.15rem, 12vw, 3rem); }
  .comments-heading p { font-size: .95rem; }
  .comments-count { padding: .58rem .75rem; }
  .comment-form-panel { padding: 1.1rem; border-radius: .9rem; }
  .comment-form-row { grid-template-columns: 1fr; }
  .comment-form button { width: 100%; }
  .comments-list { border-radius: .9rem; }
  .comments-list-heading, .comment-card { padding: 1.15rem; }
  .comment-card > p { margin-left: 0; }
}
