/*
Theme Name: The Book of Loretta
Author: Kelsey Maurine Brickl
Description: The Book of Loretta.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 7.4
*/

:root {
    --lo-bg:         #EEE4D8;
    --lo-bg-deep:    #E7DCCE;
    --lo-card:       #F5EDE5;
    --lo-pink:       #DD7C89;
    --lo-pink-hover: #C26381;
    --lo-pink-deep:  #A44F6E;
    --lo-ink:        #3A2C2A;
    --lo-ink-muted:  #6B5A57;
    --lo-rule:       #D8CBBF;

    --lo-serif: 'Playfair Display', Georgia, serif;
    --lo-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

    --lo-col:      820px;
    --lo-col-wide: 1080px;
    --lo-pad: clamp(22px, 5vw, 48px);
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--lo-bg);
    color: var(--lo-ink);
    font-family: var(--lo-sans);
    font-size: 18px;
    line-height: 1.65;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--lo-pink-deep); transition: color 150ms ease; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; }
p { margin: 0; }

/* ============ ATMOSPHERE ============ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(255, 248, 238, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 110%, rgba(164, 79, 110, 0.035) 0%, transparent 60%);
    z-index: 0;
}

.site { position: relative; z-index: 1; }
.site-main { display: block; }

/* ============ SECTIONS ============ */
.section {
    padding: 72px 0;
    position: relative;
}
.section + .section {
    border-top: 1px solid var(--lo-rule);
}
.section--home {
    padding: 96px 0 72px;
}
.section--contact {
    background: linear-gradient(to bottom, var(--lo-bg) 0%, var(--lo-bg-deep) 100%);
}

.section__inner {
    max-width: var(--lo-col);
    margin: 0 auto;
    padding-left: var(--lo-pad);
    padding-right: var(--lo-pad);
}

.section__title {
    font-family: var(--lo-serif);
    font-size: clamp(30px, 4.2vw, 40px);
    font-weight: 600;
    line-height: 1.15;
    color: var(--lo-pink-deep);
    text-align: center;
    margin: 0 0 48px;
    letter-spacing: 0;
}

/* ============ BLOCK CONTENT ============ */

/* All body content is center-aligned, per design_prompt.txt's church-bulletin / wedding-bulletin aesthetic. Do not override to left-align without explicit instruction. */
.section__content {
    text-align: center;
}
.section__content > *:first-child { margin-top: 0; }
.section__content > *:last-child  { margin-bottom: 0; }

.section__content h1,
.section__content h1.wp-block-heading {
    font-family: var(--lo-serif);
    font-size: clamp(46px, 7vw, 72px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.008em;
    color: var(--lo-pink);
    text-align: center;
    margin: 28px 0 20px;
}

.section__content h2,
.section__content h2.wp-block-heading {
    font-family: var(--lo-serif);
    font-size: clamp(28px, 3.8vw, 38px);
    font-weight: 600;
    line-height: 1.18;
    color: var(--lo-pink-deep);
    margin: 48px 0 18px;
}

.section__content h3,
.section__content h3.wp-block-heading {
    font-family: var(--lo-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--lo-ink-muted);
    margin: 40px 0 14px;
}

.section__content h4,
.section__content h4.wp-block-heading {
    font-family: var(--lo-serif);
    font-size: 22px;
    font-weight: 500;
    font-style: italic;
    color: var(--lo-pink-deep);
    margin: 32px 0 12px;
}

.section__content p {
    font-family: var(--lo-sans);
    font-size: 18px;
    line-height: 1.65;
    color: var(--lo-ink);
    margin: 0 0 22px;
}

.section__content a {
    color: var(--lo-pink-deep);
    border-bottom: 1px solid var(--lo-rule);
    text-decoration: none;
    padding-bottom: 1px;
    transition: color 150ms ease, border-color 150ms ease;
}
.section__content a:hover {
    color: var(--lo-pink-hover);
    border-bottom-color: var(--lo-pink-hover);
}

.section__content strong { font-weight: 600; }
.section__content em { font-style: italic; }

.section__content ul,
.section__content ol {
    margin: 0 0 22px;
    padding-left: 26px;
}
.section__content li { margin-bottom: 8px; }

.section__content .wp-block-separator,
.section__content hr {
    border: none;
    border-top: 1px solid var(--lo-rule);
    margin: 56px auto;
    max-width: 200px;
    opacity: 1;
}

/* ============ IMAGES ============ */
.section__content .wp-block-image {
    margin: 40px auto;
    text-align: center;
}
.section__content .wp-block-image img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--lo-rule);
    padding: 8px;
    background: var(--lo-bg);
    box-shadow:
        0 4px 18px rgba(58, 44, 42, 0.06),
        0 28px 70px -20px rgba(58, 44, 42, 0.07);
}
.section__content .wp-block-image figcaption {
    margin-top: 18px;
    font-family: var(--lo-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--lo-ink-muted);
    text-align: center;
}
.section__content .wp-block-image.alignwide {
    max-width: var(--lo-col-wide);
    margin-left: auto;
    margin-right: auto;
}
.section__content .wp-block-image.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

