/* CODE Creator Board - handwritten CSS, no framework */
/* Mobile first. Breakpoints: 640px (tablet) and 1000px (desktop) */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    color: #222;
    background-color: #f6f3ee;
}

a {
    color: #5a2ca0;
}

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid #f2a900;
    outline-offset: 2px;
}

/* header and navigation */
.site-header {
    background-color: #2b1650;
    padding: 12px 16px;
}

.logo {
    display: block;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    text-decoration: none;
    margin-bottom: 8px;
}

nav a {
    display: inline-block;
    color: white;
    text-decoration: none;
    margin-right: 12px;
    padding: 4px 0;
}

nav a:hover {
    text-decoration: underline;
}

main {
    padding: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

footer {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    padding: 24px 16px;
}

h1 {
    font-size: 1.6rem;
    margin-top: 8px;
}

/* buttons */
.button {
    display: inline-block;
    background-color: #5a2ca0;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background-color: #43207a;
}

.button-danger {
    background-color: #b3261e;
}

.button-danger:hover {
    background-color: #8c1d17;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

/* list of request cards */
.intro {
    margin-bottom: 20px;
}

.filters {
    max-width: 560px;
    margin: 20px 0;
}

.filters label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
}

.filters input {
    width: 100%;
    padding: 8px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid #aaa;
    border-radius: 6px;
}

.filters p,
.form-note {
    color: #555;
    font-size: 0.9rem;
}

.cards {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.card {
    background-color: white;
    border-radius: 10px;
    padding: 16px;
    border-left: 6px solid #5a2ca0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.card h2 {
    font-size: 1.15rem;
    margin: 10px 0 4px;
}

.card h2 a {
    text-decoration: none;
}

.card h2 a:hover {
    text-decoration: underline;
}

.by {
    color: #666;
    margin: 0;
}

.empty {
    font-style: italic;
}

/* small labels */
.tag,
.status {
    display: inline-block;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 20px;
}

.tag {
    background-color: #eadff9;
    color: #43207a;
}

.status {
    background-color: #ddd;
}

.status-open {
    background-color: #d4f2dc;
    color: #1d6b34;
}

.status-in-progress {
    background-color: #fff0c2;
    color: #7a5800;
}

.status-done {
    background-color: #e2e2e2;
    color: #444;
}

/* detail page */
.detail,
.confirm,
.form,
.about section {
    background-color: white;
    border-radius: 10px;
    padding: 16px;
}

.description {
    white-space: pre-line; /* keeps the line breaks people type */
    overflow-wrap: break-word;
}

.detail a {
    overflow-wrap: anywhere;
}

/* form */
.form label {
    display: block;
    font-weight: bold;
    margin-top: 14px;
    margin-bottom: 4px;
}

.form input,
.form textarea,
.form select {
    width: 100%;
    padding: 8px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid #aaa;
    border-radius: 6px;
}

.errors {
    background-color: #fde8e7;
    border: 1px solid #b3261e;
    border-radius: 6px;
    padding: 8px 16px;
    margin-bottom: 16px;
    color: #8c1d17;
}

/* about page */
.about {
    display: grid;
    gap: 16px;
}

.about h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

/* Breakpoint 1: tablets and bigger phones */
@media (min-width: 640px) {
    .site-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        margin-bottom: 0;
    }

    nav a {
        margin-right: 0;
        margin-left: 18px;
    }

    .cards {
        grid-template-columns: 1fr 1fr;
    }

    .row {
        display: flex;
        gap: 16px;
    }

    .row > div {
        flex: 1;
    }

    main {
        padding: 24px;
    }
}

/* Breakpoint 2: laptops and desktops */
@media (min-width: 1000px) {
    h1 {
        font-size: 2rem;
    }

    .site-header {
        padding: 16px 40px;
    }

    .cards {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .about {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .detail,
    .form,
    .confirm {
        max-width: 720px;
        padding: 32px;
    }
}
