@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Source+Code+Pro:wght@400;600&family=Caveat:wght@400;700&family=Permanent+Marker&family=Raleway:ital,wght@0,400;0,500;1,400;1,500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #474747;
    color: #d4d4d4;
    font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', serif;
    font-size: 16px;
    line-height: 1.6;
}

#page {
    max-width: 960px;
    margin: 0 auto;
    background-color: #474747;
    min-height: 100vh;
}

/* Navigation Bar */
#nav-bar {
    background-color: #2a2a2a;
    padding: 12px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

#nav-bar a {
    color: #eeeeee;
    text-decoration: none;
    font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', serif;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    transition: color 0.2s;
}

#nav-bar a:hover {
    color: #ff7722;
}

#nav-bar a.active {
    color: #ffffff;
}

/* Header / Title Area */
#site-header {
    text-align: center;
    padding: 84px 20px 20px;
    background-color: #474747;
}

#site-header h1 {
    font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', serif;
    font-size: 72px;
    font-weight: 700;
    color: #d4d4d4;
    line-height: 1.1;
    margin-bottom: 0;
    letter-spacing: 2px;
}

#site-header h1 a {
    color: inherit;
    text-decoration: none;
}

#site-header .subtitle {
    font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', serif;
    font-size: 22px;
    color: #999;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 8px;
}

#site-header .author {
    font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', serif;
    font-size: 18px;
    color: #999;
    margin-top: 20px;
    font-style: italic;
}

/* Main Content */
#content {
    padding: 30px 60px 60px;
}

/* Homepage */
.intro {
    max-width: 700px;
    margin: 0 auto 40px;
    text-align: center;
    font-size: 15px;
    color: #999;
    line-height: 1.8;
}

.intro p {
    margin-bottom: 12px;
}

/* Dedication */
.dedication {
    text-align: center;
    font-style: italic;
    color: #999;
    margin: 30px auto;
    max-width: 500px;
    padding: 20px;
    border-top: 1px solid #666;
    border-bottom: 1px solid #666;
}

.dedication p {
    margin-bottom: 4px;
}

/* Rules Section */
.rules {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #474747;
    border-radius: 4px;
}

.rules-image {
    display: block;
    width: 100%;
    height: auto;
}

/* Table of Contents */
.toc {
    margin: 30px auto;
    max-width: 700px;
}

.toc h2 {
    font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', serif;
    font-size: 32px;
    margin-bottom: 20px;
    color: #d4d4d4;
    border-bottom: 2px solid #ff7722;
    padding-bottom: 10px;
}

.toc ul {
    list-style: none;
    padding: 0;
}

.toc li {
    padding: 8px 0;
    border-bottom: 1px solid #5a5a5a;
}

.toc li:last-child {
    border-bottom: none;
}

.toc a {
    color: #ff7722;
    text-decoration: none;
    font-size: 17px;
    transition: color 0.2s;
}

.toc a:hover {
    color: #cc5500;
}

.toc-note {
    margin-top: 16px;
    font-style: italic;
    color: #999;
}

/* Download Section */
.downloads {
    float: right;
    width: 240px;
    margin: 0 0 20px 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #5a5a5a;
}

.downloads h3 {
    font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', serif;
    font-size: 16px;
    margin-bottom: 12px;
    color: #d4d4d4;
}

.downloads a {
    color: #ff7722;
    text-decoration: none;
}

.downloads a:hover {
    color: #cc5500;
}

/* Chapter Page */
.chapter-nav {
    text-align: center;
    padding: 16px 0;
    border-bottom: 2px solid #5a5a5a;
    margin-bottom: 30px;
}

.chapter-nav select {
    font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', serif;
    font-size: 14px;
    padding: 6px 12px;
    border: 1px solid #666;
    background: #3a3a3a;
    color: #d4d4d4;
    margin: 0 10px;
}

.chapter-nav a {
    color: #ff7722;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    padding: 0 8px;
}

