/* these are the site colors, replace them with anything you want!
 * this version is highly customizable... use simple-style.css for quicker editing if you don't care too much about the specifics!*/
:root {
  --site-bg: url("images/bg1.png");
  /*or like this for just a solid color:*/
  /*--site-bg: #FFE1C6; */
  
  --post-bg: white;
  --post-text: #4E223D;
  --post-header-text: #DA587E;
  --border-color: #FB8AAB;
  --border-shadow: #DA587E80;
  
  --sidebar-text: #4E223D;
  --sidebar-bg: #FB8AAB;
  --sidebar-button-bg: #FFD2E0;
  --sidebar-button-bg-hover: #FFE1C6;
  --sidebar-button-text: #4E223D;
  --sidebar-button-text-hover: #DA587E;
  --sidebar-border-color: #DA587E;
  
 /*this is for the collapsible sections at the top (status and tag filters)*/
  --pinned-text: #4E223D;
  --pinned-bg: #FFD2E0;
  /*tag filter button colors*/
  --button-bg: #FFD2E0;
  --button-bg-hover: #FFE1C6;
  --button-bg-selected: #FB8AAB;
  --button-text: #4E223D;
  --button-border-color: #DA587E;
  
  /*these next two colors are for when you highlight text on the page*/
  --selected-bg: #bde0ff;
  --selected-text: #5244c8;
}

.cf:before,.cf:after{content:" ";display:table}.cf:after{clear:both}

/*the fonts used for this template are available here: 
 * https://fonts.google.com/specimen/Atkinson+Hyperlegible
 * https://fonts.google.com/specimen/Nunito
 * 
 * if you don't include these files in a "fonts" folder on your website, your browser will try to substitute the next closest thing...
*/
@font-face {
  font-family: Nunito;
  src: url('./fonts/Nunito-Black.ttf');
  font-weight: bold;
}
@font-face {
    font-family: Atkinson Hyperlegible;
    src: url('./fonts/AtkinsonHyperlegible-Regular.ttf');
}

@font-face {
    font-family: Atkinson Hyperlegible;
    src: url('./fonts/AtkinsonHyperlegible-Bold.ttf');
    font-weight: bold;
}

html {scroll-behavior: smooth;
overflow-x: hidden;
margin-right: calc(-1 * (100vw - 100%));}
::selection {
  background: var(--selected-bg);
  color: var(--selected-text);
}
* {
  box-sizing: border-box;
  /*custom scrollbar colors~ i think it only works on some browsers tho...*/
  scrollbar-color: var(--post-header-text) var(--post-bg);
  scrollbar-width: thin;
}

body {
  /*change the main font here*/
  font-family: 'Atkinson Hyperlegible', Verdana, Tahoma, sans-serif;
  font-size: 16px;
  margin: 0;
  background: var(--site-bg);
  color: var(--post-text);
  line-height: 1.6em;
  /*if you use a bg image, this will keep it from scrolling*/
  background-attachment: fixed;
}

/*use a special font for certain headings/buttons*/
h1,
nav,
.pinned summary {
  font-family: 'Nunito', Verdana, Tahoma, sans-serif;
  font-weight: bold;
}
/*use a pointer for the fake buttons*/
details > summary,
#tag-filters label {cursor: pointer;}

/*quick addon styles you can use in combination with anything*/
.center {text-align: center;}
.small-text {font-size: smaller;}
.no-border {border: none; padding:0;}

/*some parts of the layout can be hidden/shown depending on if you're on desktop or mobile*/
.mobile-only {display:none;}
.pc-only {display: block;}

/*this class makes stuff wrap around, very handy*/
.flex {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
}
/*this container will center the page contents better for larger screen sizes*/
#container {
  max-width:1200px;
  height:100%;
  margin:auto;
  overflow-x: hidden; /* Taglia tutto ciò che prova a uscire lateralmente */
  width: 100%;

}

main {
  /*here is the post width*/
  max-width: 900px;
  /*this part means it ignores all other elements when figuring out where to sit on the page*/
  /*because of that, we gotta tell it how much room to leave for the sidebar*/                                                 
  margin-left: 280px;
  margin-right:20px;
}

#sidebar {
  position:fixed;
  background: var(--sidebar-bg);
  margin-left: 20px;
  padding: 2em 1em;
  /*we left 300px of room for the sidebar, but we want the width to be less than that since there should be some spacing between*/
  width: 240px;
  /*i put dashed borders on each side, but you can change it to a different type or remove them*/
  border-inline: 2px dashed var(--sidebar-border-color);
  /*outlines go outside of the borders, so it makes it look like stitching on the edges. cute!*/
  outline: 4px solid var(--sidebar-bg);
  z-index: 99;
  height: 100%;
  /*and add a scrollbar if someone's window is too short to see all the content*/
  overflow-y: auto;
}

