@font-face {
    font-family: "Explora";
    src: url("/assets/fonts/explora-regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Quicksand";
    src: url("/assets/fonts/quicksand-regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Quicksand";
    src: url("/assets/fonts/quicksand-semibold.ttf") format("truetype");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Quicksand";
    src: url("/assets/fonts/quicksand-bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink: #183739;
    --muted: #46666a;
    --paper: #fafaf6;
    --white: #fff;
    --line: #ccdede;
    --accent: #006973;
    --accent-dark: #004d56;
    --accent-light: #eaf5f3;
    --aqua: #80c6c6;
    --font-body: "Quicksand", "Segoe UI", sans-serif;
    --font-script: "Explora", cursive;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    scrollbar-color: #76aaaa var(--paper);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

::selection {
    color: var(--accent-dark);
    background: #b7e1db;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 17px;
    line-height: 1.7;
    caret-color: var(--accent);
}

main {
    flex: 1;
}

a {
    color: var(--accent);
    text-underline-offset: .22em;
    text-decoration-thickness: 1px;
}

a,
button,
input,
select,
[contenteditable] {
    outline-offset: 4px;
}

:focus-visible {
    outline: 2px solid var(--accent);
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.1rem);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

h3 {
    font-size: 1.35rem;
}

p {
    margin-block: 1rem;
}

.shell {
    width: min(1100px, calc(100% - 3rem));
    margin-inline: auto;
}

.reading {
    max-width: 740px;
}

.section {
    padding-block: clamp(3rem, 6vw, 5rem);
}

.skip-link {
    position: absolute;
    z-index: 5;
    top: 0;
    left: 1rem;
    padding: .7rem 1rem;
    color: var(--white);
    background: var(--accent-dark);
    transform: translateY(-110%);
}

.skip-link:focus {
    transform: translateY(0);
}

.masthead,
.footer-main {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--aqua);
}

.masthead::before,
.footer-main::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: url("/assets/lake-morning.webp") center 66% / cover;
    mix-blend-mode: soft-light;
    opacity: .3;
    pointer-events: none;
}

.masthead-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 192px;
    padding-block: 16px 23px;
}

.brand {
    color: #fffdf4;
    font-family: var(--font-script);
    font-size: clamp(4.5rem, 9vw, 7.8rem);
    font-weight: 400;
    line-height: .95;
    text-decoration: none;
    white-space: nowrap;
    text-shadow: 0 2px 9px #285f6226;
}

.brand-description {
    margin: 10px 0 0;
    color: #173f45;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: .03em;
}

.site-nav {
    background: var(--accent);
}

.nav-inner {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: 15px;
}

.site-nav a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 8px 17px;
    color: #fff;
    font-size: .95rem;
    line-height: 1.4;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: background-color 150ms ease-out;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    background: #ffffff12;
    border-bottom-color: #afe4de;
}

.site-nav a:focus-visible,
.footer-bottom a:focus-visible {
    outline-color: var(--white);
}

.hero {
    background: #a5c7c5 url("/assets/lake-morning.webp") center 58% / cover no-repeat;
    padding-block: 48px;
}

.feature-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: center;
    column-gap: clamp(2rem, 6vw, 5rem);
    padding: 42px clamp(2rem, 5vw, 66px);
    min-height: 470px;
    background: rgb(255 255 255 / 85%);
}

.feature-copy {
    max-width: 530px;
}

.coming-soon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    min-height: 350px;
    text-align: center;
}

.coming-soon p {
    margin: 0;
}

.contact-name {
    margin-block: 25px;
    font-size: 1.25rem;
    font-weight: 600;
}

.contact-details {
    margin-block: 0 28px;
}

.contact-details > div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 16px;
    padding-block: 18px;
    border-top: 1px solid var(--line);
}

.contact-details dt {
    font-weight: 600;
}

.contact-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.contact-details address {
    font-style: normal;
}

.script-heading {
    color: var(--accent);
    font-family: var(--font-script);
    font-size: clamp(4rem, 7vw, 6.1rem);
    font-weight: 400;
    line-height: 1;
    overflow-wrap: normal;
}

.feature-author {
    margin-block: 10px 20px;
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: .01em;
}

.feature-copy > p:not(.feature-author) {
    max-width: 42ch;
    line-height: 1.85;
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 24px;
    margin-top: 28px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 21px;
    border: 1px solid var(--line);
    border-radius: 3px;
    font: 600 .9rem/1.4 var(--font-body);
    text-decoration: none;
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    transition: background-color 150ms ease-out, color 150ms ease-out;
}

.button {
    color: var(--white);
    background: var(--accent);
    border-color: var(--accent);
}

.button:hover {
    background: var(--accent-dark);
}

button:not(.button):hover {
    background: var(--accent-light);
}

button:disabled {
    cursor: wait;
    opacity: .6;
}

.button-outline {
    color: var(--accent);
    background: transparent;
}

.button-outline:hover {
    color: var(--white);
}

