/* ==========================================================================
   PikoPoko — "Poko's Parenting Notes" blog
   Built from design_handoff_pikopoko_blog (reference option 2b), 7 Aug 2026.

   Loaded only on blog routes, from header.php, AFTER the theme's own
   style.css and responsive.css so the cascade lands the right way round.
   Everything is namespaced .pp-blog* / .pp-note* / .pp-article* — the theme
   stylesheet has no .pp- selectors, so nothing here can reach the rest of
   the site and nothing there reaches in.
   ========================================================================== */

/* --- short-page footer gap -------------------------------------------------
   The theme uses the classic sticky-footer pattern: #wrapper is a flex column
   and .footer-wrapper carries margin-top:auto, so on a short page the footer
   is pushed to the bottom of the viewport and the slack above it shows
   #wrapper's white. With no posts yet the blog index is exactly that short
   page, and with the scallop bands gone the slack read as a white stripe
   between the ivory section and the ivory footer. Letting the content wrapper
   grow consumes the slack; the ivory covers anything left over. Blog routes
   only, and only ever a background and a flex value.

   The hex is literal rather than var(--pp-ivory) because the tokens are
   declared on .pp-blog, which is a descendant of this element. */
body.blog .main-content-wrapper,
body.single-post .main-content-wrapper,
body.archive .main-content-wrapper,
body.search .main-content-wrapper {
    flex: 1 0 auto;
    background: #FFF4E0;
}

.pp-blog {
    /* --- colour tokens, straight from the handoff table --- */
    --pp-gold:        #E8A008;  /* headlines, outlines, primary action   */
    --pp-gold-ink:    #C4820A;  /* eyebrows, links                       */
    --pp-gold-deep:   #8E5C05;  /* small labels on warm fills            */
    --pp-teal:        #8AD1C9;  /* secondary action, tag border, focus   */
    --pp-teal-pale:   #D0ECE9;  /* scallop band, avatar, tag fill        */
    --pp-teal-ink:    #2E6E66;  /* text on teal                          */
    --pp-cloud:       #FFEB80;  /* callout, tag border                   */
    --pp-cloud-pale:  #FFF8CF;  /* photo placeholder fill, tag fill      */
    --pp-ivory:       #FFF4E0;  /* section background                    */
    --pp-pink:        #FDE7DD;  /* tag border                            */
    --pp-pink-pale:   #FFF6F2;  /* tag fill                              */
    --pp-cocoa:       #4A3F30;  /* body text — never pure black          */
    --pp-ink-soft:    #6E614E;  /* secondary text                        */
    --pp-ink-light:   #978a76;  /* bylines                               */

    --pp-ease:        cubic-bezier(.34, 1.2, .64, 1);

    position: relative;
    display: block;
    background: var(--pp-ivory);
    overflow: hidden;
    font-family: "Quicksand", Calibri, sans-serif;
    color: var(--pp-cocoa);
}

/* --- no scalloped bands ----------------------------------------------------
   The handoff opens and closes the section with scalloped cloud bands, drawn
   from a reference that had no site around it. On the live site the header
   already ends in its own scallop, so the section's top band put a second row
   of bumps directly beneath the first and the two read as a mistake. Both
   bands are dropped and the section carries its own vertical padding instead;
   the header's scallop does the transition it was always doing.             */

.pp-blog-inner {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    padding: 56px 60px 64px;
}

/* --- floating decorations --------------------------------------------------
   Decorative only: empty alt, aria-hidden, and pulled out of the flow so a
   narrow viewport never has to reserve space for them.                      */
/* Constrained to the same 1180px box as the content, not to the full-bleed
   section. The reference positions these inside its fixed 1180px frame, so
   anchoring them to the viewport instead would fling them to the screen edges
   on a wide monitor. */
.pp-blog-deco {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100%;
    max-width: 1180px;
    transform: translateX(-50%);
    pointer-events: none;
}

.pp-blog-deco img {
    position: absolute;
    height: auto;
}

.pp-blog-deco .pp-deco-1 { top: 34px;    right: 56px; width: 54px; --r: 8deg;  animation: pp-float 10s  ease-in-out infinite; }
.pp-blog-deco .pp-deco-2 { bottom: 90px; left: 40px;  width: 50px; --r: -8deg; animation: pp-float 8.5s ease-in-out infinite; }

@keyframes pp-float {
    0%, 100% { transform: translateY(0)    rotate(var(--r, 0deg)); }
    50%      { transform: translateY(-9px) rotate(var(--r, 0deg)); }
}

/* --- intro row ------------------------------------------------------------ */
.pp-blog-intro {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 14px 0 36px;
}