#sidebar h1 {
  margin-block: .5em;
}
/*link text in the sidebar should be the same color*/
#sidebar a {
  color: var(--sidebar-text);
}
/*font size for your name in the sidebar*/
#sidebar h1 a {                            
  font-size: 1em;
}
/*no underline for your name, or hovered links in sidebar*/
#sidebar h1 a,
#sidebar a:hover {text-decoration: none;}

/*center the icon in the sidebar*/
#icon {margin:auto;}
#icon img {
  /*this makes it a circle, lower the number for a rounded square*/
  border-radius:50%;
  max-width:200px;
}
/*these styles are for when your icon image is being used as a link, it just makes it react on mouseover*/
#icon a img {
  outline: 2px solid var(--sidebar-bg);
  /*adds animation to the outline*/
  transition: .2s;
}
#icon a img:hover {
  outline: 2px solid var(--sidebar-text);
  outline-offset: 0px;
}

/*profile text doesnt need as much spacing as the posts do*/
#profile p {
  margin-block: .3em;
  line-height: 1.5em;
}
/*styling the simple bio block*/
#bio {
  border-block: 2px dashed var(--sidebar-border-color);
  padding-block: .5em;
  margin-block: 1em;
  font-size: small;
}

/*for the rounded link buttons!*/
#sidebar nav ul {
  text-align: center;
  vertical-align: middle;
  margin-top: 0;
  margin-bottom: 1em;
  padding: 0;
  list-style-type: none;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 3px;
  justify-content: space-evenly;
}
#sidebar nav li a {
  /*set a width so they're the same size*/
 font-size: small;
  min-width: 100px;
  display: inline-block;
  height:25px;
  background: var(--sidebar-button-bg);
  color: var(--sidebar-button-text);
  font-weight: bold;
  border-radius: 1rem;
  outline: 2px solid #fff0;
  transition: .2s;
  text-decoration: none;
}
#sidebar nav li a:visited {color: var(--sidebar-text);}
#sidebar nav li a:hover {
  background: var(--sidebar-button-bg-hover);
  color: var(--sidebar-button-text-hover);
  outline: 2px solid var(--sidebar-text);
  outline-offset: 0px;
}
/*and add some spacing around them too*/
#sidebar nav {
  margin-block:1.5em;
}

 /*for the collapsible sections at the top (status and tag filters)*/
.pinned {
  background: var(--pinned-bg);
  font-size: smaller;
  border-radius: 1em;
  margin: 1em 0;
  border: 2px solid var(--border-color);
  outline: 2px solid var(--post-bg);
  box-shadow: 2px 2px 6px var(--border-shadow);
}
/*the heading for those blocks*/
.pinned summary {
  color: var(--sidebar-text);
  font-size: 1.5em;
  font-weight: bold;
  border-bottom: 2px dashed var(--border-color);
  margin: .5em;
}
/*since the summary uses the special font, switch back to the other one for the timestamp*/
.pinned time {
  font-family: 'Atkinson Hyperlegible', Verdana, Tahoma, sans-serif;
  float: right;
  font-weight: normal;
  font-size: small;
}

/*the list with the alternating colors! (cute!!!)*/
#status ul {
  background: var(--post-bg);
  margin:.5em;
  padding:.5em;
  border-radius: .5em;
}
#status li {
  list-style-type: none;
  padding: .2em;
}
/*list title, ie "reading:"*/
#status li:nth-child(odd) {
  font-weight: bold;
  font-size: 1.2em;
  color: var(--post-header-text);
}
/*list answer, ie "books about magic"*/
#status li:nth-child(even) {
  background: var(--pinned-bg);
  color: var(--pinned-text);
  border-radius: .3em;
  padding-inline: .8em;
}
/*make links the same as in posts*/
#status li a {color: var(--pinned-text);}
#status li a:hover {text-decoration: none;}

/*post styles*/
.post {
  background: var(--post-bg);
  color: var(--post-text);
  border-radius: 1rem;
  padding: 0 .8rem .2rem .8rem;
  margin-bottom: 1em;
  box-shadow: 2px 2px 6px var(--border-shadow);
  min-width: 100%;
}
/*make sure images stay within the post*/
.post img {max-width:100%;}
/*add some space from the post header if you have an image first*/
.post div + img {margin-top: 1em;}

/*the top of the post where you put your username*/
.post-header {
  color: var(--post-header-text);
  font-weight: bold;
  padding: .5rem 0;
  border-bottom: 2px dashed var(--border-color);
}
/*and the post's timestamp*/
.post time {
  float: right;
  font-weight: normal;
  font-size: smaller;
  margin: .2em;
}
/*link styling*/
.post a {color:var(--post-text);}
.post a:hover {text-decoration: none;}

/*this is for lists*/
.post li {
/*you can change the normal dot to anything you want :)*/
  /*list-style-type: "♥ ";*/
/*i used stars to match the bg image!*/
  list-style-image: url("images/star.png");
}

