/* ==========================================================================
   Lily O'Riley blog theme
   Palette + type lifted from the live main site so the two read as one brand.
   ========================================================================== */

/* ---- Fonts (self-hosted) ------------------------------------------------- */
@font-face { font-family: "Bebas Neue"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/bebas-neue-400.woff2") format("woff2"); }

@font-face { font-family: "KG Piece By Piece"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/kg-piece-by-piece.ttf") format("truetype"); }

@font-face { font-family: "Open Sans"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/open-sans-300.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 300; font-style: italic; font-display: swap; src: url("../fonts/open-sans-300-italic.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/open-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/open-sans-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/open-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-style: italic; font-display: swap; src: url("../fonts/open-sans-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/open-sans-700.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-style: italic; font-display: swap; src: url("../fonts/open-sans-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/open-sans-800.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 800; font-style: italic; font-display: swap; src: url("../fonts/open-sans-800-italic.woff2") format("woff2"); }

@font-face { font-family: "Martel Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/martel-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Martel Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/martel-sans-700.woff2") format("woff2"); }
@font-face { font-family: "Martel Sans"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/martel-sans-800.woff2") format("woff2"); }

/* ---- Tokens -------------------------------------------------------------- */
:root {
    --pink:        #dba4cb;   /* primary orchid: headings fill, affiliate blocks, CTA */
    --pink-alt:    #e1a0cb;   /* hover */
    --page-bg:     #fdebeb;   /* light pink page */
    --card-bg:     #fdf4ed;   /* cream content card */
    --ink:         #443028;   /* warm near-black body text */
    --shadow-grey: #c2c2c2;   /* offset shadow behind display headings */
    --terracotta:  #e48c71;   /* active nav link */
    --line:        #000;

    --display: "Bebas Neue", Impact, sans-serif;
    --script:  "KG Piece By Piece", "Comic Sans MS", cursive;
    --body:    "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;

    --wrap: 1180px;
    --gap: 40px;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--ink);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.6;
}

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

a { color: inherit; }

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; }

/* ---- Navigation (matches main site) -------------------------------------- */
.site-header { padding: 26px 24px 0; }
.nav-wrap { max-width: var(--wrap); margin: 0 auto; display: flex; justify-content: flex-end; }

.nav-menu {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}
.nav-link {
    display: flex;
    align-items: center;
    padding: 16px 22px;
    font-family: var(--body);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--line);
    transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--terracotta); }
.nav-link--current { color: var(--terracotta); }
.nav-link-cta {
    background: var(--pink);
    border-left: 2px solid var(--line);
    color: var(--line);
}
.nav-link-cta:hover { background: var(--pink-alt); color: var(--line); }

.nav-toggle { display: none; }

/* ---- Layout: main column + affiliate rail -------------------------------- */
.layout {
    max-width: var(--wrap);
    margin: 8px auto 0;
    padding: 0 24px 60px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: var(--gap);
    align-items: start;
}
.layout__main { min-width: 0; }
.layout__main--wide { grid-column: 1 / -1; }

/* ---- Display heading with offset shadow (as on main site) ---------------- */
.page-display {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(52px, 8vw, 104px);
    line-height: .92;
    letter-spacing: .01em;
    margin: 10px 0 22px;
    color: var(--pink);
    text-shadow: 4px 4px 0 var(--shadow-grey);
    text-transform: uppercase;
}

/* ---- Post list (list.png) ------------------------------------------------ */
.post-list { display: flex; flex-direction: column; gap: 30px; }

.post-card {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    background: var(--card-bg);
    padding: 18px;
}

/* Instagram-style frame around the feature image */
.ig-frame {
    display: block;
    background: var(--card-bg);
    border: 2px solid #4a2f42;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
}
.ig-frame__top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    background: var(--pink);
    border-bottom: 2px solid #4a2f42;
}
.ig-frame__cam { width: 14px; height: 12px; border: 2px solid #4a2f42; border-radius: 3px; }
.ig-frame__avatar { width: 15px; height: 15px; border: 2px solid #4a2f42; border-radius: 50%; }
.ig-frame__date { font-style: italic; font-size: 12px; font-weight: 600; color: #4a2f42; }
.ig-frame__dots { margin-left: auto; width: 16px; height: 4px; background:
    radial-gradient(circle, #4a2f42 40%, transparent 42%) 0 / 6px 100% repeat-x; }
.ig-frame__media { aspect-ratio: 1 / 1; background: var(--card-bg); }
.ig-frame__media img { width: 100%; height: 100%; object-fit: cover; }
.ig-frame__bar {
    display: flex; gap: 14px; padding: 8px 10px;
    background: var(--card-bg); border-top: 2px solid #4a2f42;
}
.ig-frame__bar span { width: 14px; height: 14px; border: 2px solid #4a2f42; border-radius: 3px; }
.ig-frame__bar span:last-child { border-radius: 50%; }

.post-card__title {
    font-family: var(--script);
    font-weight: 400;
    font-size: 34px;
    line-height: 1.05;
    margin: 4px 0 12px;
}
.post-card__title a { text-decoration: none; }
.post-card__title a:hover { color: var(--pink); }
.post-card__blurb { margin: 0 0 18px; }
.post-card__tags {
    font-family: var(--script); font-size: 20px;
    text-align: right; margin: 0; color: var(--ink);
}

/* ---- Single post (entry.png) --------------------------------------------- */
.post__card { background: var(--card-bg); padding: 30px 34px 24px; box-shadow: 8px 8px 0 var(--shadow-grey); }
.post__date { font-style: italic; text-align: right; margin: 0 0 10px; font-size: 15px; }

.post__content { font-size: 17px; }
.post__content h2, .post__content h3 {
    font-family: var(--script); font-weight: 400;
    font-size: 30px; line-height: 1.1; margin: 26px 0 8px;
}
.post__content p { margin: 0 0 16px; }
.post__content a { color: #b5638f; }

.post__footer {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 16px; margin-top: 22px;
}
.post__tags { font-family: var(--script); font-size: 20px; margin: 0; }
.post__author { font-family: var(--script); font-size: 26px; margin: 0; text-align: right; }

/* ---- Ghost native cards, themed to the mock ------------------------------ */
/* YouTube / video embeds */
.kg-embed-card, .kg-video-card { margin: 0 0 20px; }
.kg-embed-card iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }

/* Button card -> "Affiliate / Purchase Link" box */
.kg-button-card { margin: 0 0 16px; justify-content: flex-start; }
.kg-btn {
    background: #fff !important;
    color: var(--ink) !important;
    font-family: var(--script) !important;
    font-weight: 400 !important;
    font-size: 24px !important;
    border: 1px solid rgba(68,48,40,.15);
    border-radius: 4px;
    padding: 10px 26px;
    box-shadow: 0 1px 4px rgba(68,48,40,.12);
    text-transform: none;
    letter-spacing: 0;
}
.kg-btn:hover { background: var(--card-bg) !important; }

/* Callout card -> "Discount Code" box */
.kg-callout-card {
    background: #f8f8f8;
    border: none;
    border-radius: 4px;
    font-family: var(--script);
    font-size: 24px;
    padding: 12px 26px;
    box-shadow: 0 1px 4px rgba(68,48,40,.12);
    margin: 0 0 20px;
}
.kg-callout-card-content { font-family: var(--script); }
.kg-callout-emoji { font-size: 22px; }

.kg-bookmark-card, .kg-image-card, .kg-gallery-card { margin: 0 0 20px; }

/* Koenig full/wide-width cards: break out of the card padding a little */
.post__content .kg-width-wide { position: relative; width: calc(100% + 24px); margin-left: -12px; }
.post__content .kg-width-full { position: relative; width: calc(100% + 68px); margin-left: -34px; }
@media (max-width: 640px) {
    .post__content .kg-width-wide,
    .post__content .kg-width-full { width: calc(100% + 40px); margin-left: -20px; }
}

/* ---- Affiliate rail (both mocks) -----------------------------------------
   Content is a Ghost Page (slug: affiliate-links) pulled in via {{#get}}
   in partials/affiliate-sidebar.hbs -- see that file for why. These rules
   theme whichever native Koenig cards Lily puts on that page. ---------- */
.affiliate-rail { position: sticky; top: 24px; }
.affiliate-rail__content { display: flex; flex-direction: column; gap: 22px; }
.affiliate-rail__content .kg-card { margin: 0; }

/* Image card (the expected case: one linked banner image per block) */
.affiliate-rail__content figure.kg-image-card {
    background: var(--pink);
    overflow: hidden;
    transition: background .15s, transform .15s;
}
.affiliate-rail__content figure.kg-image-card:hover {
    background: var(--pink-alt);
    transform: translateY(-2px);
}
.affiliate-rail__content figure.kg-image-card a { display: block; }
.affiliate-rail__content figure.kg-image-card img {
    display: block; width: 100%; height: 84px; object-fit: cover;
}
.affiliate-rail__content figcaption {
    padding: 8px 10px 10px;
    font-family: var(--display);
    font-size: 18px;
    letter-spacing: .04em;
    color: #fff;
    text-align: center;
}

/* Button card fallback (a text-only slot before real artwork exists) */
.affiliate-rail__content .kg-btn {
    display: flex; width: 100%; min-height: 84px;
    align-items: center; justify-content: center;
    background: var(--pink) !important;
    color: #fff !important;
    font-family: var(--display) !important;
    font-size: 22px !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: none !important;
    box-shadow: none !important;
}
.affiliate-rail__content .kg-btn:hover { background: var(--pink-alt) !important; }

/* ---- Misc ---------------------------------------------------------------- */
.end-of-page {
    text-align: center; font-style: italic; color: #b9a9a3;
    letter-spacing: .1em; margin: 34px 0 0;
}
.archive-desc { margin: -8px 0 24px; font-style: italic; }
.empty { padding: 40px 0; font-style: italic; }

.pagination {
    display: flex; justify-content: center; align-items: center; gap: 22px;
    margin-top: 34px; font-family: var(--script); font-size: 22px;
}
.pagination a { text-decoration: none; }
.pagination a:hover { color: var(--pink); }

.site-footer {
    flex-shrink: 0; text-align: center; padding: 26px 24px 34px;
    font-size: 14px; color: #b08fa6;
}
.site-footer a { color: inherit; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .affiliate-rail { position: static; }
    .affiliate-rail__content { flex-direction: row; flex-wrap: wrap; }
    .affiliate-rail__content .kg-image-card,
    .affiliate-rail__content .kg-btn { flex: 1 1 40%; }
}

@media (max-width: 640px) {
    .site-header { padding: 18px 16px 0; }
    .nav-wrap { justify-content: stretch; }
    .nav-toggle {
        display: flex; flex-direction: column; gap: 5px;
        margin-left: auto; padding: 12px; background: #fff;
        border: 2px solid var(--line); border-radius: 4px; cursor: pointer;
    }
    .nav-toggle .burger-line { width: 24px; height: 2px; background: var(--line); }
    .nav-menu {
        display: none; position: absolute; left: 16px; right: 16px; z-index: 20;
        flex-direction: column; margin-top: 8px;
    }
    .nav-menu.is-open { display: flex; }
    .nav-link, .nav-link-cta { border-left: none; border-bottom: 1px solid rgba(0,0,0,.1); justify-content: center; }
    .layout { padding: 0 16px 48px; }
    .post-card { grid-template-columns: 1fr; }
    .ig-frame { max-width: 300px; }
    .post__card { padding: 20px; }
    .affiliate-rail__content .kg-image-card,
    .affiliate-rail__content .kg-btn { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
