/* =========================================
   GENERAL RESET
========================================= */

* {
    box-sizing: border-box;
}


/* =========================================
   WHOLE PAGE
========================================= */

body {
    margin: 0;

    background: #f7f5ef;

    color: #2b2925;

    font-family:
        Georgia,
        "Times New Roman",
        serif;
}


/* =========================================
   HEADER
========================================= */

header {
    background: #ffffff;

    border-bottom:
        1px solid #d8d2c5;

    padding:
        18px 5%;

    display: flex;

    justify-content:
        space-between;

    align-items: center;
}


.site-title {
    font-size: 22px;

    letter-spacing: 1px;

    color: #342d25;
}


/* =========================================
   NAVIGATION
========================================= */

nav {
    display: flex;

    gap: 25px;

    align-items: center;
}


nav a {
    text-decoration: none;

    color: #403a32;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;
}


nav a:hover {
    color: #9a6c32;
}


/* =========================================
   DONATE LINK
========================================= */

.donate-link {
    border:
        1px solid #a57b43;

    padding:
        9px 17px;

    border-radius: 3px;

    color: #795525;

    background: white;
}


.donate-link:hover {
    background: #a57b43;

    color: white;
}


/* =========================================
   INTRO SECTION
========================================= */

.intro {
    max-width: 800px;

    margin:
        40px auto 30px;

    padding:
        0 20px;

    text-align: center;
}


.intro h1 {
    font-size: 35px;

    font-weight: normal;

    margin-bottom: 10px;

    color: #2d2924;
}


.intro p {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    color: #69635a;

    line-height: 1.6;

    font-size: 15px;
}


/* =========================================
   READER BACKGROUND
========================================= */

.reader {
    min-height: 720px;

    padding:
        40px 10px 25px;

    background: #e6e1d7;

    border-top:
        1px solid #d2ccc0;

    border-bottom:
        1px solid #d2ccc0;

    display: flex;

    flex-direction: column;

    align-items: center;
}


/* =========================================
   BOOK
========================================= */

#book {
    margin: auto;

    filter:
        drop-shadow(
            0 12px 15px
            rgba(0,0,0,0.25)
        );
}


/* =========================================
   NORMAL BOOK PAGE
========================================= */

.book-page {
    position: relative;

    overflow: hidden;

    padding:
        45px 42px;

    background:
        linear-gradient(
            90deg,
            #ebe4d5 0%,
            #fffdf6 8%,
            #fffdf6 92%,
            #e5ddcd 100%
        );

    color: #292621;

    box-shadow:
        inset 0 0 18px
        rgba(80,60,30,0.08);
}


/* =========================================
   PAGE CONTENT
========================================= */

.page-content {
    height: 100%;

    display: flex;

    flex-direction: column;

    overflow: hidden;
}


/* =========================================
   PAGE TITLE
========================================= */

.page-title {
    font-size: 24px;

    text-align: center;

    margin-bottom: 25px;

    font-weight: normal;

    color: #332a21;
}


.page-title:not(:empty)::after {
    content: "";

    display: block;

    width: 45px;

    height: 1px;

    background: #a77e49;

    margin:
        12px auto;
}


/* Hide heading space
   when no title exists */

.page-title:empty {
    display: none;
}


/* =========================================
   PAGE TEXT
========================================= */

.page-text {
    font-size: 15px;

    line-height: 1.65;

    white-space: pre-wrap;

    color: #302d28;

    text-align: justify;
    text-align-last: left;
    hyphens: auto;
}


/* =========================================
   PAGE NUMBER
========================================= */

.page-number {
    position: absolute;

    bottom: 18px;

    left: 0;

    right: 0;

    text-align: center;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 12px;

    color: #8a8276;
}


/* =========================================
   FRONT / BACK COVER
========================================= */

.cover {
    background:
        linear-gradient(
            135deg,
            #d2b168,
            #ead399,
            #c49b50
        );

    border:
        1px solid #8c6733;

    padding: 25px;

    color: #241d15;
}


/* Make cover feel slightly
   more solid */

