/*!
Theme Name: nexo
Author: Andrea Lombardo
Author URI: https://lombardowebdesigner.it/
Description: Lightweight and performant theme ideal for blogs and portfolios. Customizable header and footer, enabling or disabling the search button and widgets in the articles.
Version: 1.8.5
Requires at least: 5.9
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nexo
Tags: blog, portfolio,one-column, two-columns, right-sidebar, custom-header, custom-menu, featured-images, sticky-post, editor-style, translation-ready, custom-background, custom-colors, custom-logo, footer-widgets, theme-options, wide-blocks
*/
:root {
  --backgroundNavbar: #101524;
  --textColorNavbar: #ebebeb;
  --textHoverNavbar: #bfff00;
  --backgroundReader: #fff;
  --titleArticleCard: #000;
  --paragraphArticleCard: #444;
  --ColorCard: #fff;
  --Color1: #21759b;
  --Color2: #fff;
  --fontFamily_1: "Montserrat", sans-serif;
  --fontFamily_2: "Lato", serif;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--fontFamily_2);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--fontFamily_1);
}

a {
  text-decoration: none;
}

ul {
  padding-inline: 25px;
}

ol {
  padding-inline: 25px;
}

header {
  background-color: var(--backgroundNavbar);
  width: 100%;
  min-height: 70px;
  font-family: var(--fontFamily_1);
  display: flex;
  align-items: center;
  position: relative;
  z-index: 9999;
}