/* ============ HOME SECTION ============ */

.section--home .section__content > * {
    margin-left: auto;
    margin-right: auto;
}

.section--home .section__content p {
    max-width: 680px;
}

/* Hero image — large, centered, generous bottom spacing */
.section--home .section__content > .wp-block-image:first-child {
    margin-top: 0;
    margin-bottom: 48px;
    max-width: 560px;
    text-align: center;
}

/* Title H1 — pink, centered, no top margin so it sits close to the image */
.section--home .section__content h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 14px;
}

/* Subtitle paragraph — small-caps eyebrow under the title */
.section--home .section__content p.loretta-subtitle {
    text-align: center;
    font-family: var(--lo-sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--lo-ink-muted);
    max-width: none;
    margin: 0 auto 56px;
}

/* Pullquote (logline) — serif italic, framed by lighter hairlines than the default */
.section--home .section__content .wp-block-pullquote {
    margin: 0 auto 56px;
    padding: 32px 24px 36px;
    border-top: 1px solid var(--lo-rule);
    border-bottom: 1px solid var(--lo-rule);
    text-align: center;
    max-width: 760px;
}
.section--home .section__content .wp-block-pullquote blockquote {
    margin: 0;
    padding: 0;
    border: none;
}
.section--home .section__content .wp-block-pullquote p {
    font-family: var(--lo-serif);
    font-style: italic;
    font-size: clamp(22px, 2.7vw, 27px);
    line-height: 1.4;
    color: var(--lo-pink-deep);
    margin: 0;
    max-width: 100%;
}

/* ============ METADATA GRID (used inside Home page content) ============ */
.section__content .loretta-metadata {
    margin: 56px auto 8px;
    border-top: 1px solid var(--lo-pink-deep);
    border-bottom: 1px solid var(--lo-pink-deep);
    position: relative;
    max-width: 100%;
}
.section__content .loretta-metadata::before,
.section__content .loretta-metadata::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--lo-rule);
}
.section__content .loretta-metadata::before { top: 4px; }
.section__content .loretta-metadata::after  { bottom: 4px; }

.section__content .loretta-metadata__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 40px 0 36px;
}

.section__content .loretta-metadata__cell {
    padding: 0 20px;
    border-right: 1px solid var(--lo-rule);
    text-align: center;
}
.section__content .loretta-metadata__cell:nth-child(3) {
    border-right: none;
}

.section__content .loretta-metadata__label {
    display: block;
    font-family: var(--lo-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--lo-ink-muted);
    margin-bottom: 14px;
}

.section__content .loretta-metadata__value {
    font-family: var(--lo-serif);
    font-size: 17px;
    line-height: 1.35;
    font-weight: 500;
    color: var(--lo-ink);
}

/* Wide cells span the full row (used for Comps + Focus). They lose the
   right border, get a top hairline rule, and get their own padding. */
.section__content .loretta-metadata__wide {
    grid-column: 1 / -1;
    padding: 32px 24px;
    border-top: 1px solid var(--lo-rule);
    border-right: none;
    text-align: center;
}

/* Focus row composes with .loretta-metadata__wide and adds an italic value. */
.section__content .loretta-metadata__focus .loretta-metadata__value {
    font-size: 18px;
    line-height: 1.5;
    max-width: 620px;
    margin: 0 auto;
    font-style: italic;
    font-weight: 400;
    color: var(--lo-ink);
}

/* ============ BIO SECTION ============ */
.section--bio .section__content .wp-block-image {
    max-width: 280px;
    margin: 0 auto 40px;
}
.section--bio .section__content .wp-block-image img {
    filter: contrast(1.02);
}