.text-link {
    font-size: .94rem;
    font-weight: 600;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.book-preview {
    margin: 0;
    justify-self: center;
    text-align: center;
    width: min(100%, 248px);
}

.book-cover {
    display: flex;
    flex-direction: column;
    min-height: 350px;
    aspect-ratio: .7;
    padding: 22px 0;
    color: var(--accent-dark);
    background: #f8f5e9;
    text-decoration: none;
    box-shadow: 9px 13px 23px #133f4433;
    transition: transform 220ms ease-out, box-shadow 220ms ease-out;
}

.book-cover:hover {
    transform: translateY(-4px);
    box-shadow: 11px 17px 28px #133f443b;
}

.book-author {
    margin-bottom: 19px;
    padding-inline: 14px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .04em;
}

.book-landscape {
    display: block;
    width: 100%;
    height: 142px;
    object-fit: cover;
    object-position: center 68%;
}

.book-title {
    display: block;
    margin: 18px 10px 20px;
    font-family: Georgia, serif;
    font-size: 2.35rem;
    line-height: 1.02;
    letter-spacing: -.025em;
}

.book-bottom-line {
    display: block;
    width: 38px;
    height: 1px;
    margin: auto auto 0;
    background: #609592;
}

.book-preview figcaption {
    margin-top: 17px;
    color: #365b60;
    font-size: .72rem;
}

.recent-posts {
    background: var(--white);
}

.ruled-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin: 0 0 37px;
    color: var(--accent);
    font-size: 1.55rem;
    font-weight: 400;
    text-align: center;
}

.ruled-heading::before,
.ruled-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #8cb8b7;
}

.section-action {
    margin-top: 35px;
    text-align: center;
}

.post-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.post-card {
    display: flex;
    flex-direction: column;
    color: var(--ink);
    text-decoration: none;
    min-width: 0;
}

.post-card > img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.post-card-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px 0 8px;
}

.post-card-text-only {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.post-card h3 {
    line-height: 1.45;
}

.post-card:hover h3 {
    text-decoration: underline;
    text-underline-offset: .2em;
}

.post-read {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    color: var(--accent);
    font-size: .88rem;
    font-weight: 600;
}

time {
    color: var(--muted);
    display: inline-block;
    margin-block: 8px 14px;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

.back {
    display: inline-block;
    margin-bottom: 24px;
    font-size: .9rem;
}

.article img,
#cover-preview img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
}

.article-cover {
    margin-block: 12px 32px;
}

.article-body {
    font-size: 1.08rem;
    line-height: 1.85;
}

.article-body h2,
.article-body h3 {
    margin-top: 32px;
}

.about-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    align-items: center;
    gap: 30px;
    margin-top: 22px;
}

.about-intro p {
    margin: 0;
}

.about-intro img {
    display: block;
    width: 100%;
    height: auto;
}

.family-album {
    margin-top: 40px;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
    margin-top: 24px;
}

.photo-gallery a {
    display: block;
    cursor: zoom-in;
}

.photo-gallery img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    object-fit: contain;
    background: var(--paper);
}

.article-body blockquote {
    margin: 30px 0;
    padding: 15px 23px;
    color: var(--accent-dark);
    background: var(--accent-light);
}

.footer-main {
    padding-block: 43px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px 48px;
}

.footer-signature {
    color: var(--accent-dark);
    font-family: var(--font-script);
    font-size: 4rem;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.footer-inner p {
    margin-block: 9px 0;
    color: #173f45;
    font-size: .85rem;
}

.footer-inner nav {
    display: flex;
    flex-wrap: wrap;
    gap: 13px 24px;
}

.footer-inner nav a {
    color: var(--accent-dark);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

.footer-inner nav a:hover {
    text-decoration: underline;
}

.footer-bottom {
    padding-block: 15px;
    color: #fff;
    background: var(--accent);
    font-size: .75rem;
    text-align: center;
}

.admin-page .masthead-inner {
    min-height: 90px;
    padding-block: 15px;
}

.admin-page .brand {
    font-family: var(--font-body);
    color: var(--accent-dark);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.5;
    text-shadow: none;
}

.admin-page .site-nav a {
    min-height: 46px;
}

.logout-form {
    display: flex;
    margin: 0;
}

.logout-form button {
    color: var(--white);
    background: transparent;
    border: 0;
    border-radius: 0;
    font-weight: 400;
    font-size: .95rem;
}

.logout-form button:hover {
    background: #ffffff12;
}

.logout-form button:focus-visible {
    outline-color: var(--white);
}

.panel.auth-panel {
    max-width: 460px;
}

.auth-panel form > .button {
    margin-top: 26px;
    width: 100%;
}

.admin-page .footer-main {
    display: none;
}

.panel {
    max-width: 880px;
}

.panel h1 {
    margin-bottom: 10px;
    font-size: 2rem;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 22px;
}

.empty {
    margin: 0;
    padding-block: 20px;
    color: var(--muted);
    text-align: center;
}

.draft-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    padding: 16px 18px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 4px;
    text-decoration: none;
}

.draft-row strong {
    overflow-wrap: anywhere;
}

.draft-row:hover strong {
    text-decoration: underline;
}

.draft-row span,
.optional {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 400;
}

label,
.field-label {
    display: block;
    margin: 24px 0 6px;
    font-weight: 700;
}

.hint {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: .86rem;
}

input,
select {
    font: inherit;
}

input[type="text"],
input[type="password"],
#body-editor {
    display: block;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--ink);
    background: var(--white);
}

