/* =========================================================================
   home.css — Home C ("revista") com palco de banners + destaques automáticos.
   Prefixo hm-. Tokens em site-base.css.
   ========================================================================= */

/* ---------- Palco ---------- */
.hm-stage { position: relative; background: var(--pub-blue-900); overflow: hidden; }
.hm-slides { position: relative; height: clamp(420px, 41.9vw, 600px); }
.hm-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s linear .5s; }
.hm-slide.is-on { opacity: 1; visibility: visible; transition: opacity .5s ease; z-index: 1; }
.hm-slide > a, .hm-slide__link { position: absolute; inset: 0; display: block; color: inherit; text-decoration: none; }

/* Banner: arte pronta, sempre inteira (contain) sobre a própria arte desfocada */
.hm-banner__bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(28px) brightness(.7) saturate(1.1); transform: scale(1.05); }
.hm-banner picture, .hm-banner img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hm-banner img { object-fit: contain; }

/* Destaque automático com FOTO: título por cima, gradiente lateral */
.hm-ed { position: absolute; inset: 0; display: flex; align-items: flex-end; color: #fff; }
.hm-ed__bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hm-ed::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 30, 64, .92) 0%, rgba(0, 30, 64, .6) 42%, rgba(0, 30, 64, .05) 78%); }
.hm-ed .pub-wrap { position: relative; z-index: 1; padding-bottom: 56px; }
.hm-ed__t { max-width: 640px; }

/* Destaque automático com ARTE (capa com texto): texto à esquerda, arte inteira à direita */
.hm-art { position: absolute; inset: 0; display: flex; align-items: center; color: #fff; background: var(--pub-blue-900); }
.hm-art::before { content: ""; position: absolute; right: -80px; top: -200px; width: 520px; height: 520px; border-radius: 50%; border: 36px solid var(--pub-yellow); clip-path: inset(50% 0 0 0); opacity: .9; }
.hm-art .pub-wrap { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; }
.hm-art__img { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--pub-radius); background: rgba(255, 255, 255, .06) center / contain no-repeat; }

