/* General styling */
body {
    overflow-x: hidden;
}
main {
    padding: 1.25rem;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 3.75rem);
}

/* Container block layout */
#container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    width: 100%;
    margin: 0 auto;
    flex-grow: 1;
}

/* Input/Output styling */
.container {
    display: flex;
    flex-direction: column;
    padding: 0.9rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.05);
    min-width: 0;
}
#markdown-input, #html-output, #preview {
    max-width: 100%;
    min-height: 10rem;
    height: calc(100vh - 22.5rem);
    padding: 0.75rem;
    font-size: 1rem;
    overflow: auto;
}
#markdown-input {
    resize: none;
    background-color: var(--page-bg);
}
#html-output {
    white-space: pre-wrap;
}
#html-output, #preview {
    overflow-wrap: break-word;
    word-break: break-word;
    background-color: var(--container-bg);
}
#preview {
    white-space: normal;
}
#preview > :first-child {
    margin-top: 0;
}
#preview > :last-child {
    margin-bottom: 0;
}

/* Copy button styling */
#copy-button {
    align-self: center;
    margin: 1.25rem auto 1.875rem;
    padding: 0.75rem 1.5rem;
    font-size:  1.1rem;
    font-weight: bold;
    border: none;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0.25rem 0.375rem rgba(0, 123, 255, 0.25);
}

/* Responsive layouts */

/* Medium devices (37.5rem and up) */
@media (min-width: 37.5rem) {
    #container {
        grid-template-columns: 1fr 1fr;
    }
    .container:nth-child(3) {
        grid-column: 1/-1; /* Make raw HTML output have full width below */
    }
}

/* Large devices (desktops, 64rem and up) */
@media (min-width: 64rem) {
    #container {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .container:nth-child(3) {
        grid-column: auto; /* Reset to normal column span */
    }
}