.pp-blog-mascot {
    flex: 0 0 auto;
    width: 104px;
    height: auto;
    --r: -5deg;
    animation: pp-float 8s ease-in-out infinite;
}

.pp-blog-eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--pp-gold-ink);
}

.pp-blog h1.pp-blog-title {
    margin: 0 0 8px;
    font-family: "Handineat", cursive;
    font-size: 56px;
    line-height: 1;
    letter-spacing: .03em;
    color: var(--pp-gold);
}

.pp-blog-lead {
    margin: 0;
    max-width: 540px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--pp-ink-soft);
}

/* --- search field (search results only) ----------------------------------- */
.pp-blog-search {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    max-width: 540px;
}

.pp-blog-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 10px 18px;
    border: 2px solid var(--pp-teal-pale);
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    font-family: inherit;
    font-size: 15px;
    color: var(--pp-cocoa);
}

.pp-blog-search input[type="search"]::placeholder { color: var(--pp-ink-light); }

.pp-blog-search input[type="search"]:focus-visible {
    outline: 3px solid var(--pp-teal);
    outline-offset: 2px;
}

/* --- card grid ------------------------------------------------------------ */
.pp-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    align-items: start;
}

/* --- note card -------------------------------------------------------------
   The whole card is one anchor, so it is keyboard-reachable and announced as
   a single link rather than as a pile of separate ones.                     */
.pp-note {
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 17px;
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    border: 2px solid rgba(255, 255, 255, .98);
    border-radius: 32px;
    box-shadow: 0 14px 36px rgba(122, 92, 36, .14);
    text-decoration: none;
    color: inherit;
    transition:
        box-shadow .28s var(--pp-ease),
        filter     .18s ease,
        transform  .16s var(--pp-ease);
}

/* The tilt is part of the card's resting state, so every transform below has
   to restate it — otherwise hover or press would snap the card straight. */
.pp-note-1 { transform: rotate(-1.4deg); }
.pp-note-2 { transform: rotate(1.1deg) translateY(16px); }
.pp-note-3 { transform: rotate(-.7deg); }

.pp-note:hover {
    filter: brightness(.985);
    box-shadow: 0 18px 44px rgba(122, 92, 36, .18);
}

.pp-note-1:active { transform: rotate(-1.4deg) scale(.96); }
.pp-note-2:active { transform: rotate(1.1deg) translateY(16px) scale(.96); }
.pp-note-3:active { transform: rotate(-.7deg) scale(.96); }

.pp-blog a:focus-visible,
.pp-blog button:focus-visible {
    outline: 3px solid var(--pp-teal);
    outline-offset: 3px;
}

/* --- photo well: real featured image, or the dashed placeholder ----------- */
.pp-note-photo {
    position: relative;
    display: grid;
    /* minmax(0,…), not 1fr. A bare 1fr is minmax(auto,1fr), and that automatic
       minimum is the item's min-content size — for an <img> that is its full
       intrinsic height, so the row refuses to shrink to the well and the
       picture's own height wins. The well then does not crop at all: because
       overflow is visible (the corner sticker must not be clipped) the image
       simply spills over the card below it. */
    grid-template-rows: minmax(0, 1fr);
    place-items: center;
    height: 160px;
    border-radius: 24px;
    overflow: visible;
    text-align: center;
}

.pp-note-photo.is-placeholder {
    border: 2px dashed var(--pp-gold);
}

.pp-note-photo.fill-cloud { background: rgba(255, 248, 207, .75); }
.pp-note-photo.fill-teal  { background: rgba(208, 236, 233, .70); }

.pp-note-photo-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--pp-gold-deep);
}

.pp-note-photo img.pp-note-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Above centre, because faces sit above centre. Checked against all five
       published photographs: never worse than 50%, and better on three. */
    object-position: 50% 37%;
    border-radius: 24px;
    display: block;
}

/* Corner sticker. Sits outside the well, so the well must not clip it. */
.pp-note-sticker {
    position: absolute;
    width: 52px;
    height: auto;
    pointer-events: none;
}

.pp-note-sticker.pos-1 { bottom: -18px; right: -10px; width: 52px; }
.pp-note-sticker.pos-2 { bottom: -16px; left:  -12px; width: 50px; }
.pp-note-sticker.pos-3 { bottom: -16px; right: -10px; width: 48px; }

/* --- category tag --------------------------------------------------------- */
.pp-tag {
    align-self: flex-start;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    border: 2px solid transparent;
    white-space: nowrap;
}

