/* RESET */
:root {
    --font-family-base: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --line-height: 1.6;
    --heading-line-height: 1.1;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    interpolate-size: allow-keywords;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

body {
    min-height: 100vh;
    line-height: var(--line-height);
    margin: 0;
}

h1,
h2,
h3,
h4,
button,
input,
label,
input::file-selector-button {
    line-height: var(--heading-line-height);
}

a:not([class]) {
    color: currentColor;
}

img,
picture,
video,
canvas,
svg {
    max-width: 100%;
    display: block;
}

input,
button,
textarea,
select,
input::file-selector-button {
    font: inherit;
}

textarea:not([rows]) {
    min-height: 10em
}

button:not(:disabled),
input::file-selector-button {
    cursor: pointer
}

table,
time {
    font-variant-numeric: tabular-nums;
}

p,
li,
figcaption {
    text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

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

/* END RESET ------------ */

:root {
    /* COLORS */

    /* UGA Theme */
    /* Primary */
    --clr-black: black;
    --clr-white: white;
    --clr-bulldog-red: #ba0c2f;
    /* Secondary */
    /* Vibrant */
    --clr-glory: #e4002b;
    --clr-herrick: #00a3ad;
    /* Rich */
    --clr-hedges: #b4bd00;
    --clr-olympic: #004e60;
    /* Dark */
    --clr-sanford: #554f47;
    --clr-herty: #594a25;
    --clr-athens: #66435a;
    /* Neutral */
    --clr-stegeman: #9ea2a2;
    --clr-creamery: #d6d2c4;
    --clr-odyssey: #c8d8eb;

    /* LLB Theme */
    --clr-worn-white: #f9f9f9;


    /* UI */
    --clr-accent: hsl(348, 88%, 54%);
    --clr-accent-dark: hsl(348, 68%, 54%);
    --clr-bg: var(--clr-worn-white); 
    --clr-bg-light: white;
    --clr-border: black;
    --clr-brand: #ba0c2f;
    --clr-card-bg: white;
    --clr-disabled: var(--clr-stegeman);
    --clr-text: black;
    --clr-text-light: white;

    /* END COLORS */

    /* Scale Values */
    --scale-xlarge: 1.4;
    --scale-large: 1.2;
    --scale-medium: 1.125;
    --scale-small: 1;
    /* END Scale Values */

    /* Font Sizes */
    --fs-xlarge: 1.4rem;
    --fs-large: 1.2rem;
    --fs-medium: 1.125rem;
    --fs-small: 1rem;
    /* END Font Sizes */

    --amt-line-height: calc(var(--fs-medium) * var(--line-height));
    --width-text-input: 15rem;
    --narrow-text-input: 10rem;

    --border: 1px solid black;
    --border-radius: 2px;
}

html {
        scroll-padding: 4rem;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--fs-medium);
    background-color: var(--clr-bg);
}

main {
    padding: 1rem 0;
}

h1 {
    font-size: var(--fs-xlarge);
}

h2 {
    font-size: var(--fs-large);
}

h3,
h4,
h5,
h6 {
    font-size: 1em;
}

h1,
h2 {
    & a {
        text-decoration: none;
    }
}

dialog {
    border: var(--border);
    min-width: 50%;

    &::backdrop {
        background-color: black;
        opacity: 60%;
    }
}


nav.primary,
nav.project {
    & a {
        text-decoration: none;
    }

    display: flex;
    justify-content: space-between;
    gap: 1rem 2rem;
    flex-wrap: wrap;
    align-items: center;

    ul {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem 2rem;
        align-items: center;
    }

    ul.right {
        flex-grow: 1;
        justify-content: flex-end;
    }
}

nav.primary {
    padding: 0.5rem 1rem;
    background: linear-gradient(to right, black, var(--clr-brand));
    color: var(--clr-bg);
    border-bottom: solid 1px black;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

td,
th {
    padding: 1px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

tbody tr:nth-child(even) {
    background-color: #FAFAFA
}

tbody tr:nth-child(odd) {
    background-color: white
}

table thead {
    background-color: var(--clr-bg)
}

/* Forms */
form,
.form {
    display: grid;
    gap: 1rem;

    & section {
        display: grid;
        gap: 1rem;

        & h2 {
            margin: 0;
        }
    }
}

.btn-group {
    display: flex;
    gap: 0;

    .left {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    .right {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
}

.form-group {
    display: grid;
    gap: 0.5rex;
}

.form-group:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 1ch;
}

label {
    font-size: var(--fs-small);
}

input,
.input,
textarea {
    background: var(--clr-bg-light);
    color: var(--clr-text);
    border: var(--border);
    border-radius: var(--border-radius);
    accent-color: var(--clr-accent);
    padding: 1rex 2rex;

    &[readonly] {
        background-color: var(--clr-stegeman);
        color: var(--clr-text-light);
        font-weight: bold;
    }
}

input:not([type="checkbox"], [type="radio"]),
.input {
    width: 100%;
}

/* form button { */
/*     justify-self: start; */
/* } */

:focus-visible {
    outline: 2px dashed var(--clr-accent);
}

input:focus-visible,
button:focus-visible,
.button:focus-visible,
.btn:focus-visible,
.input:focus-visible {
    border-color: var(--clr-bg);
}

button,
.button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1ex;

    background-color: var(--clr-text);
    color: var(--clr-text-light);
    border: 0;
    border-radius: 6px;
    padding: 1rex 2.5rex;

    font-weight: bold;
    text-decoration: none;

    &.outline {
        background-color: var(--clr-white);
        color: var(--clr-text);
        border: var(--border);
    }

    &.secondary {
        background-color: var(--clr-odyssey);
        color: var(--clr-text);
    }

    &:hover,
    &:focus-visible {
        background-color: var(--clr-accent);
        color: var(--clr-text-light);
        /* outline-color: transparent; */
    }
    
    &:disabled {
        background-color: var(--clr-disabled);
    }

    &.input {
        font-weight: normal;
    }
}

input[type="file"] {
    border: revert;
}

/* input[type="email"], */
/* input[type="text"], */
/* input[type="search"], */
/* input[type="number"], */
/* input[type="password"] { */
/*     width: var(--width-text-input); */
/* } */

/* END Forms */

.pad-tb-05 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.bg-white {
    background-color: white;
}

.border-top {
    border-top: 1px solid black;
}

.border-bottom {
    border-bottom: 1px solid black;
}

.border-bottom-dbl {
    border-bottom: 3px double black;
}

.center {
    text-align: center;
}

.color-warn {
    color: red;
}

.flow {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.fs-medium { font-size: var(--fs-medium); }

.grid {
    display: grid;
    gap: 1rem;
}

.italic {
    font-style: italic;
}

.margin-top-1 {
    margin-top: 1rem;
}

.no-border {
    border: none;
    outline: none;
}

.opacity-30 {
    opacity: 30%;
}

.pad-left-4px {
    padding-left: 4px;
}

.pad-right-4px {
    padding-right: 4px;
}


.sticky-column {
    position: sticky;
    top: 0;
    z-index: 2;
}

.sticky-row {
    position: sticky;
    left: 0;
    z-index: 1;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.weight-normal {
    font-weight: normal;
}

.width-7rem {
    width: 7rem;
}

.green {
    color: green;
}

.red {
    color: red;
}

.uga-white-on-red {
    background-color: var(--clr-brand);
    color: var(--clr-bg);
}

.uga-white-on-black {
    background-color: black;
    color: var(--clr-bg);
}

.uga-gradient-right {
    background: linear-gradient(to right, black, var(--clr-brand));
}

.uga-gradient-left {
    background: linear-gradient(to left, black, var(--clr-brand));
}

li.htmx-swapping,
tr.htmx-swapping,
tr.htmx-swapping td {
    opacity: 0;
    transition: opacity 500ms;
}

table.with-row-numbers {
    tbody {
        counter-reset: rowNumber;
    }

    tr {
        counter-increment: rowNumber;
    }

    td.row-number::before {
        content: counter(rowNumber);
    }
}

/* Search and Select */
.drop-down {
    position: relative;
}

.drop-down a {
    text-decoration: none;
}

.drop-down a,
.drop-down span {
    display: block;
    padding: 0.5rem 1rem;
    margin: 3px;
}

.drop-down a:hover {
    background-color: var(--clr-accent-dark);
    color: var(--clr-text-light);
}

.drop-down .content {
    background-color: white;
    border: var(--border);
    border-radius: var(--border-radius);
    width: var(--width-text-input);
    visibility: hidden;
    opacity: 0;
    transition: 250ms;
    position: absolute;
    top: 100%;
    left: 0;
    height: calc(14px + 3 * (1rem + var(--amt-line-height)));
    overflow: auto;
    z-index: 1;
}

.drop-down:focus-within>.content {
    visibility: visible;
    opacity: 1;
}

.tag-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 8rem;
    padding: 0.175rem;
}
/* END Search and Select */

/* card */
.card {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    width: min(100%, 40ch);

    background-color: var(--clr-card-bg);
    border: var(--border);
    border-radius: 0.5rem;
    box-shadow: 2px 2px var(--clr-border);

    & header {
        display: grid;
        align-content: start;
        gap: 0.5rem;
    }

    h2 a {
        text-decoration: underline;
    }
    
    .actions {
        display: grid;
        gap: 1rex;
        grid-template-columns: 1fr 1fr;
    }

    .full {
        display: grid;
        gap: 1rex;
    }

    @media(min-width: 400px) {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;

        .actions {
            grid-template-columns: 1fr;
            width: min(100%, 15ch);
        }

        .full {
            width: 100%;
            justify-content: end;
            align-content: end;
        }
    }
}

.card-list {
    margin-top: 1rem;
    display: grid;
    gap: 1rem;
}
/* END card */

/* combobox */
.combobox:focus-within {
    & > .cb-btn {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
    & > .cb-drop-down {
        opacity: 1;
        visibility: visible;
    }
}

.combobox {
    position: relative;

    .cb-btn {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .cb-drop-down {
        width: 100%;
        transition: 250ms;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1;

        opacity: 0;
        visibility: hidden;

        .cb-action {
            position: relative;

            > svg {
                position: absolute;
                top: 0;
                left: 0;
                margin-left: 1rem;
                height: 100%;
            }

            > input {
                padding-left: 2.75em;
                /* border-width: 0 1px 1px 1px; */
                border-radius: 0;
            }

            > button {
                width: 100%;
                padding: 1rex 2rex;
                border: var(--border);
                border-width: 0 1px 1px 1px;
                border-radius: 0;
            }
        }
        .cb-listbox {
            background-color: var(--clr-white);
            border: var(--border);
            border-radius: 0 0 var(--border-radius) var(--border-radius);
            height: calc(14px + 3 * (1rem + var(--amt-line-height)));
            overflow: auto;
            z-index: 1;

            & a {
                display: block;
                padding: 0.5rem 1rem;
                margin: 3px;
                text-decoration: none;

                &:hover {
                    background-color: var(--clr-accent-dark);
                    color: var(--clr-text-light);
                }
            }
        }
    }
}
/* end combobox */

/* filechooser */
.filechooser {
    position: relative;

    input[type="file"] {
        opacity: 0;
        height: 0;
        padding: 0;
        position: absolute;
    }

    .fc-selected {
        font-weight: normal;
        color: var(--clr-text);
        background-color: var(--clr-white);
    }
}
/* END filechooser */

/* Content Grid */
.content-grid,
.full-width-grid {
    --row-gap: 1rem;
    --padding-inline: 1rem;
    --content-max-width: 100%;

    --content-width: min(100% - var(--padding-inline) * 2, var(--content-max-width));

    display: grid;
    row-gap: var(--row-gap);
    grid-template-columns:
        [full-start] minmax(var(--padding-inline), 1fr) 
        [content-start] var(--content-width) [content-end]
        minmax(var(--padding-inline), 1fr) [full-end];
}

.content-grid > *,
.full-width-grid > * {
    grid-column: content;
}

.content-grid > .full-width-grid {
    grid-column: full;
}

.content-grid table {
    grid-column: full;
    justify-self: start;
}
/* END Content Grid */

/* Swatch */
ul.swatch {
    display: grid;
    gap: 1rem;
    font-weight: bold;
    justify-self: center;
    width: min(50ch, 100% - 1rem); 

    & li.color-area {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        border: solid 1px black;
        color: white;

        .color-alt {
            color: black;
        }

        .color-text {
            background: white;
            text-align: center;
        }
    }
}
/* END Swatch */

/* room-li */
.room-list {
    display: grid;
    gap: 1rem;
}
.room-li {
    display: grid;
    gap: 1rem;
    border: var(--border);
    padding: 1rem;

    .header,
    .header > * {
        font-size: var(--fs-large);
    }

    input[type="checkbox"] {
        transform: scale(var(--scale-large));
        margin: 0;
    }
}
/* END room-li */

/* top-border */
.top-border {
    margin-top: 2rem;
    border-top: var(--border);
    padding-top: 2rem;
}
/* END top-border */

@media print {
    body {
        background-color: white;
    }

    nav {
        display: none;
    }
}
