/* Google Fonts are now included via a <link> tag in the HTML <head> for better performance. */

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: lighter;
    background: white;
    overflow-x: hidden;
}

@media screen and (prefers-reduced-motion: no-preference) {
    body.switched {
        transition: color 0.6s, background-color 0.6s;
    }
}

h1,
h2 {
    text-align: center;
    font-family: "Quattrocento", Georgia, 'Times New Roman', Times, serif;
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 30pt;
    margin-bottom: 10px;
}

h2 {
    font-size: 14pt;
    font-style: italic;
    font-family: sans-serif;
    font-weight: lighter;
    color: #BBB;
}

.header {
    padding-top: 1em;
    padding-bottom: 3em;
}

/*
  Built-in class:
    # author: Name
*/
.byline {
    font-style: italic;
}

.written-in-ink {
    z-index: 3;
    font-size: 9pt;
    font-family: sans-serif;
    text-align: center;
    font-weight: 700;
    position: fixed;
    display: block;
    width: 100%;
    background: white;
    margin: 0;
    padding-top: 6px;
    padding-bottom: 6px;
    height: 14px;
    top: 0;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .written-in-ink {
        transition: color 0.6s, background-color 0.6s;
    }
}

/* 
  Enables <iframe> support work on itch.io when using mobile iOS
*/
.outerContainer {
    position: absolute;
    display: block;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    overflow: scroll;
    overflow-x: hidden;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    margin-top: 0px;
    background-size: cover;
    background-repeat: no-repeat;
}

@media screen and (max-width: 980px) {
    .outerContainer {
        margin-top: 0px;
        background-size: cover;
        background-repeat: no-repeat;
    }
}

.container {
    display: block;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 1.5em;
    background: white;
    position: relative;
    overflow-anchor: none;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .switched .container {
        transition: background-color 0.6s;
    }
}

p {
    font-size: 13pt;
    color: #888;
    line-height: 1.7em;
    font-weight: lighter;
}

a {
    font-weight: 700;
    color: #b97c2c;
    font-family: sans-serif;
    text-decoration: none;
}

.unclickable {
    font-weight: 700;
    color: #4f3411;
    font-family: sans-serif;
    text-decoration: none;
    cursor: not-allowed;
}

a:hover {
    color: black;
}

@media screen and (prefers-reduced-motion: no-preference) {
    a {
        transition: color 0.6s;
    }

    a:hover {
        transition: color 0.1s;
    }
}

strong {
    color: black;
    font-weight: bold;
}

img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.container .hide {
    opacity: 0.0;
}

.container .invisible {
    display: none;
}

.container>* {
    opacity: 1.0;
    transform: translateZ(0);
}

@media screen and (prefers-reduced-motion: no-preference) {
    .container>* {
        transition: opacity 1.0s;
    }
}

/*
  Class applied to all choices
  (Will always appear inside <p> element by default.)
*/
.choice {
    text-align: center;
    line-height: 1.7em;
}

/* 
  Class applied to first choice
*/
:not(.choice)+.choice {
    padding-top: 1em;
}

/*
  Class applied to choice links
*/
.choice a, .choice span {
    font-size: 15pt;
    display: inline-block; /* Giver bedre clickability */
    padding: 2px 8px; /* Lidt padding omkring links */ 
}

/* 
  Built-in class:
    The End # CLASS: end
*/
.end {
    text-align: center;
    font-weight: bold;
    color: black;
    padding-top: 20px;
    padding-bottom: 20px;
}

#controls {
    z-index: 4;
    position: absolute;
    width: auto;
    background: transparent !important;
}

@media screen and (prefers-reduced-motion: no-preference) {
    #controls {
        transition: color 0.6s, background-color 0.6s;
    }
}

#controls [disabled] {
    color: #ccc;
}