.pp-tag-pink  { background: var(--pp-pink-pale);  border-color: var(--pp-pink);      color: var(--pp-gold-deep); }
.pp-tag-cloud { background: var(--pp-cloud-pale); border-color: var(--pp-cloud);     color: var(--pp-gold-deep); }
.pp-tag-teal  { background: var(--pp-teal-pale);  border-color: var(--pp-teal);      color: var(--pp-teal-ink);  }
.pp-tag-gold  { background: var(--pp-ivory);      border-color: var(--pp-gold);      color: var(--pp-gold-deep); }

/* --- card type ------------------------------------------------------------ */
.pp-blog h2.pp-note-title,
.pp-blog h3.pp-note-title {
    margin: 0;
    font-family: "Handineat", cursive;
    font-size: 25px;
    line-height: 1.1;
    letter-spacing: .02em;
    color: var(--pp-cocoa);
}

.pp-note-excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--pp-ink-soft);
}

.pp-note-byline {
    font-size: 12px;
    font-weight: 600;
    color: var(--pp-ink-light);
}

/* --- load more ------------------------------------------------------------ */
.pp-blog-more {
    display: flex;
    justify-content: center;
    margin-top: 34px;
}

.pp-more-btn {
    display: inline-block;
    padding: 14px 30px;
    border: 0;
    border-radius: 999px;
    background: var(--pp-teal);
    color: var(--pp-teal-ink);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(138, 209, 201, .4);
    cursor: pointer;
    transition: transform .16s var(--pp-ease), box-shadow .28s var(--pp-ease);
}

.pp-more-btn:hover  { box-shadow: 0 12px 26px rgba(138, 209, 201, .5); color: var(--pp-teal-ink); }
.pp-more-btn:active { transform: scale(.96); }

/* Handoff: "a spinner-less disabled state at ~45% opacity while fetching." */
.pp-more-btn[aria-busy="true"],
.pp-more-btn[disabled] {
    opacity: .45;
    pointer-events: none;
}

/* --- empty / error card --------------------------------------------------- */
.pp-blog-empty {
    max-width: 420px;
    margin: 10px auto 0;
    padding: 26px 30px;
    text-align: center;
    background: var(--pp-ivory);
    border: 2px solid rgba(255, 255, 255, .98);
    border-radius: 32px;
    box-shadow: 0 14px 36px rgba(122, 92, 36, .14);
}

.pp-blog-empty p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--pp-ink-soft);
}

.pp-blog-empty a {
    color: var(--pp-gold-ink);
    font-weight: 700;
}

/* ==========================================================================
   Article page — the prototype's overlay, rebuilt as a routed /blog/<slug>.
   Scrim and close button dropped per the handoff's production note; the
   sheet, type and callout treatments are kept.
   ========================================================================== */

.pp-article-sheet {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 38px 44px 46px;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(30px) saturate(170%);
    backdrop-filter: blur(30px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 34px;
    box-shadow: 0 30px 80px rgba(74, 63, 48, .3);
}

.pp-article-eyebrow {
    margin: 0 0 10px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--pp-gold-ink);
}

.pp-blog h1.pp-article-title {
    margin: 0 0 16px;
    max-width: 600px;
    font-family: "Handineat", cursive;
    font-size: 46px;
    line-height: 1.02;
    letter-spacing: .02em;
    color: var(--pp-cocoa);
}

.pp-article-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.pp-article-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: var(--pp-teal-pale);
    border: 2px solid var(--pp-gold);
    font-size: 13px;
    font-weight: 700;
    color: var(--pp-teal-ink);
}

.pp-article-authorname {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--pp-cocoa);
}

.pp-article-read {
    display: block;
    font-weight: 500;
    color: var(--pp-ink-light);
}

.pp-article-hero {
    display: grid;
    /* See .pp-note-photo — same trap. Here overflow is hidden, so instead of
       spilling, the picture was clipped to its top 54%: a lot of floor above
       the subject and the subject cut off at the bottom. */
    grid-template-rows: minmax(0, 1fr);
    place-items: center;
    height: 240px;
    margin-bottom: 26px;
    border-radius: 24px;
    overflow: hidden;
}

.pp-article-hero.is-placeholder {
    border: 2px dashed var(--pp-gold);
    background: rgba(255, 244, 224, .7);
}

.pp-article-hero-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--pp-gold-deep);
}

.pp-article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 37%;
    display: block;
}

/* --- article body ----------------------------------------------------------
   The first paragraph becomes the lead purely by position, so nothing extra
   is asked of whoever writes the post.                                      */
.pp-article-body p {
    margin: 0 0 18px;
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--pp-cocoa);
}

