/* ============================================================
   JD Alcott — Author Site Styles
   ============================================================ */

/* --- Variables --- */
:root {
    --font-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    --font-sans: 'Lato', 'Helvetica Neue', Arial, sans-serif;
    --primary-color: #3d5a3e;
    --secondary-color: #6b4c3b;
    --text-color: #2d2d2d;
    --light-text-color: #5a5a5a;
    --bg-color: #f7f4ef;
    --container-bg: #ffffff;
    --border-color: #ddd8d0;
    --base-font-size: 16px;
    --line-height: 1.7;
    --spacing-unit: 1rem;
}

/* --- Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: var(--base-font-size);
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* --- Layout --- */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* --- Typography --- */
h1, h2 {
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    line-height: 1.3;
}

h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
}

p {
    margin-bottom: var(--spacing-unit);
    color: var(--light-text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Header --- */
.header {
    text-align: center;
    padding: calc(var(--spacing-unit) * 2) 0 var(--spacing-unit);
    background-color: var(--container-bg);
    border-bottom: 1px solid var(--border-color);
}

.author-name {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--light-text-color);
    margin: 0;
}

/* --- Hero Section (Main Page) --- */
.hero-section {
    text-align: center;
    padding: calc(var(--spacing-unit) * 3) 0 calc(var(--spacing-unit) * 2);
}

.book-title {
    font-family: var(--font-serif);
    font-size: 4rem;
    font-style: italic;
    color: var(--primary-color);
    margin-bottom: 0.15em;
    line-height: 1.1;
}

.book-subtitle {
    font-family: var(--font-sans);
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--light-text-color);
    margin: 0;
}

/* --- Content Sections --- */
.content-section {
    background-color: var(--container-bg);
    padding: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* --- Blurb Section --- */
.blurb-section {
    text-align: center;
}

.headline {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.5;
}

.body-copy {
    max-width: 560px;
    margin: 0 auto;
    text-align: left;
}

.body-copy p {
    margin-bottom: var(--spacing-unit);
    color: var(--light-text-color);
    font-size: 1.05rem;
}

.book-tagline {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--text-color);
    margin-top: calc(var(--spacing-unit) * 1.5);
    margin-bottom: 0;
    padding-top: calc(var(--spacing-unit) * 1.5);
    border-top: 1px solid var(--border-color);
}

/* --- CTA Section --- */
.cta-section {
    text-align: center;
}

.cta-section h2 {
    margin-bottom: 0.4em;
}

.cta-section > p {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.cta-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    align-items: center;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.8rem 1.8rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    min-width: 280px;
    text-align: center;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background-color: #2e4630;
    color: #fff;
    text-decoration: none;
}

.cta-button-alt {
    background-color: var(--secondary-color);
}

.cta-button-alt:hover {
    background-color: #543a2d;
}

.cta-button i {
    margin-right: 0.5em;
}

/* --- Footer --- */
.footer {
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    padding: calc(var(--spacing-unit) * 2) 0;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: #999;
}

/* --- Form Page Header --- */
.form-page-header {
    text-align: center;
    padding: calc(var(--spacing-unit) * 1.5) 0 var(--spacing-unit);
    background-color: var(--container-bg);
    border-bottom: 1px solid var(--border-color);
}

.form-page-header h1 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.2em;
}

.tagline {
    font-style: italic;
    color: var(--light-text-color);
    margin: 0;
}

/* --- Form Styles --- */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-color);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(61, 90, 62, 0.15);
}

textarea {
    min-height: calc(4 * 1.4em + 1.6rem);
    max-height: calc(20 * 1.4em + 1.6rem);
    resize: vertical;
    overflow-y: auto;
}

.form-note {
    font-size: 0.9em;
    color: #888;
    font-weight: normal;
}

.radio-group > label:first-child {
    margin-bottom: 0.6rem;
    font-weight: bold;
}

.radio-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: normal;
}

.radio-group input[type="radio"] {
    margin-right: 0.5rem;
    vertical-align: middle;
}

.submit-button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    font-family: inherit;
}

.submit-button:hover:not(:disabled) {
    background-color: #2e4630;
}

.submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
}

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

/* --- Status Message --- */
#formStatusMessage {
    margin-top: 1rem;
    font-weight: bold;
    padding: 0.75rem;
    border-radius: 4px;
    text-align: center;
}

#formStatusMessage:empty {
    display: none;
}

/* --- Success Pages --- */
.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 5px;
    text-align: center;
}

.success-message h2 {
    margin-top: 0;
    color: #155724;
}

.success-message p {
    color: #155724;
    margin-bottom: 0;
}

.icon-success {
    font-size: 3em;
    color: #28a745;
    margin-bottom: 0.5rem;
    display: block;
}

.next-steps {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #faf9f7;
}

.next-steps h3 {
    margin-top: 0;
    font-size: 1.1em;
    color: var(--text-color);
    margin-bottom: 0.75em;
}

.next-steps ul {
    padding-left: 1.2rem;
}

.next-steps li {
    margin-bottom: 0.5rem;
    color: var(--light-text-color);
}

.back-link-success {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

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

/* --- Responsiveness --- */
@media (min-width: 768px) {
    :root {
        --base-font-size: 17px;
    }

    .book-title {
        font-size: 5rem;
    }

    .headline {
        font-size: 1.6rem;
    }

    .cta-links {
        flex-direction: row;
        justify-content: center;
    }

    .container {
        padding: 0 calc(var(--spacing-unit) * 1.5);
    }
}