:root {
    --padding: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'hershey';
    src: url('fonts/Hershey-1000-fixed.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'hershey', monospace;
    line-height:1.8em;
    background: var(--bgColor, black);
    color: white;
    font-size:20px;
}


.container {
    margin: 0 auto;
    padding: var(--padding);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--padding);
}

.box {
    padding: var(--padding);
    border: 2px solid white;
}


h4, .spell-date {
    font-size: 1rem;

    font-variant-caps: all-small-caps;
    letter-spacing: 0.06em;
}

/* TYPOGRAPHY */
h1 {
    font-size: 2.5rem;
    font-weight: normal;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    display:block;
    width:100%;
    grid-column: 1 / -1;

    font-family: inherit;
    background: none;
    color:inherit;
    font-size: inherit;

    cursor: pointer;
}

/* Main sections */
main {
    display: flex;
    flex-direction: column;
    gap: calc(var(--padding) * 4);
}

section {
    display: flex;
    flex-direction: column;
    gap: calc(var(--padding) / 2);
}

/* spells display section */
.spells-display {
    padding: var(--padding);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* background:pink; */
}

.spells-list {
    position: relative;
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(min(500px, 100%), 1fr));
    align-items: start;
    justify-items: start;
    gap: calc(var(--padding) * 2) var(--padding);
}

.spell-item {
    min-width: min(300px, 100%);
    display: grid;
    grid-template-columns: 1fr;
}

.spell-text {
    position: relative;
    font-size: 1.1rem;
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.TTS {
    display: grid;
    grid-template-columns: fit-content(100%) fit-content(100%);
    gap: calc(var(--padding) / 2);
}

.TTS-btn {
    cursor:pointer;
}


/* Add spell form section */
.submit {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--padding);
}

#form {
    display: flex;
    flex-direction: column;
    gap: calc(var(--padding) * 4);

    font-family: inherit;
    font-size: inherit;
}

#submission-text {
    font-family: inherit;

    width: 100%;
    padding: var(--padding);
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s ease;

    background: var(--light-color);
    border: 5px inset var(--shadow-color);
}

#submission-text::placeholder, textarea {
    font-size: 20px; /*?? can't override with just inherit here*/
}

#submission-text::placeholder {
    color: var(--shadow-color);
}

textarea {
    color:white;
}

#submission-text:focus {
    outline: none;
    border-color: black;
}

#submit-btn:disabled {
    color: #bdc3c7;
    cursor: not-allowed;
}

/* Loading, error, and message states */
.loading {
    text-align: center;
    padding: var(--padding);
    font-size: 1.1rem;
    color: #666;
}

.error {
    background: #e74c3c;
    color: white;
    padding: var(--padding);
    margin-bottom: 20px;
}


.hidden {
    display: none;
}


/* MEDIA QUERIES */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    #submission-text::placeholder, textarea {
        font-size: 16px; /*?? can't override with just inherit here*/
    }

}