/* ============================================================
   Rafaela Bianco — a warm, literary theme
   Palette pulled from her consultório: lamp-cream, terracotta,
   teal, amethyst (rare), warm ink. All-serif. Birds in flight.
   ============================================================ */

:root {
    --paper:        #faf4e9;  /* lamp-warm wall — never clinical white */
    --paper-deep:   #f1e7d6;  /* wall in shadow / surfaces */
    --ink:          #211e1a;  /* the birds — warm near-black */
    --muted:        #6b6256;  /* taupe-gray for dates, captions */
    --terracotta:   #b05a3c;  /* the woven rug */
    --terracotta-d: #92452d;  /* darkened for text-links (AA on cream) */
    --teal:         #3f7e77;  /* the cushions + doilies */
    --teal-d:       #356a64;
    --amethyst:     #7e6c99;  /* the geode — used sparingly */
    --wood:         #8a6b52;
    --hairline:     #e3d8c5;

    --measure: 34rem;         /* reading column — narrower for Baskerville's x-height */
    --wrap: 64rem;

    --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-body: "Libre Baskerville", Georgia, "Times New Roman", serif;

    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---- reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background-color: var(--paper);
    /* faint paper grain baked into a tiny tile (cheap; no runtime filter, scrolls with content) */
    background-image: url("../images/noise.png");
    background-repeat: repeat;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.78;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

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

/* ---- layout helpers ---- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1.5rem; }
.measure { max-width: var(--measure); }
.site-main { display: block; }

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--ink); color: var(--paper);
    padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }

/* ---- typography ---- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; letter-spacing: -0.012em; text-wrap: balance; }

.section-eyebrow {
    font-family: var(--font-body);
    font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--terracotta); margin: 0 0 0.9rem;
}
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0 0 2.5rem; max-width: 24ch; }

/* ---- birds ---- */
/* warm-brown flock with atmospheric depth: deep brown lead birds dimming to latte in the distance */
.birds { color: #4f3a2a; display: block; width: 100%; height: auto; }
.bird--mid { color: #785b43; }
.bird--far { color: #a3866b; }
.birds--hero { width: min(30rem, 82%); opacity: 0.95; }
.birds--breath { width: 2.7rem; margin: 0 auto; opacity: 0.45; }
.birds--footer { width: 15rem; margin: 0 auto 1.8rem; color: rgba(250, 244, 233, 0.8); }
.birds--divider { width: 3.2rem; margin: 3.5rem auto; opacity: 0.55; }
.birds--small { width: 9rem; margin-bottom: 1.4rem; opacity: 0.7; }

/* ---- header ---- */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--paper) 96%, transparent);
    border-bottom: 1px solid var(--hairline);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 4.6rem; gap: 1rem; }
.wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark__name { font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; color: var(--ink); }
.wordmark__role { font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); margin-top: 0.3rem; }

