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

html, body {
    margin: 0;
    padding: 0;
}

/* settings */

main ul {
    padding-left: 20px;
    margin-left: 0;
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

section {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-wrap: wrap;
    gap: 2vw;
    padding: 1em;
    box-sizing: border-box;
}

aside {
    position: absolute;
    bottom: 1em;
    right: 2vw;
    transform: translateY(-50%);

    /* Center content inside circle */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-center;
    text-align: left;
    padding: 2em;
    box-sizing: border-box;

    /* Ring around */
    border: 3px solid rgb(238, 210, 2);
    border-radius: 50%;
    background-color: rgba(238, 210, 2, 0.15);
}

aside ul {
    padding: 0;
    margin: 0;
}

aside li {
    list-style: none;
}


/* TEXT specifics */
body {
    font-family: 'Courier New', Courier, monospace;
}

h2 {
    font-size: 2.5em;
    font-weight: bolder;
    padding: 0 2em;
    text-align: center;
}

h3 {
    font-size: 1.8em;
    text-align: left;
}

strong {
    font-weight: bolder;
    font-style: italic;
    font-size: 1.2em;
}

main strong {
    font-size: 1em;
}

/* h3 {
    font-size: 2.3em;
    text-align: center;
} */

aside {
    font-size: .8em;
}

/* SEMANTIC COMPONENTS specifics */
header {
    min-height: 50px;
    background: rgba(53, 221, 11, 0.267);
}

header ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1vh;
    padding: 0;
    margin: 0;
}

header ul li {
    list-style: none;
    text-align: center;
    margin: 1vw;
    /* flex: 1 0 calc(33.33% - 1vh); */
    /* background-color: red; */
}

/* Force last item of the header list to own row */
header ul li:last-of-type {
    flex-basis: 100%;
    margin-top: 1vh;
    font-size: 2em;
}

main {
    /* margin: 0 2vw; */
    min-width: 500px;
    padding: 1em;
    border: 1px rgb(53, 221, 11) solid;
    border-radius: 8px;
    width: 33.33%;
    /* margin: 0 auto; */
    /* flex: 1; */
}

footer {
    min-height: 50px; 
    background: lightgray;
    position: sticky;
    left: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    /* padding: 0; */
}

footer p {
    margin: 0;
    padding: 1vh 0 0 0;
}

.link-SoMe-logo {
    width: 3vh;
    margin: 1vh;
}

/***** Effects *****/
/* List checkmarks */

main ul li {
    list-style: none;
}

main ul li:before {
    content: '✓ ';
}

/* Header Tooltip */
header ul li {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.header_tooltip {
  visibility: hidden;
  width: 200px;
  background-color: black;
  color: #ffffff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 5px;
  position: absolute;
  z-index: 1;
  bottom: 150%;
  left: 50%;
  margin-left: -100px;
  /* Homogenized size of tooltips */
  font-size: 12px;
  font-weight: normal;
  font-style: normal;
}

.header_tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: black transparent transparent transparent;
}

header ul li:hover .header_tooltip {
  visibility: visible;
}

/* For larger screens */
@media (min-width: 901px) {
    aside {
        position: static;
        transform: none;
        width: 80%;
        height: auto;
        flex: none;
        aspect-ratio: auto;
        border-radius: 8px;
        margin-top: 1em;
    }
}

/* Small screens */
@media (max-width: 900px) {
    h2 {
        font-size: 1.5em;
    }

    header ul li em {
        font-weight: normal;
    }

    aside {
        position: static;
        transform: none;
        width: 80%;
        height: auto;
        aspect-ratio: auto;
        border-radius: 8px;
        margin-top: 1em;
        font-size: 0.7em;
    }

    main {
        width: 100%;
        min-width: 0;
    }

    .link-SoMe-logo {
        width: 7vh;
        margin: 1vh;
    }

    header ul li:last-of-type {
        font-size: 1em;
    }

    header ul li {
        /* Tillåt li-elementet att bryta rader naturligt om tooltipen visas */
        position: relative; 
    }

    .header_tooltip {
        width: 90vw;          /* Gör tooltipen flexibel baserat på skärmens bredd */
        max-width: 280px;     /* Sätt ett tak så den inte blir för stor på surfplattor */
        left: 50%;
        transform: translateX(-50%); /* Modernare sätt att centrera utan negativ margin */
        margin-left: 0;       /* Nollställ den gamla -100px marginalen */
        
        /* Valfritt: Om skärmen är extremt smal förhindrar detta overflow */
        box-sizing: border-box; 
    }

    /* Vi döljer den lilla triangeln (pilen) på mobilen eftersom  */
    /* positionen kan skifta beroende på var ordet ligger på skärmen */
    .header_tooltip::after {
        display: none;
    }
}