.chapter-nav a:hover {
    color: #cc5500;
}

.chapter-nav .disabled {
    color: #666;
    pointer-events: none;
}

.chapter-title {
    font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', serif;
    font-size: 36px;
    text-align: center;
    margin: 30px 0 10px;
    color: #d4d4d4;
    line-height: 1.3;
}

.chapter-ornament {
    text-align: center;
    font-size: 28px;
    color: #ff7722;
    font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols", serif;
    font-variant-emoji: text;
    margin: 16px 0 30px;
}

/* Story Content */
.story-content {
    max-width: 700px;
    margin: 0 auto;
}

.story-content p {
    margin-bottom: 14px;
    text-align: justify;
    text-indent: 0;
}

.story-content p.center {
    text-align: center;
}

/* Three-dot scene break: one extra line of space above and below */
.story-content p.scene-break {
    margin-top: calc(14px + 1.6em);
    margin-bottom: calc(14px + 1.6em);
    letter-spacing: 0.8em;
    /* offset the trailing letter-spacing so the dots stay centered */
    padding-left: 0.8em;
}

.story-content em {
    font-style: italic;
}

.story-content strong {
    font-weight: bold;
}

.story-content a {
    color: #ff7722;
}

.story-content a:hover {
    color: #cc5500;
}

.story-content hr {
    border: none;
    border-top: 1px solid #666;
    margin: 30px auto;
    max-width: 200px;
}

.update-note {
    max-width: 700px;
    margin: 30px auto 0;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #5a5a5a;
    text-align: center;
    font-style: italic;
    color: #999;
}

.update-note p {
    margin: 0;
}

/* Chapter bottom nav */
.chapter-nav-bottom {
    text-align: center;
    padding: 30px 0;
    border-top: 2px solid #5a5a5a;
    margin-top: 40px;
}

.chapter-nav-bottom a {
    color: #ff7722;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    padding: 0 8px;
}

.chapter-nav-bottom a:hover {
    color: #cc5500;
}

.chapter-nav-bottom .disabled {
    color: #666;
    pointer-events: none;
}

/* Footer */
#site-footer {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #777;
    border-top: 1px solid #5a5a5a;
    margin-top: 40px;
}

#site-footer a {
    color: #ff7722;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    #content {
        padding: 20px 24px 40px;
    }

    #site-header h1 {
        font-size: 42px;
    }

    #site-header .subtitle {
        font-size: 16px;
    }

    .chapter-title {
        font-size: 26px;
    }

    .downloads {
        float: none;
        width: 100%;
        margin: 0 0 20px;
    }

    .story-content p {
        text-align: left;
    }

    #nav-bar a {
        font-size: 11px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    #site-header h1 {
        font-size: 32px;
    }

    .chapter-title {
        font-size: 22px;
    }

    #content {
        padding: 16px 16px 30px;
    }
}

/* === Special Text Styles === */

/* Epigraph - rooftop flashback dialogues at chapter openings */
.epigraph {
    border-left: 3px solid rgba(255, 119, 34, 0.4);
    padding: 10px 20px;
    margin: 0 auto 10px;
    max-width: 650px;
}

.epigraph .timestamp {
    font-variant: small-caps;
    color: #888;
    letter-spacing: 1.5px;
    font-size: 14px;
    margin-bottom: 8px;
}

.epigraph p {
    font-family: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #b8b8b8;
}

/* Text messages / SMS */
.text-message {
    font-family: 'Source Code Pro', 'Courier New', monospace;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid #5a5a5a;
    padding: 6px 14px;
    margin: 10px 0 10px 20px;
    max-width: 480px;
    color: #c8c8c8;
}

.text-message strong {
    font-weight: 400;
}

/* Journal / handwritten entries */
.journal-entry {
    font-family: 'Caveat', cursive;
    font-size: 22px;
    line-height: 1.5;
    color: #c4b896;
    padding: 4px 16px;
    margin: 6px 0;
}

