/* Variables */
:root {
  --brand-red: #8B0000;
  --ink-black: #1A1A1A;
  --paper-white: #F9F7F2;
  --soft-gray: #E0E0E0;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Georgia', serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Layout and Typography */
body {
  background-color: var(--paper-white);
  color: var(--ink-black);
  font-family: var(--font-body);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--brand-red);
  font-weight: 700;
}

a {
  color: var(--brand-red);
  text-decoration: underline;
  transition: opacity 0.3s;
}

a:hover { opacity: 0.7; }

/* Buttons, Container, and Navigation */
.btn-primary {
  background-color: var(--brand-red);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-heading);
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: var(--paper-white);
    border-bottom: 1px solid var(--soft-gray);
    flex-wrap: wrap;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Search Bar */
.search-container {
    padding: 10px 5%;
    background: var(--paper-white);
    display: flex;
    justify-content: center;
}

.search-bar {
    width: 100%;
    border: 2px solid var(--soft-gray);
    max-width: 600px;
    border: 2px solid var(--soft-gray);
    padding: 10px 45px 10px 20px;
    border-radius: 25px;
    font-family: var(--font-body);
    background-color: white;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-wrapper::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    /* This is a white SVG magnifying glass */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-search' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Logo specific styling */
.nav-logo-img {
    height: 50px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.nav-logo-img:hover { transform: scale(1.05); }

.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.hero-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 30px 0;
}

.hero-logo {
    width: 800px;
    max-width: 80%;
    height: auto;
    max-height: 800px;
    display: block;
}

.hero-text {
    text-align: justify;
    text-justify: inter-word;
    text-align-last: center;
    margin: 20px auto;
    max-width: 800px;
    padding: 0 10px;
    letter-spacing: 0.01em;
}

.hero-text h1 { text-align: center; margin-bottom: 20px; }
.hero-text p { margin-bottom: 30px; }

/* Layout for the About Page */
.about-layout {
    display: flex;
    gap: 0;
    align-items: flex-start;
    justify-content: center;
}

.about-layout:has(.sidebar-nav:empty) {
    gap: 0;
}

/* Sidebar Styling */
.sidebar-nav {
    flex: 0 0 250px;
    position: sticky;
    top: 120px;
}

.sidebar-nav:empty {
    display: none;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    border-left: 2px solid var(--soft-gray);
}

.sidebar-nav li {
    margin-bottom: 15px;
    padding-left: 20px;
}

.sidebar-nav a {
    text-decoration: none;
    color: var(--ink-black);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    transition: color 0.3s;
}

/* Content Styling */
.content-area {
    flex: 1;
    text-align: justify;
    text-justify: inter-word;
    text-align-last: left;
    max-width: 800px;
    margin: 0;
    width: 100%;
}

hr {
    border: 0;
    border-top: 1px solid var(--soft-gray);
    margin: 40px 0;
}

/* Scripture Quote Styling */
.scripture {
    font-style: italic;
    border-left: 4px solid var(--brand-red);
    padding: 20px 40px;
    margin: 30px 0;
    background: rgba(139, 0, 0, 0.05);
}

.scripture span {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    font-style: normal;
}

/* Sidebar Dropdown Styling */
.has-dropdown > a { font-weight: bold; }

.dropdown-menu {
    display: none; 
    list-style: none;
    padding-left: 20px;
    margin-top: 0px;
    border-left: 1px solid var(--brand-red);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.dropdown-menu.show { 
    display: block !important; 
    margin-top: 10px;
    visibility: visible;
    opacity: 1;
}
.rotate-caret { transform: rotate(180deg); }
.caret { display: inline-block; transition: transform 0.3s ease; }

/* Book Preview Card Styling */
.book-preview-card {
    background: #ffffff;
    border: 1px solid var(--soft-gray);
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.name-content-wrapper {
    display: flex;
    gap: 25px;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    width: 100%;
}

.image-gallery {
    flex: 0 0 35%;
    min-width: 250px;
    max-width: 400px;
}

.slider-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--soft-gray);
    line-height: 0;
    aspect-ratio: 3 / 4;
}

.slider-stage {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
    height: auto;
    display: block;
}

.thumbnail-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
}

