@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&display=swap');
:root {
    --dark-color: #121212;
    --dark-shade-color: #777;
    --dark-transparent-color: rgba(0, 0, 0, 0.15);
    --shadow-color: rgba(0, 0, 0, 0.05);
    --light-color: #ffffff;
    --light-shade-color: #f7f7f7;
    --accent-color: #3CDCFF;
    --accent-hover-color: #70e5ff;
    --accent-focus-color: #00c4f0;
    --shadow: 0 20px 40px var(--shadow-color);
}

body {
    font-family: 'Fira Code', monospace;
    font-size: 16px;
    color: var(--dark-color);
    background-color: var(--light-shade-color);
    margin: 0;
    max-width: 100vw;
    height: 100vh;
    overflow-x: hidden;
}

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

.navbar {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar__navigation {
    display: flex;
    gap: 32px;
    font-size: 18px;
    font-weight: 500;
    list-style-type: none;
}

.navbar__link {
    text-decoration: none;
    color: var(--dark-color);
}

.navbar__link:hover {
    color: var(--accent-focus-color);
    text-decoration: underline;
}

.navbar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 24px;
    font-weight: 600;
}

.main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: auto;
    padding: 24px;
    padding-bottom: 160px;
}

.container {
    max-width: 640px;
    width: 100%;
}

.top {
    width: 100%;
    background-color: var(--light-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    margin-bottom: 64px;
    padding: 24px;
}

section h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 500;
}

.form {
    width: 100%;
}

.form__input {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form__title {
    width: 100%;
    padding: 12px;
    margin: 12px 0 0 0;
    border: 1px solid var(--dark-transparent-color);
    border-radius: 8px;
    resize: none;
}

.form__textarea {
    width: 100%;
    padding: 12px;
    margin: 16px 0 20px 0;
    border: 1px solid var(--dark-transparent-color);
    border-radius: 8px;
    resize: none;
}

.form__textarea:focus {
    outline: 4px double var(--accent-focus-color);
}

.form__submit-container {
    /* width: 100%; */
    display: flex;
    justify-content: flex-end;
}

.form__submit {
    height: 52px;
    border: 0;
    border-radius: 99px;
    background-color: var(--accent-color);
    font-size: 18px;
    padding: 0 24px;
}

.form__submit:hover {
    background-color: var(--accent-hover-color);
}

.form__submit:focus {
    background-color: var(--accent-focus-color);
}

.post {
    width: 100%;
    background-color: var(--light-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin: 20px 0;
    z-index: 0;
}

.post h3 {
    font-weight: 600;
    margin-bottom: 4px;
}

.post div {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.post div time {
    color: var(--dark-shade-color);
}

.post p {
    font-size: 16px;
    line-height: 150%;
}

.footer {
    display: flex;
    /* position: fixed;
    bottom: 0; */
    width: 100%;
    max-width: 100%;
    background-color: var(--dark-color);
    font-size: 12px;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 16px;
}

footer .left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

footer .right {
    display: flex;
    gap: 40px;
}

footer .footer__column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

footer a {
    color: var(--light-color);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}
/* ---- diary additions ---- */
.link-button {
    background: none;
    border: 0;
    font: inherit;
    font-size: 14px;
    color: var(--dark-shade-color);
    cursor: pointer;
    text-decoration: underline;
}

.link-button:hover {
    color: var(--accent-focus-color);
}

.error {
    color: #c0392b;
    margin-bottom: 16px;
    text-align: center;
}

.delete-form {
    margin-left: auto;
}

.entry-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.footer__item {
    color: var(--light-color);
}

/* ---- two-column layout + calendar ---- */
.layout {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 32px;
    width: 100%;
    max-width: 1200px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 16px;
}

.sidebar .top {
    margin-bottom: 24px;
}

.entries h2 {
    margin-bottom: 4px;
}

.calendar__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
}

.calendar__head a {
    color: var(--dark-color);
    text-decoration: none;
    font-size: 22px;
    padding: 0 10px;
}

.calendar__head a:hover { color: var(--accent-focus-color); }

.calendar__grid {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.calendar__grid th {
    font-size: 12px;
    color: var(--dark-shade-color);
    font-weight: 400;
    padding-bottom: 6px;
}

.calendar__grid td { padding: 2px; }

.day {
    display: block;
    padding: 6px 0;
    border-radius: 8px;
    color: var(--dark-color);
    text-decoration: none;
    font-size: 14px;
}

.day:hover { background: var(--light-shade-color); }
.day--today { outline: 1px solid var(--dark-transparent-color); }
.day--has { background: var(--accent-color); font-weight: 600; }
.day--has:hover { background: var(--accent-hover-color); }
.day--selected { background: var(--dark-color); color: var(--light-color); }
.day--selected:hover { background: var(--dark-color); }

.calendar__clear {
    margin-top: 12px;
    font-size: 13px;
    color: var(--dark-shade-color);
}

@media (max-width: 800px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
}

/* compact posts */
.entries .post {
    padding: 14px 16px;
    margin: 12px 0;
}

.entries .post div {
    margin-bottom: 8px;
}

.entries .post p {
    font-size: 15px;
    line-height: 140%;
}

.search {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    border: 1px solid var(--dark-transparent-color);
    border-radius: 8px;
    background: var(--light-color);
}

.search:focus { outline: 4px double var(--accent-focus-color); }
.post[hidden], .no-match[hidden] { display: none; }
.no-match { margin-top: 16px; color: var(--dark-shade-color); }

/* delete confirmation */
.modal {
    border: 0;
    border-radius: 8px;
    padding: 24px;
    width: min(360px, 90vw);
    margin: auto;
    font-family: inherit;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.modal::backdrop { background: rgba(0, 0, 0, 0.4); }
.modal__text { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal__skip { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--dark-shade-color); margin-bottom: 20px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal__btn { height: 40px; padding: 0 18px; border: 0; border-radius: 99px; font: inherit; font-size: 14px; background: var(--light-shade-color); cursor: pointer; }
.modal__btn:hover { background: #ececec; }
.modal__btn--danger { background: #e74c3c; color: #fff; }
.modal__btn--danger:hover { background: #c0392b; }
