/*
Theme Name: Komuniki
Theme URI: https://komuniki.io
Author: Nicola Mostallino
Description: Tema a blocchi leggero per Komuniki. Contenuti in Gutenberg, menu classici compatibili con WPML, font self-hosted.
Version: 1.0.1
Requires at least: 6.6
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: komuniki
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
:where(a):focus-visible, :where(button):focus-visible, :where(summary):focus-visible, .wp-element-button:focus-visible {
	outline: 3px solid var(--wp--preset--color--dark);
	outline-offset: 3px;
}
img { height: auto; }

/* ---------- Header ---------- */
.k-header { border-bottom: 1px solid var(--wp--preset--color--line); background: var(--wp--preset--color--white); }
.k-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.k-wordmark { font-family: var(--wp--preset--font-family--poppins); font-weight: 700; font-size: 1.25rem; letter-spacing: .08em; color: var(--wp--preset--color--dark); text-decoration: none; }
.k-nav { display: flex; align-items: center; gap: 8px 24px; flex-wrap: wrap; }
.k-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.k-nav a { text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--wp--preset--color--text); padding: 10px 0; display: inline-block; }
.k-nav a:hover, .k-nav .current-menu-item > a, .k-nav .current-menu-ancestor > a { color: var(--wp--preset--color--dark); box-shadow: inset 0 -3px 0 var(--wp--preset--color--accent); }
.k-nav .k-cta > a { background: var(--wp--preset--color--dark); color: var(--wp--preset--color--white); padding: 12px 20px; border-radius: 999px; font-weight: 600; box-shadow: none; }
.k-nav .k-cta > a:hover { background: #000; color: #fff; box-shadow: none; }
.k-lang { display: flex; gap: 10px; font-size: .85rem; }
.k-lang a { text-decoration: none; color: var(--wp--preset--color--muted); padding: 10px 2px; }
.k-lang a[aria-current="true"] { color: var(--wp--preset--color--dark); font-weight: 600; }
@media (max-width: 781px) {
	.k-header__inner { gap: 8px; }
	.k-nav { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; }
	.k-nav ul { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; gap: 20px; padding-bottom: 4px; }
	.k-nav li { flex: none; }
}

/* ---------- Sections ---------- */
.k-section { padding-top: clamp(4rem, 8vw, 7rem); padding-bottom: clamp(4rem, 8vw, 7rem); padding-left: 24px; padding-right: 24px; }
.k-section--hero { padding-top: clamp(3rem, 6vw, 5.5rem); }
.k-label { font-size: .9rem; font-weight: 600; color: var(--wp--preset--color--muted); margin-bottom: .75rem; }
.k-lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.6; max-width: 40em; }
.k-narrow { max-width: 46rem; }

/* ---------- Cards ---------- */
.k-card { border-radius: 20px; padding: 32px; border: 1px solid var(--wp--preset--color--line); box-sizing: border-box; }
.k-card h3 { margin-top: .75rem; }
.k-card h3 a { text-decoration: none; color: inherit; }
.k-card h3 a::after { content: ""; display: block; width: 2.5rem; height: 3px; background: var(--wp--preset--color--accent); margin-top: .75rem; }
.k-card--dark { border-color: transparent; }
.k-card--dashed { border: 2px dashed #C9C6BF; }
.k-tag { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--wp--preset--color--dark); background: #DDF3EF; padding: 4px 10px; border-radius: 999px; }
.k-icon { width: 32px; height: 32px; }

/* ---------- Lists ---------- */
.k-checks { list-style: none; padding-left: 0; }
.k-checks li { position: relative; padding-left: 2rem; margin-bottom: .9rem; }
.k-checks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 1.1rem; height: .6rem; border-left: 2.5px solid var(--wp--preset--color--teal); border-bottom: 2.5px solid var(--wp--preset--color--teal); transform: rotate(-45deg); }
.k-checks strong { display: block; font-family: var(--wp--preset--font-family--poppins); font-weight: 600; font-size: 1.1rem; }
.k-facts { list-style: none; padding: 1rem 0 0; margin: 0; display: flex; flex-wrap: wrap; gap: .75rem 2rem; border-top: 1px solid var(--wp--preset--color--line); }
.k-facts li { font-size: .95rem; color: var(--wp--preset--color--muted); }
.k-facts strong { font-family: var(--wp--preset--font-family--poppins); font-size: 1.6rem; color: var(--wp--preset--color--dark); display: block; }

/* ---------- Steps ---------- */
.k-step { border-top: 4px solid var(--wp--preset--color--accent); padding-top: 1.5rem; }
.k-step__n { font-family: var(--wp--preset--font-family--poppins); font-weight: 700; color: var(--wp--preset--color--muted); margin: 0; }

/* ---------- Images ---------- */
.k-img img { border-radius: 24px; width: 100%; object-fit: cover; }
.k-img--portrait img { aspect-ratio: 4 / 5; }
.k-img--wide img { aspect-ratio: 16 / 10; border-radius: 20px; }

