/*
 Theme Name:   Amia Geismann Child
 Theme URI:    https://amiageismann.com
 Description:  Divi child theme for Amia Geismann. Bespoke typographic blog: Reflections index + single post (Phase 1).
 Author:       Erik
 Template:     Divi
 Version:      2.2.2
 Text Domain:  ag-child
*/


/* ==========================================================================
   1. CSS CUSTOM PROPERTIES  (brand tokens)
   ========================================================================== */

:root {
    --ag-wine:        #8a1a3f;
    --ag-wine-deep:   #6f1431;
    --ag-gold:        #c2a14a;
    --ag-gold-soft:   #d9c089;
    --ag-gold-faint:  #efe3c8;
    --ag-cream:       #fbf7ee;
    --ag-cream-2:     #f6efe0;
    --ag-sand:        #e9d2a3;
    --ag-paper:       #ffffff;
    --ag-text:        #5b544b;
    --ag-text-soft:   #867d70;
    --ag-line:        #e7ddc8;

    --ag-serif:       'Playfair Display', Georgia, serif;
    --ag-serif-soft:  'Cormorant Garamond', Georgia, serif;
    --ag-sans:        'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

    --ag-ease:        cubic-bezier(0.32, 0.72, 0, 1);
    --ag-radius:      20px;
    --ag-shadow-card: 0 28px 50px -34px rgba(110, 20, 49, 0.30);
}


/* ==========================================================================
   2. PAGE CANVAS + GRAIN
   Backgrounds are scoped to our two pages only, so the rest of the site is
   untouched. Grain is a fixed overlay element we print inside our templates.
   ========================================================================== */

/* Cream on the body + Divi wrappers too, so no white bands show above the
   content (under the fixed header) or below it (before the footer). */
body.ag-blog-page,
body.single-post,
body.ag-blog-page #main-content,
body.single-post  #main-content {
    background: var(--ag-cream);
}

body.ag-blog-page #page-container,
body.single-post  #page-container,
body.ag-blog-page #et-main-area,
body.single-post  #et-main-area {
    background: transparent;
}

/* Force full width + no sidebar on the blog pages, in case Divi's layout
   still wraps the content in its sidebar columns. Harmless if absent. */
body.ag-blog-page #main-content .container,
body.single-post  #main-content .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

body.ag-blog-page #left-area,
body.single-post  #left-area {
    width: 100%;
    padding: 0;
    float: none;
}

body.ag-blog-page #sidebar,
body.single-post  #sidebar {
    display: none;
}

.ag-grain {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.ag-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 28px;
}


/* ==========================================================================
   3. SHARED ORNAMENTS  (eyebrow, sunburst, divider)
   ========================================================================== */

.ag-journal .ag-eyebrow,
.ag-single  .ag-eyebrow {
    font-family: var(--ag-sans);
    font-size: 11px;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ag-gold);
    display: inline-block;
    text-decoration: none;
}

a.ag-eyebrow:hover { color: var(--ag-wine); }

.ag-sun { display: block; margin: 0 auto; line-height: 0; }
img.ag-sun { height: auto; }

.ag-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 60px 0;
}

.ag-rule {
    height: 1px;
    width: 80px;
    background: linear-gradient(90deg, transparent, var(--ag-gold-soft));
}

.ag-rule-r {
    background: linear-gradient(90deg, var(--ag-gold-soft), transparent);
}


/* ==========================================================================
   4. BLOG INDEX  (.ag-journal)
   ========================================================================== */

.ag-journal h1,
.ag-journal h2,
.ag-journal h3 {
    font-family: var(--ag-serif);
    color: var(--ag-wine);
    font-weight: 600;
    line-height: 1.12;
}

/* Masthead */
.ag-masthead {
    text-align: center;
    padding: 74px 0 30px;
}

.ag-masthead .ag-eyebrow { margin: 18px 0 14px; }

