:root {
    color-scheme: light;
}

::selection {
    background: rgba(200, 169, 107, 0.35);
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

a,
button,
input,
select,
textarea {
    transition-duration: 180ms;
    transition-property: background-color, border-color, color, box-shadow, opacity, transform;
    transition-timing-function: ease;
}

.border,
input,
select,
textarea,
button {
    border-radius: 0.375rem;
}

.reveal {
    opacity: 0;
    transform: translateY(46px) scale(0.975);
    transition: opacity 920ms cubic-bezier(0.22, 1, 0.36, 1), transform 920ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.admin-images-page .reveal {
    opacity: 1;
    transform: none;
    transition-delay: 0ms;
}

.hero-reveal {
    animation: heroFadeUp 1050ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-reveal-delay {
    animation: heroImageIn 1200ms cubic-bezier(0.22, 1, 0.36, 1) 180ms both;
}

.float-soft {
    animation: floatSoft 6s ease-in-out infinite;
}

.interactive-lift {
    will-change: transform;
}

.interactive-lift:hover {
    box-shadow: 0 22px 52px rgba(15, 39, 64, 0.16);
    transform: translateY(-8px);
}

.article-content img,
.hero-image {
    transition: transform 600ms ease, filter 600ms ease;
}

a:hover .hero-image,
.article-content img:hover {
    transform: scale(1.015);
}

@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(36px) scale(0.98);
    }

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

@keyframes heroImageIn {
    from {
        opacity: 0;
        transform: translateX(34px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes floatSoft {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.nav-link {
    position: relative;
    width: fit-content;
}

.nav-link::after {
    background: #C8A96B;
    bottom: -6px;
    content: "";
    height: 2px;
    left: 0;
    position: absolute;
    transform: scaleX(0);
    transform-origin: left;
    width: 100%;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
    transform: scaleX(1);
}

.article-content {
    color: #27323A;
    font-size: 1.0625rem;
    line-height: 1.9;
}

.article-content p,
.article-content blockquote,
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content pre {
    margin-left: auto;
    margin-right: auto;
    max-width: 1100px;
}

.article-content h1 {
    color: #0F2740;
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
    margin-top: 3rem;
}

.article-content h2 {
    color: #163A59;
    font-size: clamp(1.55rem, 2.3vw, 2.15rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    margin-top: 2.8rem;
}

.article-content h3 {
    color: #0F2740;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.35;
    margin-top: 2rem;
}

.article-content h4 {
    color: #163A59;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.45;
    margin-top: 1.6rem;
}

.article-content blockquote {
    border-left: 4px solid #C8A96B;
    color: #163A59;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.45;
    margin-bottom: 2rem;
    margin-top: 2rem;
    padding-left: 1.25rem;
}

.article-content ul,
.article-content ol {
    margin: 1.3rem auto;
    max-width: 1100px;
    padding-left: 1.4rem;
}

.article-content ul {
    list-style: disc;
}

.article-content ol {
    list-style: decimal;
}

.article-content li {
    margin-top: 0.55rem;
    padding-left: 0.2rem;
}

.article-content a {
    color: #163A59;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: #C8A96B;
    text-underline-offset: 4px;
}

.article-content figure {
    margin: 2rem auto;
    max-width: 1100px;
}

.article-content img {
    border-radius: 0.375rem;
    box-shadow: 0 18px 45px rgba(15, 39, 64, 0.10);
    height: auto;
    margin: 2rem auto;
    max-width: 100%;
}

.article-content figcaption {
    color: #8B8F97;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0.75rem auto 0;
    max-width: 1100px;
    text-align: center;
}

.article-content strong,
.article-content b {
    color: #163A59;
    font-weight: 800;
}

.article-content pre {
    background: #0F2740;
    border-radius: 0.375rem;
    color: #F7F2EA;
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    margin-top: 2rem;
    overflow-x: auto;
    padding: 1.1rem 1.25rem;
}

.article-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.article-content p code,
.article-content li code {
    background: rgba(22, 58, 89, 0.08);
    border-radius: 0.25rem;
    color: #163A59;
    padding: 0.12rem 0.32rem;
}

.article-content .ql-align-center {
    text-align: center;
}

.article-content .ql-align-right {
    text-align: right;
}

.article-content .ql-align-justify {
    text-align: justify;
}

.article-content .ql-indent-1 {
    padding-left: 3em;
}

.article-content .ql-indent-2 {
    padding-left: 6em;
}

.article-content .ql-indent-3 {
    padding-left: 9em;
}

.article-content .ql-indent-4 {
    padding-left: 12em;
}

.article-content .ql-indent-5 {
    padding-left: 15em;
}

.article-content .ql-indent-6 {
    padding-left: 18em;
}

.article-content .ql-indent-7 {
    padding-left: 21em;
}

.article-content .ql-indent-8 {
    padding-left: 24em;
}

#richEditor {
    min-height: 430px;
}

#richEditor .ql-editor {
    color: #27323A;
    font-size: 1rem;
    line-height: 1.8;
    min-height: 390px;
}

.ql-toolbar.ql-snow,
.ql-container.ql-snow {
    border-color: rgba(22, 58, 89, 0.15);
}

.ql-toolbar.ql-snow {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 0.375rem 0.375rem 0 0;
    box-shadow: 0 14px 30px rgba(15, 39, 64, 0.08);
    position: sticky;
    top: 78px;
    z-index: 30;
}

.ql-container.ql-snow {
    border-radius: 0 0 0.375rem 0.375rem;
}

.ql-toolbar.ql-snow .ql-formats {
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.hero-image {
    background: #D8CBB8;
    object-fit: cover;
}

.cm-day-cell {
    align-items: flex-start;
    aspect-ratio: 1 / 1;
    background: rgba(247, 242, 234, 0.78);
    border: 1px solid rgba(22, 58, 89, 0.08);
    color: #8B8F97;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 58px;
    padding: 0.45rem;
    text-align: left;
    width: 100%;
}

.cm-day-active {
    background: #FFFFFF;
    color: #163A59;
    cursor: pointer;
}

.cm-day-active:hover,
.cm-day-selected {
    border-color: #C8A96B;
    box-shadow: inset 0 0 0 1px #C8A96B;
    transform: translateY(-1px);
}

.cm-day-empty {
    background: transparent;
    border-color: transparent;
}

.cm-event-marker {
    background: #C8A96B;
    border-radius: 999px;
    display: inline-block;
    height: 0.42rem;
    width: 0.42rem;
}

textarea {
    min-height: 360px;
}

.comment-form textarea {
    min-height: 120px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 767px) {
    #mainMenu.open {
        display: block;
    }
}

.article-toc-wrapper {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(22, 58, 89, 0.10);
    border-radius: 0.375rem;
    margin-bottom: 2.5rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 760px;
    padding: 1.5rem;
}

.article-toc-title {
    color: #C8A96B;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.toc-list,
.toc-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-item a {
    color: #163A59;
    display: inline-block;
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.35rem 0;
    text-decoration: none;
    transition: color 180ms ease;
}

.toc-item a:hover {
    color: #C8A96B;
}

.toc-h2 > a {
    font-size: 1rem;
    font-weight: 800;
}

.toc-sublist {
    padding-left: 1.1rem;
}

.toc-h3 a {
    color: #27323A;
    font-size: 0.9rem;
    font-weight: 600;
}

@media (min-width: 1024px) {
    .article-toc-wrapper {
        margin-bottom: 3rem;
        padding: 1.75rem;
    }
}

/* === Article typography v2 === */
.article-content > p + p {
    margin-top: 1.1em;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    scroll-margin-top: 96px;
}

.article-content figure.full-bleed {
    margin-left: 50%;
    margin-right: auto;
    max-width: 100vw;
    transform: translateX(-50%);
    width: 100vw;
}

@media (min-width: 1024px) {
    .article-content figure.full-bleed {
        max-width: 1240px;
    }
}

.article-content table {
    border-collapse: collapse;
    display: block;
    font-size: 0.95rem;
    margin: 2rem auto;
    max-width: 100%;
    overflow-x: auto;
    width: 100%;
}

.article-content th,
.article-content td {
    border: 1px solid rgba(22, 58, 89, 0.15);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.article-content th {
    background: rgba(22, 58, 89, 0.06);
    font-weight: 700;
}

.toc-active {
    border-left: 3px solid #C8A96B;
    color: #C8A96B !important;
    margin-left: -0.85rem;
    padding-left: 0.6rem;
    transition: all 200ms ease;
}

.article-layout-toc {
    align-items: start;
}

@media (min-width: 1024px) {
    .article-layout-toc {
        grid-template-columns: 260px minmax(0, 1fr);
    }
}

.show-from-lg {
    display: none;
}

@media (min-width: 1024px) {
    .show-from-lg {
        display: block;
    }
}

.wrap-on-sm {
    flex-wrap: wrap;
}

.flash-message {
    transition: max-height 400ms ease, opacity 400ms ease, margin 400ms ease;
    max-height: 200px;
    overflow: hidden;
    opacity: 1;
}

.flash-message.flash-dismiss {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    pointer-events: none;
}

#readingProgress {
    transition: width 80ms linear;
    width: 0;
}

#backToTop {
    transition: opacity 220ms ease, transform 220ms ease;
}

#backToTop.is-visible {
    display: inline-flex;
    opacity: 1;
    transform: translateY(0);
}

#backToTop:not(.is-visible) {
    display: none;
    opacity: 0;
    transform: translateY(8px);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal,
    .reveal.is-visible,
    .hero-reveal,
    .hero-reveal-delay,
    .float-soft,
    .interactive-lift,
    .interactive-lift:hover,
    a:hover .hero-image,
    .article-content img:hover {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .toc-active,
    #readingProgress,
    #backToTop {
        transition: none;
    }
}
