:root {
    font-size: 14px;

    --border-radius-std: 10px;
    --border-radius-sm: 5px;

    --padding-sm: 5px;
    --padding-std: 10px;
    --padding-lg: 20px;
    --padding-xl: 30px;

    --success-foreground: hsl(100, 67%, 35%);
    --success-background: #ffffff;

    --warning-foreground: hsl(40, 100%, 50%);
    --warning-background: #ffffff;

    --error-foreground: #bd0100; /* hsl(0, 67%, 50%); */
    --error-background: #ffffff;

    --info-foreground: hsl(200, 67%, 35%);
    --info-background: #ffffff;

    --primary-action-background: hsl(100, 0%, 35%);
    --primary-action-foreground: #fff;
    --secondary-action-background: #fff; /* hsl(50, 67%, 35%); */
    --secondary-action-foreground: hsl(100, 0%, 35%);
    --destructive-action-background: var(
        --error-background
    ); /* hsl(50, 67%, 35%); */
    --destructive-action-foreground: var(--error-foreground);
    --disabled-action-background: darkgrey; /* hsl(50, 67%, 35%); */
    --disabled-action-foreground: black;

    --accent-color-hsl: 0 98% 24%;
    --accent-color: hsl(var(--accent-color-hsl));

    --accent-color-alt-hsl: 0 100% 100%;
    --accent-color-alt: hsl(var(--accent-color-alt-hsl));

    --background-image: linear-gradient(0deg, hsl(0, 0%, 70%), hsl(0, 0%, 90%));
    --content-background: hsl(0, 0%, 100%);

    --heading-color-1: #000;
    --heading-color-2: #000;
    --heading-background-color: #a8a8a8;

    --input-background-color: #ffffffcc;
    --input-option-background-color: #fff;

    --input-foreground-color: black;
    --input-border-color: #00000033;

    --label-foreground-color: black;

    --post-card-background-color: white;
    --post-stats-background-color: #888;

    --table-border-color: var(--disabled-action-background);
    --table-heading-color: var(--primary-action-background);
    --table-background-color: var(--lighter-background);
}

* {
    padding: 0;
    margin: 0;
    text-align: left;
    box-sizing: border-box;
    border-collapse: collapse;

    font-family: "DM Sans";
}

html {
    margin: 0;
    padding: 0;

    /* filter: grayscale() saturate(200%) hue-rotate(90deg); */
}

BODY {
    max-width: 1000px;
    width: 1000px;
    margin-inline: auto;

    height: auto;
    min-height: calc(100vh - 4rem);

    -webkit-box-shadow:
        0px 10px 13px -7px hsl(0, 0%, 0%),
        0px 0px 15px 11px rgba(0, 0, 0, 0.18);
    box-shadow:
        0px 10px 13px -7px #000000,
        0px 0px 15px 11px rgba(0, 0, 0, 0.18);

    margin-block: 2rem;

    background-image: var(--background-image);
}

h1,
h2,
h3,
h4,
h5 {
    text-align: left;
    display: block;
    padding-block: 0.5em;
    color: var(--heading-color-2);
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    padding-bottom: 0;
}

h3 {
    font-size: 1.5em;
    padding: 0.5em;
    background-color: var(--heading-background-color);
    color: var(--heading-color-2);
    margin-bottom: 0.5em;
}

h4 {
    font-size: 1.2rem;
    border-bottom: 1px solid var(--primary-action-background);
}

h5 {
    font-size: 1.25em;
    color: black;
}

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

.layout-container {
    background-color: var(--content-background);
    display: grid;
    height: auto;
    min-height: 100vh;
    width: 100%;
    grid-template-rows: fit-content(70px) 1fr;
    grid-template-columns: 1fr;
    grid-template-areas:
        "header"
        "content";
}

NAV {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding-inline: var(--padding-std);
    gap: var(--padding-lg);

    backdrop-filter: blur(20px);
    background-color: var(--heading-background-color);
    padding-inline: 20px;
}

NAV > A > H1 > I.fa-solid {
    display: none;
}

NAV .search-bar {
    flex: 1;
}

NAV .search-bar INPUT[type="search"] {
    width: 100%;
    margin: 0;
    min-width: 25em;
}

NAV a:hover,
a:hover {
    color: var(--accent-color);
}

.tag-list LI A:hover {
    color: inherit;
}

.nav-menu > A {
    color: var(--nav-menu-foreground);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    font-size: 1em;
}

.nav-menu > A > I {
    font-size: 1.2em;
}