.ag-masthead h1 {
    font-size: clamp(44px, 7vw, 82px);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.ag-masthead .ag-sub {
    font-family: var(--ag-serif-soft);
    font-style: italic;
    font-size: 23px;
    color: var(--ag-text-soft);
    max-width: 560px;
    margin: 18px auto 0;
    line-height: 1.5;
}

/* Category filter bubbles */
.ag-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
    margin: 34px 0 8px;
}

.ag-cat {
    font-family: var(--ag-sans);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ag-text-soft);
    padding: 7px 16px;
    border: 1px solid var(--ag-line);
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.45s var(--ag-ease),
                border-color 0.45s var(--ag-ease),
                background 0.45s var(--ag-ease);
}

.ag-cat.on,
.ag-cat:hover {
    color: var(--ag-wine);
    border-color: var(--ag-gold);
    background: var(--ag-paper);
}

/* Featured post */
.ag-featured {
    position: relative;
    display: block;
    margin: 46px 0 10px;
    padding: 54px 56px;
    background: var(--ag-paper);
    border: 1px solid var(--ag-line);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 30px 60px -42px rgba(110, 20, 49, 0.28);
    text-decoration: none;
    color: inherit;
    transition: transform 0.6s var(--ag-ease), box-shadow 0.6s var(--ag-ease);
}

.ag-featured:hover {
    transform: translateY(-4px);
    box-shadow: var(--ag-shadow-card);
}

.ag-featured::before {
    content: "01";
    position: absolute;
    right: 34px;
    top: -26px;
    font-family: var(--ag-serif);
    font-size: 200px;
    color: var(--ag-gold);
    opacity: 0.07;
    line-height: 1;
    font-weight: 700;
    pointer-events: none;
}

.ag-featured .ag-tag { margin-bottom: 20px; }

.ag-featured h2 {
    font-size: clamp(30px, 4.4vw, 52px);
    max-width: 14ch;
}

.ag-featured .ag-ex {
    margin: 20px 0 26px;
    font-size: 18px;
    max-width: 60ch;
    color: var(--ag-text);
    font-family: var(--ag-sans);
    line-height: 1.7;
}

/* Meta row */
.ag-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--ag-text-soft);
    font-family: var(--ag-sans);
    flex-wrap: wrap;
}

.ag-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ag-gold);
    flex: 0 0 4px;
}

/* Read-more link */
.ag-readlink {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    font-family: var(--ag-sans);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ag-wine);
    transition: gap 0.4s var(--ag-ease);
}

.ag-featured:hover .ag-readlink { gap: 18px; }

.ag-arrow {
    width: 34px;
    height: 34px;
    border: 1px solid var(--ag-gold-soft);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--ag-gold);
    transition: background 0.4s var(--ag-ease), border-color 0.4s var(--ag-ease), color 0.4s var(--ag-ease);
}

.ag-featured:hover .ag-arrow {
    background: var(--ag-wine);
    border-color: var(--ag-wine);
    color: var(--ag-cream);
}

/* Card grid */
.ag-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    margin: 46px 0;
}

.ag-card {
    position: relative;
    background: var(--ag-paper);
    border: 1px solid var(--ag-line);
    border-radius: 20px;
    padding: 34px 32px;
    cursor: pointer;
    transition: transform 0.6s var(--ag-ease), box-shadow 0.6s var(--ag-ease), border-color 0.6s var(--ag-ease);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.ag-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--ag-shadow-card);
    border-color: var(--ag-gold-soft);
}

.ag-card .ag-tag {
    font-size: 10px;
    letter-spacing: 0.2em;
    margin-bottom: 16px;
}

.ag-card h3 {
    font-size: 25px;
    line-height: 1.18;
    margin-bottom: 12px;
}

.ag-card p {
    font-size: 15px;
    color: var(--ag-text);
    margin-bottom: 22px;
    flex: 1;
    font-family: var(--ag-sans);
    line-height: 1.7;
}

.ag-card .ag-meta {
    margin-top: auto;
    font-size: 12px;
}

.ag-glyph {
    position: absolute;
    top: 30px;
    right: 30px;
    opacity: 0.5;
    margin: 0;
}

/* Tinted card variants */
.ag-card.ag-cream {
    background: var(--ag-cream-2);
    border-color: var(--ag-gold-faint);
}

