/*
Theme Name: acgpt
Description: A minimal starter theme with styled menu and right sidebar
Author: ChatGPT
Version: 1.0
*/

/*------ Variabili ------*/
:root {
  --website-width: 1500px;
  --website-content-width: 1340px;

  --website-main-color: #005b99;
  --website-main-color-light: #eff9fd;
  --website-main-color-hover: #338fcc;

  --menu-background-color: #ffffff;
  --menu-text-color: #1a1a1a;
  --menu-background-color-hover: var(--website-main-color-light);
  --menu-text-color-hover: var(--website-main-color);
  --menu-border-bottom-color: lightgray;

  --h-color: var(--website-main-color);
  --text-color: #1a1a1a;
  --link-color: #0040ff;

  --widget-title-color: var(--website-main-color);

  --footer-background-color: var(--website-main-color);
  --footer-widget-title-color: #ffffff;
  --footer-text-color: #ffffff;
  --footer-link-color: #ffffff;
}
/*-----------------------*/

*, *::before, *::after {
  box-sizing: border-box;
}

body {
    font-family: Verdana, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 24px;
}

b {
    font-weight: bold;
}

.site-size {
    max-width: var(--website-width);
    margin: 0 auto;
}

.container {
    display: flex;
    margin: 0 auto;
    max-width: var(--website-content-width);
    width: 100%;
}

.content {
    flex: 3;
    min-width: 0;
    padding-right: 1rem;
    padding:1rem;
}

.sidebar {
    flex: 1;
    background: #fff;
    padding: 1rem;
}

@media (min-width: 1025px) {
    .container {
        display: flex;
        flex-wrap: nowrap;
        gap: 0rem;
    }

    .content {
        flex-basis: 70%;
        max-width: 942px;
        width: 100%;
    }

    .sidebar {
        flex-shrink: 0;
        min-width: 300px;
        max-width: 400px;
    }
}


/* Menu */
nav.main-navigation {
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0.5px;
    background-color: var(--menu-background-color);
    color: var(--menu-text-color);
    border-bottom: 1px solid var(--menu-border-bottom-color);
}

nav.main-navigation .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0rem;
    justify-content: center;
    line-height: 54px
}

/* Hamburger icon */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding-right: 1rem;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--menu-text-color);
  border-radius: 2px;
}

nav.main-navigation .menu li {
    position: relative;
    padding: 0px 16px;
    margin: 0;
}

nav.main-navigation .menu li:hover {
    background-color: var(--menu-background-color-hover);
    color: var(--menu-text-color-hover);
}

nav.main-navigation ul.sub-menu {
    display: none; /* Hide submenus by default */
    position: absolute;
    top: 100%; /* Position submenus below the parent menu item */
    left: 0;
    background-color: var(--menu-background-color-hover); /* submenu inverted color */
    color: var(--menu-background-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    padding: 0;
    list-style: none;
    margin: 0;
    z-index: 99999;
    width: 200px; /* Adjust the width of the dropdown */
}

nav.main-navigation .menu li:hover > ul {
    display: block; /* Show submenu when parent is hovered */
}

nav.main-navigation ul.sub-menu li {
    min-height: 40px;
    line-height: 40px;
    width: 100%;
}

nav.main-navigation ul.sub-menu li:hover {
    background-color: var(--menu-background-color);
    color: var(--menu-text-color);
}


@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        margin-top: 2rem;
    }

    nav.main-navigation ul {
        flex-direction: column;
        align-items: center;
    }

    nav.main-navigation ul.sub-menu {
        position: static; /* Submenus become static on mobile */
        display: none;
        width: 100%; /* Full width for mobile submenus */
    }

    nav.main-navigation .menu.active {
        display: flex;
    }

    nav.main-navigation .menu li {
        width: 100%;
    }
}

nav.main-navigation .nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
}

nav.main-navigation .nav-inner-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav.main-navigation .menu a {
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    color: var(--menu-text-color);
    text-shadow: 0.2px 0 0 currentColor;
}

nav.main-navigation .menu a:hover {
    color: var(--menu-text-color-hover);
}

nav.main-navigation ul.sub-menu a:hover {
    color: var(--menu-text-color);
}

@media (max-width: 1024px) {
    nav.main-navigation .nav-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    nav.main-navigation .nav-inner-left {
        width: 100%;
    }

    .hamburger {
      display: flex;
    }

    nav.main-navigation .menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    nav.main-navigation .menu.active {
        display: flex;
    }

    nav.main-navigation .menu li {
        width: 100%;
    }
}

/* Widgets */
aside.sidebar .widget {
    padding: 1rem;
}