/* ============ QUOTES (default, used outside the home pullquote override) ============ */
.section__content blockquote,
.section__content .wp-block-quote {
    margin: 40px 0;
    padding: 32px 0;
    border-top: 1px solid var(--lo-rule);
    border-bottom: 1px solid var(--lo-rule);
    font-family: var(--lo-serif);
    font-style: italic;
    font-size: clamp(22px, 2.6vw, 27px);
    line-height: 1.4;
    color: var(--lo-pink-deep);
    text-align: center;
}
.section__content blockquote p,
.section__content .wp-block-quote p {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    margin-bottom: 12px;
}
.section__content blockquote p:last-child,
.section__content .wp-block-quote p:last-child { margin-bottom: 0; }

.section__content blockquote cite,
.section__content .wp-block-quote cite {
    display: block;
    margin-top: 14px;
    font-family: var(--lo-sans);
    font-style: normal;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--lo-ink-muted);
}

.section__content .wp-block-pullquote {
    margin: 48px 0;
    padding: 36px 0;
    border-top: 1px solid var(--lo-pink-deep);
    border-bottom: 1px solid var(--lo-pink-deep);
    text-align: center;
}
.section__content .wp-block-pullquote p {
    font-family: var(--lo-serif);
    font-style: italic;
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.35;
    color: var(--lo-pink-deep);
    margin: 0;
}

/* ============ BUTTONS ============ */
.section__content .wp-block-button { margin: 24px 0; }