/* ---------- Quote ---------- */
.k-quote p { font-family: var(--wp--preset--font-family--poppins); font-weight: 500; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.35; }

/* ---------- FAQ ---------- */
.wp-block-details { border-bottom: 1px solid var(--wp--preset--color--line); padding: .5rem 0 1.25rem; }
.wp-block-details summary { font-family: var(--wp--preset--font-family--poppins); font-weight: 600; font-size: 1.15rem; color: var(--wp--preset--color--dark); cursor: pointer; min-height: 44px; display: flex; align-items: center; }

/* ---------- Dark sections ---------- */
.has-dark-background-color, .has-dark-background-color h2, .has-dark-background-color h3 { color: var(--wp--preset--color--white); }
.has-dark-background-color .k-label, .has-dark-background-color p { color: #E4E4E4; }
.has-dark-background-color .k-checks strong { color: #fff; }

/* ---------- Accent CTA band ---------- */
.has-accent-background-color, .has-accent-background-color h2, .has-accent-background-color p { color: var(--wp--preset--color--dark); }
.has-accent-background-color .wp-block-button__link { background: var(--wp--preset--color--dark); color: #fff; }
.has-accent-background-color .is-style-outline .wp-block-button__link { background: transparent; color: var(--wp--preset--color--dark); border-color: var(--wp--preset--color--dark); }

/* ---------- Posts ---------- */
.k-post-grid .wp-block-post-featured-image img { border-radius: 16px; }
.k-post-grid .wp-block-post-title a { text-decoration: none; }

/* ---------- Footer ---------- */
.k-footer { border-top: 1px solid var(--wp--preset--color--line); font-size: .9rem; color: var(--wp--preset--color--muted); }
.k-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.k-footer a { color: var(--wp--preset--color--muted); }
.k-checks--2 { columns: 2 320px; column-gap: 3rem; }
.k-checks--2 li { break-inside: avoid; }
.k-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; }
.k-links a { font-weight: 600; text-decoration: none; box-shadow: inset 0 -3px 0 var(--wp--preset--color--accent); }
.k-bignum { font-family: var(--wp--preset--font-family--poppins); font-weight: 700; font-size: 3rem; line-height: 1; margin: 0; color: #fff; }
.k-note { font-size: .95rem; }

/* ---------- Layout fixes ---------- */
.wp-site-blocks { overflow-x: clip; }
.wp-site-blocks > * + *, .wp-block-post-content > .k-section, .wp-block-post-content > .alignfull + .alignfull { margin-block-start: 0; }
.is-layout-constrained > .k-lead, .is-layout-constrained > .k-narrow, .is-layout-constrained > .k-note {
	margin-left: max(0px, calc((100% - 1240px) / 2)) !important;
	margin-right: auto !important;
}
.wp-block-column .k-card, .is-layout-grid > .k-card { box-sizing: border-box; }
.is-layout-grid > .k-card { height: 100%; }
.k-quote { border: 0 !important; padding-left: 0 !important; margin: 0; }
.k-quote cite { font-size: .9rem; color: #D6D6D6; font-style: normal; }
.has-dark-background-color a { color: #fff; }
.has-dark-background-color .wp-block-button.is-style-outline .wp-block-button__link { color: #fff; border-color: #fff; }
.k-links a { text-decoration: none !important; }
.k-footer { padding-top: 32px; padding-bottom: 32px; }
.k-footer p { margin: 0; }

/* ---------- WPML: nascondi il selettore con bandiere aggiunto al menu (usiamo IT ES EN) ---------- */
.k-nav .wpml-ls-item, .k-nav .wpml-ls-menu-item { display: none !important; }

/* ---------- Contenuti Avada temporanei ---------- */
.k-fc-container { max-width: 1240px; margin: 0 auto; padding: 0 24px clamp(2rem, 4vw, 3.5rem); box-sizing: border-box; }
.k-fc-row { display: flex; flex-wrap: wrap; gap: 32px; }
.k-fc-col { flex: 1 1 calc(var(--k-fc-w, 100%) - 32px); min-width: min(100%, 280px); }
.k-fc-image img { border-radius: 16px; width: 100%; height: auto; }
.k-fc-gallery, .k-fc-boxes, .k-fc-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 24px; }
.k-fc-post a { text-decoration: none; color: inherit; display: block; }
.k-fc-post img { border-radius: 16px; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.k-fc-text > :first-child { margin-top: 0; }

/* Testo di pagine e articoli allineato a sinistra sulla griglia di 1240px */
.k-content.is-layout-constrained > :not(.alignfull):not(.alignwide):not(.k-fc-container) {
	margin-left: max(0px, calc((100% - 1240px) / 2)) !important;
	margin-right: auto !important;
}
.k-content > .k-fc-container { padding-left: 0; padding-right: 0; }
.k-section .is-layout-constrained > .wp-block-post-title,
.k-section .is-layout-constrained > .wp-block-post-terms,
.k-section .is-layout-constrained > .wp-block-post-date { max-width: 46rem; margin-left: max(0px, calc((100% - 1240px) / 2)) !important; }
