/* ==========================================================================
   The Unaltered Stream — Shared Stylesheet
   ========================================================================== */

/* --- Base --- */
body {
    background-color: #f9f7f2;
    color: #2c2c2c;
    font-family: "Georgia", serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;

    background-image: url('../images/ink_wash_accent.png');
    background-repeat: no-repeat;
    background-position: bottom 5% right -100px;
    background-size: 600px;
    background-attachment: fixed;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Hero banner (index only) --- */
.top-hero-banner {
    width: 100%;
    height: 260px;
    display: block;
    object-fit: cover;
    object-position: center;
    border-bottom: 2px solid #2c2c2c;
    filter: grayscale(100%) sepia(20%);
}

/* --- Navigation --- */
.nav {
    display: flex;
    justify-content: space-between;
    padding: 15px 40px;
    border-bottom: 1px solid #2c2c2c;
    align-items: center;
    background-color: rgba(249, 247, 242, 0.92);
    position: sticky;
    top: 0;
    z-index: 100;
}
.seal {
    background: #a52a2a;
    color: #f9f7f2;
    padding: 8px 12px;
    font-weight: bold;
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 2px;
}
.nav-links {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
}
.nav-links a {
    margin-left: 20px;
}
.nav-links a:hover {
    text-decoration: underline;
}
.nav-links a.active {
    font-weight: bold;
}

/* --- Layout --- */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.article-wrapper {
    max-width: 750px;
    margin: 0 auto;
}

/* --- Typography --- */
header {
    text-align: center;
    margin-bottom: 40px;
}
h1 {
    font-size: 3rem;
    margin: 0;
    font-weight: normal;
    border-bottom: 1px double #2c2c2c;
    padding-bottom: 10px;
}
h2 {
    font-weight: normal;
}
.subtitle {
    font-style: italic;
    margin-top: 10px;
    color: #555;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.article-content {
    font-size: 1.15rem;
    line-height: 1.8;
}
.article-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* --- Video --- */
.video-box {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 40px 0;
    background: #000;
    border: 1px solid #2c2c2c;
}
.video-box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Clickable thumbnail (used when a video can't be embedded) */
.video-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 40px 0;
    background: #000;
    border: 1px solid #2c2c2c;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
}
.video-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.25s;
}
.video-thumb:hover img {
    opacity: 0.85;
}
.video-thumb .play-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(165, 42, 42, 0.88);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}
.video-thumb:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(165, 42, 42, 1);
}
.video-thumb .play-overlay::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 14px 0 14px 22px;
    border-color: transparent transparent transparent #fff;
    margin-left: 5px;
}
.video-thumb .video-label {
    position: absolute;
    bottom: 0; left: 0;
    right: 0;
    padding: 14px 18px;
    background: linear-gradient(to top, rgba(0,0,0,0.82), rgba(0,0,0,0));
    font-family: sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
.video-thumb .video-label strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
}

/* --- Cards & Pull-outs --- */
.latest-entry-card {
    margin-top: 60px;
    padding: 30px;
    border: 1px solid #e1dfd8;
    background: rgba(255, 252, 247, 0.7);
    border-radius: 2px;
}
.latest-entry-card h3 {
    margin: 0 0 10px 0;
    font-family: sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #a52a2a;
}

.view-writings-btn {
    color: #a52a2a;
    font-weight: bold;
    display: inline-block;
    margin-top: 15px;
}
.view-writings-btn:hover {
    text-decoration: underline;
}

.principle-box {
    background: #fffdf9;
    border: 1px solid #d1cfc8;
    padding: 25px;
    margin: 30px 0;
    font-style: italic;
    border-left: 5px solid #a52a2a;
}

.sidebar-note {
    float: right;
    width: 250px;
    margin-left: 30px;
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #d1cfc8;
    background: #fff;
    font-size: 0.95rem;
}

/* --- Story cards (lineage stories) --- */
.story-section {
    margin-top: 60px;
    border-top: 2px solid #2c2c2c;
    padding-top: 40px;
}
.story-section-label {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1rem;
    color: #555;
    margin-bottom: 30px;
}
.story-card {
    background: #fffdf9;
    border: 1px solid #d1cfc8;
    padding: 40px;
    margin-bottom: 60px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
}
.story-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.story-date {
    font-family: sans-serif;
    font-size: 0.75rem;
    color: #a52a2a;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.story-card h2 {
    margin: 10px 0 0 0;
}
.story-card p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: justify;
    line-height: 1.8;
}