.nav-menu SPAN {
    white-space: nowrap;
}

.site-logo {
    height: 64px;
    width: 75px;
    background-image: url("/images/logos/NRCA_Green_Logo.png");
    background-position: center;
    background-size: contain;
    display: inline-block;
    background-repeat: no-repeat;
}

.site-name {
    font-size: 0.75em;
}

.sticky {
    position: sticky;
    top: 0px;
    z-index: 50;
}

.hidden {
    display: none !important;
}

.selected {
    font-weight: bold;
}

.horizontal-list {
    display: flex;
    flex-direction: row;
    gap: 1em;
    flex-wrap: wrap;
    justify-content: space-around;
    height: 128px;
    overflow-y: auto;
}

.horizontal-list.expanded {
    overflow-y: none;
    height: auto;
    justify-content: start;
}

.horizontal-list A {
    width: 128px;
    height: 128px;
    overflow: hidden;
}

h1.heading {
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background-color: hsla(0, 100%, 0%, 0.05);
    padding-inline: 0.5rem;
    margin-top: 2rem;
}

h1.heading A,
.see-all > DIV {
    color: var(--accent-color-alt);
    background-color: var(--accent-color);
    font-size: 1rem;
    padding: 0.5rem 2rem;
}

UL.post-grid {
    display: grid;
    justify-content: space-around;
    grid-template-columns: repeat(auto-fill, 300px);
    gap: 1em;
}

li.post-card {
    padding: var(--padding-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1em;
    overflow: hidden;

    border-width: 2px;
    border-style: solid;
    border-image: linear-gradient(
            135deg,
            gray,
            white 5%,
            white 95%,
            var(--accent-color)
        )
        1;

    transition: background-color 0.25s ease-in-out;
    border-radius: 0;
}

li.post-card:hover,
.post-row:hover {
    /* background-color: hsl(var(--accent-color-hsl) / 0.2); */
    background-color: hsl(var(--accent-color-hsl) / 0.2);
}

.post-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;

    transition: background-color 0.25s ease-in-out;
}

.bottom-border,
.post-row {
    border-width: 0px;
    border-bottom-width: 1px;
    border-style: solid;
    border-image: linear-gradient(
            90deg,
            white 0%,
            var(--accent-color) 35%,
            var(--accent-color) 65%,
            white 100%
        )
        1;
}

.post-image {
    background-color: #fff;
    overflow: hidden;
    /* background-image: url("/images/content/no_image_wide.png"); */
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.post-image.small {
    height: 32px;
    width: auto;
    max-width: 100px;
    max-height: max-content;
}

.post-image.large {
    height: 128px;
    width: auto;
    max-width: 128px;
    max-height: max-content;
}

LI.post-card > DIV.post-image {
    width: 100%;
    aspect-ratio: 16 / 9;
}

LI.post-card H5 {
    color: black;
    overflow-y: hidden;
    align-self: start;
}

LI.post-card > DIV > SPAN {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding-top: 0.5em;
}

UL.tag-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--padding-std);
    padding-block: var(--padding-std);
}

UL.tag-list > LI {
    display: inline;
    background-color: var(--primary-action-background);
    color: var(--primary-action-foreground);
    padding: var(--padding-sm) var(--padding-std);
    border-radius: var(--border-radius-std);
    border: 1px solid var(--primary-action-foreground);
    max-width: 7em;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow-x: hidden;
}

UL.tag-list > LI > I {
    cursor: pointer;
}

.post-stats {
    color: var(--post-stats-background-color);
    padding: 1em;
    display: flex;
    flex-direction: row;
    gap: 0.5em;
}

.channel-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5em;
    gap: 1em;
}