.hm-kind { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
/* Os dois selos informativos do slide têm o MESMO formato (6 px, caixa alta,
   mesmo tamanho); só a cor muda: amarelo = situação, branco translúcido = origem.
   O botão continua pill (pill = clicável, 6 px = informativo). */
.hm-kind .pub-badge, .hm-kind__src { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px; font: 800 11px/1 var(--pub-font); letter-spacing: .08em; text-transform: uppercase; }
.hm-kind__src { background: rgba(255, 255, 255, .16); color: #fff; }
.hm-title { font: 800 clamp(30px, 3.6vw, 50px)/1.05 var(--pub-font-display); letter-spacing: -.02em; color: #fff; margin: 0 0 12px; text-wrap: balance; }
.hm-text { font: 400 17px/1.55 var(--pub-font); color: #e3ecf7; margin: 0 0 22px; max-width: 52ch; }
.hm-acts { display: flex; flex-wrap: wrap; gap: 10px; }

/* Setas e pausa */
.hm-ctrl { position: absolute; z-index: 3; right: max(var(--pub-gutter), calc((100% - var(--pub-wrap)) / 2 + var(--pub-gutter))); bottom: 18px; display: flex; gap: 8px; }
.hm-ctrl button { width: 40px; height: 40px; border-radius: 999px; border: 0; background: rgba(0, 0, 0, .35); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(4px); }
.hm-ctrl button:hover, .hm-ctrl button:focus-visible { background: rgba(0, 0, 0, .55); }

/* ---------- Faixa "Agora no Sesc" (índice do palco) ---------- */
.hm-rail { background: #fff; border-bottom: 1px solid var(--pub-line); }
.hm-rail .pub-wrap { display: flex; align-items: stretch; }
.hm-rail__lbl { display: flex; align-items: center; padding-right: 20px; font: 700 12px/1.2 var(--pub-font); letter-spacing: .09em; text-transform: uppercase; color: var(--pub-muted); white-space: nowrap; flex: none; }
.hm-rail__tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hm-rail__tabs::-webkit-scrollbar { display: none; }
.hm-tab { all: unset; box-sizing: border-box; cursor: pointer; flex: 1 0 180px; max-width: 280px; min-width: 0; padding: 14px 16px 16px; border-left: 1px solid var(--pub-line-soft); position: relative; scroll-snap-align: start; }
.hm-tab::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: transparent; }
.hm-tab::after { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 0; background: var(--pub-yellow); }
.hm-tab.is-on::before { background: rgba(246, 190, 0, .25); }
.hm-tab.is-on::after { width: var(--hm-prog, 100%); }
.hm-tab.is-on { background: #fbfcfe; }
.hm-tab:focus-visible { outline: 2px solid var(--pub-blue); outline-offset: -2px; }
.hm-tab small { display: block; font: 700 11px/1.2 var(--pub-font); letter-spacing: .06em; text-transform: uppercase; color: var(--pub-muted); }
.hm-tab b { display: block; font: 700 14.5px/1.3 var(--pub-font-display); color: var(--pub-ink); margin: 4px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tab span { display: block; font-size: 12.5px; font-weight: 600; color: #15803d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tab span.is-banner { color: var(--pub-muted); font-weight: 500; }

/* ---------- Áreas (tipográficas) ---------- */
.hm-areas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 34px; padding: 26px 0 24px; border-bottom: 1px solid var(--pub-line); }
.hm-areas a { display: inline-flex; align-items: center; gap: 10px; font: 700 21px/1.3 var(--pub-font-display); color: var(--pub-ink); text-decoration: none; transition: color .15s; }
/* Ícone no tom claro da cor da área (padrão de badge do site: tint + matiz). */
.hm-areas__ic { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 17px; color: var(--c, var(--pub-blue)); background: color-mix(in srgb, var(--c, var(--pub-blue)) 14%, #fff); transition: transform .15s; }
.hm-areas__tx { padding-bottom: 3px; border-bottom: 3px solid var(--c, var(--pub-blue)); }
.hm-areas a:hover, .hm-areas a:focus-visible { color: var(--pub-blue); }
.hm-areas a:hover .hm-areas__ic, .hm-areas a:focus-visible .hm-areas__ic { transform: translateY(-2px); }

/* ---------- Seções ---------- */
.hm-sec { padding: 48px 0; }
.hm-sec--tint { background: var(--pub-tint); }
.hm-h { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 20px; }
.hm-h h2 { font: 800 clamp(24px, 2.4vw, 30px)/1.15 var(--pub-font-display); letter-spacing: -.01em; color: var(--pub-ink); margin: 0; }
.hm-h a { font: 600 14.5px/1 var(--pub-font); color: var(--pub-blue); white-space: nowrap; text-decoration: none; }
.hm-h a:hover { text-decoration: underline; }

/* Mosaico de notícias */
.hm-mosaic { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; }
.hm-big, .hm-small a { color: inherit; text-decoration: none; display: block; }
/* Mosaico: a grande ocupa a altura toda da coluna das menores (topo e base
   alinhados, um bloco só) e leva o texto por cima da foto. */
.hm-mosaic { align-items: stretch; }
.hm-big { position: relative; min-height: 460px; border-radius: 6px; overflow: hidden; }
.hm-big__img { position: absolute; inset: 0; background: var(--pub-tint) center / cover no-repeat; transition: transform .4s ease; }
.hm-big:hover .hm-big__img { transform: scale(1.03); }
.hm-big__tx { position: absolute; left: 0; right: 0; bottom: 0; padding: 72px 28px 24px; background: linear-gradient(to top, rgba(0, 20, 50, .92) 0%, rgba(0, 20, 50, .62) 55%, rgba(0, 20, 50, 0) 100%); }
.hm-big h3 { font: 800 clamp(22px, 2.2vw, 30px)/1.18 var(--pub-font-display); color: #fff; margin: 10px 0 6px; text-wrap: balance; }
.hm-big .hm-meta { color: rgba(255, 255, 255, .86); }
.hm-big:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.hm-small a:hover h3 { color: var(--pub-blue); }
.hm-meta { font-size: 13px; color: var(--pub-muted); margin-top: 8px; display: flex; gap: 8px; align-items: center; }
/* As 3 menores dividem a altura da coluna por igual (acompanham a grande),
   em vez de ficarem empilhadas no topo com a coluna vazia embaixo. */
.hm-small { display: grid; gap: 20px; grid-auto-rows: minmax(0, 1fr); align-content: stretch; }
/* Foto à esquerda, do lado da notícia grande: as imagens se encostam e
   formam o mosaico; o texto fica na borda de fora. */
.hm-small a { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--pub-line-soft); }
.hm-small a:last-child { border-bottom: 0; padding-bottom: 0; }
.hm-small__img { order: -1; height: 100%; min-height: 110px; border-radius: 6px; background: var(--pub-tint) center / cover no-repeat; }
.hm-small h3 { font: 700 17px/1.3 var(--pub-font-display); color: var(--pub-ink); margin: 6px 0 0; }
.hm-chip { display: inline-block; border-radius: 6px; font: 700 10.5px/1.3 var(--pub-font); letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; background: #e6eef8; color: var(--pub-blue); }
.hm-chip[data-cat="cultura"] { background: #f1e9fe; color: #6d28d9; }
.hm-chip[data-cat="educacao"] { background: #e6effe; color: #1d4ed8; }
.hm-chip[data-cat="lazer"] { background: #fff0e5; color: #c2410c; }
.hm-chip[data-cat="saude"] { background: #fde8f3; color: #be185d; }
.hm-chip[data-cat="assistencia"] { background: #e5f8ec; color: #15803d; }
.hm-chip[data-cat="esportes"] { background: #e0f7f4; color: #0f766e; }

/* Agenda em tira */
.hm-ag { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--pub-ink); }
.hm-ag a { display: block; color: inherit; text-decoration: none; padding: 16px 20px 4px 0; margin-right: 20px; border-right: 1px solid var(--pub-line); }
/* Margem igual em todos: sem ela o último card ficava mais largo e a foto, mais alta. */
.hm-ag a:last-child { border-right: 0; }
.hm-ag small { font: 700 12px/1.3 var(--pub-font); letter-spacing: .06em; text-transform: uppercase; color: var(--pub-blue); }
.hm-ag b { display: block; font: 700 17px/1.28 var(--pub-font-display); color: var(--pub-ink); margin: 6px 0; }
.hm-ag a:hover b { color: var(--pub-blue); }
.hm-ag__tx > span { font-size: 13.5px; color: var(--pub-muted); }
/* Foto do evento em cima (desktop) / miniatura ao lado (celular). */
.hm-ag__img { display: block; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--pub-line) center / cover no-repeat; margin-bottom: 12px; overflow: hidden; transition: transform .2s; }
.hm-ag__img--vazia { display: flex; align-items: center; justify-content: center; color: var(--pub-blue); font-size: 26px; background: color-mix(in srgb, var(--pub-blue) 10%, #fff); }
.hm-ag a:hover .hm-ag__img { transform: translateY(-2px); }
.hm-ag__tx { display: block; min-width: 0; }

/* Faixa da credencial */
.hm-cred { display: grid; grid-template-columns: 1fr 1fr; min-height: 360px; background: #003366; color: #fff; }
.hm-cred__img { background: center / cover no-repeat; min-height: 240px; }
.hm-cred__t { padding: 48px max(var(--pub-gutter), 48px); display: flex; flex-direction: column; justify-content: center; gap: 14px; max-width: 640px; }
.hm-cred h2 { font: 800 clamp(26px, 2.8vw, 36px)/1.1 var(--pub-font-display); color: #fff; margin: 0; text-wrap: balance; }
.hm-cred p { color: #c6d7ec; margin: 0; font-size: 16.5px; line-height: 1.55; max-width: 46ch; }
.hm-cred ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; color: #e3ecf7; }
.hm-cred li::before { content: "✓"; color: var(--pub-yellow); font-weight: 700; margin-right: 9px; }
.hm-cred p.hm-cred__cta { color: #fff; font-weight: 600; font-size: 15.5px; }

/* Matrículas: seletor de unidade + grid do atv-card (searchatividade.js) */
.hm-mat__bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.hm-mat__sel { position: relative; min-width: min(320px, 100%); }
.hm-mat__sel select { width: 100%; appearance: none; border: 1.5px solid #cdd8e6; border-radius: 999px; padding: 11px 42px 11px 40px; font: 500 15px var(--pub-font); color: var(--pub-ink); background: #fff; cursor: pointer; }
.hm-mat__sel .fa-location-dot { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--pub-blue); pointer-events: none; }
.hm-mat__sel .fa-chevron-down { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--pub-muted); font-size: 12px; pointer-events: none; }
.hm-mat .atividades-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.hm-mat__cta { text-align: center; margin-top: 28px; }

@media (max-width: 1199px) {
    .hm-mat .atividades-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hm-ag { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-ag a:nth-child(2n) { border-right: 0; }
}

@media (max-width: 991px) {
    .hm-art .pub-wrap { grid-template-columns: 1fr; gap: 18px; }
    .hm-art__img { max-height: 220px; }
    .hm-mosaic { grid-template-columns: 1fr; gap: 28px; }
    .hm-big { min-height: 340px; }
    /* Uma coluna: a altura volta a ser a do conteúdo. */
    .hm-small { grid-auto-rows: auto; align-content: start; }
    .hm-small a { grid-template-columns: 140px minmax(0, 1fr); }
    .hm-small__img { height: auto; min-height: 0; aspect-ratio: 4 / 3; }
    .hm-cred { grid-template-columns: 1fr; }
    .hm-mat .atividades-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .hm-big { min-height: 280px; }
    .hm-big__tx { padding: 56px 18px 18px; }
    /* Palco na proporção dos banners (1600x670): a arte enche sem sobra de desfoque.
       Os destaques automáticos cabem só com selo e título; texto e botões ficam a um
       toque (as abas abaixo já mostram título e situação). Setas saem (há swipe e as
       abas); fica a pausa, que a troca automática exige. */
    .hm-slides { height: auto; aspect-ratio: 1600 / 670; min-height: 160px; }
    .hm-ed .pub-wrap, .hm-art .pub-wrap { padding-bottom: 14px; padding-right: 52px; }
    .hm-text, .hm-acts { display: none; }
    .hm-kind { margin-bottom: 6px; }
    .hm-kind .pub-badge, .hm-kind__src { height: 22px; padding: 0 8px; font-size: 10px; }
    .hm-ed::after { background: linear-gradient(180deg, rgba(0, 30, 64, .1) 15%, rgba(0, 30, 64, .94) 72%); }
    .hm-art { align-items: flex-end; }
    .hm-art::before { display: none; }
    /* Arte (capa com texto): no celular vale a própria arte, inteira; o texto, só sem arte. */
    .hm-art__img { position: absolute; inset: 0; width: 100%; max-height: none; aspect-ratio: auto; border-radius: 0; z-index: 2; }
    .hm-art:has(.hm-art__img) .pub-wrap > div:first-child { visibility: hidden; }
    .hm-title { font-size: 20px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .hm-ctrl { top: 10px; bottom: auto; right: 10px; }
    .hm-ctrl [data-hm-prev], .hm-ctrl [data-hm-next] { display: none; }
    .hm-ctrl button { width: 32px; height: 32px; font-size: 12px; }
    .hm-rail__lbl { display: none; }
    .hm-rail .pub-wrap { padding-right: 0; }
    .hm-tab { flex: 0 0 64%; border-left: 0; border-right: 1px solid var(--pub-line-soft); padding-left: 0; }
    .hm-tab + .hm-tab { padding-left: 14px; }
    /* Celular: grade de 3 por linha (ícone em cima, nome embaixo). A faixa com rolagem
       lateral cortava os nomes nas duas pontas. */
    .hm-areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 8px; padding: 20px 0; }
    .hm-areas a { flex-direction: column; gap: 6px; font-size: 14.5px; text-align: center; min-width: 0; }
    .hm-areas__ic { width: 48px; height: 48px; font-size: 19px; }
    .hm-areas__tx { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom-width: 2px; }
    .hm-sec { padding: 34px 0; }
    .hm-small a { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
    .hm-small h3 { font-size: 15.5px; }
    .hm-ag { grid-template-columns: 1fr; }
    .hm-ag a, .hm-ag a:nth-child(2n) { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--pub-line); padding: 14px 0; display: flex; gap: 14px; align-items: flex-start; }
    .hm-ag__img { flex: none; width: 92px; aspect-ratio: 1; margin: 0; border-radius: 10px; }
    .hm-ag__img--vazia { font-size: 22px; }
    .hm-ag a:last-child { border-bottom: 0; }
    .hm-cred__t { padding: 30px var(--pub-gutter) 34px; }
    .hm-mat .atividades-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .hm-mat__sel { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .hm-slide, .hm-slide.is-on { transition: none; }
}

/* Skeleton e vazio do carregamento de turmas (vinham inline na home antiga) */
.atv-skeleton { background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid #eef1f6; }
.atv-skeleton-img, .atv-skeleton-line { background: linear-gradient(90deg, #f0f3f8 0%, #e6ebf3 50%, #f0f3f8 100%); background-size: 200% 100%; animation: hm-skel 1.4s ease-in-out infinite; }
.atv-skeleton-img { height: 180px; }
.atv-skeleton-body { padding: 18px; }
.atv-skeleton-line { height: 12px; border-radius: 6px; margin-bottom: 10px; }
.atv-skeleton-line.w-80 { width: 80%; }
.atv-skeleton-line.w-60 { width: 60%; }
.atv-skeleton-line.w-100 { width: 100%; }
.atv-skeleton-cta { height: 14px; width: 40%; border-radius: 7px; margin-top: 16px; }
@keyframes hm-skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.atv-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: #6b7a90; }
.atv-empty i { font-size: 44px; margin-bottom: 14px; color: #cbd5e1; }
.atv-empty p { font-size: 15px; margin: 0; }
@media (prefers-reduced-motion: reduce) { .atv-skeleton-img, .atv-skeleton-line { animation: none; } }