.cover-inner {
    height: 100%;

    width: 100%;

    border:
        4px double #8b5d2d;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    text-align: center;

    padding: 30px;
}


.cover h2 {
    font-size: 37px;

    font-weight: normal;

    margin:
        0 0 20px;

    white-space: pre-line;
}


.cover p {
    font-size: 15px;

    letter-spacing: 1px;

    color: #493b2b;
}


/* =========================================
   CONTROLS
========================================= */

.controls {
    width: 100%;

    max-width: 850px;

    margin-top: 28px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 15px;
}


.controls button {
    width: 44px;

    height: 40px;

    background: #f7f5ef;

    border:
        1px solid #aaa398;

    color: #514a41;

    font-size: 22px;

    cursor: pointer;

    border-radius: 3px;
}


.controls button:hover {
    background: white;

    border-color: #927044;

    color: #7b5728;
}


/* =========================================
   PAGE SLIDER
========================================= */

#pageSlider {
    width: 50%;

    max-width: 450px;

    accent-color: #987044;

    cursor: pointer;
}


/* =========================================
   PAGE DISPLAY
========================================= */

#pageDisplay {
    min-width: 85px;

    text-align: center;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 8px;

    color: #615b52;
}


/* =========================================
   HELP TEXT
========================================= */

.reader-help {
    margin-top: 18px;

    color: #817a70;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 12px;

    text-align: center;
}


/* =========================================
   ABOUT SECTION
========================================= */

.information {
    max-width: 800px;

    margin:
        55px auto;

    padding:
        0 25px;

    text-align: center;
}


.information h2 {
    font-size: 26px;

    font-weight: normal;

    color: #332e28;
}


.information p {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 15px;

    line-height: 1.7;

    color: #686158;

    text-align: left;
}


/* =========================================
   FOOTER
========================================= */

footer {
    border-top:
        1px solid #d8d2c5;

    background: #eeeae1;

    padding: 30px;

    text-align: center;

    color: #777066;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 12px;
}

/* =========================================
   REFERENCES PAGE
========================================= */

.references-page {
    max-width: 900px;

    margin: 60px auto;

    padding: 0 30px;
}


.references-page h1 {
    font-size: 36px;

    font-weight: normal;

    margin-bottom: 10px;
}


.references-intro {
    color: #686158;

    margin-bottom: 50px;
}


.reference-book {
    margin-bottom: 60px;
}


.reference-book h2 {
    font-size: 27px;

    font-weight: normal;

    border-bottom:
        1px solid #d8d2c5;

    padding-bottom: 10px;

    margin-bottom: 25px;
}


.reference-book ol {
    padding-left: 35px;
}


.reference-book li {
    padding-left: 8px;

    margin-bottom: 20px;

    line-height: 1.6;
}


.missing-reference {
    color: #a00000;

    font-weight: bold;
}

/* =========================================
   CITATIONS
========================================= */

.citation {
    font-size: 0.65em;

    line-height: 0;

    vertical-align: super;

    margin-left: 1px;
}


.citation a {
    color: #806536;

    text-decoration: none;

    font-weight: bold;
}


.citation a:hover {
    color: #49391f;

    text-decoration: underline;
}

/* =========================================
   INVISIBLE PAGE USED FOR
   AUTOMATIC PAGINATION
========================================= */

.page-measurer {
    position: fixed !important;

    left: -10000px;

    top: 0;

    width: 460px !important;

    height: 650px !important;

    padding:
        45px 42px;

    visibility: hidden;

    overflow: hidden;

    box-sizing: border-box;

    filter: none !important;
}


/* Important:
   the measuring content must have
   exactly the same usable height
   as the real book page */

.page-measurer .page-content {
    height: 100%;

    overflow: hidden;
}

/* =========================================
   COVER IMAGE
========================================= */

.cover-image {
    width: 40%;
    max-height: 22.5%;

    object-fit: contain;

    margin-bottom: 25px;

    border-radius: 3px;
}

/* =========================================
   BIBLE-STYLE INDEX TABS
========================================= */

