/********************************/
/*           GENERAL            */
/********************************/

html, body {
    margin: 0;
    padding: 0;
    border: 0;
    scroll-behavior: smooth;
}
/* Fonts & basic styling */
body {
    background-color: var(--colour-background);
    /* GINGHAM PATTERN created via Laney Smith's Gingham generator! https://gingham.laney.tech/
        (I moved the colours over to the variables file) */
    background-image: linear-gradient(0deg,
      var(--colour-gingham-2) 0% 25%, var(--colour-gingham-1) 25% 75%, var(--colour-gingham-2) 75% 100%),
      linear-gradient(90deg,
        var(--colour-gingham-2) 0% 25%, var(--colour-gingham-1) 25% 75%, var(--colour-gingham-2) 75% 100%);
    background-size: 100px 100px, 100px 100px;
    background-repeat: repeat;
    color: var(--colour-text);
    font-family: var(--font-body);
    line-height: 1.5;
    font-size: 1rem;
    /* To keep the footer at the bottom of the page even with not enough content, use vsync's flexbox solution:
    https://stackoverflow.com/a/20352949 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
#page-content {
    flex: 1;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headers);
    background-color: var(--colour-background);
    background-image: linear-gradient(90deg, var(--colour-background), var(--colour-bg));
    padding-left: 8px;
    border-radius: 8px;
}
a {
    color: var(--colour-link);
    text-decoration: dotted underline var(--colour-link);
}
.fun-font h2 {
    font-family: var(--font-fun);
}

#site-title {
    font-family: var(--font-title);
    font-weight: bold;
    text-align: center;
	font-size: 3rem; /* 48px */
    text-shadow: 2px 2px 4px White;
    padding-top: 1em;
}
#site-title a {
    color: var(--colour-text);
    text-decoration: none;
}
h1 {
	font-size: 1.75rem;
}
h2 {
  	font-size: 1.5rem;
}
h3 {
    font-size: 1.25rem;
}
h4 {
    font-size: 1.125rem;
}
h5 {
    font-size: 1rem;
}
h6 {
    font-size: 0.875rem;
}
/* footer */
footer {
    display: flex;
    width: 100%;
    align-items: center;
    background-color: var(--colour-bg);
    background-image: var(--colour-bg-gradient);
    border-radius: 16px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top: var(--border-default);
    padding-top: 16px;
    padding-bottom: 16px;
}
footer > div {
    padding-left: 16px;
    flex: 1 1 50%;
}
footer > p {
    text-align: right;
    padding-right: 16px;
    flex: 1 1 50%;
}
/* sections */
main {
    background-color: var(--colour-bg);
    border-radius: 16px;
    padding: 16px;
    padding-top: 8px;
    margin: 16px;
    display:block;
    border: var(--border-default);
}
/* elements */
hr {
    border: none;
    border-top: var(--border-dark);
    width: 25%;
    margin-top: 16px;
    margin-bottom: 16px;
}
/* smaller if in section */
section hr {
    width: 12.5%;
}
blockquote {
    text-align: center;
    border-top-left-radius: 16px;
    border-bottom-right-radius: 16px;
    background-color: var(--colour-card);
    border: 1px dotted var(--colour-borders);
    padding: 16px;
}
summary {
    border: 1px dotted var(--colour-borders);
    border-radius: 8px;
    background-color: var(--colour-card);
    padding: 4px;
}
/* Page titles */
#page-title h1 {
    font-family: var(--font-headers-cursive);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0;
    background-color: inherit;
    background-image: inherit;
    padding-left: inherit;
    border-radius: inherit;
}
#page-title div {
    border-bottom: var(--border-dark);
    width: 50%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 16px;
}

/********************************/
/*        PAGE-SPECIFIC         */
/********************************/
#emi > div {
    display: flex;
    flex-wrap: nowrap;
}
#emi > div > section { /* makes the things I like and places to find me sections next to each other */
    flex: 1 1 50%;
}

#credits summary {
    border: initial;
    border-radius: initial;
    background-color: initial;
    padding: initial;
}
#credits details {
    border: 1px dotted var(--colour-borders);
    border-radius: 8px;
    background-color: var(--colour-card);
    padding: 4px;
    padding-top: 0;
    padding-bottom: 0;
}
#credits details h4 {
    display: inline-block;
    width: 50%;
}

#hub-links {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}
#hub-links > div {
    flex: 1 1 33%;
    margin: 16px;
}
#hub-links > div a {
    font-family: var(--font-fun);
    font-size: 1.5rem;
    text-decoration: none;
}
#hub-links > div div {
    margin-top: 8px;
}

/********************************/
/*            IMAGES            */
/********************************/

img {
    border-radius: 50%;
    width: 75%;
    max-width: 150px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 2px 2px 3px var(--colour-borders);
}
.rec-img {
    box-shadow: none;
    border-radius: 16px;
    max-width: 75%;
    margin-bottom: 8px;
    margin-top: 0;
}
.char-ref img {
    width: 100%;
    max-width: 100%;
}
#sitemap img {
    max-width: 25%;
}