.site-nav { display: flex; align-items: center; gap: 1.8rem; }
.site-nav a { font-size: 0.82rem; letter-spacing: 0.05em; color: var(--ink); position: relative; }
.site-nav a:not(.site-nav__cta)::after {
    content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0;
    background: var(--terracotta); transition: width 0.3s var(--ease);
}
.site-nav a:not(.site-nav__cta):hover::after { width: 100%; }
.site-nav__cta {
    border: 1px solid var(--terracotta); color: var(--terracotta-d);
    padding: 0.45rem 1.05rem; border-radius: 999px; transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.site-nav__cta:hover { background: var(--terracotta); color: #fff; }

.nav-toggle { display: none; }

/* ---- buttons ---- */
.btn {
    display: inline-block; font-family: var(--font-body); font-size: 0.85rem; letter-spacing: 0.04em;
    padding: 0.92rem 1.7rem; border-radius: 999px; border: 1px solid transparent;
    transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn--primary { background: var(--terracotta); color: #fff; box-shadow: 0 10px 26px -16px rgba(176, 90, 60, 0.55); }
.btn--primary:hover { background: var(--terracotta-d); transform: translateY(-2px); }
.btn--ghost { color: var(--ink); border-color: var(--wood); }
.btn--ghost:hover { background: var(--paper-deep); transform: translateY(-2px); }
.btn--light { background: var(--paper); color: var(--terracotta-d); }
.btn--light:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -16px rgba(0,0,0,0.5); }

/* ---- hero ---- */
.hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5.5rem); position: relative; }
.hero__inner { position: relative; max-width: 48rem; }
.hero__birds { display: block; width: min(38rem, 100%); height: auto; margin: 0 0 2.4rem; }
.hero__eyebrow { font-size: 0.76rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--terracotta); margin: 0 0 1.4rem; }
.hero__title {
    font-size: clamp(2.2rem, 5.6vw, 3.8rem); font-weight: 400; font-style: italic;
    line-height: 1.04; letter-spacing: -0.018em; text-wrap: balance;
    margin: 0 0 1.9rem; max-width: 20ch; color: var(--ink);
}
.hero__welcome { font-size: 1.12rem; color: #3a352d; max-width: 34rem; }
.hero__welcome p { margin: 0 0 1.1rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.4rem; }

/* ---- sobre ---- */
.sobre { padding: clamp(4rem, 10vw, 8rem) 0; }
.sobre__quote {
    margin: 0 0 2rem; padding: 0 0 0 1.6rem; border-left: 2px solid var(--terracotta);
    font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.05rem); font-style: italic;
    font-weight: 400; line-height: 1.4; color: var(--ink);
}
.sobre__quote footer { font-family: var(--font-body); font-style: normal; font-size: 0.82rem; letter-spacing: 0.04em; color: var(--muted); margin-top: 1rem; }
.sobre__body { color: #3a352d; }

/* ---- reflexoes ---- */
.reflexoes { padding: clamp(3rem, 8vw, 6.5rem) 0; border-top: 1px solid var(--hairline); }
.reflexoes__all { margin: 2.4rem 0 0; }
.reflexoes__all a { font-size: 0.9rem; letter-spacing: 0.02em; color: var(--terracotta-d); border-bottom: 1px solid transparent; transition: border-color 0.25s var(--ease); }
.reflexoes__all a:hover { border-color: var(--terracotta); }
.reflection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 2.2rem 2rem; }
.reflection-card { position: relative; }
.reflection-card__link { display: block; padding: 1.5rem 0; border-top: 1px solid color-mix(in srgb, var(--hairline) 55%, transparent); transition: transform 0.3s var(--ease); }
.reflection-card__link:hover { transform: translateX(5px); }
.reflection-card__link:hover .reflection-card__title { color: var(--terracotta-d); }
.reflection-card__tag { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--teal-d); }
.reflection-card__title { font-size: 1.5rem; font-weight: 500; margin: 0.55rem 0 0.7rem; color: var(--ink); transition: color 0.25s var(--ease); }
.reflection-card__excerpt { font-size: 0.92rem; line-height: 1.65; color: var(--muted); margin: 0 0 0.9rem; text-wrap: pretty; }
.reflection-card__date { font-size: 0.74rem; letter-spacing: 0.05em; color: var(--wood); text-transform: lowercase; }