.book-tab {
    position: absolute;

    width: 20px;
    height: 46px;

    background: #d5bd83;
    color: #49391f;

    border: 1px solid #9f8047;

    display: flex;
    align-items: center;
    justify-content: center;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 9px;
    font-weight: bold;

    letter-spacing: 0.5px;

    /* Turn SAG vertically */
    writing-mode: vertical-rl;
    transform: rotate(180deg);

    z-index: 100;

    box-shadow:
        inset 0 0 5px
        rgba(70, 50, 20, 0.18);
}


/* =========================================
   TAB ON LEFT EDGE
========================================= */

.book-tab-left {

    left: 0;

    border-left: none;

    border-radius:
        0 14px 14px 0;
}


/* =========================================
   TAB ON RIGHT EDGE
========================================= */

.book-tab-right {

    right: 0;

    border-right: none;

    border-radius:
        14px 0 0 14px;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 700px) {

    header {
        flex-direction: column;

        gap: 15px;
    }


    nav {
        gap: 17px;
    }


    .intro {
        margin-top: 35px;
    }


    .intro h1 {
        font-size: 29px;
    }


    .reader {
        padding:
            25px 4px;
    }


    .book-page {
        padding:
            32px 25px;
    }


    .page-text {
        font-size: 16px;

        line-height: 1.6;
    }


    .controls {
        gap: 8px;
    }


    #pageSlider {
        width: 40%;
    }

}

/* =========================================
   EVOLVING BOOK / CONTRIBUTION EXPERIENCE
========================================= */

a { color: inherit; }

.site-title-link { text-decoration: none; }

nav a[aria-current="page"] {
    color: #7b5728;
    border-bottom: 1px solid #a57b43;
    padding-bottom: 4px;
}

.intro-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    font-family: Arial, Helvetica, sans-serif;
}

.primary-action,
.secondary-action {
    display: inline-block;
    padding: 12px 19px;
    border: 1px solid #9b7440;
    border-radius: 3px;
    text-decoration: none;
    font-size: 14px;
}