/* --- Writings index --- */
.writing-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e1dfd8;
}
.writing-section h2 {
    color: #a52a2a;
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.writing-section p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.read-link {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: bold;
    color: #2c2c2c;
}
.read-link:hover {
    text-decoration: underline;
}

/* --- Full article layout (e.g., Real Cost essay) --- */
.essay {
    max-width: 750px;
    margin: 0 auto;
    padding: 40px 20px;
}
.essay h1 {
    font-family: 'Arial', sans-serif;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 10px;
    border-bottom: none;
    padding-bottom: 0;
    text-align: left;
}
.essay .author-date {
    font-style: italic;
    color: #666;
    margin-bottom: 40px;
    border-bottom: 1px solid #e0ddd5;
    padding-bottom: 10px;
}
.essay h2, .essay h3 {
    font-family: 'Arial', sans-serif;
    margin-top: 40px;
    color: #1a1a1a;
}
.essay p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
}
.essay blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    background-color: #f0eee7;
    border-left: 5px solid #d4cfc1;
    font-style: italic;
    font-size: 1.1rem;
}
.essay table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-family: 'Arial', sans-serif;
    background: white;
}
.essay th, .essay td {
    text-align: left;
    padding: 12px;
    border: 1px solid #d4cfc1;
}
.essay th {
    background-color: #e0ddd5;
}

.footer-nav {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 2px solid #1a1a1a;
    font-family: 'Arial', sans-serif;
    text-transform: uppercase;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
}
.footer-nav a {
    color: #1a1a1a;
    font-weight: bold;
}

/* --- Photos --- */
.photo-figure {
    margin: 40px 0;
    text-align: center;
}
.photo-figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: 1px solid #d1cfc8;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}
.photo-figure figcaption {
    margin-top: 12px;
    font-size: 0.9rem;
    font-style: italic;
    color: #555;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

/* Portrait on the opening of a page — sits beside intro text */
.portrait-lead {
    float: right;
    width: 240px;
    margin: 0 0 20px 30px;
    border: 1px solid #d1cfc8;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}

/* Same, but with a caption below (figure wrapper) */
.portrait-lead-figure {
    float: right;
    width: 240px;
    margin: 0 0 20px 30px;
}
.portrait-lead-figure img {
    width: 100%;
    display: block;
    border: 1px solid #d1cfc8;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}
.portrait-lead-figure figcaption {
    margin-top: 10px;
    font-size: 0.85rem;
    font-style: italic;
    color: #555;
    line-height: 1.4;
    text-align: left;
}

/* Gallery grid at bottom of page */
.gallery {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #2c2c2c;
}
.gallery-label {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1rem;
    color: #555;
    margin-bottom: 30px;
    text-align: center;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}
.gallery-grid figure {
    margin: 0;
}
.gallery-grid img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    object-position: center top;
    border: 1px solid #d1cfc8;
    display: block;
}
.gallery-grid figcaption {
    margin-top: 10px;
    font-size: 0.85rem;
    font-style: italic;
    color: #555;
    line-height: 1.4;
}

/* --- Contact form --- */
.contact-form {
    max-width: 600px;
    margin: 40px auto 0;
}
.contact-form .form-row {
    margin-bottom: 22px;
}
.contact-form label {
    display: block;
    font-family: sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #555;
    margin-bottom: 6px;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    font-family: "Georgia", serif;
    font-size: 1rem;
    background: #fffdf9;
    border: 1px solid #d1cfc8;
    border-radius: 2px;
    box-sizing: border-box;
    color: #2c2c2c;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #a52a2a;
    background: #fff;
}
.contact-form textarea {
    min-height: 160px;
    resize: vertical;
    line-height: 1.5;
}
.contact-form .hp-field {
    /* Honeypot — hidden from humans, bots fill it */
    position: absolute;
    left: -5000px;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.contact-form button {
    background: #a52a2a;
    color: #f9f7f2;
    font-family: sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 28px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.2s;
}
.contact-form button:hover {
    background: #822020;
}
.contact-intro {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #444;
}

/* --- Page footer --- */
footer.page-footer {
    text-align: center;
    padding: 80px 0 40px;
    font-size: 0.8rem;
    opacity: 0.5;
    letter-spacing: 1px;
}

/* --- Mobile --- */
@media (max-width: 700px) {
    .nav {
        padding: 12px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .nav-links a {
        margin-left: 0;
        margin-right: 14px;
    }
    h1 { font-size: 2rem; }
    .essay h1 { font-size: 1.75rem; }
    .essay table { font-size: 0.85rem; }
    .story-card { padding: 25px; }
    .sidebar-note {
        float: none;
        width: auto;
        margin: 0 0 20px 0;
    }
    .portrait-lead {
        float: none;
        width: 60%;
        max-width: 240px;
        margin: 0 auto 20px auto;
        display: block;
    }
    .portrait-lead-figure {
        float: none;
        width: 70%;
        max-width: 260px;
        margin: 0 auto 25px auto;
    }
    .portrait-lead-figure figcaption {
        text-align: center;
    }
    .gallery-grid img {
        height: 220px;
    }
    body {
        background-size: 400px;
        background-position: bottom 5% right -80px;
    }
}