/********************************/
/*          NAVIGATION          */
/********************************/

nav {
    background-color: var(--colour-button-light);
    background-image: linear-gradient(var(--colour-button-light), var(--colour-button-lighter));
    border: var(--border-default);
    border-radius: 16px;
    color: var(--colour-nav);
    font-family: var(--font-fun);
    font-size: 1.125rem;
    padding: 8px;
    margin: 16px;
}
nav li {
	width: 100%;
    list-style-type: none;
}
nav ul { /* makes padding less drastic on mobile. */
	margin: 0;
	padding: 0;
    padding-right: 8px;
    padding-left: 8px;
}
nav a {
    color: var(--colour-nav);
    text-decoration: none; /* Only has text decoration if 'active' */
	width: 100%;
	padding-top: 4px;
	padding-bottom: 4px; /* The padding is on the link so the "button" is clickable. */
    border-radius: 8px;
    padding-left: 8px;
}

/* On small screens, the nav links are hidden by default. */
#navlist > li > a:not(#sitemap), .nav-list a {
    display: none;
}
#navlist:not(.responsive) .nav-list.responsive {
    display: none;
}

/* the menu & sitemap are always visible */
#nav-toggle, #navlist #sitemap {
    display: block;
    text-align: center;
    padding-left: 0;
}
/* when dropdown menu shows up, put sitemap on left */
#navlist.responsive #sitemap {
    text-align: left;
    padding-left: 8px;
}

/* use arrow to notify user there are more links after the given heading */
nav a:has(+ .nav-list)::after {
    font-size: 0.8rem; /* smaller */
    content: "  \2766";
}

/* active link */
nav .active {
    text-decoration: underline dotted var(--colour-nav) 2px;
}
/* If a nav list contains an active link but is not open then highlight the other link */
nav a:has(+ .nav-list:not(.responsive) .active) {
    text-decoration: underline dotted var(--colour-nav) 2px;    
}

/********************************/
/*            CLASSES           */
/********************************/

.button {
    padding: 12px;
    border-radius: 16px;
    text-align: center;
    font-family: var(--font-fun);
    font-size: 1.125rem;
    background-color: var(--colour-button);
    background-image: var(--colour-button-gradient);
    color: var(--colour-button-text);
    text-decoration: none;
    border: 1px solid var(--colour-button-borders);
    box-shadow: 2px 2px var(--colour-button-shadow);
}

.center {
    text-align: center;
}

.link-on-right {
    display:flex;
    flex-wrap: nowrap;
    align-items: center;
}
.link-on-right > :first-child {
    flex: 1 1 50%;
}
.link-on-right > div { /* links are in div */
    flex: 1 1 50%;
    font-size: 0.9rem;
    text-align: right;
}
/* char-name's have smaller space */
.link-on-right > .char-name {
    flex: 1 1 25%;
}
.link-on-right > .char-name + div {
    flex: 1 1 75%;
}

.h-p-inline {
    margin-bottom: 8px;
}
.h-p-inline h1, .h-p-inline h2, .h-p-inline h3, .h-p-inline h4, .h-p-inline h5, .h-p-inline h6 {
    display:inline;
    padding-right: 8px;
}
.h-a a {
    color: var(--colour-text);
    text-decoration: dotted underline var(--colour-text);
}
.h-p-inline p {
    display:inline;
    padding-left: 8px;
    border-left: var(--border-dark);
}

/********************************/
/*       CHARACTER LISTS        */
/********************************/
.char-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}
/* featured character lists are NOT oriented on the left */
.featured .char-list {
    justify-content: center;
}
/* character boxes */
.character {
    background-color: var(--colour-card);
    border-radius: 8px;
    border: 1px dotted var(--colour-borders);
    padding: 16px;
    text-align: center;
    font-size: 0.9rem;
    margin: 4px;
    text-decoration: none;
    color: var(--colour-text);
    max-width: 100px;
}
.card .char-list .character {
    background-color: var(--colour-card-inside-card);
}

.character span {
    display: block;
}
.character .tagline {
    font-family: var(--font-fun);
    font-size: 0.9rem;
    font-weight: normal;
}
.text-small {
    font-family: 'Montserrat', Tahoma, sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: normal !important;
}
.note {
    border: 1px dotted var(--colour-borders-note);
    background-color: White;
    padding: 16px;
    border-radius: 8px;
}
.note.text-small {
    padding: 4px;
}

/********************************/
/*          CHARACTERS          */
/********************************/

