/*
Theme Name: Terni Oggi
Template: twentytwentyfive
Description: Tema figlio di Twenty Twenty-Five che riprende l'impaginazione da quotidiano del vecchio tema Newspaper.
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.2
Text Domain: ternioggi
*/

body { -webkit-font-smoothing: antialiased; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }

/* Testata */
.tg-testata { padding-top: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--wp--preset--color--accent-6); }
.tg-testata .wp-block-site-logo img { height: auto; }
.tg-barra-menu { padding-top: 0; padding-bottom: 0; }
.tg-barra-menu .wp-block-navigation a { color: #fff; padding: 14px 0; display: inline-block; }
.tg-barra-menu .wp-block-navigation a:hover { color: var(--wp--preset--color--accent-1); text-decoration: none; }
.tg-barra-menu .wp-block-navigation__container { gap: 24px; }
.tg-barra-menu .wp-block-search__button { background: transparent; color: #fff; border: 0; }
.tg-barra-menu .wp-block-search__input { color: #111; }
.tg-barra-menu .wp-block-navigation__responsive-container-open { color: #fff; padding: 12px 0; }
.tg-barra-menu .wp-block-navigation__responsive-container.is-menu-open { background: #222; color: #fff; }

/* Titoli dei blocchi alla Newspaper */
.tg-titolo-blocco { border-bottom: 2px solid #222; margin-bottom: 20px; }
.tg-titolo-blocco h2, .tg-titolo-blocco h4 { display: inline-block; margin: 0; background: #222; color: #fff; font-family: var(--wp--preset--font-family--roboto); font-size: 14px; font-weight: 700; line-height: 1; padding: 8px 12px 7px; text-transform: uppercase; }

/* Etichetta di categoria: nera, solo la prima categoria */
.tg-etichetta { font-family: var(--wp--preset--font-family--roboto); font-size: 10px; line-height: 1; margin: 0; }
.tg-etichetta a { display: inline-block; background: #222; color: #fff; padding: 3px 6px 4px; text-decoration: none; }
.tg-etichetta a:not(:first-of-type), .tg-etichetta .wp-block-post-terms__separator { display: none; }
.tg-etichetta a:hover { background: var(--wp--preset--color--accent-1); text-decoration: none; }

/* Meta: autore - data */
.tg-meta { font-family: var(--wp--preset--font-family--open-sans); font-size: 11px; line-height: 1.4; gap: 0 !important; }
.tg-meta .wp-block-post-author-name { color: #000; font-weight: 700; margin: 0; }
.tg-meta .wp-block-post-date { margin: 0; }
.tg-meta .wp-block-post-author-name + .wp-block-post-date::before { content: "-"; margin: 0 6px; color: #999; }

/* Riquadri con immagine e titolo sovrapposto */
.tg-sovrapposto { padding: 20px !important; overflow: hidden; }
.tg-sovrapposto .wp-block-cover__background { background: linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(0,0,0,.85) 100%) !important; opacity: 1 !important; }
.tg-sovrapposto .wp-block-cover__image-background { transition: transform .4s ease; }
.tg-sovrapposto:hover .wp-block-cover__image-background { transform: scale(1.04); }
.tg-sovrapposto .wp-block-cover__inner-container { width: 100%; }
.tg-sovrapposto .wp-block-post-title { margin: 6px 0 4px; font-family: var(--wp--preset--font-family--roboto); font-weight: 500; line-height: 1.3; text-shadow: 0 0 2px rgba(0,0,0,.4); }
.tg-sovrapposto .wp-block-post-title a { color: #fff; }
.tg-sovrapposto .tg-meta, .tg-sovrapposto .tg-meta .wp-block-post-author-name, .tg-sovrapposto .tg-meta .wp-block-post-date { color: #fff; }
.tg-grande .wp-block-post-title { font-size: 27px; }
.tg-medio .wp-block-post-title { font-size: 21px; }
.tg-piccolo .wp-block-post-title { font-size: 15px; }
.tg-griglia-alto { gap: 4px !important; }
.tg-griglia-alto .wp-block-column { display: flex; flex-direction: column; gap: 4px; }
.tg-griglia-alto .wp-block-post-template { gap: 4px !important; margin: 0; }
.tg-griglia-alto .wp-block-query { margin: 0; }
.tg-griglia-larga { max-width: 1340px !important; margin-left: auto !important; margin-right: auto !important; }

/* Schede in griglia (blocco "ultimi articoli") */
.tg-scheda { gap: 8px; }
.tg-scheda > * { margin-block: 0 !important; }
.tg-immagine { position: relative; margin: 0 0 8px; }
.tg-immagine .wp-block-post-featured-image { margin: 0; }
.tg-immagine .wp-block-post-featured-image img { width: 100%; object-fit: cover; }
.tg-immagine:has(img) .tg-etichetta { position: absolute; left: 0; bottom: 0; }
.tg-scheda .wp-block-post-title { font-size: 17px; line-height: 1.3; font-weight: 400; margin: 0 0 6px; }
.tg-scheda .wp-block-post-title a, .tg-riga .wp-block-post-title a, .tg-lista .wp-block-post-title a { color: #111; }
.tg-scheda .wp-block-post-title a:hover, .tg-riga .wp-block-post-title a:hover, .tg-lista .wp-block-post-title a:hover { color: var(--wp--preset--color--accent-1); text-decoration: none; }
.tg-griglia .wp-block-post-template { row-gap: 32px !important; }

/* Altri articoli sotto l'articolo */
.tg-correlati .wp-block-post-title { font-size: 13px; font-weight: 500; }
.tg-correlati .tg-meta { display: none; }

/* Righe con immagine a sinistra (blocco 12 di Newspaper, ricerca) */
.tg-riga { gap: 24px !important; margin-bottom: 40px; }
.tg-riga .wp-block-post-featured-image { margin: 0; }
.tg-riga .wp-block-post-title { font-size: 21px; line-height: 1.3; margin: 0 0 6px; }
.tg-riga .wp-block-post-excerpt { margin: 8px 0 12px; }
.tg-riga .wp-block-post-excerpt__more-text { display: none; }
.tg-continua { display: inline-block; background: var(--wp--preset--color--accent-1); color: #fff !important; font-family: var(--wp--preset--font-family--roboto); font-size: 13px; padding: 7px 12px; }
.tg-continua:hover { background: #222; text-decoration: none !important; }

/* Elenco compatto in colonna laterale */
.tg-lista .wp-block-post-template > li { border-bottom: 1px dashed var(--wp--preset--color--accent-6); padding-bottom: 12px; }
.tg-lista .wp-block-post-title { font-size: 14px; line-height: 1.35; margin: 0 0 4px; }

/* Colonna laterale */
.tg-laterale > * + * { margin-top: 40px; }
.tg-laterale .wp-block-search__input { border: 1px solid #e1e1e1; font-size: 12px; padding: 6px 9px; }
.tg-laterale .wp-block-search__button { background: #222; color: #fff; border: 0; font-family: var(--wp--preset--font-family--roboto); font-size: 13px; }
.tg-offerte-lavoro { text-align: center; }
.tg-offerte-lavoro p { margin: 0 0 8px; font-size: 17px; }
.tg-offerte-lavoro a { color: #111; }

/* Articolo */
.tg-articolo .tg-titolo-articolo { font-family: var(--wp--preset--font-family--open-sans); font-size: clamp(28px, 4vw, 41px); line-height: 1.2; font-weight: 400; margin: 8px 0 12px; }
.tg-articolo .tg-meta { font-size: 11px; margin-bottom: 16px; }
.tg-articolo .wp-block-post-content { font-size: 15px; line-height: 1.74; }
.tg-articolo .wp-block-post-content > * { margin-block: 0 26px; }
.tg-articolo .wp-block-post-content h2 { font-size: 27px; }
.tg-articolo .wp-block-post-content h3 { font-size: 22px; }
.tg-articolo .wp-block-post-content img { max-width: 100%; height: auto; }
.tg-articolo .wp-block-post-content .wp-caption { max-width: 100%; }
.tg-articolo .wp-block-post-content .wp-caption-text { font-size: 12px; font-style: italic; color: #444; margin-top: 6px; }
.tg-articolo .gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tg-articolo .gallery-columns-1 { grid-template-columns: repeat(1, 1fr); }
.tg-articolo .gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.tg-articolo .gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.tg-articolo .gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.tg-articolo .gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.tg-articolo .gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }
.tg-articolo .gallery-columns-7 { grid-template-columns: repeat(7, 1fr); }
.tg-articolo .gallery-columns-8 { grid-template-columns: repeat(8, 1fr); }
.tg-articolo .gallery-columns-9 { grid-template-columns: repeat(9, 1fr); }
@media (max-width: 781px) { .tg-articolo .gallery[class*="gallery-columns-"]:not(.gallery-columns-1) { grid-template-columns: repeat(2, 1fr); } }
.tg-articolo .gallery .gallery-item { margin: 0; }
.tg-articolo .gallery img { width: 100%; height: auto; border: 0 !important; }
.tg-articolo iframe { max-width: 100%; }
.tg-articolo .wp-block-post-featured-image { margin-bottom: 24px; }
.tg-tag { font-family: var(--wp--preset--font-family--roboto); font-size: 11px; }
.tg-tag .wp-block-post-terms__prefix { background: #222; color: #fff; padding: 4px 8px; margin-right: 6px; text-transform: uppercase; }
.tg-tag a { display: inline-block; border: 1px solid #ededed; color: #111; padding: 3px 7px; margin: 0 4px 4px 0; }
.tg-tag .wp-block-post-terms__separator { display: none; }

.ternioggi-condividi { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.ternioggi-condividi a { color: #fff; font-family: var(--wp--preset--font-family--roboto); font-size: 11px; padding: 9px 16px; text-decoration: none; }
.ternioggi-condividi a:hover { opacity: .85; text-decoration: none; }
.ternioggi-condividi-facebook { background: #516eab; }
.ternioggi-condividi-x { background: #111; }
.ternioggi-condividi-whatsapp { background: #25d366; }
.ternioggi-annuncio { margin: 0 0 24px; min-height: 1px; }
.ternioggi-blocco-vecchio { margin: 0 0 16px; }

/* Archivi */
.tg-titolo-archivio { font-family: var(--wp--preset--font-family--roboto); font-size: 28px; font-weight: 400; text-transform: uppercase; margin: 0 0 20px; line-height: 1.2; }

/* Paginazione */
.wp-block-query-pagination { margin-top: 40px; gap: 6px; }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { border: 1px solid #ccc; color: #444; padding: 4px 10px; min-width: 32px; text-align: center; }
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--accent-1); border-color: var(--wp--preset--color--accent-1); color: #fff; }
.wp-block-query-pagination .page-numbers.dots { border: 0; }

/* Piè di pagina */
.tg-piede { color: #fff; padding-top: 18px; padding-bottom: 18px; font-size: 12px; }
.tg-piede p { margin: 0; }
.tg-piede .alignwide { gap: 10px; }
.tg-piede a { color: #fff; }
.tg-piede .wp-block-navigation { font-size: 12px; font-weight: 400; text-transform: none; font-family: var(--wp--preset--font-family--open-sans); }
.tg-piede .wp-block-navigation__container { gap: 16px; }

@media (max-width: 781px) {
	.tg-grande { min-height: 300px !important; }
	.tg-grande .wp-block-post-title { font-size: 21px; }
	.tg-riga .wp-block-column { flex-basis: 100% !important; }
	.tg-testata .wp-block-site-logo img { width: 200px; }
	.tg-barra-menu .wp-block-search { display: none; }
}

/* Modulo Contatti (Contact Form 7) */
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 textarea { width: 100%; border: 1px solid #e1e1e1; padding: 6px 9px; font: inherit; font-size: 13px; box-sizing: border-box; }
.wpcf7 textarea { height: 168px; }
.wpcf7 input[type="submit"] { background: #222; color: #fff; border: 0; font-family: var(--wp--preset--font-family--roboto); font-size: 13px; font-weight: 500; padding: 10px 15px; cursor: pointer; }
.wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--accent-1); }
.wpcf7 input[type="submit"]:disabled { opacity: .5; cursor: default; }
.wpcf7 .wpcf7-acceptance .wpcf7-list-item { margin-left: 0; }

/* Allineamenti delle immagini nei vecchi articoli (editor classico) */
.wp-block-post-content .alignleft { float: left; margin: 6px 24px 16px 0; }
.wp-block-post-content .alignright { float: right; margin: 6px 0 16px 24px; }
.wp-block-post-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-block-post-content img.aligncenter { margin-bottom: 16px; }
.wp-block-post-content .wp-caption.aligncenter { text-align: center; }
.wp-block-post-content .wp-caption img { display: block; }
.wp-block-post-content p::after { content: ""; display: table; clear: both; }
.wp-block-post-content p:has(> .alignleft, > a > .alignleft, > .alignright, > a > .alignright)::after { display: none; }

/* Righe e colonne di Visual Composer */
.tg-vc-riga { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.tg-vc-colonna { box-sizing: border-box; padding: 0 15px; min-width: 0; }
.tg-vc-colonna > * + * { margin-top: 26px; }
.tg-vc-colonna > .ternioggi-blocco-vecchio > *:first-child { margin-top: 0; }
.tg-vc-colonna > .ternioggi-blocco-vecchio > * { margin-block: 0 26px; }
.tg-vc-spazio { display: block; }

/* Riquadri informativi (vc_message, intense_content_box) */
.tg-riquadro { position: relative; background: #5aaeea; color: #fff; padding: 28px 40px 28px 64px; margin: 0 0 26px; clear: both; }
.tg-riquadro::before { content: "i"; position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #5aaeea; font: 700 15px/22px Georgia, serif; text-align: center; }
.tg-riquadro h1, .tg-riquadro h2, .tg-riquadro h3, .tg-riquadro h4 { color: #111; text-align: center; margin: 0 0 16px; }
.tg-riquadro p { margin: 0 0 16px; }
.tg-riquadro p:last-child { margin-bottom: 0; }
.tg-riquadro a { color: #fff; text-decoration: underline; }

/* Foto con punti numerati (cq_vc_hotspot) */
.tg-hotspot { margin: 0 0 26px; clear: both; }
.tg-hotspot-area { position: relative; }
.tg-hotspot-immagine { display: block; width: 100%; height: auto; }
.tg-punto { position: absolute; transform: translate(-50%, -50%); z-index: 2; cursor: pointer; outline: none; }
.tg-punto-numero { display: block; width: 30px; height: 30px; border: 3px solid #fff; border-radius: 50%; background: rgba(221, 51, 51, .9); color: #fff; font: 700 14px/24px var(--wp--preset--font-family--roboto); text-align: center; box-shadow: 0 0 0 4px rgba(255,255,255,.35); }
.tg-punto:hover .tg-punto-numero, .tg-punto:focus .tg-punto-numero { background: #222; }
.tg-nota { display: none; position: absolute; top: 38px; left: -12px; width: 300px; background: #fff; color: #222; font-size: 13px; line-height: 1.55; padding: 14px; box-shadow: 0 4px 18px rgba(0,0,0,.3); cursor: auto; }
.tg-nota-sinistra .tg-nota { left: auto; right: -12px; }
.tg-nota p { margin: 0 0 8px; }
.tg-nota p:last-child { margin: 0; }
.tg-nota img { max-width: 100%; height: auto; margin: 6px 0 0; }
.tg-punto:hover .tg-nota, .tg-punto:focus .tg-nota, .tg-punto:focus-within .tg-nota { display: block; }
.tg-hotspot-note { display: none; margin: 12px 0 0; padding-left: 24px; font-size: 13px; }
.tg-hotspot-note li { margin-bottom: 10px; }
.tg-hotspot-note img { display: none; }

/* Blocchi di articoli di Newspaper dentro i contenuti */
.tg-blocco-articoli { clear: both; margin: 0 0 26px; }
.tg-blocco-griglia { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; }
.tg-blocco-griglia li { margin: 0; }
.tg-blocco-griglia a { color: #111; display: block; }
.tg-blocco-griglia img { width: 100%; height: auto; aspect-ratio: 218/150; object-fit: cover; display: block; margin-bottom: 8px; }
.tg-blocco-titolo { display: block; font-family: var(--wp--preset--font-family--roboto); font-size: 15px; line-height: 1.3; }
.tg-blocco-data { display: block; font-size: 11px; color: #999; margin-top: 4px; }

/* Sottotitolo */
.tg-sottotitolo { font-size: 15px; line-height: 1.6; color: #666; font-style: italic; margin: 0 0 12px; }

/* Articoli senza colonna laterale */
.tg-senza-laterale .tg-articolo > .tg-laterale { display: none; }
.tg-senza-laterale .tg-articolo > .wp-block-column:first-child { flex-basis: 100% !important; }

/* Copertina a tutta larghezza (modello 8 di Newspaper) */
.tg-copertina { position: relative; min-height: 560px; background-size: cover; background-position: center; display: flex; align-items: flex-end; }
.tg-copertina::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.05) 30%, rgba(0,0,0,.8) 100%); }
.tg-copertina-testo { position: relative; width: 100%; max-width: 1068px; margin: 0 auto; padding: 48px 16px; box-sizing: border-box; color: #fff; }
.tg-copertina-testo h1 { color: #fff; font-family: var(--wp--preset--font-family--open-sans); font-size: clamp(30px, 4.5vw, 52px); line-height: 1.15; font-weight: 400; margin: 12px 0; max-width: 900px; }
.tg-copertina .tg-sottotitolo { color: #eee; font-size: 17px; max-width: 800px; }
.tg-copertina-etichetta { display: inline-block; background: var(--wp--preset--color--accent-1); color: #fff; font: 500 11px/1 var(--wp--preset--font-family--roboto); padding: 4px 7px; }
.tg-copertina-meta { font-size: 12px; margin: 0; }
.tg-copertina-meta a { color: #fff; font-weight: 700; }
.tg-con-copertina .tg-intestazione-articolo { display: none; }

@media (max-width: 781px) {
	.tg-vc-colonna { flex-basis: 100% !important; }
	.tg-vc-colonna-vuota { display: none; }
	.tg-riquadro { padding: 20px 20px 20px 52px; }
	.tg-riquadro::before { left: 16px; top: 24px; transform: none; }
	.tg-nota { display: none !important; }
	.tg-hotspot-note { display: block; }
	.tg-punto-numero { width: 24px; height: 24px; font-size: 12px; line-height: 18px; border-width: 2px; }
	.wp-block-post-content .alignleft, .wp-block-post-content .alignright { float: none; margin: 0 auto 16px; display: block; }
	.tg-copertina { min-height: 420px; }
}