#body-editor {
    min-height: 280px;
    border-radius: 0 0 4px 4px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

#body-editor img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-block: 8px;
    cursor: pointer;
}

#body-editor img[data-selected] {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

:is(#body-editor, .article) img[data-width="25"] { width: 25%; }
:is(#body-editor, .article) img[data-width="50"] { width: 50%; }
:is(#body-editor, .article) img[data-width="75"] { width: 75%; }
:is(#body-editor, .article) img[data-width="100"] { width: 100%; }

.toolbar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
    background: var(--accent-light);
}

.toolbar button {
    min-height: 38px;
    padding: 6px 10px;
    font-size: .85rem;
}

.image-size-control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding-inline: 5px;
}

.image-size-control label {
    margin: 0;
    font-size: .85rem;
}

.image-size-control select {
    min-height: 38px;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--ink);
    background: var(--white);
    font-size: .85rem;
}

input[type="file"] {
    max-width: 100%;
    font-size: .9rem;
}

#cover-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

#cover-preview img {
    width: 145px;
}

.notice {
    padding: 13px 17px;
    border-radius: 4px;
    background: var(--accent-light);
}

.notice.error {
    background: #f7e5e1;
}

.error-text {
    color: #8f3023;
}

dialog {
    width: min(720px, calc(100% - 2rem));
    max-height: 85vh;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    background: var(--paper);
}

dialog article {
    margin-top: 22px;
}

dialog::backdrop {
    background: #103c45a0;
}

@media (min-width: 1600px) {
    .hero {
        padding-block: 65px;
    }
}

@media (max-width: 900px) {
    .post-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .masthead-inner {
        min-height: 155px;
    }

    .brand {
        font-size: clamp(3.8rem, 11vw, 5.3rem);
    }

    .brand-description {
        font-size: .95rem;
    }

    .nav-inner {
        column-gap: 0;
    }

    .site-nav a {
        padding-inline: 13px;
    }

    .feature-panel {
        grid-template-columns: minmax(0, 1fr) 220px;
        column-gap: 28px;
        padding: 30px;
    }

    .script-heading {
        font-size: 4.6rem;
    }

    .book-cover {
        min-height: 300px;
    }

    .book-landscape {
        height: 115px;
    }

    .book-title {
        font-size: 2rem;
    }

}

@media (max-width: 580px) {
    body {
        font-size: 16px;
    }

    .shell {
        width: calc(100% - 2rem);
    }

    .masthead-inner {
        min-height: 137px;
        padding-block: 17px 20px;
    }

    .brand {
        font-size: clamp(3.5rem, 12vw, 4.9rem);
    }

    .brand-description {
        margin-top: 8px;
        font-size: .84rem;
        letter-spacing: .02em;
    }

    .nav-inner {
        width: calc(100% - 12px);
    }

    .site-nav a {
        min-height: 48px;
        padding-inline: 10px;
        font-size: .78rem;
    }

    .hero {
        padding-block: 23px;
        background-position: 56% center;
    }

    .feature-panel {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
        padding: 27px 26px 24px;
    }

    .script-heading {
        font-size: 4.4rem;
    }

    .feature-author {
        margin-block: 8px 15px;
        font-size: 1.1rem;
    }

    .contact-details > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .about-intro {
        grid-template-columns: minmax(0, 1fr) 115px;
        align-items: start;
        gap: 18px;
    }

    .photo-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .feature-copy > p:not(.feature-author) {
        line-height: 1.8;
    }

    .actions {
        gap: 12px 18px;
        margin-top: 24px;
    }

    .button,
    button {
        padding-inline: 16px;
        font-size: .83rem;
    }

    .book-preview {
        width: 195px;
    }

    .book-cover {
        min-height: 285px;
        padding-block: 17px;
    }

    .book-author {
        margin-bottom: 13px;
        font-size: .68rem;
    }

    .book-landscape {
        height: 108px;
    }

    .book-title {
        margin-block: 15px;
        font-size: 1.85rem;
    }

    .book-preview figcaption {
        margin-top: 14px;
    }

    .ruled-heading {
        gap: 15px;
        margin-bottom: 28px;
        font-size: 1.4rem;
    }

    .post-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 30px;
    }

    .footer-main {
        padding-block: 30px;
    }

    .footer-signature {
        font-size: 3.5rem;
    }

    .footer-inner nav {
        gap: 10px 22px;
    }

    .admin-page .brand {
        font-size: 1.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }

    .book-cover:hover {
        transform: none;
    }
}