/*"read more" button for long posts*/
.readmore {
  margin-bottom: 1em;
}
.readmore summary {
  font-weight: bold;
  color: var(--post-header-text);
  /*this gets rid of the arrow*/
  list-style-type: none;
}
/*hide the "read more" button after it's clicked (delete this line to keep it there)*/
.readmore[open] > summary {display:none;}
/*optional border to denote a border was there before*/
.readmore[open] {
  border-top: 2px dashed var(--button-bg);
  padding-top:1em;
}

.tags {
  border-top: 2px dashed var(--border-color);
  padding: .4em 0;
}
.tags a {color: var(--post-text);}
.tags span {color: var(--post-header-text);}
.tags a,
.tags span {
  font-size: small;
  padding: .2em .5em;
  border-radius: 1em;
  text-decoration: none;
}
.tags a:hover {
  background:var(--button-bg);
  text-decoration: underline;
}

/*css for hiding posts*/
.tagged:has(input:checked) article {display: none;}

/*add new tags to filter here!
 * follow the class naming conventions (no spaces, don't start it with a number)
 * remember on the actual page you can write the tag however you want!*/
.tagged:has(#all:checked) article,
.tagged:has(#intro:checked) article[class~="intro"],
.tagged:has(#personal:checked) article[class~="personal"],
.tagged:has(#secret:checked) article[class~="secret"],
.tagged:has(#art:checked) article[class~="art"] {display: inline-block;}

/*tag filter button styles (there's a lot)*/
#tag-filters label {
  background: var(--button-bg);
  border: 1px solid var(--button-border-color);
  border-radius: .5em;
  display: inline-block;
  margin-left: .5em;
  margin-block: .3em;
  padding: 0 .8em 0 .1em;
}
/*hovering filter buttons (normal)*/
#tag-filters label:hover {
  background: var(--button-bg-hover);
  text-decoration: underline;
}
/*selected filters*/
#tag-filters label:has(input:checked) {
  background: var(--button-bg-selected);
  color: var(--button-text);
  text-decoration: underline;
  font-weight: bold;
}
/*hovering selected filters*/
#tag-filters label:has(input:checked):hover {
  background: var(--button-bg-hover);
  text-decoration: none;
}
/*hide the radio button for tags*/
#tag-filters input {appearance: none;}

/*for the "back to top" link at the bottom of the page*/
#page-nav a {color:var(--sidebar-text);}
#page-nav a:hover {text-decoration: none;}

footer {
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  /*in the html the footer is at the very end, but when looking at the site you see it at the bottom of the sidebar!*/
  z-index: 100;
  position: fixed;
  /*make it the same length/positioning as the sidebar*/
  margin-left:22px;
  width:236px;
  bottom:4px;
  font-size: small;
  /*semitransparent so you can see any content that goes under it*/
  text-align: center;
}

.s_box16 {
background:#FFD2E0;
border:1px dashed #DA587E;
border-radius:10px;
box-shadow:0 0 0 5px #FFD2E0;
box-sizing:border-box;
margin:15px 0 25px; /* 中央寄せは0をautoに変更 */
padding:.5em;
width:80% /* 幅 */
}

@media only screen and (max-width: 600px) {
  .mobile-only { display: block; }
  .pc-only { display: none; }


  /* Reset del container */
  #container {
    display: block; /* Più sicuro di flex su mobile per layout semplici */
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
  }

  /* Reset Sidebar */
  #sidebar {
    position: static;
    width: 100%;
    margin: 0;
    border-inline: none;
    outline: none;
    height: auto;
    padding: 20px;
  }

  /* RESET FONDAMENTALE PER IL CONTENUTO */
  main {
    position: static;
    margin: 0 !important; /* Rimuove lo spazio vuoto a sinistra */
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
  }
  
  img, pre, code, table {
    max-width: 100%;
    height: auto;
  }

  /* Fix per i post che "escono" dai bordi */
  .post {
    min-width: 0;
    width: auto;
    margin-left: 0;
    margin-right: 0;
  }

  /* Icona e Profilo */
  #icon {
    max-width: 40%;
    margin-right:.5 em;
  }
  
  #icon img {max-width: 100%;}

  #profile {
    flex:2;
  }
  
  #profile p {
    margin-block: 0;
    margin-left: 10px;
  }
  
  #bio {
    border: none;
    padding-block: 0;}
    
    main {left: 0; margin-inline: 1em; max-width: 100%; flex: 100%;}
    
   
    
  .s_box16 {
    width: 90%; /* Più larga su mobile */
    margin: 15px auto; /* Centrata */
  }

  /* Reset Footer */
  footer {
    position: static;
    width: 100% !important;
    margin: 20px 0 0 0 !important;
    background: var(--sidebar-bg);
    padding: 10px;
  }
}