/* Character names/titles */
.card > span, .char-links .rel-info a span, .char-links .rel-info.no-link > span:first-of-type, .character > .name {
    font-family: var(--font-headers);
    font-weight: bold;
    display: block;
    text-align: center;
    font-size: 1.25rem;
    padding-top: 8px;
}
.char-links .rel-info a span, .char-links .rel-info.no-link > span:first-of-type{
    display: inline;
}
/* Sets up spans that are descriptions/highlighted items */
.desc-span li span, .note.desc-span span {
    font-family: var(--font-fun);
    font-weight: bold;
    font-size: 1rem;
    padding-right: 8px;
    border-right: var(--border-default);
}

/* Cards specific */
.card {
    border-radius: 16px;
    border: var(--border-default);
    background-color: var(--colour-card);
    padding: 16px;
}
.char-card ul {
    padding: 0;
    margin-bottom: 0;
}
.char-card li {
    list-style-type: none;
}
.char-links span {
    text-align: left;
    padding: 0;
}
.char-design {
    border: 1px dotted var(--colour-borders);
    border-radius: 8px;
    background-color: var(--colour-card);
    padding: 16px;
    padding-top: 0;
}
.char-links img {
    max-width: 125px;
}

/* Character relationships */
/* Char names in links */
.char-links .rel-info > a {
    color: var(--colour-text);
    text-decoration: none;
}
.char-links .rel-info:not(.no-link) > span, .char-links .rel-info.no-link span + span {
    font-family: var(--font-fun);
    font-size: 1rem;
    font-weight: normal;
    border-left: var(--border-dark);
    padding-left: 8px;
}
.char-links section {
    padding: 16px;
    background-color: var(--colour-card);
    border-radius: 8px;
    border: 1px dotted var(--colour-borders); 
}
.char-name, .group-name {
    font-family: var(--font-headers-cursive);
    font-size: 1.75rem;   
    border-bottom: var(--border-dark);
    margin-bottom: 16px;
    background-color: inherit;
    background-image: inherit;
    padding-left: inherit;
    border-radius: inherit;
}
.group-name {
    border-bottom: 0;
    font-size: 2rem;
}
.char-links .rel-info span {
    display: inline;
}
.char-links .rel-info a span, .char-links .rel-info span:first-of-type {
    padding-right: 8px;
}
.char-links .rel-info {
    text-align: center;
}
.char-links .rel-info img {
    margin-bottom: 8px;
}

/********************************/
/*           CONTENTS           */
/********************************/

#char-list h2 {
    font-size: 1.25rem;
}
#char-list ~ h3 {
    font-size: 1rem;
}
#char-list.center {
    margin-bottom: 8px;
    margin-top: 0;
}

/* Nav, Lore Contents list, and Contents list are framed by these leaf looking arrow thingies */
#contents::before, #nav-toggle::before, #lore-contents::before {
    content: "\2619";
}
#contents::after, #nav-toggle::after, #lore-contents::after {
    content: "\2767";
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6, details h4 {
    background-color: var(--colour-card-inside-card);
    background-image: linear-gradient(90deg, var(--colour-card-inside-card), var(--colour-card));
}


/********************************/
/*              TABS            */
/********************************/

/*
    Resources:
    
    JS Tab Tutorial by W3Schools Team
    https://www.w3schools.com/howto/howto_js_tabs.asp
*/

.tab-toggle {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    color: var(--colour-text);
    background-color: var(--colour-tab);
    background-image: var(--colour-tab-gradient);
    border-top: var(--border-default);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.tab-toggle .tab-link {
    flex: 1 1 50px;
    font-size: 1.25rem;
    font-family: var(--font-fun);
    background: none;
    padding: 8px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border: none;
    border-right: var(--border-default);
    display: inline-block;
    width: 100%;
    /* change appearance on hover or click of the given tab*/
    transition: color 0.5s, background-color 0.5s;
}
.tab-toggle .tab-link a {
    text-decoration: none;
}
.tab-toggle .tab-link:last-child {
    border-right: none;
}
.tab-toggle .tab-link.active {
	background-color: var(--colour-tab-active);
    background-image: linear-gradient(var(--colour-tab-active), var(--colour-tab));
}
.tab-toggle .tab-link.active a{
    color: var(--colour-tab-active-text);
    text-decoration: none;
}

.tabs > hr {
    display: none;
}
.tabs {
    overflow: hidden;
}

.tab {
    width: 100%;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: -9999px;
    left: -9999px;
    transition: opacity 1s;
    /* Fading effect takes 1 second */
}
.tab.active {
    visibility: visible;
    position: initial;
    top: initial;
    left: initial;
    opacity: 1;
}

.nojs .tab-toggle,.notabs .tab-toggle {
    display: none;
}
.nojs .tabs .tab, .notabs .tabs .tab {
    display: initial;
    visibility: initial;
    position: initial;
    top: initial;
    left: initial;
    opacity: initial;
}
.nojs .tabs .hr, .notabs .tabs hr {
    display: block;
}

#tab-button {
    margin-bottom: 8px;
}
/* no need for it if JS is disabled */
.nojs #tab-button {
    display: none;
}


#go-back {
    display: inline-block;
    margin-bottom: 32px;
}