.thumb.active { border-color: var(--brand-red); }

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 12px 8px;
    cursor: pointer;
    z-index: 5;
    font-size: 18px;
}

.prev { left: 0; border-radius: 0 4px 4px 0; }
.next { right: 0; border-radius: 4px 0 0 4px; }

.about-inline-img {
    width: 150px;
    height: auto;
    display: block;
    margin: 0;
    border-radius: 4px;
}

.symbolism-img {
    max-width: 100%;
    width: 900px;
    height: auto;
    display: block;
    border-radius: 4px;
}

.symbolism-image-container {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    padding: 20px 0;
}

.name-text {
    flex: 1;
    min-width: 0;
}

.book-specs {
    background: var(--paper-white);
    padding: 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 20px;
}

/* BLOG GRID DIRECTORY */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.blog-card {
    background: #ffffff;
    border: 1px solid var(--soft-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.blog-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--soft-gray);
}

.blog-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-content h2 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 10px;
}

.blog-card-content p {
    font-size: 0.95rem;
    color: var(--ink-black);
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more {
    font-family: var(--font-heading);
    font-weight: bold;
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--brand-red);
}

/* JOURNAL CONTENT STYLING */
.hanging-indent {
    padding-left: 30px !important;
    text-indent: -30px !important;
    margin-bottom: 15px;
    line-height: 1.6;
    text-align: left;
    text-align-last: left;
}

.post-featured-image {
    float: left;
    width: 300px;
    margin-right: 25px;
    margin-bottom: 10px;
    margin-top: 10px;
    max-width: 400px;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--soft-gray);
}

.content-area::after {
    content: "";
    display: table;
    clear: both;
}

/* --- MEDIA QUERIES --- */

@media (max-width: 850px) {
    .about-layout { flex-direction: column; }
    .sidebar-nav {
        position: static;
        flex: none;
        width: 100%;
        margin-bottom: 10px;
        height:auto;
    }
    .sidebar-nav ul {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        border-left: none;
        border-bottom: 2px solid var(--soft-gray);
        padding-bottom: 15px;
        margin-bottom: 0;
    }
    .sidebar-nav li {
        padding-left: 0;
        margin-bottom: 5px;
        width: 100%;
    }
    .has-dropdown {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    .dropdown-menu {
        display: none !important;
        width: 100%;
        margin: 0;
        padding: 0;
        text-align: left;
        border-left: 1px solid var(--brand-red);
        border-top: none;
    }
    .dropdown-menu.show {
        display: block !important;
        margin-top: 10px;
        padding-left: 20px;
    }
}

@media (max-width: 768px) {
    .name-content-wrapper, .name-content-wrapper.gallery-layout {
        flex-direction: column !important;
        align-items: center;
        text-align: center;
        width: 100%;
    }
    .image-gallery {
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .name-text p {
        text-align: justify;
        text-align-last: center;
    }
    .book-specs {
        width: 100%;
        padding: 15px;
        margin: 20px 0 0 0;
        text-align: left;
    }
    .post-featured-image {
        float: none;
        margin: 0 auto 20px auto;
        max-width: 100%;
        text-align: center;
    }
    .post-featured-image img {
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 600px) {
    .blog-grid { grid-template-columns: 1fr; }
    .symbolism-image-container { justify-content: center; }
    .symbolism-img, .about-inline-img { width: 100%; max-width: 200px; }
    .content-area {
        padding: 0 20px !important;
        overflow-x: hidden;
    }
}

/* Contact Form Styling */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: var(--font-heading);
    font-weight: bold;
    color: var(--brand-red);
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--soft-gray);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
    background-color: #fff;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 5px rgba(139, 0, 0, 0.1);
}

.contact-form .btn-primary {
    align-self: flex-start;
    padding: 12px 30px;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.contact-form .btn-primary:hover {
    background-color: #660000;
}

/* Mobile Tweak for Form */
@media (max-width: 600px) {
    .contact-form .btn-primary {
        width: 100%; /* Full width button on phones */
    }
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--brand-red);
    background: white;
    cursor: pointer;
}

.pagination button.active {
    background: var(--brand-red);
    color: white;
}