/*
    -------------------------------------------
    GLOBAL VARIABLES & BOX-SIZING
    -------------------------------------------
*/
:root {
    /* Fonts */
    --header-font: "Georgia";
    --body-font: "Garamond";

    /* Font sizes */
    --base-font-size: 1rem;
    --header-font-size: 1rem;
    --body-font-size: 1rem;

    /* Colors */
    --background: rgb(69, 69, 69);
    --text: rgb(216, 216, 216);
    --card: rgb(85, 85, 91);
    --link: rgb(255, 75, 75);
    --shadow: rgba(0, 0, 0, 0.777);
    
}

* {
    box-sizing: border-box;
}

/*
    -------------------------------------------
    BASIC HTML STYLES
    -------------------------------------------
*/
html {
    padding: 0;
    font-family: var(--body-font);
    font-size: var(--base-font-size);
    background-color: var(--background);
    color: var(--text);
    margin: 0 auto;
}

html * {
    transition: all 0.1s ease-in-out;
}

body {
    -webkit-font-smoothing: antialiased; /* Improve font rendering on webkit browsers */
    -moz-osx-font-smoothing: grayscale; /* Improve font rendering on macOS */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1.6rem;
    max-width: 950px;
    min-width: 300px;
    width: 100%;
    padding: 1rem;
    margin: 0 auto;
    line-height: 1.5;
}


hr {
    height: 1px;
    width: 100%;
    border: none;
    background-color: var(--link);
}

pre {
    height: auto;
    margin: 0;
    padding: 0;
    max-width: 100%;
    width: fit-content;
}

.hljs {
    box-shadow:
        0.3rem 0.3rem .3rem 0 var(--shadow) inset,
        0rem 0rem .3rem 0 var(--card) inset;
}

code {
    font-size: 1rem;
    word-break: normal;
    padding: 0.2rem;
    border-radius: 0.4em;
    background: rgba(0, 0, 0, 0);
}



/*
    -------------------------------------------
    NAVIGATION
    -------------------------------------------
*/
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    font-size: 1rem;
    color: var(--text);
    gap: 0.7rem;
    margin-bottom: .7rem;
    flex-wrap: wrap;
}

nav a {
    display: block;
    padding: 0.1rem 0.3rem;
    margin: 0rem;
    text-decoration: none;
    color: var(--background);
    background-color: var(--text);
    border-radius: 0.15em;
    filter: opacity(100%);
    text-shadow: none;
    box-shadow:
        0.1rem 0.1rem .3rem 0 var(--shadow),
        -.0rem -.0rem .1rem 0 var(--text);
}

nav a:hover {
    background-color: var(--text);
    box-shadow: none;
}

/*
    -------------------------------------------
    IMAGES
    -------------------------------------------
*/

img {
    max-width: 100%;
    height: auto;
    align-self: center;
}

header img {
    height: 1.3rem;
    margin-left: 0;
    
    filter: invert(80%);
    
}

.detail img {
    max-height: 20rem;
    margin: 0;
    padding: 0;
    align-self: center;
}

header a img:hover,
.detail a img:hover {
    filter: invert(70%);
}

.share {
    width: 1rem;
}

.description img {
    width: auto;
    height: auto;
    align-self: center;
}

.actionicons {
    width: 2.2rem;
    height: 2.2rem;
    margin: 0;
    padding: 0;
    filter: invert(50%);
}


/*
    -------------------------------------------
    ARTICLE DETAIL BOX
    -------------------------------------------
*/
.detail {
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1rem;
    border-radius: 0.4em;
    background-color: var(--card);
    padding: 1rem;
    margin: 0;
    border: none;
    box-shadow:
        .5rem .5rem 1.2rem 0 var(--shadow),
        -.0rem -.0rem 1rem 0 var(--card);
    color: var(--text);
}

details summary {
    cursor: pointer;
    padding-bottom: 1rem;
}

.articlelinks {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    gap: 1rem;
}

.headline {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem 0.7rem;
    margin: 0;
}

.description {
    align-self: center;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-around;
    gap: 1rem;
    word-wrap: normal;
}

.content {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}

.sharebuttons {
    align-self: flex-end;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    margin: 0;
    padding: 0;
    margin-left: auto;
}

/*
    -------------------------------------------
    TABLE STYLES
    -------------------------------------------
*/

.table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    border-radius: 0.4em;
    box-shadow:
        .3rem .3rem .5rem 0 var(--shadow),
        -.0rem -.0rem .1rem 0 var(--card);
    /* white-space: nowrap; */}

