/* ============================================
   T.M. Haviland - Author Website
   Clean, maintainable CSS (replaces RapidWeaver)
   ============================================ */

/* --- CSS Variables --- */
:root {
    --color-text: #adb5bd;
    --color-text-light: #d0d0d0;
    --color-heading: #ffffff;
    --color-bg-dark: #1a1a2e;
    --color-link: #6ea8fe;
    --color-link-hover: #9ec5fe;
    --color-divider: rgba(255, 255, 255, 0.15);
    --color-overlay: rgba(0, 0, 0, 0.55);
    --font-body: 'Karla', sans-serif;
    --font-heading: 'Prata', serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-weight: 200;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg-dark);
}

/* --- Background with Parallax --- */
.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: url('../images/background.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--color-overlay);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-heading);
    margin-top: 0;
}

h2 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

h4.section-label {
    font-family: var(--font-body);
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

h6 {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

/* --- Banner --- */
.site-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1100;
    text-align: center;
    padding: 1.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.banner-title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* --- Layout --- */
.site-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 130px 1rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 1rem 0 2rem;
}

/* --- Main Content --- */
.main-content {
    min-width: 0;
}

/* --- Book Section --- */
.book-section {
    margin-bottom: 2.5rem;
}

.book-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

.book-cover {
    width: 180px;
    height: auto;
    border-radius: 4px;
}

.book-cover-link {
    display: inline-block;
}

.book-cover-link:hover .book-cover {
    opacity: 0.9;
}

.book-info p {
    margin-bottom: 0.75rem;
}

.book-tagline {
    font-size: 1.05rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.reviews {
    margin-top: 1rem;
}

.reviews p {
    font-style: italic;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

/* --- Divider --- */
.section-divider {
    border: none;
    border-top: 1px solid var(--color-divider);
    margin: 2rem 0;
}

.animated-divider {
    width: 60px;
    height: 2px;
    background: var(--color-text);
    margin: 2rem 0;
}

/* --- Sidebar --- */
.sidebar {
    min-width: 0;
}

.sidebar-section {
    margin-bottom: 2.5rem;
}

/* --- Signup Form (Mailchimp) --- */
.signup-section p {
    font-size: 0.95rem;
}

#mc_embed_signup {
    background: transparent;
    clear: left;
    font: 14px var(--font-body);
}

#mc_embed_signup .email {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-heading);
    font-size: 0.95rem;
}

#mc_embed_signup .email::placeholder {
    color: var(--color-text);
}

#mc_embed_signup .button {
    background: var(--color-link);
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

#mc_embed_signup .button:hover {
    background: var(--color-link-hover);
}

/* --- About Section --- */
.author-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.about-text {
    font-size: 0.95rem;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-light);
    font-size: 1.1rem;
    transition: background 0.2s ease, color 0.2s ease;
    text-decoration: none;
}

.social-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-heading);
    text-decoration: none;
}

/* --- Contact Form --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--color-text-light);
}

.form-group label .required {
    color: #dc3545;
}

.form-group input,
.form-group textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-heading);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-link);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.btn-submit {
    align-self: flex-start;
    padding: 0.5rem 1.5rem;
    background: var(--color-link);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: background 0.2s ease;
}

.btn-submit:hover {
    background: var(--color-link-hover);
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--color-divider);
    margin-top: 2rem;
}

.site-footer h5 {
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.btn-privacy {
    display: inline-block;
    padding: 0.25rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--color-text-light);
    font-size: 0.85rem;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-body);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-privacy:hover {
    border-color: var(--color-link);
    color: var(--color-heading);
    text-decoration: none;
}

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #2a2a3e;
    color: var(--color-text);
    border-radius: 8px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-divider);
}

.modal-header h5 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-heading);
}

.modal-body {
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body strong {
    color: var(--color-heading);
}

/* --- Honeypot (for form spam prevention) --- */
.honeycomb {
    position: absolute;
    left: -5000px;
}

/* --- Form Status Messages --- */
.form-status {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    min-height: 1.2em;
}

.form-status.success {
    color: #4ade80;
}

.form-status.error {
    color: #f87171;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .book-grid {
        grid-template-columns: 150px 1fr;
    }

    .book-cover {
        width: 150px;
    }
}

@media (max-width: 767px) {
    .book-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .book-cover {
        width: 200px;
        margin: 0 auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    h2 {
        font-size: 1.6rem;
    }
}