.ag-card.ag-sand {
    background:
        radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, 0.5), transparent),
        linear-gradient(115deg, #ecd6a8, #e3c88f 40%, #edd8ad);
    border-color: transparent;
}

.ag-card.ag-sand h3,
.ag-card.ag-sand .ag-tag { color: var(--ag-wine-deep); }

.ag-card.ag-sand p,
.ag-card.ag-sand .ag-meta { color: #6f5a39; }

/* Typographic quote card (rhythm breaker, no image) */
.ag-card.ag-quote {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--ag-wine), var(--ag-wine-deep));
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 46px;
    cursor: default;
}

.ag-card.ag-quote:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px -34px rgba(110, 20, 49, 0.55);
}

.ag-card.ag-quote blockquote {
    font-family: var(--ag-serif-soft);
    font-style: italic;
    font-size: 30px;
    line-height: 1.34;
    color: var(--ag-cream);
    max-width: 24ch;
    border: 0;
    padding: 0;
    margin: 0;
}

.ag-card.ag-quote cite {
    display: block;
    margin-top: 18px;
    font-family: var(--ag-sans);
    font-style: normal;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ag-gold-soft);
}

/* Load more */
.ag-loadmore {
    display: flex;
    justify-content: center;
    margin: 20px 0 90px;
}

.ag-loadmore button {
    font-family: var(--ag-sans);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ag-wine);
    background: var(--ag-paper);
    border: 1px solid var(--ag-gold-soft);
    padding: 16px 40px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.5s var(--ag-ease), color 0.5s var(--ag-ease), border-color 0.5s var(--ag-ease);
}

.ag-loadmore button:hover {
    background: var(--ag-wine);
    color: var(--ag-cream);
    border-color: var(--ag-wine);
}

/* Pagination (archives) */
.ag-pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0 90px;
}

.ag-pagination .nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-family: var(--ag-sans);
}

.ag-pagination .page-numbers {
    display: grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--ag-line);
    border-radius: 999px;
    color: var(--ag-wine);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.08em;
    transition: background 0.4s var(--ag-ease), color 0.4s var(--ag-ease), border-color 0.4s var(--ag-ease);
}

.ag-pagination .page-numbers.current,
.ag-pagination .page-numbers:hover {
    background: var(--ag-wine);
    color: var(--ag-cream);
    border-color: var(--ag-wine);
}

/* Empty state */
.ag-empty {
    text-align: center;
    padding: 40px 0 90px;
    font-family: var(--ag-sans);
    color: var(--ag-text-soft);
}


/* ==========================================================================
   5. SINGLE POST  (.ag-single)
   ========================================================================== */

.ag-single h1,
.ag-single h2,
.ag-single h3 {
    font-family: var(--ag-serif);
    color: var(--ag-wine);
    font-weight: 600;
    line-height: 1.12;
}

/* Header */
.ag-post-head {
    text-align: center;
    max-width: 760px;
    margin: 60px auto 0;
    padding: 0 20px;
}

.ag-back {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ag-text-soft);
    display: inline-block;
    margin-bottom: 30px;
    text-decoration: none;
    transition: color 0.4s var(--ag-ease);
}

.ag-back:hover { color: var(--ag-wine); }

.ag-post-head h1 {
    font-size: clamp(36px, 5.4vw, 62px);
    margin: 16px 0 22px;
    letter-spacing: -0.01em;
}

.ag-post-head .ag-meta { justify-content: center; }

/* Article body */
.ag-article {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.ag-article p {
    font-family: var(--ag-sans);
    font-size: 18.5px;
    line-height: 1.85;
    margin: 0 0 26px;
    color: #534c43;
}

.ag-article h2 {
    font-size: 30px;
    margin: 46px 0 18px;
}

/* Drop cap on the first paragraph */
.ag-article > p:first-of-type::first-letter {
    font-family: var(--ag-serif);
    font-size: 74px;
    line-height: 0.78;
    float: left;
    color: var(--ag-wine);
    padding: 8px 14px 0 0;
    font-weight: 700;
}

/* Lists with gold markers */
.ag-article ul {
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}

.ag-article ul li {
    position: relative;
    padding-left: 30px;
    font-size: 18px;
    margin-bottom: 12px;
    line-height: 1.6;
    font-family: var(--ag-sans);
    color: var(--ag-text);
}

.ag-article ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 12px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ag-gold);
    box-shadow: 0 0 0 3px rgba(194, 161, 74, 0.18);
}