.primary-action { background: #8c6637; color: white; }
.primary-action:hover { background: #76532b; }
.secondary-action { background: transparent; color: #76532b; }
.secondary-action:hover { background: #eee8dc; }

.edition-note {
    margin-top: 18px;
    font-size: 12px !important;
    letter-spacing: 0.25px;
    color: #857c70 !important;
}

.project-principles {
    padding: 74px 24px;
    background: #fbfaf6;
    border-top: 1px solid #dfd8cb;
}

.section-heading {
    max-width: 760px;
    margin: 0 auto 42px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 10px;
    color: #987044;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.section-heading h2 {
    margin: 0 0 15px;
    color: #302820;
    font-size: 31px;
    font-weight: normal;
}

.section-heading > p:last-child {
    color: #676057;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.7;
}

.principle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    max-width: 1050px;
    margin: 0 auto;
}

.principle-grid article {
    min-height: 230px;
    padding: 28px;
    background: white;
    border: 1px solid #ded7ca;
    border-radius: 4px;
    box-shadow: 0 7px 22px rgba(70, 50, 25, 0.055);
}

.principle-grid article > span {
    color: #b59a71;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    letter-spacing: 1px;
}

.principle-grid h3 {
    margin: 17px 0 11px;
    font-size: 23px;
    font-weight: normal;
}

.principle-grid p,
.humanity-statement p {
    margin: 0;
    color: #686158;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

.humanity-statement {
    max-width: 850px;
    margin: 27px auto 0;
    padding: 22px 25px;
    background: #f1ecdf;
    border-left: 3px solid #a57b43;
}

.text-link {
    color: #7b5728;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    text-decoration: none;
}

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

.contribution-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 58px 24px 80px;
}

.contribution-hero {
    max-width: 760px;
    margin-bottom: 38px;
}

.contribution-hero h1 {
    margin: 0 0 16px;
    color: #2d2924;
    font-size: 42px;
    font-weight: normal;
}

.contribution-hero > p:last-child {
    color: #686158;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.75;
}

.contribution-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.8fr);
    gap: 28px;
    align-items: start;
}

.contribution-form,
.sidebar-card {
    background: white;
    border: 1px solid #dcd5c8;
    border-radius: 5px;
    box-shadow: 0 8px 25px rgba(68, 50, 27, 0.06);
}

.contribution-form { padding: 31px; }

.form-progress {
    display: flex;
    gap: 9px;
    margin-bottom: 31px;
    color: #8c857b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.form-progress span {
    flex: 1;
    padding-bottom: 9px;
    border-bottom: 2px solid #e5dfd5;
}

.form-progress .active { color: #7b5728; border-color: #a57b43; }

.form-section { margin-bottom: 25px; }

.form-section label,
.agreement-box legend {
    display: block;
    margin-bottom: 7px;
    color: #342d25;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
}

.field-help {
    margin: 0 0 10px;
    color: #787168;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.55;
}

.form-section input,
.form-section select,
.form-section textarea,
.tracking-form input {
    width: 100%;
    border: 1px solid #bbb3a7;
    border-radius: 3px;
    background: #fffefa;
    color: #2b2925;
    font: 14px/1.55 Arial, Helvetica, sans-serif;
}

.form-section input,
.form-section select,
.tracking-form input {
    min-height: 44px;
    padding: 10px 12px;
}

.form-section textarea {
    min-height: 120px;
    padding: 12px;
    resize: vertical;
}

.form-section input:focus,
.form-section select:focus,
.form-section textarea:focus,
.tracking-form input:focus {
    outline: 2px solid rgba(165, 123, 67, 0.2);
    border-color: #9a713e;
}

.field-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    color: #938b80;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
}

.two-column-fields {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 16px;
}

.agreement-box {
    margin: 30px 0 24px;
    padding: 20px;
    border: 1px solid #d7cdbd;
    background: #f8f5ed;
}

.agreement-box legend { padding: 0 7px; }

.check-row {
    display: grid !important;
    grid-template-columns: 18px 1fr;
    gap: 11px;
    margin-bottom: 15px !important;
    font-weight: normal !important;
    line-height: 1.55;
}

.check-row input {
    margin: 3px 0 0;
    accent-color: #8c6637;
}

.agreement-note,
.privacy-line {
    color: #817970;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    line-height: 1.55;
}

.humanity-button {
    width: 100%;
    padding: 16px 22px;
    border: 1px solid #7c572d;
    border-radius: 3px;
    background: #8c6637;
    color: white;
    cursor: pointer;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
}

.humanity-button:hover { background: #755029; }
.privacy-line { margin: 11px 0 0; text-align: center; }

.form-error {
    margin-bottom: 15px;
    padding: 11px 13px;
    background: #f9e8e4;
    border-left: 3px solid #9b3b2d;
    color: #7f2e23;
    font: 13px/1.5 Arial, Helvetica, sans-serif;
}

.review-sidebar { display: grid; gap: 18px; }
.sidebar-card { padding: 24px; }

.sidebar-card h2 {
    margin: 0 0 9px;
    font-size: 23px;
    font-weight: normal;
}

.sidebar-card > p:not(.eyebrow) {
    color: #6f685f;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.review-steps {
    margin: 19px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: review-step;
}

.review-steps li {
    position: relative;
    padding: 0 0 22px 31px;
    counter-increment: review-step;
    font-family: Arial, Helvetica, sans-serif;
}

.review-steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 19px;
    bottom: 3px;
    left: 9px;
    width: 1px;
    background: #d6c9b6;
}

.review-steps li::before {
    content: counter(review-step);
    position: absolute;
    top: 0;
    left: 0;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #eee6d8;
    color: #76532b;
    text-align: center;
    font-size: 10px;
    line-height: 19px;
}

.review-steps strong,
.review-steps span { display: block; }
.review-steps strong { color: #3d362e; font-size: 13px; }

.review-steps span {
    margin-top: 4px;
    color: #817a71;
    font-size: 11px;
    line-height: 1.45;
}

.tracking-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.tracking-form button,
.secondary-button {
    border: 1px solid #a57b43;
    border-radius: 3px;
    background: white;
    color: #76532b;
    cursor: pointer;
    font: 12px Arial, Helvetica, sans-serif;
}

.tracking-form button { padding: 0 12px; }
.tracking-result { margin-top: 13px; font: 12px/1.5 Arial, Helvetica, sans-serif; }
.tracking-missing { color: #8a3b30; }

.tracking-found {
    display: flex;
    gap: 9px;
    padding: 11px;
    background: #f1ede3;
}

.tracking-found p { margin: 3px 0 0; color: #777067; }

.status-dot {
    width: 9px;
    height: 9px;
    margin-top: 3px;
    border-radius: 50%;
    background: #b28a51;
}

.evidence-card { border-left: 3px solid #a57b43; }

.pilot-notice {
    margin-top: 26px;
    padding: 15px 18px;
    background: #eee9df;
    border: 1px dashed #b6aa99;
    color: #655e55;
    font: 12px/1.55 Arial, Helvetica, sans-serif;
}

.submission-receipt { padding: 40px 20px; text-align: center; }

.submission-receipt h2 {
    margin: 8px 0 20px;
    font-size: 30px;
    font-weight: normal;
}

.submission-receipt > p:not(.eyebrow) {
    max-width: 500px;
    margin: 18px auto;
    color: #70685f;
    font: 14px/1.65 Arial, Helvetica, sans-serif;
}

.receipt-code {
    display: inline-block;
    padding: 14px 22px;
    background: #f0eadf;
    border: 1px solid #c9baa3;
    color: #3c3023;
    font: bold 24px/1.2 "Courier New", monospace;
    letter-spacing: 1.5px;
}

.secondary-button { padding: 11px 17px; }
.receipt-link { display: block; margin-top: 19px; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 900px) {
    .contribution-layout { grid-template-columns: 1fr; }
    .review-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .evidence-card { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    header { padding-left: 18px; padding-right: 18px; }
    nav { flex-wrap: wrap; justify-content: center; }
    .principle-grid,
    .two-column-fields,
    .review-sidebar { grid-template-columns: 1fr; }
    .evidence-card { grid-column: auto; }
    .project-principles { padding: 52px 18px; }
    .contribution-page { padding: 42px 14px 60px; }
    .contribution-hero h1 { font-size: 34px; }
    .contribution-form { padding: 22px 17px; }
    .form-progress { font-size: 9px; }
    .tracking-form { flex-direction: column; }
    .tracking-form button { min-height: 40px; }
}

/* Private editorial workspace */
.admin-page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0 100px; }
.admin-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 34px 0 22px; }
.admin-toolbar button, .admin-toolbar select, .decision-editor button, .decision-editor select { border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: #171717; color: #f3f0e9; padding: 11px 14px; font: inherit; }
.submission-list { display: grid; gap: 24px; }
.submission-card { border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(255,255,255,.035); padding: clamp(22px, 4vw, 42px); }
.submission-card-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.submission-card-head h2 { margin: 5px 0 0; }
.submission-card-head time { color: #aaa49a; font-size: .84rem; }
.review-field { margin: 22px 0; }
.review-field h3 { margin: 0 0 7px; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: #c9ad72; }
.review-field p { margin: 0; white-space: pre-wrap; line-height: 1.72; }
.decision-editor { display: grid; gap: 13px; margin-top: 30px; padding: 20px; border-radius: 12px; background: rgba(201,173,114,.08); }
.decision-editor label { display: grid; gap: 7px; font-weight: 600; }
.decision-editor textarea { width: 100%; resize: vertical; }
.decision-editor button { justify-self: start; background: #c9ad72; color: #17130c; border-color: #c9ad72; font-weight: 700; cursor: pointer; }
.save-state { color: #c9ad72; min-height: 1.4em; }
.empty-state, .loading-line { padding: 40px; text-align: center; color: #aaa49a; border: 1px dashed rgba(255,255,255,.15); border-radius: 12px; }
.secure-notice { border-color: rgba(201,173,114,.35); }

@media (max-width: 640px) {
    .admin-page { width: min(100% - 24px, 1180px); padding-top: 45px; }
    .submission-card-head { display: block; }
    .submission-card-head time { display: block; margin-top: 10px; }
}
