/* Foro: indice lateral y una sola columna de lectura. Ver GUIA_DE_MARCA.md */
.fo-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "index main" "lado main"; grid-template-rows: auto 1fr; gap: 32px 56px; align-items: start; max-width: 1440px; margin: 0 auto; padding: 40px 56px 64px; }
.fo-index { grid-area: index; display: flex; flex-direction: column; }
.fo-main { grid-area: main; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.fo-main > *, .fo-posts > * { min-width: 0; max-width: 100%; }
.fo-lado { grid-area: lado; display: flex; flex-direction: column; gap: 24px; }

.fo-index a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0 12px 16px; border-left: 2px solid var(--border); color: var(--text-dim); font-size: 15px; font-weight: 700; }
.fo-index a:hover { color: var(--text); }
.fo-index a[aria-current] { border-color: var(--gold); color: var(--text); }
.fo-index-n { font-weight: 400; font-variant-numeric: tabular-nums; }
.fo-index-tit { margin: 0 0 12px; color: var(--violet-light); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* Tema abierto: sin cabecera de pagina, indice fijo con los titulos del post */
.fo-tema .page-hero { display: none; }
.fo-tema .fo-layout { grid-template-areas: "index main" "index lado"; grid-template-rows: auto auto; }
.fo-tema .fo-index { position: sticky; top: 104px; }
.fo-tema .fo-main, .fo-tema .fo-lado { width: 100%; max-width: 800px; }
.fo-tema .fo-lado { flex-direction: row; gap: 40px; }
.fo-tema .fo-lat { flex: 1; }

/* Encabezados y bloques */
.fo-cab { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fo-cab h2, .fo-topic-head h2 { margin: 0; font-size: 36px; line-height: 1.15; font-weight: 600; overflow-wrap: anywhere; }
.fo-bloque { padding: 28px; background: var(--bg-card); border-radius: 2px; }
.fo-bloque > .fo-cab h2 { font-size: 22px; line-height: 1.25; }
.fo-bloque > .fo-cab { margin-bottom: 20px; }
.fo-layout .btn { border-radius: 2px; }
.fo-layout .btn.btn-sm { padding: 10px 16px; font-size: 14px; }
.fo-back { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.fo-back a { color: var(--text-dim); }
.fo-back a:hover { color: var(--text); }
.fo-topic-head { margin: 0; }
.fo-topic-meta { margin-top: 10px; color: var(--text-dim); font-size: 14px; }
.fo-mod { margin-top: 16px; }
.fo-danger { border-color: #E08A7E; color: #E08A7E !important; }

/* Lista de temas */
.fo-lista { margin-top: 20px; padding: 8px 28px; background: var(--bg-card); border-radius: 2px; }
.fo-topic { grid-template-columns: minmax(0, 1fr) 90px 180px; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.fo-topic:last-child { border-bottom: 0; }
.fo-topic:hover { background: none; }
.fo-topic:hover .fo-topic-tit { color: var(--gold); }
.fo-topic-tit { font-size: 16px; }
.fo-topic-sub, .fo-topic-last { margin-top: 4px; color: var(--text-dim); font-size: 14px; }
.fo-topic-stats strong { color: var(--text); font-size: 16px; }
.fo-topic-stats span { font-size: 13px; }
.fo-tag, .fo-tag-pin, .fo-tag-op { padding: 2px 8px; border: 1px solid var(--border); border-radius: 2px; color: var(--violet-light); font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.fo-topic-head h2 .fo-tag { vertical-align: middle; }
.fo-empty { font-size: 15px; }

/* Mensajes */
.fo-posts { gap: 16px; margin-top: 24px; }
.fo-post { border: 0; border-radius: 2px; background: var(--bg-card); }
.fo-post-head { gap: 12px; padding: 16px 28px; background: none; }
.fo-post-author { color: var(--text); font-size: 15px; }
.fo-post-date { color: var(--text-dim); font-size: 14px; }
.fo-del { color: #E08A7E; font-size: 14px; font-weight: 700; }

/* Texto de los mensajes: un solo color, 70-75 caracteres por linea y aire entre secciones */
.fo-post-body { padding: 28px; font-size: 17px; line-height: 1.7; }
.fo-post-body.fo-fmt { white-space: normal; color: var(--violet-light); }
.fo-fmt > p, .fo-fmt > ul, .fo-fmt > ol, .fo-fmt > blockquote, .fo-fmt > h3, .fo-fmt > h4 { max-width: 680px; }
.fo-fmt p { margin: 0 0 16px; }
.fo-fmt h3 { margin: 56px 0 16px; color: var(--text); font-family: var(--font-display); font-size: 24px; line-height: 1.25; font-weight: 600; text-wrap: balance; scroll-margin-top: 104px; }
.fo-fmt h4 { margin: 28px 0 8px; color: var(--gold); font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.fo-fmt h3 + h4 { margin-top: 16px; }
.fo-fmt h3:first-child, .fo-fmt h4:first-child { margin-top: 0; }
.fo-fmt ul, .fo-fmt ol { margin: 0 0 16px; padding-left: 0; }
.fo-fmt ul { list-style: none; }
.fo-fmt ol { padding-left: 24px; }
.fo-fmt ul > li { position: relative; margin: 8px 0; padding-left: 20px; }
.fo-fmt ol > li { margin: 8px 0; padding-left: 4px; }
.fo-fmt ol > li::marker { color: var(--violet-light); font-weight: 700; }
.fo-fmt ul > li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 5px; height: 5px; background: var(--violet); }
.fo-fmt li ul { margin: 8px 0 0; }
.fo-fmt li li::before { background: none; border: 1px solid var(--violet); box-sizing: border-box; }
.fo-fmt blockquote { margin: 24px 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--violet); }
.fo-fmt blockquote.fo-lead { margin: 0 0 32px; padding: 0; border: 0; font-size: 19px; line-height: 1.6; }
.fo-fmt hr { height: 1px; margin: 40px 0; border: 0; background: var(--border); }
.fo-fmt hr:has(+ h3) { display: none; }
.fo-fmt strong { color: var(--text); font-weight: 700; }
.fo-fmt a { color: var(--gold); text-decoration: underline; }
.fo-fmt .fo-tabla { overflow-x: auto; margin: 16px 0 24px; }
.fo-fmt table { border-collapse: collapse; font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.fo-fmt th, .fo-fmt td { padding: 10px 28px 10px 0; overflow-wrap: normal; text-align: left; }
.fo-fmt th:last-child, .fo-fmt td:last-child { padding-right: 0; }
.fo-fmt th { border-bottom: 1px solid var(--violet); color: var(--violet-light); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.fo-fmt td { border-bottom: 1px solid var(--border); vertical-align: middle; }
.fo-fmt td:first-child { white-space: nowrap; }
.fo-ico { display: inline-block; width: 32px; height: 32px; margin-right: 4px; vertical-align: middle; border: 1px solid var(--border); border-radius: 2px; }

/* Imagenes del foro: intercaladas en el texto */
.fo-img-link { display: block; margin: 12px 0; }
.fo-img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 2px; }
.fo-imgbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.fo-imgbar-hint { color: var(--text-dim); font-size: 14px; }
.fo-imgbar-hint.err { color: #E08A7E; }
.fo-preview { margin-top: 16px; border: 1px dashed var(--border); border-radius: 2px; }
.fo-preview-tit { padding: 8px 16px; border-bottom: 1px dashed var(--border); color: var(--text-dim); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* Formularios */
.fo-campo { display: block; margin-top: 16px; }
#fNuevo select, #fNuevo input, #fNuevo textarea, #ftResp textarea, #faAlias { padding: 12px; border: 1px solid var(--violet); border-radius: 2px; background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
#fnCat, #fnTit, #fnCuerpo, #frCuerpo { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; }
textarea.fo-drop { border-color: var(--gold) !important; }
.fo-enviar { margin-top: 16px; }
.fo-ancho { width: 100%; margin-top: 12px; text-align: center; }
.fo-nuevo-cuerpo, .fo-responder { margin-top: 24px; }

/* Columna de apoyo */
.fo-lat { padding-top: 24px; border-top: 1px solid var(--border); }
.fo-lat-tit { margin: 0 0 12px; color: var(--violet-light); font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.fo-side-text { margin: 0 0 12px; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
.fo-side-text strong { color: var(--text); }
.fo-rules { margin: 0; padding: 0; list-style: none; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
.fo-rules li { margin-bottom: 10px; }

/* Paginas */
.fo-main .mk-page { display: inline-block; border-radius: 2px; background: var(--bg-card); }
.fo-main .mk-page.active { background: none; border-color: var(--gold); color: var(--text); }

@media (max-width: 1080px) {
	.fo-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 32px 40px; padding-left: 32px; padding-right: 32px; }
}
@media (max-width: 960px) {
	/* En celular el indice queda arriba, en una fila que se desliza */
	.fo-layout { display: block; padding: 0 24px 48px; }
	.fo-index, .fo-tema .fo-index { position: sticky; top: 60px; z-index: 10; flex-direction: row; gap: 20px; margin: 0 -24px; padding: 0 24px; overflow-x: auto; background: var(--bg); border-bottom: 1px solid var(--border); scrollbar-width: none; }
	.fo-index a { flex: none; padding: 14px 0; border-left: 0; border-bottom: 2px solid transparent; }
	.fo-index-n, .fo-index-tit { display: none; }
	.fo-main { padding-top: 32px; }
	.fo-lado, .fo-tema .fo-lado { flex-direction: column; margin-top: 32px; }
	.fo-cab h2, .fo-topic-head h2 { font-size: 30px; }
	.fo-bloque { padding: 20px; }
	.fo-lista { padding: 4px 20px; }
	.fo-post-head { padding: 12px 20px; }
	.fo-post-body { padding: 20px; font-size: 16px; }
	.fo-fmt blockquote.fo-lead { font-size: 18px; }
	.fo-fmt h3 { margin-top: 44px; font-size: 22px; scroll-margin-top: 124px; }
}
@media (max-width: 640px) {
	.fo-topic { grid-template-columns: minmax(0, 1fr) 70px; }
	.fo-topic-last { display: none; }
}
@media (max-width: 760px) {
	/* Tablas chicas: el texto se acomoda. Tablas de 4 columnas o mas: se deslizan de costado */
	.fo-fmt td:first-child { white-space: normal; }
	.fo-fmt tr:has(td:nth-child(4)) td { white-space: nowrap; }
}

/* Portada: guia oficial a todo el ancho y comunidad debajo */
.fo-portada .fo-layout { display: block; padding-top: 16px; }
.fo-portada .fo-index { display: none; }
.fo-portada .fo-main { gap: 56px; }
.fo-portada .fo-lado { flex-direction: row; gap: 40px; margin-top: 56px; }
.fo-portada .fo-lat { flex: 1; }
.fo-hero { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 520px; background: var(--bg) url(../img/foro/portada-20261030.webp) right 55% / cover no-repeat; border-bottom: 0; }
.fo-hero::after { display: block; background: linear-gradient(transparent 70%, var(--bg)); }
.fo-sec-sub { margin: 8px 0 24px; color: var(--text-dim); font-size: 16px; }
.fo-guia-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fo-guia-card { display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 16 / 10; padding: 24px; background-color: var(--bg-card); background-position: center; background-size: cover; border-radius: 2px; color: var(--text-dim); text-decoration: none; }
a.fo-guia-card:hover h3 { color: var(--gold); }
.fo-guia-n { color: var(--violet-light); font-size: 13px; font-weight: 700; letter-spacing: .1em; }
.fo-guia-card h3 { margin: 4px 0; color: var(--text); font-size: 24px; line-height: 1.2; font-weight: 600; }
.fo-guia-card p { margin: 0; font-size: 15px; line-height: 1.4; color: var(--violet-light); }
.fo-guia-card:last-child { grid-column: 1 / -1; aspect-ratio: auto; min-height: 320px; background-position: center 55%; }
.fo-guia-off h3 { color: var(--text-dim); }
.fo-guia-off p { color: var(--text-dim); }
.fo-comu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 20px; }
.fo-comu-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; background: var(--bg-card); border-radius: 2px; text-decoration: none; }
.fo-comu-card strong { color: var(--text); font-size: 16px; }
.fo-comu-card span { color: var(--text-dim); font-size: 14px; }
.fo-comu-card:hover strong { color: var(--gold); }

/* Tema de la guia: portada grande con el titulo, sin datos de foro */
.fo-cover { display: flex; align-items: flex-end; min-height: 460px; background: var(--bg-card) center 22% / cover no-repeat; position: relative; }
.fo-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,16,19,.82), transparent 70%), linear-gradient(transparent 45%, var(--bg)); }
.fo-cover-in { position: relative; width: 100%; max-width: 1440px; margin: 0 auto; padding: 40px 56px 32px; }
.fo-cover-back { display: inline-block; margin-bottom: 28px; color: var(--violet-light); font-size: 15px; font-weight: 700; }
.fo-cover-n { display: block; color: var(--violet-light); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.fo-cover h1 { margin: 4px 0 8px; font-size: 56px; line-height: 1.1; font-weight: 600; }
.fo-cover p { margin: 0; max-width: 640px; color: var(--text); font-size: 18px; }
.fo-guia .fo-back, .fo-guia .fo-topic-head { display: none; }
.fo-guia .fo-post { background: none; }
.fo-guia .fo-post-body { padding: 0; }
.fo-guia .fo-posts { margin-top: 0; }
.fo-guia .fo-main, .fo-guia .fo-lado { max-width: 900px; }
.fo-guia .fo-lat:last-child { display: none; }
.fo-guia .fo-fmt table { width: 100%; }
.fo-guia .fo-fmt .fo-tabla { padding: 8px 24px; background: var(--bg-card); border-radius: 2px; }

@media (max-width: 960px) {
	.fo-guia-grid { grid-template-columns: repeat(2, 1fr); }
	.fo-portada .fo-layout { padding-top: 32px; }
	.fo-portada .fo-lado { flex-direction: column; }
	.fo-hero { min-height: 0; padding-top: 52vw; background-size: auto 64vw; background-position: 88% top; }
	.fo-hero::after { background: linear-gradient(transparent calc(64vw * .5), var(--bg) 64vw); }
	.fo-cover { min-height: 340px; }
	.fo-cover-in { padding: 24px 24px 20px; }
	.fo-cover h1 { font-size: 36px; }
	.fo-cover p { font-size: 16px; }
	.fo-guia .fo-post-body { padding: 0; }
}
@media (max-width: 560px) {
	.fo-guia-grid { grid-template-columns: 1fr; }
	.fo-guia-card:last-child { aspect-ratio: 16 / 10; min-height: 0; }
	.fo-guia-card { padding: 20px; }
}

/* Portada: la guia en carrusel lateral */
.fo-car-ctrl { display: flex; align-items: center; gap: 8px; }
.fo-car-ctrl[hidden] { display: none; }
.fo-car-all { margin-right: 12px; color: var(--gold); font-size: 15px; font-weight: 700; }
.fo-car-all:hover { color: var(--gold-light); }
.fo-car-btn { width: 44px; height: 44px; padding: 0; background: var(--bg-card); border: 1px solid #7A828C; border-radius: 2px; color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.fo-car-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.fo-car-btn:disabled { border-color: var(--border); color: var(--border); cursor: default; }
.fo-guia-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.fo-guia-track::-webkit-scrollbar { display: none; }
.fo-guia-track .fo-guia-card { flex: 0 0 300px; aspect-ratio: 3 / 2; padding: 20px; scroll-snap-align: start; }
.fo-guia-track .fo-guia-card h3 { font-size: 20px; }
.fo-guia-track .fo-guia-card p { font-size: 14px; }
.fo-guia-track .fo-guia-card:last-child { grid-column: auto; min-height: 0; aspect-ratio: 3 / 2; }

/* foro.html?guia=1: la guia completa */
.fo-guia-todo .fo-lado, .fo-guia-todo .fo-comu-sec, .fo-guia-todo #fLista { display: none; }
@media (max-width: 760px) {
	.fo-car-all { margin-right: 0; }
	.fo-car-btn { display: none; }
	.fo-guia-track .fo-guia-card { flex-basis: 78%; }
}
/* Sin el aire de las secciones generales: Comunidad queda cerca del carrusel */
.fo-guia-sec, .fo-comu-sec { padding: 0; }
