/* Base */
:root {
    --bg-color: #fbf6f3; /*for the background*/
    --dark-bg-color: #f3efec; /*for things with a clearly differant background than --bg-color*/
    --darker-bg-color: #ece8e4; /*for outline before hover*/
    --darkest-bg-color: #d3cecc; /*for outlines and for hover outline*/
    --text-color: #130c09; /*for text*/
    --lighter-text-color: #aba29e; /*for less inportant text*/
    --primary-color: #EE7322; /*for header and hover*/
    --secondary-color: #da8852; /*for orange color before hover*/
    --highlight-color: yellow; /*for the article type*/
}
* {
    margin: 0;
}
body {
    background-color: var(--bg-color);
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    color: var(--text-color);
    overflow-wrap: anywhere;
}

/* Hide scrollbar */
::-webkit-scrollbar {
    display: none;
}

/* Dropdown */
#dropdown {
    background-color: transparent;
    z-index: 11;
    height: 2.5rem;
    font-family: 'Times New Roman', Times, serif;
    width: fit-content;
    font-size: 2rem;
    padding: 0.5rem 1rem 1.5rem 1rem;
    border: none;
    position: fixed;
    cursor: default;
    top: 0;
    right: 0.5rem;
}
#dropdown_button_container {
    background-color: var(--dark-bg-color);
    border: var(--darkest-bg-color) solid 2px;
    position: fixed;
    padding: 1rem;
    top: 4rem;
    right: 0.5rem;
    min-width: 5rem;
    direction: rtl;
    flex-direction: column;
    
    display: none;
}
#dropdown:hover #dropdown_button_container {
    display: flex;
}
#dropdown_button_container:hover {
    display: flex;
}
@media (height < 30rem) {
    #dropdown_button_container {
        overflow-y: scroll;
        width: calc(100% - 3rem);
        height: calc(100% - 6.5rem);
        grid-template-rows: repeat(3, minmax(0, 1fr));
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-items: center;
        align-items: center;
        font-size: 4.5vw;
        text-align: center;
    }
    #dropdown:hover #dropdown_button_container {
        display: grid;
    }
    #dropdown_button_container:hover {
        display: grid;
    }
}
.dropdown_button {
    padding: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    border-right: transparent solid 2px;
    transition: border 0.3s;
}
@media (height < 26rem) {
    .dropdown_button {
        width: fit-content;
    }
}
.dropdown_button:hover {
    border-right: var(--primary-color) solid 2px;
}
@media (height < 30rem) {
    .header_button {
        font-size: 1.4rem;
    }
}
@media (height < 23rem) {
    #header_button_container {
        flex-direction: row;
    }
}

/* Header */
header {
    z-index: 10;
    width: 100%;
    height: 3.4rem;
    top: 0;
    background-color: var(--primary-color);
    overflow: auto;
    white-space: nowrap;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}
header img {
    cursor: pointer;
}
header p {
    font-size: 1.2rem;
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: hsl(0, 0%, 100%, 90%);
    cursor: default;
    width: 33%;
    text-align: center;
}
@media (width <= 52rem) {
    header p {
        display: none;
    }
}
#header_titel_image {
    width: 12rem;
    padding: 0.4rem;
}
@media (width <= 13rem) {
    #header_titel_image {
        width: calc(100% - 1rem);
    }
}

/* Breaking news */
#breaking {
    width: 100%;
    height: 2rem;
    background-color: red;
}

/* Main */
main {
    margin: 0 auto 0 auto;
    padding: 3rem;
    padding-top: 1rem;
    width: calc(80rem - 8rem);
    min-height: calc(100vh - 3.4rem - 4rem);
    height: fit-content;
    /*
    border-left: var(--darker-bg-color) solid 2px;
    border-right: var(--darker-bg-color) solid 2px;
    */
}
@media (80rem <= width <= 120rem) {
    main {
        width: calc(55rem - 8rem);
    }
}
@media (45rem <= width < 80rem) {
    main {
        width: calc(45rem - 8rem);
    }
}
@media (width < 45rem) {
    main {
        width: calc(100% - 4rem);
        padding: 2rem;
    }
}

main img {
    width: 100%;
    max-height: 22rem;
    object-fit: cover;
    aspect-ratio: attr(width) / attr(height); /*To make sure frame exists*/
}
@media (width > 120rem) {
    main img {
        max-height: 38rem;
    }
}
@media (width < 35rem) {
    main img {
        max-height: 12rem;
    }
}