table {
    /* display: block;
    max-width: -moz-fit-content;*/
    width: fit-content; 
    border-collapse: collapse;
    margin: 0 auto;
    background-color: var(--card);

}

th,
td {
    padding: 0.4rem;
    text-align: left;
}

thead th {
    font-weight: bold;
    color: var(--text);
    border-bottom: 2px solid var(--text);
}

tbody tr:nth-child(odd) {
    background-color: var(--background);
}

tfoot td {
    font-weight: bold;
    background-color: var(--background);
}

caption {
    padding: 0.5rem;
    text-align: center;
    font-weight: bold;
    color: var(--text);
}

body {
    overflow-x: auto;
}

/*
    -------------------------------------------
    TAG FILTER BUTTONS (Show All / Hide All)
    -------------------------------------------
*/
#hide_all_btn,
#show_all_btn.off {
    border-radius: 50%;
    color: transparent;
    box-shadow:
        0.2rem 0.2rem .3rem 0 var(--shadow) inset,
        -.0rem -.0rem .1rem 0 var(--card);
}

#show_all_btn,
#hide_all_btn.off {
    border-radius: 50%;
    color: transparent;
    box-shadow:
        0.3rem 0.3rem .3rem 0 var(--shadow),
        -.0rem -.0rem .1rem 0 var(--card);
}

#hide_all_btn:hover,
#show_all_btn:hover {
    filter: brightness(90%);
    text-shadow: 0 0 0.8rem var(--shadow);
}

/*
    -------------------------------------------
    BUTTONS
    -------------------------------------------
*/
button {
    align-self: flex-end;
    width: fit-content;
    border: none;
    padding: 0.3rem 0.5rem;
    border-radius: 0.15rem;
    cursor: pointer;
    font-size: .9rem;
    font-family: var(--body-font);
    color: var(--text);
    background-color: var(--card);
    box-shadow:
        0.1rem 0.1rem .3rem 0 var(--shadow),
        -.0rem -.0rem .1rem 0 var(--card);
}

button:hover {
    
    filter: brightness(80%);
    
    box-shadow: none;
}

.off {
    opacity: 0.3;
    box-shadow:
        0.1rem 0.1rem .3rem 0 var(--shadow) inset,
        0rem 0rem .1rem 0 var(--card) inset;
    /* Preserve button appearance */
    color: var(--text);
    background-color: var(--card);
    border-radius: 0.15rem;
    font-size: .9rem;
    font-family: var(--body-font);
    border: none;
    padding: 0.3rem 0.5rem;
    width: fit-content;
    cursor: pointer;
}

.off:hover {
    opacity: 0.3;
    box-shadow:
        0.1rem 0.1rem .3rem 0 var(--shadow) inset,
        0rem 0rem .1rem 0 var(--card) inset;
}

/* Ensure images always stay centered, even if parent has .off */
.off img,
.off a img,
.off .description img,
.off .detail img,
.off header img {
    align-self: center !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Strongest possible selector for images inside .off or button.off, covering all cases */
.off img,
.off a img,
.off .description img,
.off .detail img,
.off header img,
button.off img,
button.off a img,
button.off .description img,
button.off .detail img,
button.off header img {
    align-self: center !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-self: center !important;
    float: none !important;
}

/* Also, ensure parent flex containers do not override alignment for images inside .off */
.off,
button.off {
    align-items: initial !important;
    justify-content: initial !important;
}


/*
    -------------------------------------------
    HEADER STYLES
    -------------------------------------------
*/
header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0;
    margin: 0;
}

header h1 {
    font-family: var(--header-font);
    font-size: calc(var(--header-font-size) * 1.2);
    width: fit-content;
    margin: 0;
    padding: 0;
    font-weight: 700;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    text-align: center;
}

header h2 {
    font-family: var(--header-font);
    font-size: calc(var(--header-font-size) * 1.0);
    margin: 0;
    padding: 0;
    font-weight: 400;
    opacity: 70%;
    text-align: center;
}

header a {
    align-self: flex-start;
    text-align: left;
}

/*
    -------------------------------------------
    TYPOGRAPHY
    -------------------------------------------
*/
h1,
h2,
h3,
h4,
h5,
p,
a {
    text-align: justify;
    text-justify: inter-word;
    margin: 0;
    padding: 0;
    margin-right: auto;
    word-break: normal;
    line-height: 1.4rem;
    }
h1,
h2,
h3 {
    letter-spacing: 0.05rem;
}

p {
    font-family: var(--body-font);
    font-size: calc(var(--body-font-size) * 1.2);
    line-height: 120%;
    
}

