/* Todas as técnicas: faixas por área, cartões que enchem a linha (sem espaços vazios) e imagem em cada ficha. */
html body #main .technique-catalog { padding: 0 0 4rem !important; border-top: 0 !important; margin-top: 0; }
html body #main .technique-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .4rem 1.4rem; padding: 0; }
html body #main .technique-toolbar label { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html body #main .technique-toolbar input { flex: 0 1 15rem; max-width: 15rem; height: 2.2rem; padding: 0 .2rem 0 1.7rem; border: 0; border-bottom: 1px solid #d9d4c4; border-radius: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a948c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0 50%; color: #20342a; font-size: .92rem; box-shadow: none; }
html body #main .technique-toolbar input::placeholder { color: #9aa39c; }
html body #main .technique-toolbar input:focus { outline: 0; border-bottom-color: #4c7a34; }
html body #main .technique-count { margin: 0; color: #8a948c; font-size: .82rem; }
html body #main .technique-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.8rem; margin-top: 1.4rem; }
html body #main .technique-group { --tom: #4c7a34; scroll-margin-top: 6.5rem; }
html body #main .technique-group-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 0.9rem; margin: 0 0 1rem; }
html body #main .technique-group-head h2 { display: flex; align-items: center; gap: 0.6rem; margin: 0; color: #20342a; font-family: Georgia, serif; font-size: 1.6rem; line-height: 1.15; }
html body #main .technique-group-head h2::before { content: ""; flex: 0 0 auto; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--tom); }
html body #main .technique-group-count { color: #6d7a70; font-size: 0.9rem; }
html body #main .technique-group-cards { display: flex; flex-wrap: wrap; gap: 1.2rem; }
/* Cartão: imagem, título e resumo; toda a área abre a ficha. */
html body #main .tcard { --tom: inherit; flex: 1 1 17.5rem; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 0 !important; border-radius: 20px; background: color-mix(in srgb, var(--tom) 6%, #fff); color: inherit; text-decoration: none; scroll-margin-top: 7rem; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
html body #main .tcard:hover, html body #main .tcard:focus-visible { transform: translateY(-3px); background: color-mix(in srgb, var(--tom) 11%, #fff); box-shadow: 0 18px 30px -24px var(--tom); outline: none; }
html body #main .tcard-media { position: relative; display: block; height: 13.5rem; background: #ece7dc; overflow: hidden; }
html body #main .tcard-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
html body #main .tcard:hover .tcard-media img { transform: scale(1.04); }
html body #main .tcard-badge { position: absolute; right: .7rem; bottom: .7rem; padding: .22rem .65rem; border-radius: 999px; background: rgba(32, 52, 42, .82); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
html body #main .tcard-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: .35rem; padding: 1rem 1.15rem 1.15rem; }
html body #main .tcard-meta { color: var(--tom); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
html body #main .tcard-title { color: #20342a; font-family: Georgia, serif; font-size: 1.2rem; line-height: 1.22; }
html body #main .tcard-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; color: #4a554e; font-size: .95rem; line-height: 1.55; }
html body #main .tcard-more { margin-top: auto; padding-top: .6rem; color: var(--tom); font-size: .88rem; font-weight: 700; }
html body #main .technique-grid .empty { padding: 1.4rem; border: 0; border-radius: 16px; background: #f4f1ea; color: #55605a; font-size: 1rem; }
html body #main .topic-back-links { margin-top: 2.4rem; }
html body #main .technique-group[data-tom="solo"] { --tom: #6b8f47; }
html body #main .technique-group[data-tom="compostagem"] { --tom: #8a5a3c; }
html body #main .technique-group[data-tom="planeamento"] { --tom: #a66f50; }
html body #main .technique-group[data-tom="agua"] { --tom: #2f6f9e; }
html body #main .technique-group[data-tom="sementeiras"] { --tom: #3f8a4a; }
html body #main .technique-group[data-tom="sementes"] { --tom: #7d3350; }
html body #main .technique-group[data-tom="biodiversidade"] { --tom: #1e8449; }
html body #main .technique-group[data-tom="prevencao"] { --tom: #c9762f; }
html body #main .technique-group[data-tom="perenes"] { --tom: #3f7373; }
@media (max-width: 700px) { html body #main .technique-toolbar input { flex-basis: 100%; max-width: none; } }

/* Ficha completa numa janela */
html.tec-aberta { overflow: hidden; }
.tfiche-janela { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: clamp(.6rem, 3vw, 2rem); }
.tfiche-fundo { position: absolute; inset: 0; background: rgba(24, 36, 29, .6); backdrop-filter: blur(3px); animation: tfiche-fundo .2s ease; }
.tfiche { --tom: #4c7a34; position: relative; display: flex; flex-direction: column; width: min(1120px, 100%); max-height: 100%; overflow: auto; border-radius: 24px; background: #fff; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); animation: tfiche-entra .25s ease; overscroll-behavior: contain; }
.tfiche[data-tom="solo"] { --tom: #6b8f47; } .tfiche[data-tom="compostagem"] { --tom: #8a5a3c; } .tfiche[data-tom="planeamento"] { --tom: #a66f50; }
.tfiche[data-tom="agua"] { --tom: #2f6f9e; } .tfiche[data-tom="sementeiras"] { --tom: #3f8a4a; } .tfiche[data-tom="sementes"] { --tom: #7d3350; }
.tfiche[data-tom="biodiversidade"] { --tom: #1e8449; } .tfiche[data-tom="prevencao"] { --tom: #c9762f; } .tfiche[data-tom="perenes"] { --tom: #3f7373; }
.tfiche-fechar { box-sizing: border-box; position: sticky; top: .5rem; z-index: 3; align-self: flex-end; flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; min-width: 0; margin: .5rem .6rem -2.9rem 0; padding: 0 0 .25rem; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: #5f6b64; font-size: 2.1rem; font-weight: 300; line-height: 1; letter-spacing: 0; text-transform: none; cursor: pointer; }
.tfiche-fechar:hover, .tfiche-fechar:focus-visible { color: #20342a; background: transparent !important; outline: 0; }
/* Duas imagens: uma por cima da outra, ao lado do texto, para não deixar vazio por baixo */
.tfiche-cabeca { padding: clamp(1.2rem, 2.6vw, 2rem) clamp(1rem, 2.4vw, 1.8rem) 0; padding-right: 3.4rem; }
.tfiche-grelha { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.4rem); padding: 1.2rem clamp(1rem, 2.4vw, 1.8rem) clamp(1rem, 2.4vw, 1.8rem); align-items: stretch; }
/* A coluna das imagens estica até à altura dos passos: a única foto cresce, as duas repartem o espaço. */
.tfiche-imagens { display: flex; flex-direction: column; min-width: 0; }
.tfiche-imagens .tec-galeria { margin: 0; }
.tfiche-imagens .tec-galeria--um, .tfiche-imagens .tec-galeria--n2 { flex: 1 1 auto; display: flex; flex-direction: column; gap: .6rem; }
.tfiche-imagens .tec-galeria--um .tec-fig, .tfiche-imagens .tec-galeria--n2 .tec-fig { flex: 1 1 auto; display: flex; flex-direction: column; }
.tfiche-imagens .tec-galeria--um .tec-fig img, .tfiche-imagens .tec-galeria--n2 .tec-fig img { flex: 1 1 auto; width: 100%; height: auto; min-height: 190px; max-height: 520px; aspect-ratio: 3 / 2; }
.tfiche-texto { min-width: 0; padding: 0; }
.tfiche-imagens .tec-galeria--n3 { flex: 1 1 auto; grid-template-rows: auto minmax(0, 1fr); }
.tfiche-imagens .tec-galeria--n3 .tec-fig--foto { display: flex; flex-direction: column; }
.tfiche-imagens .tec-galeria--n3 .tec-fig--foto img { flex: 1 1 auto; height: auto; min-height: 140px; max-height: 460px; }
.tfiche-grelha:has(.tec-galeria--n2) { grid-template-columns: minmax(0, .64fr) minmax(0, 1fr); }
.tfiche-imagens .tec-galeria--n2 .tec-fig img { aspect-ratio: 16 / 10; min-height: 150px; }
.tfiche-meta { display: block; color: var(--tom); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tfiche-cabeca h2 { margin: .5rem 0 .7rem; color: #20342a; font-family: Georgia, serif; font-size: clamp(1.6rem, 3vw, 2.15rem); line-height: 1.15; }
.tfiche-resumo { margin: 0; color: #3f4a43; font-size: 1.05rem; line-height: 1.65; }
.tfiche-quando { margin: 1.1rem 0 0; padding: .9rem 1.1rem; border-radius: 14px; background: color-mix(in srgb, var(--tom) 10%, #fff); color: #33413a; font-size: .96rem; line-height: 1.55; }
.tfiche-quando b { display: block; margin-bottom: .2rem; color: var(--tom); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.tfiche-sub { margin: 0 0 .8rem; color: var(--tom); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tfiche-passos { counter-reset: passo; margin: 0; padding: 0; list-style: none; }
.tfiche-passos li { counter-increment: passo; position: relative; margin: 0; padding: 0 0 1rem 2.9rem; color: #33413a; font-size: 1rem; line-height: 1.6; }
.tfiche-passos li::before { content: counter(passo); position: absolute; left: 0; top: 0; z-index: 1; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--tom); color: #fff; font-size: .9rem; font-weight: 800; }
.tfiche-passos li::after { content: ""; position: absolute; left: .95rem; top: 2.2rem; bottom: .2rem; width: 2px; background: color-mix(in srgb, var(--tom) 22%, #fff); }
.tfiche-passos li:last-child { padding-bottom: 0; } .tfiche-passos li:last-child::after { display: none; }
.tfiche-fontes { margin: 1.4rem 0 0; color: #5a6560; font-size: .8rem; line-height: 1.55; }
.tfiche-fontes a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tfiche-rodape { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 1rem; padding: .9rem clamp(1rem, 2.4vw, 1.8rem); background: color-mix(in srgb, var(--tom) 7%, #fff); }
.tfiche-nav { display: flex; align-items: center; gap: .6rem; max-width: 46%; color: #20342a; font-weight: 700; text-decoration: none; line-height: 1.25; }
.tfiche-nav small { display: block; color: var(--tom); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.tfiche-nav span { min-width: 0; font-size: .92rem; } .tfiche-nav:last-child { margin-left: auto; text-align: right; }
.tfiche-nav:hover span { text-decoration: underline; text-underline-offset: 3px; }
/* Duas fotografias e poucos passos: as fotografias em faixa, lado a lado, e os passos em duas colunas por baixo. */
.tfiche--faixa .tfiche-grelha, .tfiche--faixa .tfiche-grelha:has(.tec-galeria--n2) { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
.tfiche--faixa .tfiche-imagens .tec-galeria--n2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.tfiche--faixa .tfiche-imagens .tec-galeria--n2 .tec-fig { display: block; grid-column: auto; }
.tfiche--faixa .tfiche-imagens .tec-galeria--n2 .tec-fig--esquema img { object-fit: contain; }
.tfiche--faixa .tfiche-imagens .tec-galeria--n2 .tec-fig img { aspect-ratio: 16 / 9; max-height: 300px; min-height: 0; }
.tfiche--faixa .tfiche-passos { columns: 2; column-gap: 2.4rem; }
.tfiche--faixa .tfiche-passos li { break-inside: avoid; }
.tfiche--faixa .tfiche-passos li::after { display: none; }
.tfiche--faixa .tfiche-sub { margin-top: 0; }
@keyframes tfiche-fundo { from { opacity: 0; } to { opacity: 1; } }
@keyframes tfiche-entra { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
    .tfiche-janela { padding: 0; }
    .tfiche { border-radius: 0; height: 100%; }
    .tfiche-grelha, .tfiche--faixa .tfiche-grelha:has(.tec-galeria--n2) { grid-template-columns: minmax(0, 1fr); }
    .tfiche--faixa .tfiche-passos { columns: 1; }
    .tfiche--faixa .tfiche-imagens .tec-galeria--n2 { display: flex; gap: .7rem; }
    .tfiche--faixa .tfiche-imagens .tec-galeria--n2 .tec-fig { flex: 0 0 86%; }
    .tfiche--faixa .tfiche-imagens .tec-galeria--n2 .tec-fig img { aspect-ratio: 3 / 2; max-height: none; }
    .tfiche-imagens .tec-galeria--n3 { display: flex; }
    .tfiche-imagens .tec-galeria--n3 .tec-fig--foto img { flex: none; min-height: 0; max-height: none; }
    .tfiche-imagens { position: static; margin: 0 -1rem; }
    /* Em telemóvel as imagens deslizam na horizontal, para o texto aparecer logo. */
    .tfiche-imagens .tec-galeria { display: flex; gap: .7rem; padding: 0 1rem .4rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .tfiche-imagens .tec-galeria::-webkit-scrollbar { display: none; }
    .tfiche-imagens .tec-fig { flex: 0 0 86%; scroll-snap-align: center; }
    .tfiche-imagens .tec-fig img { aspect-ratio: 3 / 2; }
    .tfiche-texto { padding: 0; }
    .tfiche-cabeca { padding-right: 3rem; }
    .tfiche-imagens .tec-galeria--um, .tfiche-imagens .tec-galeria--n2 { display: flex; flex-direction: row; }
    .tfiche-nav { max-width: 48%; } .tfiche-nav span { font-size: .84rem; }
}
@media (prefers-reduced-motion: reduce) { .tfiche, .tfiche-fundo { animation: none; } }
.tfiche-guia { display: block; margin-top: 1.4rem; padding: .9rem 1.1rem; border-radius: 14px; background: color-mix(in srgb, var(--tom) 8%, #fff); color: #20342a; font-weight: 700; text-decoration: none; line-height: 1.35; }
.tfiche-guia small { display: block; margin-bottom: .15rem; color: var(--tom); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.tfiche-guia:hover { background: color-mix(in srgb, var(--tom) 16%, #fff); }
