@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --bg-color: #f4f6f8;
    --text-color: #2c2c2c;
    --nav-bg: #2c3e50;
    --card-bg: #ffffff;
    --border-color: #dce1e7;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color, #f4f6f8);
    color: var(--text-color, #2c2c2c);
    font-size: 1rem;
    min-height: 100pt;
    line-height: 1.6;
}

header {
    background-color: rgb(44, 62, 80);
    color: #ffffff;
    padding: 2rem 5%;
    border-bottom: 4px solid #3498db;
    text-align: center;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0.5em;
}

header p {
    color: hsl(204, 70%, 80%);
    font-size: 0.95rem;
}

nav {
    background-color: var(--nav-bg, #2c3e50);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 4px;
    padding-bottom: 4px;
    padding-left: 16px;
    padding-right: 16px;
}

nav ul li a {
    color: #ffffff;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.2s ease;
}

nav ul li a:hover {
    background-color: color-mix(in srgb, #3498db 80%, white 20%);
}

nav ul li a:active {
    background-color: color(srgb 0.15 0.5 0.85);
}

main {
    width: 90%;
    max-width: 900px;
    min-width: 280px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

section {
    background-color: var(--card-bg, #ffffff);
    border: 1px solid #dce1e7;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin: 0 0 0.5rem 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    animation: fadeIn 0.4s ease both;
}

h2 {
    color: var(--primary-color, #2c3e50);
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    margin-left: 0;
    margin-right: 0;
    border-bottom-style: solid;
    border-bottom-color: #3498db;
    border-bottom-width: 2px;
    padding-bottom: 0.4rem;
}

h3 {
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

p {
    text-align: left;
    color: var(--text-color, #2c2c2c);
    margin-bottom: 0.75rem;
}

a {
    color: #3498db;
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
    color: #1a6fa8;
}

strong,
b {
    color: #2c3e50;
}

em,
i {
    color: #555;
}

span {
    font-weight: 600;
    color: #3498db;
}

#attendance ul,
#agenda ol {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

#attendance ul li,
#agenda ol li {
    margin-bottom: 0.3rem;
    color: #444;
}

details {
    background-color: #eef2f7;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

summary {
    font-weight: 600;
    color: var(--primary-color, #2c3e50);
}

hr {
    border: none;
    border-top: 1px solid var(--border-color, #dce1e7);
    margin: 1rem 0;
}

#media .media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: flex-start;
    align-items: flex-start;
}

#media .media-grid>* {
    flex: 1 1 200px;
}

/* child combinator targets only the direct h2 inside #media */
#media>h2 {
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 2px solid #dce1e7;
    display: block;
}

img:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

audio,
video {
    display: block;
    max-width: 100%;
    margin-top: 0.5rem;
}

#form fieldset {
    border: 1px solid var(--border-color, #dce1e7);
    border-radius: 8px;
    padding: 1.5rem;
}

#form legend {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color, #2c3e50);
    padding: 0 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 1rem;
    grid-auto-rows: minmax(40px, auto);
}

.form-grid>p {
    margin: 0;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    background-color: #fafafa;
}

input[type="text"]:focus,
input[type="date"]:focus {
    border-color: #3498db;
    outline: none;
}

textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    resize: vertical;
}

select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fafafa;
}

button[type="submit"] {
    background-color: var(--accent-color, #3498db);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    min-width: 120px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

button[type="submit"]:hover {
    background-color: #1a6fa8;
}

button[type="submit"]:active {
    transform: scale(0.97);
}

footer {
    text-align: center;
    padding: 1.5rem;
    background-color: rgb(44, 62, 80);
    color: hsl(0, 0%, 90%);
    font-size: 0.875rem;
    margin-top: 40px;
}

#new-business {
    border-left: 4px solid #3498db;
}

#unfinished {
    border-left: 4px solid #e67e22;
}

/* :has() - targets sections that contain an h3 */
section:has(h3) {
    background-color: #fafcff;
}

nav {
    & ul {
        & li {
            display: inline-block;
        }
    }
}

h2~p {
    color: #444;
}

h2+h3 {
    margin-top: 0.25rem;
    color: #666;
}

section.highlighted {
    background-color: #fffbea;
    border-color: #f1c40f;
}

.hidden {
    display: none;
}

.badge {
    position: relative;
    display: inline-block;
}

.badge::after {
    content: "New";
    position: absolute;
    top: -8px;
    right: -28px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 20px;
    }

    main {
        width: 95%;
        margin: 1rem auto;
    }

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

    nav ul {
        flex-direction: column;
        align-items: center;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    main {
        width: 92%;
    }
}

/* smooth scroll for nav links */
html {
    scroll-behavior: smooth;
}

section {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

section:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

details summary {
    color: darkslategray;
}