.pp-article-body > p:first-of-type {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.65;
}

.pp-article-body > p:last-child { margin-bottom: 0; }

.pp-article-body h2,
.pp-article-body h3 {
    font-family: "Handineat", cursive;
    line-height: 1.15;
    letter-spacing: .02em;
    color: var(--pp-cocoa);
    margin: 30px 0 12px;
}

.pp-article-body h2 { font-size: 30px; }
.pp-article-body h3 { font-size: 24px; }

.pp-article-body ul,
.pp-article-body ol {
    margin: 0 0 18px;
    padding-left: 22px;
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--pp-cocoa);
}

.pp-article-body li { margin-bottom: 6px; }

.pp-article-body a { color: var(--pp-gold-ink); }
.pp-article-body a:hover { color: var(--pp-gold); }

.pp-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 24px;
}

/* --- "Try this tomorrow" callout ------------------------------------------ */
.pp-callout {
    padding: 22px 26px;
    margin: 0 0 18px;
    background: rgba(255, 235, 128, .4);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 24px;
}

/* Both selectors are deliberately over-qualified. The callout sits inside
   .pp-article-body, whose generic `p` rule (16.5px cocoa) and the callout's
   own `p` rule (16px) would otherwise outrank a bare .pp-callout-label on
   specificity and swallow the 11.5px label. */
.pp-article-body .pp-callout p.pp-callout-label,
.pp-callout p.pp-callout-label {
    margin: 0 0 8px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--pp-gold-deep);
}

.pp-article-body .pp-callout p {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
}

/* --- back link + prev/next ------------------------------------------------ */
.pp-article-foot {
    max-width: 760px;
    margin: 30px auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
}

.pp-article-foot a { color: var(--pp-gold-ink); font-weight: 700; font-size: 14px; text-decoration: none; }
.pp-article-foot a:hover { color: var(--pp-gold); text-decoration: underline; }

/* ==========================================================================
   Glass fallback. Chrome/Safari/Firefox all support backdrop-filter now, but
   where it is missing the .72 alpha would read as washed-out grey over the
   ivory, so both surfaces go solid instead.
   ========================================================================== */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .pp-note,
    .pp-article-sheet { background: #FFFDF8; }
}

/* ==========================================================================
   Responsive — specified in the handoff, absent from the reference.
   ========================================================================== */
@media (max-width: 1023px) {
    .pp-blog-inner   { padding: 48px 40px 56px; }
    .pp-blog-grid    { grid-template-columns: repeat(2, 1fr); gap: 22px; }
    .pp-blog h1.pp-blog-title { font-size: 42px; }
    .pp-article-sheet { padding: 34px 34px 40px; }
    .pp-blog h1.pp-article-title { font-size: 40px; }
    .pp-blog-deco .pp-deco-2 { display: none; }
}

@media (max-width: 639px) {
    .pp-blog-inner { padding: 34px 20px 40px; }
    .pp-blog-deco  { display: none; }

    /* Stacked, not side by side: at 375px a 72px mascot plus its gap leaves
       the headline barely 240px to wrap into, and "Poko's Parenting Notes"
       breaks badly. The handoff leaves the responsive layout to us. */
    .pp-blog-intro  { flex-direction: column; align-items: flex-start; gap: 12px; margin: 10px 0 26px; }
    .pp-blog-mascot { width: 72px; }
    .pp-blog h1.pp-blog-title { font-size: 34px; }

    .pp-blog-grid { grid-template-columns: 1fr; gap: 18px; }

    /* The scattered tilt reads as a mistake in a single column. */
    .pp-note-1,
    .pp-note-2,
    .pp-note-3 { transform: rotate(0); }
    .pp-note-1:active,
    .pp-note-2:active,
    .pp-note-3:active { transform: scale(.96); }

    /* Tap targets >= 44px. */
    .pp-more-btn { padding: 15px 28px; min-height: 44px; }

    .pp-article-sheet { padding: 26px 22px 32px; border-radius: 28px; }
    .pp-blog h1.pp-article-title { font-size: 32px; }
    .pp-article-hero { height: 180px; }
    .pp-article-body > p:first-of-type { font-size: 17.5px; }
    .pp-callout { padding: 18px 20px; }
}

/* ==========================================================================
   Motion preferences. The handoff asks for the float to stop; anything that
   moves an element across the screen goes with it.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .pp-blog-mascot,
    .pp-blog-deco img {
        animation: none;
        transform: rotate(var(--r, 0deg));
    }
    .pp-note,
    .pp-more-btn { transition: none; }
}
