:root {
    color-scheme: light;
    --pine: #153a32;
    --pine-light: #24574a;
    --cream: #fffaf0;
    --paper: #fffdf8;
    --gold: #d7ad61;
    --muted: #718078;
    --line: #e8e2d5;
    font-family: 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: #223b33;
    background:
        radial-gradient(ellipse at 12% 5%, rgba(215, 173, 97, .15), transparent 28rem),
        var(--cream);
}

button, input, textarea { font: inherit; }

.page {
    width: min(100% - 32px, 1060px);
    margin: 0 auto;
    padding: 66px 0 34px;
}

.hero { max-width: 650px; margin: 0 auto 42px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: #a47d38; font-size: .75rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
h1, .door-heading { font-family: Georgia, serif; }
.hero h1, .admin-heading h1, .login-card h1 { margin: 0; color: var(--pine); font-size: clamp(2.35rem, 7vw, 4.3rem); line-height: 1.08; }
.intro { max-width: 520px; margin: 18px auto 12px; color: #617169; font-size: 1.05rem; line-height: 1.7; }
.date { color: #a47d38; font-size: .9rem; font-weight: 600; }

.calendar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.door {
    min-width: 0;
    border: 1px solid rgba(21, 58, 50, .1);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 5px 16px rgba(37, 55, 45, .05);
}
.door > summary, .door-locked {
    display: flex;
    min-height: 130px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    color: var(--pine);
    cursor: pointer;
    list-style: none;
    transition: background .2s, transform .2s;
}
.door > summary::-webkit-details-marker { display: none; }
.door > summary:hover, .door[open] > summary { background: #f3eddf; }
.door > summary:hover { transform: translateY(-2px); }
.door-number { font-family: Georgia, serif; font-size: 2.7rem; font-weight: 700; line-height: 1; }
.door-label { margin-top: 7px; color: #718078; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.door-icon { margin-top: 7px; color: var(--gold); }
.door-locked { color: #a7afa8; background: rgba(235, 231, 220, .62); cursor: default; }
.door-locked .door-icon { color: #bdc3bd; }
.door-content { padding: 3px 18px 20px; color: #516159; line-height: 1.65; }
.door-heading { margin: 12px 0 8px; color: var(--pine); font-size: 1.25rem; }
.door-content p { white-space: normal; }
.door-content img { display: block; width: 100%; max-height: 300px; margin-top: 14px; border-radius: 10px; object-fit: cover; }

.footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 38px; color: #87918a; font-size: .82rem; }
.footer a, .back-link { color: var(--pine-light); text-decoration: none; }
.footer a:hover, .back-link:hover { text-decoration: underline; }

.admin-page { width: min(100% - 32px, 960px); margin: 0 auto; padding: 34px 0 70px; }
.back-link { display: inline-block; margin-bottom: 24px; font-size: .9rem; }
.admin-card { width: min(100%, 440px); margin: 5vh auto 0; padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 12px 32px rgba(37, 55, 45, .08); }
.login-card h1 { font-size: 2.2rem; }
.login-card > p:not(.eyebrow):not(.message) { color: #69766e; line-height: 1.6; }
.login-card form { display: grid; gap: 10px; margin-top: 24px; }
.login-card label, .editor-card > label:first-child { color: var(--pine); font-weight: 700; }
.login-card input[type="password"], .editor-card textarea, .editor-card input[type="file"] { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.login-card input[type="password"]:focus, .editor-card textarea:focus { outline: 2px solid rgba(36, 87, 74, .25); border-color: var(--pine-light); }
.primary-button, .quiet-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 9px; cursor: pointer; font-weight: 700; }
.primary-button { color: #fff; background: var(--pine); }
.primary-button:hover { background: var(--pine-light); }
.quiet-button { color: var(--pine); background: #eee9dd; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 10px 0 28px; }
.admin-heading h1 { font-size: clamp(2rem, 6vw, 3rem); }
.admin-heading p:not(.eyebrow) { max-width: 610px; margin-bottom: 0; color: #69766e; line-height: 1.6; }
.editor-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.editor-card { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.editor-card textarea { resize: vertical; line-height: 1.5; }
.file-label { margin-top: 2px; color: #68756d; font-size: .82rem; }
.editor-card input[type="file"] { padding: 8px; font-size: .82rem; }
.current-image { display: flex; align-items: center; gap: 12px; }
.current-image img { width: 88px; height: 66px; border-radius: 8px; object-fit: cover; }
.remove-image { color: #7a554d; font-size: .85rem; }
.save-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; margin-top: 18px; padding: 14px 0; background: linear-gradient(transparent, var(--cream) 24%); }
.message { padding: 12px 14px; border-radius: 9px; line-height: 1.5; }
.error { color: #8d302b; background: #fce9e5; }
.success { color: #235d41; background: #e6f4e9; }

@media (max-width: 700px) {
    .page { padding-top: 42px; }
    .calendar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .door > summary, .door-locked { min-height: 112px; }
    .editor-list { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-heading { align-items: flex-start; }
    .admin-heading > form { flex: 0 0 auto; }
    .quiet-button { padding: 0 12px; }
    .footer { flex-direction: column; }
}