.section__content .wp-block-button__link {
    display: inline-block;
    padding: 16px 40px;
    border: 1px solid var(--lo-pink);
    border-radius: 999px;
    background: transparent;
    color: var(--lo-pink);
    font-family: var(--lo-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 180ms ease;
}
.section__content .wp-block-button__link:hover {
    background: var(--lo-pink);
    color: var(--lo-bg);
    border-color: var(--lo-pink-hover);
    box-shadow: 0 4px 18px rgba(164, 79, 110, 0.18);
    transform: translateY(-1px);
}
.section__content .wp-block-button.is-style-fill .wp-block-button__link {
    background: var(--lo-pink);
    color: var(--lo-bg);
}
.section__content .wp-block-button.is-style-fill .wp-block-button__link:hover {
    background: var(--lo-pink-hover);
    border-color: var(--lo-pink-hover);
}

/* ============ CONTACT FORM 7 ============ */
.section--contact .section__inner {
    max-width: 640px;
}

.section__content .wpcf7 {
    max-width: 560px;
    margin: 0 auto;
}

.section__content .wpcf7-form p {
    margin: 0 0 22px;
    font-family: var(--lo-sans);
}

.section__content .wpcf7-form label {
    display: block;
    font-family: var(--lo-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--lo-ink-muted);
    margin-bottom: 10px;
}

.section__content .wpcf7-form input[type="text"],
.section__content .wpcf7-form input[type="email"],
.section__content .wpcf7-form input[type="tel"],
.section__content .wpcf7-form input[type="url"],
.section__content .wpcf7-form input[type="number"],
.section__content .wpcf7-form input[type="date"],
.section__content .wpcf7-form textarea,
.section__content .wpcf7-form select {
    width: 100%;
    padding: 15px 18px;
    background: var(--lo-card);
    border: 1px solid var(--lo-rule);
    border-radius: 8px;
    font-family: var(--lo-serif);
    font-size: 17px;
    line-height: 1.5;
    color: var(--lo-ink);
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
    -webkit-appearance: none;
    appearance: none;
}

.section__content .wpcf7-form input:focus,
.section__content .wpcf7-form textarea:focus,
.section__content .wpcf7-form select:focus {
    outline: none;
    border-color: var(--lo-pink);
    background: #FBF6EF;
    box-shadow: 0 0 0 3px rgba(221, 124, 137, 0.12);
}

.section__content .wpcf7-form textarea {
    min-height: 160px;
    resize: vertical;
    font-family: var(--lo-sans);
    font-size: 16px;
}

.section__content .wpcf7-form input[type="submit"],
.section__content .wpcf7-form button[type="submit"] {
    /* display: block + width: fit-content + margin: auto self-centers the
       button regardless of whether the parent <p> inherits text-align: center.
       Inline-block + margin auto does NOT work for centering. */
    display: block;
    width: fit-content;
    margin: 18px auto 0;
    padding: 17px 46px 16px;
    border: 1px solid var(--lo-pink);
    border-radius: 999px;
    background: var(--lo-pink);
    color: var(--lo-bg);
    font-family: var(--lo-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 180ms ease;
    -webkit-appearance: none;
    appearance: none;
}

.section__content .wpcf7-form input[type="submit"]:hover,
.section__content .wpcf7-form button[type="submit"]:hover {
    background: var(--lo-pink-hover);
    border-color: var(--lo-pink-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(164, 79, 110, 0.18);
}

.section__content .wpcf7-form p:last-of-type {
    text-align: center;
    margin-bottom: 0;
}

.section__content .wpcf7-response-output {
    margin: 24px 0 0;
    padding: 16px 20px;
    border: 1px solid var(--lo-rule);
    border-radius: 8px;
    background: var(--lo-card);
    font-family: var(--lo-sans);
    font-size: 13px;
    color: var(--lo-ink);
    text-align: center;
}

.section__content .wpcf7 form.sent .wpcf7-response-output {
    border-color: var(--lo-pink);
    background: #FBF6EF;
}

.section__content .wpcf7 form.invalid .wpcf7-response-output,
.section__content .wpcf7 form.failed .wpcf7-response-output {
    border-color: var(--lo-pink-deep);
    color: var(--lo-pink-deep);
}

.section__content .wpcf7-not-valid-tip {
    display: block;
    margin-top: 8px;
    font-family: var(--lo-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--lo-pink-deep);
    letter-spacing: 0;
    text-transform: none;
}

.section__content .wpcf7-form .wpcf7-list-item {
    margin: 0 16px 8px 0;
}

.section__content .wpcf7-form .ajax-loader {
    margin-left: 12px;
}

/* ============ SITE FOOTER ============ */

/* Sits below the Contact section. Continues the bg-deep gradient color so the
   page settles into the same downward shade rather than restarting at the
   default cream. Copy is rendered from theme metadata + date('Y') so no text
   is hardcoded in the template — change the Author header in style.css to
   change what the copyright says. */
.site-footer {
    padding: 36px 0 48px;
    background: var(--lo-bg-deep);
    border-top: 1px solid var(--lo-rule);
    text-align: center;
    position: relative;
    z-index: 1;
}
.site-footer__inner {
    max-width: var(--lo-col);
    margin: 0 auto;
    padding-left: var(--lo-pad);
    padding-right: var(--lo-pad);
}
.site-footer__copyright {
    display: inline-block;
    font-family: var(--lo-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lo-ink-muted);
}

/* ============ REVEAL (progressive enhancement) ============ */
.js .section.reveal-init {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1100ms cubic-bezier(.2,.7,.2,1), transform 1100ms cubic-bezier(.2,.7,.2,1);
}
.js .section.reveal-init.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 820px) {
    body { font-size: 17px; }
    .section { padding: 56px 0; }
    .section--home { padding: 72px 0 56px; }
    .section__title { margin-bottom: 36px; }
    .section__content h1 { font-size: clamp(38px, 10vw, 58px); }
    .section--home .section__content > .wp-block-image:first-child {
        max-width: 100%;
        margin-bottom: 40px;
    }
    .section--home .section__content .wp-block-pullquote {
        margin-bottom: 40px;
        padding: 28px 16px 32px;
    }

    /* Metadata grid stacks to a single column on tablet/mobile */
    .section__content .loretta-metadata__grid {
        grid-template-columns: 1fr;
        padding: 28px 0;
    }
    .section__content .loretta-metadata__cell {
        padding: 18px 16px;
        border-right: none;
        border-bottom: 1px solid var(--lo-rule);
    }
    .section__content .loretta-metadata__cell:last-child {
        border-bottom: none;
    }
    .section__content .loretta-metadata__wide {
        padding: 22px 16px;
        border-top: none;
    }
}

@media (max-width: 520px) {
    .section { padding: 48px 0; }
    .section--home { padding: 64px 0 48px; }
    .section__content .wp-block-image img { padding: 6px; }
    .section--home .section__content p.loretta-subtitle {
        font-size: 11px;
        letter-spacing: 0.22em;
        margin-bottom: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .js .section.reveal-init {
        opacity: 1 !important;
        transform: none !important;
    }
}