/* Text styling */
h1.top_text {
    width: 100%;
    height: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
}
main .article h1 { /* Same as h2 in but for articles */
    font-size: 2.2rem;
}
@media (width < 35rem) {
    main .article h1 {
        font-size: 1.8rem;
    }
}
main h2 {
    font-size: 2.2rem;
}
@media (width < 35rem) {
    main h2 {
        font-size: 1.8rem;
    }
}
main p {
    font-size: 1.2rem;
}
main li {
    font-size: 1.2rem;
}
.redacted_text {
    background-color: black;
    color: black;
}

/* Content in main */
.article {
    background-color: var(--bg-color);
    position: relative;
    padding: 1rem;
    display: block;
    margin-bottom: 2.5rem;
    color: var(--text-color);
    text-decoration: none;
    border: var(--darker-bg-color) solid 2px;
    transition: 0.3s;
}
.article:not(:has(~ .article)) { /* Gör så bara sista .article har margin-bottom = 0 */
    margin-bottom: 0;
}

.extra_info {
    background-color: var(--dark-bg-color);
    border: var(--secondary-color) solid 2px;
    width: 12.5rem;
    position: absolute;
    top: 7.9rem;
    left: calc(50%);
    transform: translateX(calc((72rem / 2) + 2rem)); /*width = 72rem*/
    transition: none;
    text-align: center;
}
@media (83rem <= width <= 120rem) { 
    .extra_info {
        transform: translateX(calc((47rem / 2) + 2rem)); /*width = 47rem*/
    }
}
@media (width < 83rem) {
    .extra_info {
        position: static;
        transform: translateX(0);
        width: calc(100% - 2rem);
    }
}
.extra_info.attention {
    box-shadow: var(--highlight-color) 0 0 0.5rem;
    margin-bottom: 1rem;
}
a.extra_info.user_prompt {
    transition: 0.3s;
}
a.extra_info.user_prompt:hover {
    background-color: var(--darker-bg-color);
    border: var(--primary-color) solid 2px;
    transform: translate(calc((72rem / 2) + 2rem - 0.2rem), -0.2rem); /*width = 72rem*/
    box-shadow: var(--darkest-bg-color) 0.2rem 0.2rem 0.8rem;
}
@media (83rem <= width <= 120rem) { 
    a.extra_info.user_prompt:hover {
        transform: translate(calc((47rem / 2) + 2rem - 0.2rem), -0.2rem); /*width = 47rem*/
    }
}
@media (width < 83rem) {
    a.extra_info.user_prompt:hover {
        transform: translate(-0.2rem, -0.2rem);
    }
}

/* Up button */
#go_up {
    background-color: var(--bg-color);
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 4rem;
    z-index: 2;
    cursor: pointer;
    text-align: center;
    border: var(--darker-bg-color) solid 2px;
    padding: 1rem;
    padding-top: 0.7rem;
    color: var(--secondary-color);
    text-decoration: none;
    transition: border 0.3s, color 0.3s, opacity 0.3s, visibility 0.3s;

    /*Starting as this, changed later by JS. Therefor the #go_up.show class*/
    opacity: 0%;
    pointer-events: none;
    visibility: hidden;
}
#go_up:hover {
    border: var(--darkest-bg-color) solid 2px;
    color: var(--primary-color);
}
@media (width < 55rem) {/*Main width is 100%*/
    #go_up {
        right: 1rem;
    }
}
@media (width < 45rem) {/*Main width is 100%*/
    #go_up {
        bottom: 1rem;
    }
}
#go_up.show {
    opacity: 100%;
    pointer-events: auto;
    visibility: visible;
}
#go_up p {
    font-size: 2rem;
}

/* Footer */
footer {
    min-width: 100%;
    min-height: 4rem;
    height: fit-content;
    position: absolute;
    background-color: var(--dark-bg-color);
    border-top: var(--darkest-bg-color) solid 2px;
    overflow: auto;
    white-space: nowrap;
    display: flex;
    justify-content: space-between;
}
@media (width < 50rem) {
    footer {
        flex-direction: column;
    }
}
@media (width < 25rem) {
    footer {
        white-space: normal;
    }
}

.footer_text {
    padding: 0.7em;
}

/* Animation stopper */
.resize_animation_stopper * {
  transition: none !important;
  animation: none !important;
}