.channel-icon .image {
    height: 64px;
    width: 64px;
    min-height: 64px;
    min-width: 64px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

MAIN {
    grid-area: content;
    position: relative;
    overflow-y: auto;
    padding: var(--padding-std);
}

INPUT,
LABEL,
TEXTAREA,
SELECT {
    display: block;
    max-width: 100%;
    color: var(--input-foreground-color);
    margin-block: 5px;
}

INPUT:focus,
TEXTAREA:focus,
SELECT:focus {
    outline-color: var(--primary-action-background);
}

INPUT[type="checkbox"] {
    display: inline;
}

INPUT,
TEXTAREA,
SELECT {
    padding: var(--padding-std);
    border-radius: var(--border-radius-std);
    border: 1px solid var(--input-border-color);
    background-color: var(--input-background-color);
}

LABEL {
    color: var(--label-foreground-color);
    display: flex;
    justify-content: space-between;
    gap: 1em;
}

BUTTON {
    border: none;
    color: inherit;
    background: none;
    font-size: inherit;
    margin-block: 10px;
    cursor: pointer;
    padding: 0.5rem 2rem;
}

INPUT[type="radio"] {
    display: inline;
    padding-right: var(--padding-sm);
}

INPUT:focus,
TEXTAREA:focus,
SELECT:focus {
    outline-color: var(--primary-action-background);
}

TEXTAREA {
    height: 200px;
    width: 100%;
    resize: none;
}

.action {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: var(--padding-std);
    gap: var(--padding-std);
    border-radius: var(--border-radius-sm);
    font-weight: bold;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.action.primary {
    background-color: var(--primary-action-background);
    border: 1px solid var(--primary-action-foreground);
    color: var(--primary-action-foreground);
}

.action.secondary {
    background-color: var(--secondary-action-background);
    border: 1px solid var(--secondary-action-foreground);
    color: var(--secondary-action-foreground);
}

.action.destructive {
    background-color: var(--destructive-action-background);
    border: 1px solid var(--destructive-action-foreground);
    color: var(--destructive-action-foreground);
}

.action.disabled {
    background-color: var(--disabled-action-background);
    color: var(--disabled-action-foreground);
    pointer-events: none;
}

/* Post View */
.post {
    display: grid;
    grid-template-columns: 1fr minmax(300px, auto);
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "heading sidebar"
        "content sidebar";
    gap: 1em;
    background-color: var(--section-background-color);
    padding: 1em;
}

.post-title,
.button-group {
    display: flex;
    flex-direction: row;
    gap: 0.5em;
    align-items: center;
    justify-content: space-between;
}

.post-title {
    grid-area: heading;
    padding-bottom: 0.5em;
}

.post-content {
    grid-area: content;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    /* align-items: start; */
    padding-top: 0.5em;
}

.post ASIDE {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    align-items: normal;
    border: 1px solid var(--section-border-color);
    border-radius: var(--border-radius-std);
    max-width: 300px;
}

.new-post-comment {
    display: flex;
    align-items: end;
    flex-direction: column;
}

.comment-card {
    display: flex;
    flex-direction: column;
    gap: var(--padding-sm);
    margin-block: var(--padding-std);
}

.comment-header,
.comment-footer {
    display: flex;
    justify-content: space-between;
}

.comment-content {
    padding: 0.5em;
    background-color: var(--heading-background-color);
    border-radius: var(--border-radius-sm);
}

/* section style */
.section {
    backdrop-filter: blur(10px);
    background-color: var(--section-background-color);
    padding: 1em;
    color: var(--body-foreground-color);
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

.section-heading {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: var(--padding-std);
}

.section-content {
    padding: var(--padding-std);
    display: flex;
    flex-direction: column;
}

/* dialog styling */
DIALOG {
    margin: auto;
}

DIALOG::backdrop {
    background-color: hsla(0, 100%, 0%, 0.05);
    backdrop-filter: blur(4px);
}

DIALOG LABEL {
    color: var(--input-foreground-color);
}

/* Flash Section */
.flash-section {
    position: fixed;
    bottom: 10px;
    left: 10px;
    backdrop-filter: blur(10px);

    z-index: 50;

    animation: fade-in-out 3000ms forwards;
}

.flash-section DIV {
    border-radius: var(--border-radius-sm);
    padding: var(--padding-std);
    border: 2px solid var(--body-backgound-color);
}

.flash-section DIV + DIV {
    margin-top: 10px;
}

DIV.flash-success {
    border-color: var(--success-foreground);
    background-color: var(--success-background);
    color: var(--success-foreground);
    font-size: 14px;
}

DIV.flash-warning {
    border-color: var(--warning-foreground);
    background-color: var(--warning-background);
    color: var(--warning-foreground);
    font-size: 14px;
}

DIV.flash-error {
    border-color: var(--error-foreground);
    background-color: var(--error-background);
    color: var(--error-foreground);
    font-size: 14px;
}

DIV.flash-info {
    border-color: var(--info-foreground);
    background-color: var(--info-background);
    color: var(--info-foreground);
    font-size: 14px;
}

.bordered {
    border-width: 1px;
    border-radius: var(--border-radius-sm);
    border-style: solid;
    padding: var(--padding-std);
    margin-block: var(--padding-std);
}

/* Animations */
@keyframes fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
        display: block;
    }
}

@keyframes fade-in-out {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        display: none;
    }
}