header ul,
header li,
header ol {
  list-style-type: none;
  padding: 0;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.75rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.5rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

h5 {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

h6 {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.25rem;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

img {
  max-width: 100%;
}

.alignright {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

.alignleft {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1.5rem;
}

.aligncenter {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  text-align: center;
}

.alignfull {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  position: relative;
}

.alignwide:not(.wp-block-query .alignwide) {
  width: calc(100% + 140px);
  max-width: 1500px;
  margin-inline: auto;
  position: relative;
  left: -70px;
}

.mobile-menu {
  display: none;
}

.mobile-menu.open {
  display: block;
}

.hamburger[aria-expanded="true"] + .mobile-menu {
  display: block;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--backgroundReader);
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: var(--Color1);
  display: block;
  font-size: 14px;
  font-size: 0.875rem;
  font-weight: bold;
  height: auto;
  right: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

.wp-caption {
  margin-bottom: 20px;
  padding: 10px;
  max-width: 97%;
  border: 1px solid #eee;
  text-align: center;
}

.wp-caption img {
  margin: 0;
  padding: 0;
  width: 100% !important;
  height: auto;
  border: 0 none;
}

.wp-caption p.wp-caption-text {
  margin: 0;
  padding: 8px;
  font-size: 1em;
  line-height: 17px;
}

.gallery-caption {
  font-size: 20px;
}

.sticky {
  border-bottom: 3px solid #eee;
}

#comments a {
  font-weight: 600;
  color: var(--Color1);
}

#comments .comments-title {
  text-align: center;
}

.comment-form-author {
  float: left;
  margin-top: 20px;
  margin-right: 3%;
  width: 30.3333333%;
}

.comment-form-author input {
  width: 100%;
}

.comment-form-email {
  float: left;
  margin-top: 20px;
  margin-right: 3%;
  width: 30.3333333%;
}

.comment-form-email input {
  width: 100%;
}

.comment-form-url {
  float: left;
  margin-top: 20px;
  margin-right: 3%;
  width: 30.3333333%;
}

.comment-form-url input {
  width: 100%;
}

ol.comment-list {
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
  text-indent: 0;
}

ol.comment-list li.comment {
  padding: 1em;
}

ol.comment-list li.comment div.vcard cite.fn {
  text-transform: uppercase;
  font-size: 14px;
}

ol.comment-list li.comment div.vcard img.avatar {
  float: left;
  margin: 6px 1em 1em 0;
  border-radius: 50px;
}

ol.comment-list li.comment footer.comment-meta .comment-metadata {
  font-size: 0.75rem;
  margin-block: 0.25rem;
}

ol.comment-list li.comment ul {
  margin: 0 0 1em 2em;
}

ol.comment-list li.comment div.reply {
  margin-left: 80px;
  font-size: 11px;
}

ol.comment-list li.comment div.reply a {
  font-weight: bold;
}

ol.comment-list li.comment ul.children {
  margin: 1em 0 0;
  list-style: none;
  text-indent: 0;
}

ol.comment-list li.comment ul.children li.depth-2 {
  margin: 0 0 0.25em 0.25em;
  border-left: 1px solid #eee;
}

ol.comment-list li.comment ul.children li.depth-3 {
  margin: 0 0 0.25em 0.25em;
  border-left: 1px solid #eee;
}

ol.comment-list li.comment ul.children li.depth-4 {
  margin: 0 0 0.25em 0.25em;
  border-left: 1px solid #eee;
}

ol.comment-list li.bypostauthor .fn {
  font-weight: bold;
}

ol.comment-list li img {
  max-width: 97%;
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea,
input[type="number"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #949494;
  background: #fff;
  border-radius: 0;
  margin-top: 5px;
}

input[type="submit"],
button[type="submit"] {
  margin-top: 10px;
  padding: 15px 20px;
  color: var(--Color2);
  text-transform: uppercase;
  background: #222;
  border: none;
  margin-top: 5px;
  display: block;
  font-weight: bold;
  width: auto;
}

#comments {
  width: 100%;
  padding-inline: 15px;
}

blockquote {
  font-weight: 200;
  margin: 0.25em 0;
  padding: 0px 30px;
  line-height: 1.45;
  position: relative;
  border-left: 5px solid #101524;
}

.header__container {
  width: 100%;
  max-width: 1360px;
  height: 100%;
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline: 15px;
}

.header__container .header__branding {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.header__container .header__branding h3 {
  margin: 0;
}

.header__container .header__branding h3 a {
  color: var(--textColorNavbar);
  text-transform: uppercase;
}

.header__container .header__branding p {
  color: var(--textColorNavbar);
  margin-bottom: 0;
}

.menu {
  display: flex;
  font-weight: 600;
  flex-wrap: wrap;
}

.menu li {
  margin: 1px;
  display: flex;
  position: relative;
  align-items: center;
}

.menu li a {
  display: block;
  padding: 15px 10px;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  color: var(--textColorNavbar);
  flex-grow: 1;
}

.menu li a:hover {
  color: var(--textHoverNavbar);
}

.menu-item-has-children {
  position: relative;
  display: flex;
  align-items: center;
}

.menu-item-has-children a {
  flex-grow: 1; /* Il link prende tutto lo spazio possibile */
}

.menu-item-has-children ul.sub-menu {
  position: absolute;
  background-color: var(--backgroundNavbar);
  top: 100%;
  right: 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
  z-index: 100;
}

/* Desktop: solo Hover */
@media screen and (min-width: 769px) {
  .menu-item-has-children:hover > .sub-menu {
    opacity: 1 !important;
    max-height: 1000px !important;
    visibility: visible !important;
    display: block !important;
  }

  .menu-item-has-children:hover > .sub-menu-toggle {
    transform: rotate(180deg);
  }
}

/* --- Il Toggle Button (Iniettato dal Walker) --- */
.sub-menu-toggle {
  background: transparent;
  border: none;
  color: var(--textColorNavbar);
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

/* Icona Chevron (usiamo il tuo SVG o CSS) */
.sub-menu-toggle::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z'/%3E%3C/svg%3E")
    no-repeat center/contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z'/%3E%3C/svg%3E")
    no-repeat center/contain;
}

/* Rotazione icona quando attivo */
.menu-item-has-children.is-active > .sub-menu-toggle {
  transform: rotate(180deg);
}

/* --- Mobile Breakpoint (Adattamento) --- */
@media screen and (max-width: 768px) {
  .menu-item-has-children {
    flex-wrap: wrap; /* Permette al sottomenu di andare a capo */
  }

  .menu-item-has-children ul.sub-menu {
    position: relative;
    width: 100%;
    display: none !important;
    max-height: 0 !important;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  .menu-item-has-children.is-active > .sub-menu {
    display: block !important;
    max-height: 1000px !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

.menu-item-has-children ul.sub-menu li {
  width: 180px;
}

.menu-item-has-children ul.sub-menu li > ul.sub-menu {
  top: 0;
  right: 100%;
}

.hamburger {
  cursor: pointer;
  display: none;
  background-color: transparent;
  border: none;
}

.hamburger span {
  display: block;
  background-color: var(--textColorNavbar);
  height: 3px;
  width: 30px;
  margin-block: 12px;
}

.main {
  max-width: 1360px;
  margin: 50px auto;
  min-height: calc(100vh - 70px);
  width: 100%;
  padding-inline: 10px;
}

.main section.main__article {
  width: 100%;
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.main section.main__article article.blog-template {
  width: 366px;
  border-radius: 10px;
  box-shadow: 3px 3px 8px rgba(16, 21, 36, 0.3);
  background-color: var(--ColorCard);
}

.main section.main__article article.blog-template div.post-thumbnail {
  width: 100%;
  height: 206px;
}

.main section.main__article article.blog-template div.post-thumbnail img {
  border-radius: 10px 10px 0 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.main article.single-template {
  padding-inline: 5px;
}

.main article.single-template .post-thumbnail img {
  display: block;
  margin-inline: auto;
  height: auto;
}

.main article.single-template .entry-header h1 {
  text-align: center;
}

.main article.single-template .entry-content a {
  text-decoration: underline;
  font-weight: 600;
  color: var(--Color1);
}

.main article.single-template .entry-footer {
  padding-inline: 10px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.main article.single-template .entry-footer .entry-categories {
  margin-block: 10px;
  gap: 5px;
}

.main article.single-template .entry-footer .entry-categories a {
  background-color: var(--backgroundNavbar);
  color: var(--textColorNavbar);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
}

.main article.single-template .entry-footer .entry-tags {
  font-size: 0.9rem;
}

.main article.single-template .entry-footer .entry-tags .tag-link {
  display: inline-block;
  padding: 5px 10px;
  margin: 5px 5px 0 0;
  background-color: var(--backgroundNavbar);
  color: var(--textColorNavbar);
  border-radius: 16px;
  text-decoration: none;
}

.main article.single-template .entry-footer .entry-meta {
  display: flex;
  align-items: center;
}

.main article.single-template .entry-footer .entry-meta p {
  margin: 0;
}

.navigation {
  padding-inline: 15px;
}

.navigation .nav-links span {
  color: var(--backgroundNavbar);
}

.navigation .nav-links a {
  color: var(--backgroundNavbar);
}

.navigation .nav-links .page-numbers {
  display: inline-block;
  padding: 10px;
  margin: 5px;
  font-weight: 500;
}

.navigation .nav-links .page-numbers.current {
  background-color: var(--backgroundNavbar);
  color: var(--textColorNavbar);
}

.article__box {
  width: 100%;
  min-height: 240px;
  padding-inline: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: start;
}

.article__box div.entry-category {
  display: inline-block;
  margin-block: 10px;
  display: flex;
  flex-wrap: wrap;
}

.article__box div.entry-category a {
  display: block;
  padding: 5px 12px;
  background-color: var(--backgroundNavbar);
  color: var(--textColorNavbar);
  border-radius: 16px;
  font-size: 12px;
  margin: 0 4px 4px;
}

.article__box .entry-header {
  margin-bottom: 10px;
  min-height: 106px;
  width: 100%;
}

.article__box .entry-header h3 a {
  color: var(--titleArticleCard);
}

.article__box .entry-content {
  height: 90px;
  margin-bottom: 10px;
  width: 100%;
}

.article__box .entry-content p {
  color: var(--paragraphArticleCard);
  overflow-wrap: break-word;
}

.article__box .entry-meta {
  height: 22px;
  margin-top: auto;
  margin-bottom: 10px;
}

section.not-article {
  margin-inline: auto;
}

section.not-article h1 {
  text-align: center;
  margin-bottom: 10px;
}

section.not-article h2 {
  text-align: center;
  margin-block: 20px;
}

footer.site-footer {
  background-color: var(--backgroundNavbar);
  width: 100%;
  min-height: 40px;
}

footer.site-footer .widget-footer {
  max-width: 1360px;
  width: 100%;
  margin-inline: auto;
  color: var(--textColorNavbar);
}

footer.site-footer .site-info {
  width: 100%;
  max-width: 1360px;
  height: 40px;
  padding-inline: 15px;
  margin-inline: auto;
  display: flex;
  align-items: center;
}

footer.site-footer .site-info p {
  color: var(--textColorNavbar);
  margin-block: 0;
}

footer.site-footer .site-info p a {
  color: var(--textColorNavbar);
}

.page-template .entry-content a {
  text-decoration: underline;
  color: var(--Color1);
  font-weight: 600;
}

@media screen and (max-width: 768px) {
  .header__container {
    position: relative;
  }
  ul.menu {
    position: absolute;
    top: 100%;
    left: -100vw;
    background-color: var(--backgroundNavbar);
    display: block;
    width: 100%;
    min-height: calc(100vh - 70px);
    transition: left 0.3s cubic-bezier(1, 0.01, 0.19, 0.41);
    overflow: auto;
  }
  ul.menu > li {
    margin-block: 10px;
    padding-block: 10px;
  }
  ul.menu.open {
    left: 0;
  }
  .menu-item-has-children ul.sub-menu {
    width: 100%;
    position: initial;
    max-height: 0;
    overflow: hidden;
    display: none;
    transition: max-height 0.3s ease-in-out;
  }
  .menu-item-has-children ul.sub-menu .menu-item-has-children {
    width: 100%;
  }
  .menu-item-has-children ul.sub-menu .menu-item-has-children ul.sub-menu li {
    padding-right: 0;
  }
  .hamburger {
    display: block;
  }
  .hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .hamburger.open span:nth-child(2) {
    transform: rotate(-45deg) translate(6px, -5px);
  }
  .main article.single-template .entry-footer {
    margin-bottom: 10px;
  }
  .main article.single-template .entry-footer .entry-categories a {
    margin: 0 5px 5px 0;
    display: block;
  }
}

/* Widget */
/* Wrapper per layout con Flexbox */
.layout-wrapper {
  display: flex;
  gap: 20px;
  /* Distanza tra i contenitori */
  margin: 20px auto;
}

/* Layout a larghezza piena */
.layout-wrapper.full-width .content-area {
  flex: 1;
  /* Il contenuto occupa tutto lo spazio disponibile */
}

/* Layout con sidebar */
.layout-wrapper.with-sidebar {
  align-items: flex-start;
  /* Allinea sidebar e contenuto in alto */
}

.layout-wrapper.with-sidebar .content-area {
  flex: 0 0 70%;
  /* Il contenuto occupa il 70% */
}

.layout-wrapper.with-sidebar .widget-area {
  flex: 0 0 30%;
  /* La sidebar occupa il 30% */
}

/* Stile della sidebar */
.widget-area {
  background-color: #f9f9f9;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

/* Stile del contenitore principale */
.content-area {
  background-color: #fff;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

/* Media Query per dispositivi mobili */
@media (max-width: 768px) {
  .layout-wrapper {
    flex-direction: column-reverse;
    /* Imposta layout verticale */
  }
  .layout-wrapper.with-sidebar .content-area,
  .layout-wrapper.with-sidebar .widget-area {
    flex: 1;
    /* Entrambi occupano il 100% */
  }
}

/*
* SEARCH
*/
.search svg.lente-search {
  fill: var(--textColorNavbar);
  cursor: pointer;
}

.search-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  box-sizing: border-box;
  background-color: rgba(34, 34, 34, 0.7);
  z-index: 10000;
  overflow: hidden;
}

/* Rimuove lo stile predefinito del dialog */
#search-dialog::backdrop {
  background: transparent;
}

/* Stile form di ricerca all'interno del dialog */
#search-dialog .search-form {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 600px;
  z-index: 1001;
}

/* Stile per l'input di ricerca */
#search-field {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/*page*/
/* con widget */
.container .row {
  display: flex;
}

.container .row .col-md-3 {
  width: 30%;
  background-color: #f9f9f9;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.container .row .col-md-7 {
  width: 70%;
  background-color: #fff;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Layout a larghezza intera */
.page-template.fullwidth-layout .entry-content {
  width: 100%;
  background-color: #fff;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

/* Media Query per dispositivi mobili */
@media (max-width: 768px) {
  .container .row {
    flex-direction: column;
  }
  .container .row .col-md-3,
  .container .row .col-md-7 {
    width: 100%;
    margin-bottom: 20px;
  }
}
