/* «O que se passa na tua horta?»: pesquisa, filtros e cartões que abrem. */
.problemas { margin: 0 0 3rem; min-height: 0 !important; }
.problemas-head h2 { margin: .2em 0 .3em; font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height: 1.1; }
.problemas-head p { max-width: 46rem; margin: 0 0 1.2rem; color: var(--muted, #68736c); line-height: 1.6; }
.problemas-tools { display: grid; gap: .9rem; margin-bottom: 1.2rem; }
.problemas-tools input { width: 100%; box-sizing: border-box; height: 3.4em; padding: 0 1.2em; border: 1px solid var(--line, #d9e1db); border-radius: 14px; background: #fff; color: var(--ink, #1d2922); font: inherit; font-size: 1em; }
.problemas-linha { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: .75rem; }
.problemas-tools select { width: 100%; box-sizing: border-box; height: 3.4em; padding: 0 1em; border: 1px solid var(--line, #d9e1db); border-radius: 14px; background: #fff; color: var(--ink, #1d2922); font: inherit; font-size: .95em; }
.problemas-tools select:focus { outline: 2px solid var(--forest, #536b57); outline-offset: 1px; }
.problemas-tools input:focus { outline: 2px solid var(--forest, #536b57); outline-offset: 1px; }
.problemas-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.problemas .problemas-chips button { height: auto; line-height: 1.2; padding: .5em .95em; border: 1px solid var(--line, #d9e1db); border-radius: 999px; background: #fff; color: var(--ink, #1d2922); font: 700 .86em/1.2 "Source Sans Pro", sans-serif; letter-spacing: 0; text-transform: none; box-shadow: none; cursor: pointer; }
.problemas .problemas-chips button:hover { border-color: var(--forest, #536b57); }
.problemas .problemas-chips button[aria-pressed="true"], .problemas .problemas-chips button[aria-pressed="true"] small { background-color: var(--forest, #536b57) !important; border-color: var(--forest, #536b57) !important; color: #fff !important; }
.problemas .problemas-chips button[aria-pressed="true"] small { background: transparent !important; }
.problemas-chips small { margin-left: .35em; font-weight: 600; opacity: .7; color: inherit; }
.problemas-contagem { margin: 0; color: var(--muted, #68736c); font-size: .9em; }
.problemas-lista { display: grid; gap: .5rem; }
.problema { border: 1px solid var(--line, #e1e8e2); border-radius: 12px; background: #fff; overflow: hidden; }
.problema[open] { border-color: var(--forest, #536b57); box-shadow: 0 10px 28px rgba(36, 55, 43, .07); }
.problema summary { display: grid; gap: .1em; padding: .7em 2.6em .7em 1em; cursor: pointer; list-style: none; position: relative; }
.problema summary::-webkit-details-marker { display: none; }
.problema summary::after { content: "+"; position: absolute; right: .9em; top: .5em; color: var(--forest, #536b57); font-size: 1.4em; line-height: 1; font-weight: 300; }
.problema[open] summary::after { content: "−"; }
.problema-titulo { color: var(--ink, #1d2922); font: 800 1em/1.3 "Source Sans Pro", sans-serif; }
.problema-resumo { overflow: hidden; color: var(--muted, #5b665f); font-size: .86em; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.problema[open] .problema-resumo { white-space: normal; }
.problema-corpo { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 1.2rem; padding: 0 1.3rem 1.2rem; }
.problema-col { padding: 1.1em 1.2em; border-radius: 12px; background: var(--pale, #f1f5f1); min-width: 0; }
.problema-fazer { background: #eaf1e6; }
.problema-col h3 { margin: 0 0 .6em; color: var(--forest, #536b57); font: 800 max(11px, .72em)/1.2 "Source Sans Pro", sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.problema-col ul, .problema-col ol { margin: 0; padding-left: 1.2em; display: grid; gap: .5em; }
.problema-col li { color: var(--ink, #27312c); font-size: .95em; line-height: 1.5; }
.problema-links, .problema-fontes { margin: 0; padding: 0 1.3rem 1rem; font-size: .88em; line-height: 1.6; }
.problema-links { display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.problema-links a { color: var(--forest, #536b57); font-weight: 700; text-decoration: none; }
.problema-links a:hover { text-decoration: underline; }
.problema-links small { margin-right: .3em; color: var(--muted, #68736c); font-weight: 800; font-size: .8em; letter-spacing: .1em; text-transform: uppercase; }
.problema-fontes { padding-top: 0; color: var(--muted, #68736c); }
.problema-fontes a { color: inherit; }
.problemas-vazio { padding: 1.6rem; border-radius: 14px; background: var(--sand, #f7f3ea); color: var(--muted, #68736c); }
@media (max-width: 900px) { .problema-corpo { grid-template-columns: 1fr; } }

.problemas-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 1.2rem; }
.problemas .problemas-mais { height: auto; line-height: 1.2; padding: .75em 1.5em; border: 1px solid var(--forest, #536b57); border-radius: 999px; background: transparent; color: var(--forest, #536b57); font: 800 .9em/1.2 "Source Sans Pro", sans-serif; letter-spacing: 0; text-transform: none; box-shadow: none; cursor: pointer; }
.problemas .problemas-mais:hover { background: var(--forest, #536b57); color: #fff; }
.problemas .problemas-mais[hidden] { display: none; }

/* Problemas frequentes numa ficha de cultura. */
.crop-problemas { margin: 0 0 2.5rem; min-height: 0 !important; }
.crop-problemas[hidden] { display: none; }
.crop-problemas-head { margin-bottom: 1rem; }
.crop-problemas-head span { display: block; color: var(--forest, #536b57); font: 800 .72rem/1.2 "Source Sans Pro", sans-serif; letter-spacing: .18em; text-transform: uppercase; }
.crop-problemas-head h2 { margin: .3em 0 .3em; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.15; }
.crop-problemas-head p { margin: 0; color: var(--muted, #68736c); max-width: 46rem; line-height: 1.6; }
.crop-problemas-lista { display: grid; gap: .7rem; }
.crop-problemas-mais { margin-top: 1rem; }

/* Chips de cultura com ícone redondo, como nas pragas sazonais do Calendário. */
.problemas .problemas-chips button.has-img { display: inline-flex; align-items: center; gap: .5em; padding: .3em .95em .3em .3em; }
.problemas .problemas-chips button img { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: #eaf1e6; }
.problemas .problemas-chips button.has-img small { margin-left: .1em; }

/* Ao escolher uma ligação da barra fixa, o título da secção fica logo por baixo da barra (e não escondido atrás dela).
   #percursos e #atualidade já têm um espaço interior grande: desconta-se esse espaço. */
#problemas, #fatores { scroll-margin-top: 6.5rem; }
#main #percursos, #main #atualidade { scroll-margin-top: calc(6.5rem - clamp(3.5rem, 7vw, 6rem)); }
@media (max-width: 760px) {
    #main #percursos { scroll-margin-top: calc(6.5rem - 3.2rem); }
    #main #atualidade { scroll-margin-top: calc(6.5rem - 3.5rem); }
}

@media (max-width: 760px) { .problemas-linha { grid-template-columns: 1fr; } }

/* Grelha de quadrados discretos (hub): o problema e o grupo; a resposta abre num painel a toda a largura por baixo da linha. */
.problemas-grelha { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .55rem; }
.problemas-grelha .problemas-vazio { grid-column: 1 / -1; }
/* Cores suaves por grupo: o fundo e a etiqueta mudam de tom, o título fica sempre em tinta escura. */
.problemas .problema-quadro { --q-bg: #f3f6f3; --q-line: #d9e3db; --q-tag: #3f6b4c; display: flex !important; flex-direction: column; justify-content: space-between; gap: .55em; min-height: 5.4em; height: auto !important; padding: .75em .9em !important; border: 1px solid var(--q-line) !important; border-radius: 12px !important; background: var(--q-bg) !important; color: #27312c !important; font: inherit; letter-spacing: 0 !important; text-align: left; text-transform: none !important; white-space: normal !important; box-shadow: none !important; cursor: pointer; transition: border-color .15s, background-color .15s; }
.problemas .problema-quadro[data-grupo="sementeira"] { --q-bg: #fbf6e9; --q-line: #ebdfbd; --q-tag: #8a6a1c; }
.problemas .problema-quadro[data-grupo="pragas"] { --q-bg: #fbf0eb; --q-line: #efd3c8; --q-tag: #a04e38; }
.problemas .problema-quadro[data-grupo="doencas"] { --q-bg: #f3f0f9; --q-line: #dcd6ec; --q-tag: #5d4c8d; }
.problemas .problema-quadro:hover { border-color: var(--q-tag) !important; }
.problemas .problema-quadro.is-active { border-color: var(--q-tag) !important; box-shadow: inset 0 0 0 1px var(--q-tag) !important; }
.problemas .problema-quadro-titulo { display: -webkit-box !important; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; color: #27312c !important; font: 650 .9em/1.3 "Source Sans Pro", sans-serif; letter-spacing: 0; text-transform: none; white-space: normal !important; text-overflow: clip; }
.problemas .problema-quadro small { color: var(--q-tag) !important; font: 800 max(11px, .62em)/1.2 "Source Sans Pro", sans-serif; letter-spacing: .1em; text-transform: uppercase; white-space: normal; opacity: .9; }
.problema-painel { position: relative; grid-column: 1 / -1; border: 1px solid var(--forest, #536b57); border-radius: 14px; background: #fff; box-shadow: 0 10px 28px rgba(36, 55, 43, .07); padding-top: 1.1rem; }
.problema-painel-titulo { margin: 0; padding: 0 3.2rem 0 1.3rem; color: var(--ink, #1d2922); font: 800 1.15em/1.3 "Source Sans Pro", sans-serif; }
.problema-painel-resumo { margin: .35rem 0 1rem; padding: 0 1.3rem; color: var(--muted, #5b665f); font-size: .95em; line-height: 1.55; }
.problemas .problema-fechar { position: absolute; top: .55rem; right: .7rem; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--forest, #536b57); font-size: 1.5em; line-height: 1; box-shadow: none; cursor: pointer; }
.problemas .problema-fechar:hover { background: var(--pale, #f1f5f1); }
@media (max-width: 760px) { .problemas-grelha { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Ferramentas do hub: uma fotografia e quatro ligações, sem cartões redondos nem espaços vazios. */
.hub-tools-lead { margin: .9rem 0 0; max-width: 62ch; color: var(--muted, #5b665f); font-size: 1rem; line-height: 1.7; }
.hub-tools-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.4rem, 3.2vw, 2.8rem); align-items: stretch; }
.hub-tools-foto { margin: 0; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.hub-tools-foto img { display: block; width: 100%; flex: 1; min-height: 300px; max-height: 420px; object-fit: cover; border-radius: 22px; border: 1px solid var(--line, #dfe5dc); }
.hub-tools-foto figcaption { font-size: .78rem; line-height: 1.55; color: var(--muted, #5b665f); }
.hub-tools-foto figcaption span { display: block; }
.hub-tools-foto figcaption a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.hub-tools-lista { list-style: none; margin: 0; padding: 0; display: grid; align-content: center; min-width: 0; }
.hub-tools-lista li { margin: 0; padding: 0; border-bottom: 1px solid var(--line, #dfe5dc); }
.hub-tools-lista li:first-child { border-top: 1px solid var(--line, #dfe5dc); }
.hub-tools-lista a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.1rem; align-items: center; padding: 1.15rem .3rem; color: var(--ink, #1d2922); text-decoration: none; border-bottom: 0; }
.hub-tools-ico { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 50%; background: var(--pale, #eef3ec); color: var(--forest, #2f6b3a); transition: background .2s, color .2s; }
.hub-tools-txt { display: grid; gap: .2rem; min-width: 0; }
.hub-tools-txt strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.28rem; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.hub-tools-txt small { font-size: .92rem; line-height: 1.5; color: var(--muted, #5b665f); }
.hub-tools-seta { font-size: 1.25rem; color: var(--forest, #2f6b3a); transition: transform .2s; }
.hub-tools-lista a:hover .hub-tools-ico, .hub-tools-lista a:focus-visible .hub-tools-ico { background: var(--forest, #2f6b3a); color: #fff; }
.hub-tools-lista a:hover .hub-tools-seta, .hub-tools-lista a:focus-visible .hub-tools-seta { transform: translateX(5px); }
/* Blocos alternados: a fotografia fica à direita, o texto à esquerda. */
@media (min-width: 861px) {
  .hub-tools-grid--inv { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .hub-tools-grid--inv .hub-tools-foto { order: 2; }
}
@media (max-width: 860px) {
  .hub-tools-grid { grid-template-columns: minmax(0, 1fr); }
  .hub-tools-foto img { min-height: 0; max-height: none; aspect-ratio: 3 / 2; }
}

/* Sem traços horizontais entre blocos. */
.hub-section:has(> .hub-tools-grid) { border-top: 0 !important; padding: clamp(2rem, 4vw, 3.2rem) 0 !important; }
.hub-section[id], .hub-latest[id] { scroll-margin-top: 5.8rem; }