.widget .widget-title {
  color: var(--widget-title-color);
}

.under-menu-widget-area {
  background-color: #f8f8f8;
  margin-bottom: 8px;
}

.under-menu-widget-area .widget {
    padding: 0.5rem 2rem;
}

.widget.footer-widget {
  color: var(--footer-text-color);
  margin: 2rem;
}

.widget.footer-widget a{
  color: var(--footer-link-color);
}

.widget.footer-widget .widget-title {
  color: var(--footer-widget-title-color);
  margin-top: 0px;
  font-weight: normal;
  text-shadow: 0.1px 0 0 currentColor;
}

.site-footer {
  background-color: var(--footer-background-color);
  padding-top: 1rem;
  padding-bottom: 2rem;
  margin-top: 3rem;
}

.footer-widgets {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 0 auto;
}

.footer-column {
  flex: 1;
  min-width: 200px;
}

@media (max-width: 1024px) {
  .footer-column {
    flex: 1 0 100%;
  }
}

/* Archives */
.archive-post {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 1rem;
  align-items: flex-start;
}

.archive-post-thumbnail {
  flex: 0 0 150px;
}

.archive-post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.archive-post-content {
  flex: 1;
  min-width: 200px;
}

.archive-post-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

@media screen and (max-width: 600px) {
  .archive-post {
    flex-direction: column;
  }

  .archive-post-thumbnail {
    flex: none;
    width: 100%;
  }

  .archive-post-content {
    width: 100%;
  }
}

.nav-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  gap: 1rem;
}

.nav-previous a,
.nav-next a {
  display: inline-block;
  padding: 0.6rem 1rem;
  background-color: var(--website-main-color, #025928);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.nav-previous a:hover,
.nav-next a:hover {
  background-color: var(--website-main-color-hover, #3c8c30);
  text-decoration: underline;
}

/* Responsive: impila su schermi piccoli */
@media screen and (max-width: 600px) {
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .nav-previous,
  .nav-next {
    width: 100%;
  }
}


/* Logo - Images */
.content img, .widget img {
  max-width: 100%;
  height: auto;
}

.site-logo {
  max-height: 50px;
  padding-left: 1rem;
  margin: 4px 0px;
}

.custom-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Tipography */
h1, h2, h3, h4, h5, h6 {font-family: Arial, Helvetica, sans-serif; font-weight: normal; color: var(--h-color); text-shadow: 0.1px 0 0 currentColor;}
h1 {font-size: 30px; line-height: 34px;}
h2 {font-size: 26px; line-height: 32px; margin-top:6rem;}
h3 {font-size: 22px; line-height: 30px;}
h4 {font-size: 20px; line-height: 28px;}
h5 {font-size: 18px; line-height: 26px;}
h6 {font-size: 16px; line-height: 24px;}

.main-content a {color: var(--link-color); text-decoration: none; }

.main-content > p, .main-content > ul { font-family: Arial; font-size: 20px; }
.main-content > p { margin-top: 1rem; margin-bottom: 2.5rem; line-height: 34px; }
.main-content > p:has(+ ul) { margin-bottom: 6px; }
.main-content ul { margin-top: 4px; padding-inline-start: 24px; line-height: 28px;}
.main-content > ul li {margin-bottom: 8px;}

/*------ Fix wordpress rendering ----*/
p:empty{display:none;}
h1:empty{display:none;}

/* sticky widget - ultimo in basso - per far funzionare sticky, tutti i parents devono avere overflow visible */
div.container {overflow: visible;}
aside.sidebar > div:last-child {position: sticky; top: 0px; /*padding-top: 0px;*/}


/* Fix Flexbox issues for Safari 6.1-10.0 */
@media screen and ( min-color-index: 0 ) and ( -webkit-min-device-pixel-ratio: 0 ) {
	@media {
		.content,
		.sidebar {
			margin-right: -1px;
		}
	}
}

/* Fix Flexbox issues for Safari 10.1+ */
@media not all and ( min-resolution: .001dpcm ) {
	@media {
    .content,
		.sidebar {
			margin-right: -1px;
		}
	}
}



/*--------------------------------------------------------------
# - Alignments
--------------------------------------------------------------*/
.alignleft,
.alignright,
.aligncenter {
	display: block;
	margin: 0.5em 0;
}

.aligncenter {
	clear: both;
	margin-right: auto;
	margin-left: auto;
	text-align: center;
}

@media only screen and (min-width: 20em) {
	.alignleft {
		float: left;
		margin-right: 1.5em;
	}

	.alignright {
		float: right;
		margin-left: 1.5em;
	}
}