.journal-entry em {
    font-style: normal;
}

/* Conor's handwriting: Moreton, a font made by the author. Other characters keep Caveat. */
@font-face {
    font-family: 'Moreton';
    src: url('fonts/MoretonSmartFont.otf') format('opentype');
    font-display: swap;
}

.journal-entry.conor {
    font-family: 'Moreton', 'Caveat', cursive;
}

/* Board / whiteboard text */
.board-text {
    font-family: 'Permanent Marker', cursive;
    font-size: 18px;
    color: #e0d8c8;
    letter-spacing: 1px;
}

/* Sign / banner text */
.sign-text {
    font-family: 'Permanent Marker', cursive;
    color: #ff7722;
}

/* Intercom / PA announcement text */
.announcement {
    font-family: 'Source Code Pro', monospace;
    font-size: 14px;
    color: #aaa;
}

/* Comments section */
.comments-section {
    max-width: 700px;
    margin: 40px auto 0;
    padding-top: 30px;
    border-top: 2px solid #5a5a5a;
}

.comments-section h3 {
    font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', serif;
    font-size: 20px;
    color: #d4d4d4;
    margin-bottom: 16px;
}

.comment-form input,
.comment-form textarea,
.admin-login input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid #5a5a5a;
    border-radius: 4px;
    color: #d4d4d4;
    font-family: inherit;
    font-size: 15px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.comment-form input:focus,
.comment-form textarea:focus,
.admin-login input:focus {
    outline: none;
    border-color: #ff7722;
}

.comment-form textarea {
    resize: vertical;
    min-height: 80px;
}

.comment-form button,
.admin-login button {
    background: #ff7722;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 24px;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
}

.comment-form button:hover,
.admin-login button:hover {
    background: #e5691f;
}

.comment-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spam trap: kept off-screen so people never fill it in; bots do */
.comment-form .hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.comments-list {
    margin-top: 30px;
}

.comment {
    border-left: 3px solid #5a5a5a;
    padding: 10px 16px;
    margin-bottom: 16px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.comment-author {
    color: #ff7722;
    font-size: 15px;
}

.comment-date {
    color: #888;
    font-size: 13px;
}

.comment-body {
    color: #c0c0c0;
    font-size: 15px;
    line-height: 1.5;
}

.no-comments {
    color: #888;
    font-style: italic;
}

/* Tip / PayPal button */
.tip-section {
    text-align: center;
    margin-bottom: 30px;
}

.tip-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 1px solid #6a6a6a;
    border-radius: 6px;
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 0.3px;
    transition: border-color 0.2s, color 0.2s;
}

.tip-button:hover {
    border-color: #999;
    color: #d4d4d4;
}

.paypal-icon {
    opacity: 0.5;
}

.tip-button:hover .paypal-icon {
    opacity: 0.75;
}

/* Author badge on comments */
.author-badge {
    display: inline-block;
    background: rgba(255, 119, 34, 0.15);
    color: #ff7722;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.comment-author-reply {
    border-left-color: #ff7722;
}

/* Admin controls */
.admin-notice {
    background: rgba(255, 119, 34, 0.1);
    border: 1px solid rgba(255, 119, 34, 0.3);
    color: #ff7722;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
}

.admin-notice a {
    color: inherit;
    margin-left: 6px;
}

.admin-login {
    margin-bottom: 24px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-delete {
    background: none;
    border: 1px solid #5a5a5a;
    color: #888;
    font-size: 16px;
    line-height: 1;
    padding: 2px 7px;
    border-radius: 3px;
    cursor: pointer;
}

.comment-delete:hover {
    border-color: #c44;
    color: #c44;
}

@media (max-width: 768px) {
    .epigraph {
        padding: 8px 14px;
    }

    .text-message {
        margin-left: 10px;
        max-width: 100%;
    }

    .journal-entry {
        font-size: 20px;
        padding: 4px 10px;
    }
}