@media screen and (max-width: 980px) {
    #controls {
        z-index: 4;
        position: relative;
        width: 100%;
        right: auto;
        left: auto;
        bottom: auto;
        display: flex;
        margin-bottom: -1.5em;
        justify-content: center;
        background: transparent !important;
    }
    /* Fjern eventuel whitespace omkring theme icon */
    #theme-switch {
        margin: 0;
        padding: 2px;
        height: 36px; /* Lidt større på mobil for bedre touch target */
        width: 36px;
        box-shadow: 0 0 10px rgba(0,0,0,0.4);
    }

    .dark #theme-switch {
        box-shadow: 0 0 10px rgba(255,255,255,0.4); /* Større skygge på mobil i mørkt tema */
    }
    /* Større ikoner på mobilenheder for bedre touch */
    .theme-icon {
        height: 36px; /* Lidt større ikoner på mobil */
        width: auto;
    }
}

/* 
  Dark Theme (Added in Inky 0.10.0)
    # theme: dark
*/

body.dark {
    background: black;
    color: white;
}

.dark h2 {
    color: #666;
}

.dark .container {
    background: black;
}

.dark .written-in-ink {
    background: black;
}

.dark a {
    color: #cb8d1a;
}
.dark .unclickable{
    color: #c4af87;
    cursor: not-allowed;
}

.dark a:hover {
    color: white;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .dark a {
        transition: color 0.6s;
    }
}

.dark strong {
    color: white;
}

.dark #controls [disabled] {
    color: #444;
}

.dark .end {
    color: white;
}

.dark #controls {
    background: black;
}

/* Style for the theme switch button */
#theme-switch {
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    height: 30px; /* Fixed height to prevent layout shifts */
    width: 30px; /* Fixed width to prevent layout shifts */
    background: transparent;
    border: none;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.3); /* Subtil skygge for bedre synlighed */
    margin: 0;
}

/* Dark theme (black background): show sun icon in white */
.dark #dark-theme-icon {
    opacity: 0;
}

.dark #light-theme-icon {
    opacity: 1;
    filter: invert(100%); /* White sun on black background */
}

/* Tilføj en skygge i mørkt tema */
.dark #theme-switch {
    box-shadow: 0 0 5px rgba(255,255,255,0.3); /* Lys skygge i mørkt tema */
}

/* Hover effekt for bedre interaktion */
#theme-switch:hover {
    box-shadow: 0 0 8px rgba(0,0,0,0.5); /* Kraftigere skygge ved hover i lyst tema */
}

/* Hover effekt i mørkt tema */
.dark #theme-switch:hover {
    box-shadow: 0 0 8px rgba(255,255,255,0.5); /* Kraftigere skygge ved hover i mørkt tema */
}

.theme-icon {
    height: 24px;
    width: 24px;
    display: block;
    padding: 0;
    transition: opacity 0.3s;
    opacity: 0;
    position: absolute;
    left: 50%; /* Centrér vandret */
    top: 50%; /* Centrér lodret */
    transform: translate(-50%, -50%); /* Perfekt centrering */
}

/* Light theme (white background): show moon icon in black */
#dark-theme-icon {
    display: inline-block;
    opacity: 1;
    filter: invert(0%); /* Black moon on white background */
}

#light-theme-icon {
    display: inline-block;
    opacity: 0;
}

#labels {
    display: block;
    text-align: center;
    margin-top: 30px; /* Afstand mellem knap og labels */
    width: 100%;
    position: relative;
    clear: both; /* Sikrer at det er under knappen */
}

#theme-switch-label{
    display: inline-block;
    font-size: small;
    text-align: center;
    margin-top: 4px;
    color: #cb8d1a; /* Normal tekstfarve, ikke linkfarve */
    cursor: default; /* Normal cursor i stedet for pointer */
}

/* Specifik override for hover i dark mode */
.dark .theme-switch-label:hover,
.dark .theme-switch-label:active {
    color: #cb8d1a !important; /* Behold samme farve ved hover selv i dark mode */
    text-decoration: none !important;
}

/* Fjern active state for labels */
/* Sikre at hover, active og focus alle bevarer samme farve */
.theme-switch-label:hover,
.theme-switch-label:active,
.theme-switch-label:focus {
    color: #cb8d1a !important;
    text-decoration: none !important;
}
body.dark .light-theme-label {
    display: none;
}

body:not(.dark) .dark-theme-label {
    display: none;
}