.temas { margin-top: 3.5rem; padding-top: 2.2rem; border-top: 1px solid var(--hairline); }
.temas__label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--terracotta); margin: 0 0 1.1rem; }
.temas__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem 0.75rem; }
.temas__list a {
    display: inline-block; font-size: 0.82rem; color: var(--ink);
    border: 1px solid var(--hairline); padding: 0.4rem 0.95rem; border-radius: 999px;
    transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.temas__list a:hover { border-color: var(--teal); color: var(--teal-d); }

/* ---- page head (archive / tag) ---- */
.page-head { padding: clamp(3rem, 8vw, 6rem) 0 1rem; }
.page-head__title { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0 0 0.6rem; }
.page-head__sub { color: var(--muted); font-size: 1.05rem; max-width: 32rem; }
.archive { padding: 2.5rem 0 5rem; }

/* ---- single reflection ---- */
.reflection { padding: clamp(2.5rem, 6vw, 4.5rem) 0 4rem; }
.reflection__header { text-align: center; margin-bottom: 2.8rem; }
.reflection__tag { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal-d); }
.reflection__title { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0.8rem 0 1rem; }
.reflection__date { font-size: 0.78rem; letter-spacing: 0.06em; color: var(--wood); text-transform: lowercase; }
.reflection__figure { margin: 0 0 2.8rem; }
.reflection__figure img { border-radius: 3px; }

