:root {
    --coffee: #362516;
    --copper: #8A5B32;
    --stone:  #8C8F98;
    --slate:  #617A8F;
    --teal:   #2C404D;
    --white:  #ffffff;
    --off-white: #f9f9f9;
    --nav-height: 70px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Century Gothic", "Lato", sans-serif;
    background-color: var(--white);
    color: var(--coffee);
}

a { color: var(--teal); }

.page-main {
    padding-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

/* Navigation */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--white);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-inner {
    height: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: relative;
}

.nav-brand {
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.15rem;
    color: var(--coffee);
    text-decoration: none;
    text-transform: uppercase;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--coffee);
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    color: var(--stone);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--copper);
    background: rgba(138, 91, 50, 0.08);
}

/* Flash messages */
.flash {
    max-width: 900px;
    margin: 12px auto 0;
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
}

.flash-ok {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.flash-err {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Sections */
.page-hero,
.page-section {
    padding: 60px 20px 80px;
    scroll-margin-top: var(--nav-height);
}

.page-hero {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.wallpaper {
    position: relative;
    background-image: url("/static/assets/wallpaper.png");
    background-repeat: repeat;
    background-position: top left;
}

.wallpaper::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.75);
    pointer-events: none;
}

.wallpaper > *,
.page-hero > * {
    position: relative;
    z-index: 1;
}

.wallpaper-alt {
    background-color: #ddd;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin: 0;
    letter-spacing: 0.35rem;
    color: var(--coffee);
    border-bottom: 4px solid var(--copper);
    padding-bottom: 10px;
}

.hero-content h3 {
    font-size: 1.1rem;
    letter-spacing: 0.15rem;
    color: var(--slate);
    margin-top: 20px;
}

.hero-lead {
    max-width: 520px;
    margin: 24px auto;
    line-height: 1.7;
}

.content-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.content-container.wide { max-width: 1100px; }
.content-container.narrow { max-width: 420px; }

h2 {
    font-size: 2.2rem;
    color: var(--teal);
    margin-bottom: 28px;
    text-align: center;
}

p { line-height: 1.8; font-size: 1.05rem; }

.muted { color: var(--slate); font-size: 0.95rem; }

.btn,
button[type="submit"]:not(.btn-danger):not(.btn-secondary) {
    display: inline-block;
    padding: 14px 22px;
    background: var(--teal);
    color: var(--white);
    text-decoration: none;
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 6px;
}

.btn-secondary {
    background: var(--stone);
    color: var(--white);
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 6px;
}

.btn-danger {
    background: #a33;
    color: var(--white);
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
}

.teaching-statement {
    background: var(--off-white);
    padding: 30px;
    border-left: 5px solid var(--copper);
    border-radius: 10px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.teaching-statement h3 { margin-top: 0; color: var(--teal); }

.content-block {
    margin-top: 24px;
    padding: 20px;
    background: var(--off-white);
    border-radius: 8px;
}

/* Performances */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    text-align: left;
}

.col-recordings h2,
.col-events h2 {
    text-align: left;
    font-size: 1.6rem;
    border-bottom: 1px solid var(--stone);
    padding-bottom: 8px;
}

.video-card { margin-bottom: 24px; }

.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 6px;
    background: var(--stone);
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.caption { margin-top: 8px; font-weight: bold; color: var(--teal); }
.caption-desc { font-size: 0.9rem; color: var(--slate); margin-top: 4px; }

.event-card {
    display: flex;
    gap: 15px;
    background: var(--off-white);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid transparent;
}

.date-badge {
    background: var(--teal);
    color: var(--white);
    padding: 10px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 54px;
}

.month { font-size: 0.7rem; text-transform: uppercase; }
.day { font-size: 1.2rem; font-weight: bold; }

.event-info h3 { margin: 0; font-size: 1rem; }
.location { margin: 6px 0 0; font-size: 0.9rem; color: var(--slate); }
.event-detail { font-size: 0.9rem; margin: 8px 0 0; }

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.gallery-item {
    margin: 0;
    background: var(--off-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.gallery-item figcaption {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
}

/* Contact */
.contact-form {
    max-width: 420px;
    margin: 24px auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255,255,255,0.9);
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.contact-form input,
.contact-form textarea,
.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.hp, label.hp { display: none !important; }

/* Page content (About, etc.) */
.page-content h2,
.page-content h3 {
    color: var(--teal);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.page-content h2:first-child,
.page-content h3:first-child { margin-top: 0; }

.page-content p {
    line-height: 1.7;
    margin-bottom: 1em;
}

.page-content ul,
.page-content ol {
    line-height: 1.7;
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.page-content a { color: var(--teal); }

/* Admin */
.admin-section h2 { text-align: left; }

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-nav a {
    font-weight: bold;
}

.admin-form {
    background: var(--off-white);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 32px;
}

.admin-form label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: bold;
}

.admin-form .form-actions {
    margin-top: 16px;
    margin-bottom: 0;
}

.wysiwyg-editor {
    min-height: 360px;
    background: var(--white);
    border-radius: 6px;
}

.wysiwyg-editor .ql-editor {
    min-height: 320px;
    font-family: "Century Gothic", "Lato", sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--coffee);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.admin-table th { background: var(--teal); color: var(--white); }

.details-cell { max-width: 280px; word-break: break-word; }

.inbox-card {
    background: var(--off-white);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid var(--copper);
}

.inbox-card header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.inbox-card time { color: var(--slate); margin-left: auto; }

/* Footer */
.site-footer {
    background-color: var(--teal);
    color: var(--white);
    padding: 50px 20px 30px;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand h3 {
    margin: 0;
    letter-spacing: 0.2rem;
}

.footer-brand p {
    margin: 8px 0 24px;
    color: var(--off-white);
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.footer-social a {
    color: var(--white);
    font-size: 1.3rem;
    margin: 0 10px;
}

.footer-bottom p {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 24px;
}

.recaptcha-notice {
    font-size: 0.75rem;
    color: var(--stone);
    margin: 12px 0 0;
}

.grecaptcha-badge {
    z-index: 1001 !important;
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-bottom: 1px solid rgba(0,0,0,0.08);
    }

    .nav-links.open { max-height: 360px; }

    .nav-link {
        padding: 16px 20px;
        border-top: 1px solid rgba(0,0,0,0.05);
    }

    .split-layout { grid-template-columns: 1fr; }

    .hero-content h1 { letter-spacing: 0.15rem; }
}