a {
    text-decoration: none;
    font-weight: 200;
    color: var(--link);
    text-shadow: 0.07rem 0.07rem 0.13rem var(--shadow);
}

a:hover {
    filter: brightness(60%);
}

h1 {
    font-size: calc(var(--header-font-size) * 1.4);
    font-family: var(--header-font);
}

h2 {
    font-size: calc(var(--header-font-size) * 1.3);
    font-family: var(--header-font);
}

h3 {
    font-size: calc(var(--header-font-size) * 1.2);
    font-family: var(--header-font);
}

h4 {
    font-size: calc(var(--header-font-size) * 1.1);
    font-family: var(--header-font);
}

h5 {
    font-size: calc(var(--header-font-size) * 1.0);
    font-family: var(--header-font);
}

blockquote {
    padding: 1rem;
    margin: 0;
}

blockquote p:before {
    content: "“ ";
    font-size: 3rem;
    vertical-align: -0.9rem;
}

blockquote p:after {
    content: " „";
    font-size: 3rem;
}

sup {
    vertical-align: top;
    font-size: 0.6em;
    margin-left: 0.2rem;
    margin-right: 0.2rem;
}

/*
    -------------------------------------------
    ARTICLE INFO
    -------------------------------------------
*/
.info {
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    row-gap: 0.2rem;
    align-items: end;
    justify-content: space-between;
    font-size: calc(var(--body-font-size) * 1.0);
    color: var(--text);
    opacity: 0.8;
    width: min-content;
}

.date {
    padding: 0;
    margin: 0;
    font-size: calc(var(--body-font-size) * 0.6);
    color: var(--text);
    filter: brightness(80%);
    width: max-content;
}

/*
    -------------------------------------------
    LIST STYLES
    -------------------------------------------
*/

li {
    margin: 0;
    padding: 0;
    font-size: calc(var(--body-font-size) * 1.2);
}

/* Unordered list styles */
ul li::marker {
    content: '· ';
    color: var(--link);
}

ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
    list-style-position: inside;
}

ul ul {
    margin-left: 1rem;
    list-style-type: none;
}

ul ul ul {
    margin-left: 2rem;
    list-style-type: none;
}

ul ul ul ul {
    margin-left: 3rem;
    list-style-type: none;
}

/* Ordered list styles */

ol li::marker {
    color: var(--link);
}

ol {
    margin: 0;
    padding: 0;
    list-style-type: decimal;
    list-style-position: inside;
}

ol ol {
    margin-left: 1rem;
    list-style-type: decimal;
}

ol ol ol {
    margin-left: 2rem;
    list-style-type: decimal;
}

ol ol ol ol {
    margin-left: 2rem;
    list-style-type: decimal;
}


/*
    -------------------------------------------
    INPUTS
    -------------------------------------------
*/
input[type=checkbox] {
    accent-color: var(--link);
    filter: saturate(1.5);
}


/*
    -------------------------------------------
    ASIDE ELEMENT
    -------------------------------------------
*/
aside {
    margin: 0 0 0 1rem;
    padding: 0;
    display: flex;
}

aside img {
    height: 1.5rem;
    width: 1.5rem;
    margin: 0.5rem;
}

aside img:hover {
    filter: opacity(25%);
}


/*
    -------------------------------------------
    TAGS CONTAINER & FILTER
    -------------------------------------------
*/
#buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    gap: .8rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}


/*
    -------------------------------------------
    FOOTER
    -------------------------------------------
*/
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/*
    -------------------------------------------
   SEARCH STYLES
    -------------------------------------------
*/
#search-input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    outline: none;
    border: none;
    border-radius: 0.7rem;
    font-size: calc(var(--body-font-size) * 1.0);
    color: var(--text);
    background-color: var(--card);
    box-shadow:
        0.1rem 0.1rem .3rem 0 var(--shadow) inset,
        0rem 0rem .1rem 0 var(--background) inset;
}

#search-input:focus {
    border-radius: 0.15rem;
    box-shadow:
        0.1rem 0.1rem .5rem 0 var(--shadow),
        0rem 0rem .2rem 0 var(--background);
}

#search-results {
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
    margin-bottom: 1rem;
    border: none;
    border-radius: 0.25rem;
    background-color: var(--card);
    box-shadow:
        0.1rem 0.1rem .5rem 0 var(--shadow),
        0rem 0rem .2rem 0 var(--background);
}

#search-results li {
    padding: 0.5rem 1rem;
}

#search-results li a {
    color: var(--link);
    text-decoration: none;
    font-size: calc(var(--body-font-size) * 1.0);
}

#search-results li a:hover {
    color: var(--text);
}