.reflection__content { font-size: 1.15rem; line-height: 1.85; color: #2e2a23; hyphens: auto; -webkit-hyphens: auto; }
.reflection__content p { margin: 0 0 1.5rem; text-wrap: pretty; }
.reflection__content a { color: var(--terracotta-d); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* her posts ARE curated quotes — make the blockquote the centerpiece */
/* the curated quote IS the post — set it as a centered epigraph, marked by a
   single amethyst bird (her rare jewel) instead of a generic quotation mark */
.reflection__content blockquote {
    margin: 3.4rem auto; padding: 0; border: 0; max-width: 30rem; text-align: center;
    font-family: var(--font-display); font-size: clamp(1.6rem, 3.6vw, 2.35rem);
    font-style: italic; font-weight: 400; line-height: 1.38; color: var(--ink); text-wrap: pretty;
}
.reflection__content blockquote::before {
    content: ""; display: block; width: 2.5rem; height: 1.2rem; margin: 0 auto 1.8rem;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86 61'%3E%3Cg transform='translate(0.000000,61.000000) scale(0.100000,-0.100000)' fill='%237e6c99' stroke='none'%3E %3Cpath d='M350 519 c0 -28 -44 -130 -69 -158 l-26 -32 -37 26 c-46 31 -75 31 -112 0 l-30 -24 27 -40 c45 -68 146 -169 191 -190 75 -37 147 -27 301 39 50 21 105 44 123 51 47 17 62 35 62 75 0 19 -2 34 -3 34 -2 0 -31 -14 -65 -31 -67 -33 -141 -38 -133 -9 2 8 7 31 12 50 9 37 12 160 4 160 -2 0 -35 -20 -72 -45 -37 -25 -72 -45 -79 -45 -6 0 -15 11 -18 24 -12 48 -51 126 -63 126 -7 0 -13 -5 -13 -11z'/%3E %3C/g%3E%3C/svg%3E");
}
.reflection__content blockquote p { margin: 0 0 1rem; }
.reflection__content .attribution {
    font-family: var(--font-body); font-style: normal; font-size: 0.82rem;
    letter-spacing: 0.09em; text-align: center; color: var(--muted); margin-top: 1.8rem;
}

.reflection__invite { text-align: center; margin: 1rem 0 2.5rem; }
.reflection__invite p { font-family: var(--font-display); font-size: 1.4rem; font-style: italic; color: var(--ink); margin: 0 0 1.4rem; }
.reflection__back { text-align: center; font-size: 0.86rem; }
.reflection__back a { color: var(--muted); }
.reflection__back a:hover { color: var(--terracotta-d); }

/* ---- footer (the terracotta close) ---- */
.site-footer { position: relative; overflow: hidden; background: linear-gradient(165deg, #b85f40 0%, #9c4d33 100%); color: #fdf3ec; margin-top: 4rem; }
.site-footer > * { position: relative; }
.site-footer__inner {
    display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem;
    padding-top: clamp(3.5rem, 8vw, 5.5rem); padding-bottom: 2.5rem; align-items: start;
}
.site-footer__invite { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); font-style: italic; line-height: 1.3; margin: 0 0 1.6rem; }
.site-footer__details { font-size: 0.92rem; line-height: 1.65; color: #f7e3d8; }
.site-footer__name { font-family: var(--font-display); font-size: 1.5rem; font-style: normal; color: #fff; margin: 0 0 0.4rem; }
.site-footer__details p { margin: 0 0 0.25rem; }
.site-footer__addr { margin-top: 0.9rem !important; }
.site-footer__links { margin-top: 1rem !important; display: flex; gap: 0.6rem; align-items: center; }
.site-footer__links a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.site-footer__base { border-top: 1px solid rgba(255,255,255,0.22); padding-top: 1.4rem; padding-bottom: 2rem; }
.site-footer__base p { font-size: 0.78rem; color: #f3d8c9; margin: 0; }

/* ---- pagination ---- */
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 3.5rem; font-size: 0.85rem; }
.pagination a { color: var(--terracotta-d); }
.page-number { color: var(--muted); }

/* ============================================================
   Koenig editor cards — let images & embeds breathe past the
   reading column; required classes styled for full functionality
   ============================================================ */
.reflection__content :is(figure, .kg-card) { margin: 2.4rem 0; }
.reflection__content img { border-radius: 3px; }

.kg-width-wide { width: min(54rem, 92vw); margin-inline: calc(50% - min(27rem, 46vw)); }
.kg-width-full { width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); border-radius: 0; }
.kg-width-full img { border-radius: 0; width: 100%; }

.kg-image-card img { margin-inline: auto; }
.kg-card figcaption,
.kg-image-card figcaption { font-size: 0.82rem; color: var(--muted); text-align: center; padding-top: 0.7rem; line-height: 1.5; }

.kg-gallery-container { display: flex; flex-direction: column; gap: 0.75rem; }
.kg-gallery-row { display: flex; gap: 0.75rem; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }

.kg-bookmark-card { width: 100%; }
.kg-bookmark-container { display: flex; border: 1px solid var(--hairline); border-radius: 4px; overflow: hidden; color: var(--ink); }
.kg-bookmark-content { padding: 1.1rem 1.3rem; flex: 1; }
.kg-bookmark-title { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }
.kg-bookmark-description { color: var(--muted); font-size: 0.9rem; }

.kg-callout-card { padding: 1.2rem 1.4rem; border-radius: 4px; background: var(--paper-deep); margin: 2rem 0; }

/* ============================================================
   Motion — one orchestrated page-load + a gentle drift
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal { opacity: 0; transform: translateY(14px); animation: rise 0.9s var(--ease) forwards; animation-delay: calc(var(--d) * 130ms + 150ms); }
    @keyframes rise { to { opacity: 1; transform: none; } }

    /* float the whole flock — never animate per-bird transform (it clobbers their positions) */
    .birds--hero { animation: flock-float 10s ease-in-out infinite alternate; }
    @keyframes flock-float { from { transform: translateY(0); } to { transform: translateY(-6px); } }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
    body { font-size: 1rem; }
    .nav-toggle {
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 2.6rem; height: 2.6rem; background: none; border: 0; cursor: pointer; padding: 0;
    }
    .nav-toggle span { display: block; height: 1.5px; width: 1.5rem; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
    .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(6.5px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6.5px) rotate(-45deg); }

    .site-nav {
        position: fixed; inset: 4.6rem 0 auto 0; flex-direction: column; gap: 1.4rem;
        background: var(--paper); padding: 2rem 1.5rem 2.4rem; border-bottom: 1px solid var(--hairline);
        transform: translateY(-120%); transition: transform 0.4s var(--ease); align-items: flex-start;
    }
    .site-nav.is-open { transform: translateY(0); }
    .site-nav a { font-size: 1.1rem; }

    .site-footer__inner { grid-template-columns: 1fr; gap: 2.2rem; text-align: center; }
    .site-footer__links { justify-content: center; }
    .reflection-grid { grid-template-columns: 1fr; }
}
