/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@font-face {
    font-family: "Goudy Bookletter 1911";
    src: url("/assets/goudy_bookletter_1911-1042af78.ttf");
}

/* Default the layout to dark */
:root {
    --background: #F2E6D8;
    --foreground: #09090b;
    --primary: #044536;
    --primary-foreground: #F2E6D8;
    --danger: #DE5D52;
    --warning: #DBC451;
    --success: #09AD76;
}

/* OS Preference */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #111111;
        --foreground: #ffffff;
        --primary: #09AD76;
        --primary-foreground: #F2E6D8;
        --danger: #DE5D52;
        --warning: #DBC451;
        --success: #09AD76;
    }
}

/* Data theme overrides that are set with app setting */
[data-theme="dark"] {
    --background: #111111;
    --foreground: #ffffff;
    --primary: #09AD76;
    --primary-foreground: #F2E6D8;
    --danger: #DE5D52;
    --warning: #DBC451;
    --success: #09AD76;
}

[data-theme="light"] {
    --background: #F2E6D8;
    --foreground: #09090b;
    --primary: #044536;
    --primary-foreground: #F2E6D8;
    --danger: #DE5D52;
    --warning: #DBC451;
    --success: #09AD76;
}

h1, h2, h3, h4, a, p, label {
    color: var(--foreground);
}

* {
    padding: 0;
}

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
    box-sizing: border-box;
}
/* 2. Remove default margin */
*:not(dialog) {
    margin: 0;
}
/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
    html {
        interpolate-size: allow-keywords;
    }
}

body {
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--background);
    /*font-family: Arial, Helvetica, sans-serif;*/
    font-family: "Goudy Bookletter 1911", Arial, Helvetica, sans-serif;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

ul, ol {
    list-style: none;
    padding: 0;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
    font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}
/* 9. Improve line wrapping */
p {
    text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

/* Links */
a {
    text-decoration: none;
}

a[aria-current],
.navbar a[aria-current] {
    text-decoration: underline;
}

/* main */
main {
    display: flex;
    padding: 3rem;
    max-width: 70rem;
    margin: 0 auto;
}

/* Footer */
footer {
    max-width: 70rem;
    margin: 0 auto;
    padding: 2rem;

    &::before {
        content: "";
        display: block;
        width: 1.5rem;
        height: 2px;
        background: var(--foreground);
        margin-bottom: 1.5rem;
    }
    a {
        text-decoration: none;
    }
    li {
        list-style: none;
        margin-bottom: 0.5rem;
    }
    ul {
        padding: 0;
    }
}

/* Toasts */
.alert,
.error {
    color: var(--danger);
}
.notice {
    color: var(--warning);
}

/* Header */
.header-background {
    background-color: var(--primary);
    padding: 1.5rem;
    position: relative;
}
.header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 70rem;
    margin: 0 auto;
    color: var(--primary-foreground);
}
.logo {
    display: flex;
}
.logo-text {
    padding: 1rem;
    font-weight: 600;
    font-size: 1.5rem;
    text-decoration: none;
    color: currentColor;
}
#logo-graphic {
    width: 2rem;
}

/* Header - Navbar */
nav.navbar {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}
nav.navbar a {
    text-decoration: none;
    color: currentColor;
}
.navbar-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 1.25rem;
}
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* Buttons */
a.jump-link {
    display: inline-block;
    padding: 0 18px;
    background-color: var(--primary-foreground);
    color: var(--foreground);
    cursor: pointer;
    user-select: none;
    border: 2px solid var(--foreground);
    box-shadow: var(--foreground) 4px 4px 0 0;
    font-weight: 600;
    font-size: 1.25rem;

    &:hover {
        background-color: #fff;
        transition: background-color 0.2s ease;
    }
    &:active {
        box-shadow: var(--foreground) 2px 2px 0 0;
        transform: translate(2px, 2px);
    }
}

.jump-button {
    background-color: var(--primary-foreground);
    border: 2px solid var(--foreground);
    box-shadow: var(--foreground) 4px 4px 0 0;
    color: var(--foreground);
    cursor: pointer;
    font-weight: 600;
    font-size: 1.25rem;
    padding: 0 18px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;

    &:hover {
        background-color: #fff;
        transition: background-color 0.2s ease;
    }
    &:active {
        box-shadow: var(--foreground) 2px 2px 0 0;
        transform: translate(2px, 2px);
    }
}

.button-group {
    padding: 1rem 0 0 0;
    display: flex;
    gap: 1rem;
}

@media (min-width: 768px) {
    .button-74 {
        min-width: 120px;
        padding: 0 25px;
    }
}

/* Mobile */
@media (max-width: 768px) {

    /* Nav */
    .navbar-toggle {
        display: block;
        color: var(--background)
    }
    .navbar-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary);
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    .navbar-menu.is-open {
        display: flex;
        text-align: center;
    }
    .navbar .desktop-nav {
        display:none;
    }

    /* Main */
    main {
        padding: 1rem;
    }
}

section.settings {
    display: flex;
    gap: 1rem;

    nav {
        width: 200px;

        a {
            display: block;
        }
    }
}

/* Theme Toggle */
:root:not([data-theme="dark"]) .icon-light {
    opacity: 0;
    transform: rotate(90deg);
    pointer-events: none;
}
[data-theme="dark"] .icon-dark {
    opacity: 0;
    transform: rotate(-90deg);
    pointer-events: none;
}
#theme-toggle {
    position: relative;
    width: 30px;
    height: 30px;

    svg {
        transition: opacity 0.2s ease, transform 0.2s ease;
        position: absolute;
        top: 0;
        left: 0;
    }
}
/* Fade + rotate out the hidden icon */
.icon-light,
.icon-dark {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Content Layouts */

/* * Account Settings * */
.content {
    flex-grow: 2;
    min-width: 0;
}

/* Forms */
/* Sections */
.block-form, .block-section{
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--foreground);
    border-radius: .5rem;
    margin-bottom: 1rem;

    .input-group{
        margin-bottom: 1rem;
    }

    .input-group > * {
        display: block;
    }

    input {
        width: 100%;
        border-radius: 6px;
        background-color: var(--background);
        color: var(--foreground);
    }

    input[type=submit] {
        background-color: var(--primary);
        color: var(--background);
        border: 0;
        padding: .5rem;
        font-weight: 600;
    }
}



/* Trix Overrides */
.trix-content {
    * {
        color: var(--foreground);
    }

    pre {
        background-color: var(--primary);
    }
}

/* Helpers */
.no-pad {
    padding: 0;
}