/* Pull quote: the editor's normal Quote block becomes this */
.ag-article blockquote {
    margin: 44px 0;
    padding: 6px 0 6px 34px;
    border-left: 2px solid var(--ag-gold-soft);
    font-family: var(--ag-serif-soft);
    font-style: italic;
    font-size: 30px;
    line-height: 1.4;
    color: var(--ag-wine);
    background: none;
}

.ag-article blockquote p {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0;
}

/* Optional callout: add an editor block / wrapper with class ag-callout */
.ag-callout {
    background: var(--ag-cream-2);
    border: 1px solid var(--ag-gold-faint);
    border-radius: 18px;
    padding: 30px 34px;
    margin: 40px 0;
}

.ag-callout .ag-eyebrow {
    font-size: 10px;
    margin-bottom: 10px;
}

.ag-callout p {
    font-size: 17px;
    margin: 0;
    color: var(--ag-text);
    font-family: var(--ag-sans);
}

/* Author block (photo in the ring; monogram fallback) */
.ag-author {
    max-width: 680px;
    margin: 50px auto 0;
    padding: 38px 34px;
    background: var(--ag-paper);
    border: 1px solid var(--ag-line);
    border-radius: 22px;
    display: flex;
    gap: 26px;
    align-items: center;
}

.ag-ring {
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 1px solid var(--ag-gold-soft);
    display: grid;
    place-items: center;
    background: var(--ag-cream-2);
    overflow: hidden;
}

.ag-ring.ag-ring-photo {
    background: none;
    padding: 4px;
}

.ag-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ag-ring span {
    font-family: var(--ag-serif);
    font-size: 34px;
    color: var(--ag-wine);
}

.ag-author .ag-eyebrow { font-size: 10px; }

.ag-author h3 {
    font-size: 23px;
    margin: 6px 0 8px;
}

.ag-author p {
    font-size: 15px;
    margin: 0;
    font-family: var(--ag-sans);
    line-height: 1.7;
}

/* Bottom breathing room before the footer (whether or not related shows) */
.ag-single { padding-bottom: 90px; }

/* Related posts */
.ag-related { padding: 30px 0 0; }

.ag-divider-bare { margin: 70px 0 0; }

.ag-related-head {
    text-align: center;
    margin-bottom: 36px;
}

.ag-related-head .ag-eyebrow { margin-bottom: 10px; }

.ag-related-head h2 {
    font-family: var(--ag-serif);
    color: var(--ag-wine);
    font-size: 34px;
}

.ag-rgrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}


/* ==========================================================================
   6. SCROLL REVEAL  (paired with ag-custom.js)
   ========================================================================== */

.ag-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ag-ease), transform 0.8s var(--ag-ease);
}

.ag-reveal.ag-revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .ag-reveal { opacity: 1; transform: none; transition: none; }
    .ag-card,
    .ag-featured { transition: none; }
    .ag-card:hover,
    .ag-featured:hover { transform: none; }
}


/* ==========================================================================
   7. RESPONSIVE
   ========================================================================== */

@media (max-width: 860px) {
    .ag-grid { grid-template-columns: repeat(2, 1fr); }
    .ag-card.ag-quote { grid-column: span 2; }
    .ag-rgrid { grid-template-columns: 1fr; }
    .ag-featured { padding: 40px 30px; }
}

@media (max-width: 560px) {
    .ag-wrap { padding: 0 18px; }
    .ag-grid { grid-template-columns: 1fr; }
    .ag-card.ag-quote { grid-column: span 1; }
    .ag-author { flex-direction: column; text-align: center; }
    .ag-article > p:first-of-type::first-letter { font-size: 58px; }
}
