/* ============================================================
   APPLEGUM POCKET — Ghost Theme Stylesheet
   Palette confirmed June 2026
   ============================================================ */

/* ---- CSS Variables ---------------------------------------- */
:root {
    --ap-forest:      #5a7a3a;   /* The one strong green */
    --ap-espresso:    #3d2010;   /* Body text, brand name */
    --ap-rose:        #bd8274;   /* Accent, CTAs, links */
    --ap-tan:         #dfbd9c;   /* Dividers, decorative warmth */
    --ap-whisper:     #fdf8f2;   /* Sidebar background */
    --ap-warm-white:  #fffcf8;   /* Feed / page background */
    --ap-sage:        #e8f2e0;   /* Active nav, tag pills */

    --ap-border:      rgba(30, 24, 13, 0.1);
    --ap-text-muted:  rgba(30, 24, 13, 0.45);

    --ap-sidebar-width: 240px;
    --ap-content-max:   720px;
    --ap-radius:        6px;
    --ap-radius-lg:     10px;

    --ap-font-sans: 'Georgia', 'Times New Roman', serif;
    --ap-font-brand: 'Dancing Script', cursive;
    --ap-font-ui:   system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--ap-font-sans);
    font-size: 1rem;
    color: var(--ap-espresso);
    background: var(--ap-warm-white);
    -webkit-font-smoothing: antialiased;
    line-height: 1.7;
}

a { color: var(--ap-forest); text-decoration: none; }
a:hover { color: var(--ap-rose); }

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

/* ============================================================
   LAYOUT — Shell, Sidebar, Main
   ============================================================ */

.ap-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---------------------------------------------- */
.ap-sidebar {
    width: var(--ap-sidebar-width);
    flex-shrink: 0;
    background: var(--ap-whisper);
    border-right: 1px solid var(--ap-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}
.ap-sidebar::-webkit-scrollbar { display: none; }

.ap-sidebar-inner {
    padding: 32px 22px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* Brand */
.ap-brand {
    display: block;
    font-family: var(--ap-font-brand);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ap-espresso);
    line-height: 1.2;
    letter-spacing: 0.01em;
    margin-bottom: 6px;
}
.ap-brand:hover { color: var(--ap-forest); }

.ap-tagline {
    font-family: var(--ap-font-ui);
    font-size: 0.72rem;
    color: var(--ap-rose);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 28px;
    line-height: 1.4;
}

/* Navigation */
.ap-nav { margin-bottom: 24px; }

.ap-nav .nav {
    list-style: none;
}

.ap-nav .nav li { margin-bottom: 2px; }

.ap-nav .nav li a {
    display: block;
    font-family: var(--ap-font-ui);
    font-size: 0.875rem;
    color: var(--ap-forest);
    padding: 6px 10px;
    border-radius: var(--ap-radius);
    transition: background 0.15s, color 0.15s;
}

.ap-nav .nav li a:hover,
.ap-nav .nav li.nav-current a {
    background: var(--ap-sage);
    color: var(--ap-espresso);
}

/* Browse / secondary nav */
.ap-browse {
    margin-bottom: 28px;
}

.ap-browse-label {
    display: block;
    font-family: var(--ap-font-ui);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ap-text-muted);
    margin-bottom: 8px;
    padding: 0 10px;
}

.ap-browse .nav { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; padding: 0 10px; }

.ap-browse .nav li a {
    display: inline-block;
    font-family: var(--ap-font-ui);
    font-size: 0.72rem;
    background: var(--ap-sage);
    color: var(--ap-forest);
    padding: 3px 10px;
    border-radius: 20px;
    transition: background 0.15s;
}

.ap-browse .nav li a:hover {
    background: var(--ap-tan);
    color: var(--ap-espresso);
}

/* Subscribe block */
.ap-subscribe-block {
    background: white;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    padding: 16px;
    margin-bottom: 28px;
}

.ap-subscribe-prompt {
    font-family: var(--ap-font-ui);
    font-size: 0.75rem;
    color: var(--ap-espresso);
    margin-bottom: 10px;
    line-height: 1.4;
}

.ap-subscribe-form { display: flex; flex-direction: column; gap: 6px; }

.ap-subscribe-form input[type="email"] {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius);
    font-family: var(--ap-font-ui);
    font-size: 0.8rem;
    background: var(--ap-warm-white);
    color: var(--ap-espresso);
    outline: none;
    transition: border-color 0.15s;
}
.ap-subscribe-form input[type="email"]:focus { border-color: var(--ap-forest); }

.ap-subscribe-form button {
    padding: 7px 12px;
    background: var(--ap-rose);
    color: white;
    border: none;
    border-radius: var(--ap-radius);
    font-family: var(--ap-font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.ap-subscribe-form button:hover { background: var(--ap-forest); }

/* Sidebar footer */
.ap-sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--ap-border);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ap-social-link {
    font-family: var(--ap-font-ui);
    font-size: 0.72rem;
    color: var(--ap-text-muted);
    transition: color 0.15s;
}
.ap-social-link:hover { color: var(--ap-rose); }

/* ---- Main content ----------------------------------------- */
.ap-main-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ap-main {
    flex: 1;
    padding: 40px 32px;
    max-width: calc(var(--ap-content-max) + 64px);
}

/* ---- Footer ----------------------------------------------- */
.ap-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--ap-border);
    font-family: var(--ap-font-ui);
    font-size: 0.75rem;
    color: var(--ap-text-muted);
}
.ap-footer a { color: var(--ap-text-muted); }
.ap-footer a:hover { color: var(--ap-rose); }

/* ============================================================
   FEED — Card grid
   ============================================================ */

.ap-feed-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ap-border);
}

.ap-feed-title {
    font-size: 1.5rem;
    color: var(--ap-forest);
    font-weight: 700;
}

.ap-feed-desc {
    font-size: 0.9rem;
    color: var(--ap-text-muted);
    margin-top: 6px;
}

.ap-feed {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ---- Single card ------------------------------------------ */
.ap-card {
    background: white;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.ap-card:hover {
    box-shadow: 0 4px 20px rgba(30, 24, 13, 0.08);
    transform: translateY(-1px);
}

.ap-card-image-wrap {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--ap-sage);
}

.ap-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ap-card:hover .ap-card-image { transform: scale(1.02); }

.ap-card-body {
    padding: 18px 20px 20px;
}

.ap-card-meta-top { margin-bottom: 7px; }

.ap-card-tag {
    display: inline-block;
    font-family: var(--ap-font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ap-forest);
    background: var(--ap-sage);
    padding: 2px 9px;
    border-radius: 20px;
    transition: background 0.15s;
}
.ap-card-tag:hover { background: var(--ap-tan); color: var(--ap-espresso); }

.ap-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
    color: var(--ap-espresso);
}

.ap-card-title a { color: inherit; }
.ap-card-title a:hover { color: var(--ap-forest); }

.ap-card-excerpt {
    font-size: 0.9rem;
    color: var(--ap-text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ap-card-meta-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ap-font-ui);
    font-size: 0.78rem;
    color: var(--ap-text-muted);
}

.ap-card-sep { opacity: 0.4; }
.ap-card-lock { font-size: 0.75rem; }

/* ---- Pagination ------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 48px 0 20px;
    font-family: var(--ap-font-ui);
    font-size: 0.85rem;
}

.pagination a {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius);
    color: var(--ap-forest);
    transition: background 0.15s;
}

.pagination a:hover { background: var(--ap-sage); }

.pagination .page-number { color: var(--ap-text-muted); }

/* ============================================================
   SINGLE POST
   ============================================================ */

.ap-post { max-width: var(--ap-content-max); }

.ap-post-header { margin-bottom: 28px; }

.ap-post-tag {
    display: inline-block;
    font-family: var(--ap-font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ap-forest);
    background: var(--ap-sage);
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.ap-post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ap-espresso);
    margin-bottom: 14px;
}

.ap-post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-family: var(--ap-font-ui);
    font-size: 0.82rem;
    color: var(--ap-text-muted);
}

.ap-post-author { font-weight: 500; color: var(--ap-forest); }

/* Feature image */
.ap-post-feature-image {
    margin: 0 0 36px;
    border-radius: var(--ap-radius-lg);
    overflow: hidden;
}

.ap-post-feature-image img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
}

.ap-post-feature-image figcaption {
    font-family: var(--ap-font-ui);
    font-size: 0.78rem;
    color: var(--ap-text-muted);
    text-align: center;
    padding: 8px 0 0;
}

/* ---- Post body (Ghost .gh-content) ------------------------ */
.gh-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--ap-espresso);
}

.gh-content h2 {
    font-size: 1.45rem;
    color: var(--ap-forest);
    margin: 40px 0 14px;
    font-weight: 700;
}

.gh-content h3 {
    font-size: 1.2rem;
    color: var(--ap-forest);
    margin: 32px 0 10px;
    font-weight: 700;
}

.gh-content p { margin-bottom: 1.4em; }

.gh-content a {
    color: var(--ap-rose);
    text-decoration: underline;
    text-decoration-color: rgba(189, 130, 116, 0.4);
    transition: text-decoration-color 0.15s;
}
.gh-content a:hover { text-decoration-color: var(--ap-rose); }

.gh-content ul, .gh-content ol {
    margin: 0 0 1.4em 1.5em;
}

.gh-content li { margin-bottom: 0.4em; }

.gh-content blockquote {
    border-left: 3px solid var(--ap-tan);
    padding: 8px 20px;
    margin: 24px 0;
    color: var(--ap-text-muted);
    font-style: italic;
}

.gh-content img {
    border-radius: var(--ap-radius);
    margin: 24px auto;
}

.gh-content hr {
    border: none;
    border-top: 1px solid var(--ap-border);
    margin: 36px 0;
}

.gh-content pre {
    background: var(--ap-whisper);
    border-radius: var(--ap-radius);
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 0.88rem;
    margin-bottom: 1.4em;
}

.gh-content code {
    background: var(--ap-whisper);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.88em;
}

.gh-content figure { margin: 28px 0; }
.gh-content figcaption {
    font-family: var(--ap-font-ui);
    font-size: 0.78rem;
    color: var(--ap-text-muted);
    text-align: center;
    margin-top: 8px;
}

/* Post footer */
.ap-post-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--ap-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ap-post-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.ap-tag-pill {
    display: inline-block;
    font-family: var(--ap-font-ui);
    font-size: 0.72rem;
    background: var(--ap-sage);
    color: var(--ap-forest);
    padding: 3px 10px;
    border-radius: 20px;
    transition: background 0.15s;
}
.ap-tag-pill:hover { background: var(--ap-tan); color: var(--ap-espresso); }

.ap-share-link {
    font-family: var(--ap-font-ui);
    font-size: 0.78rem;
    color: var(--ap-text-muted);
    border: 1px solid var(--ap-border);
    padding: 4px 12px;
    border-radius: var(--ap-radius);
    margin-left: auto;
    transition: background 0.15s, color 0.15s;
}
.ap-share-link:hover { background: var(--ap-rose); color: white; border-color: var(--ap-rose); }

/* Prev / next nav */
.ap-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--ap-border);
}

.ap-post-nav-prev,
.ap-post-nav-next {
    display: block;
    padding: 16px 18px;
    background: white;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ap-post-nav-prev:hover,
.ap-post-nav-next:hover {
    border-color: var(--ap-forest);
    box-shadow: 0 2px 10px rgba(30, 24, 13, 0.06);
}

.ap-post-nav-next { text-align: right; grid-column: 2; }

.ap-post-nav-label {
    display: block;
    font-family: var(--ap-font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ap-text-muted);
    margin-bottom: 5px;
}

.ap-post-nav-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ap-espresso);
    line-height: 1.3;
}

/* ============================================================
   STATIC PAGE
   ============================================================ */

.ap-page { max-width: var(--ap-content-max); }

/* ============================================================
   ERROR PAGE
   ============================================================ */

.ap-error {
    text-align: center;
    padding: 80px 20px;
}

.ap-error h1 {
    font-size: 5rem;
    color: var(--ap-tan);
    margin-bottom: 12px;
}

.ap-error p {
    font-size: 1.1rem;
    color: var(--ap-text-muted);
    margin-bottom: 28px;
}

.ap-btn {
    display: inline-block;
    padding: 10px 22px;
    background: var(--ap-forest);
    color: white;
    border-radius: var(--ap-radius);
    font-family: var(--ap-font-ui);
    font-size: 0.88rem;
    transition: background 0.15s;
}
.ap-btn:hover { background: var(--ap-rose); color: white; }

/* ============================================================
   COMMENTS
   ============================================================ */
.ap-comments {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--ap-border);
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */

.ap-mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ap-whisper);
    border-bottom: 1px solid var(--ap-border);
    padding: 14px 20px;
    align-items: center;
    justify-content: space-between;
}

.ap-mobile-brand {
    font-family: var(--ap-font-sans);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ap-espresso);
}

.ap-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.ap-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ap-espresso);
    border-radius: 2px;
    transition: opacity 0.2s, transform 0.2s;
}

/* Overlay (mobile) */
.ap-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 24, 13, 0.4);
    z-index: 90;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
    :root { --ap-sidebar-width: 200px; }
    .ap-main { padding: 28px 24px; }
}

@media (max-width: 768px) {
    /* Hide static sidebar, show mobile header */
    .ap-mobile-header { display: flex; }

    .ap-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        box-shadow: 4px 0 20px rgba(30, 24, 13, 0.15);
    }

    .ap-sidebar.is-open { transform: translateX(0); }

    .ap-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity 0.28s; }
    .ap-overlay.is-open { opacity: 1; pointer-events: all; }

    .ap-main { padding: 24px 18px; }

    .ap-post-title { font-size: 1.5rem; }

    .ap-post-nav { grid-template-columns: 1fr; }
    .ap-post-nav-next { grid-column: 1; text-align: left; }
}

@media (max-width: 480px) {
    .ap-card-title { font-size: 1rem; }
    .ap-main { padding: 18px 14px; }
}

/* ============================================================
   GHOST EDITOR CARD WIDTHS (required by Ghost theme spec)
   ============================================================ */

.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin: auto calc(50% - 50vw);
    transform: translateX(calc(50vw - 50%));
}

.kg-width-full {
    position: relative;
    width: 100vw;
    margin: auto calc(50% - 50vw);
    transform: translateX(calc(50vw - 50%));
}

.kg-image { max-width: 100%; }

.kg-gallery-container { display: flex; flex-direction: column; }
.kg-gallery-row { display: flex; flex-direction: row; justify-content: center; gap: 8px; margin-bottom: 8px; }
.kg-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; }

.kg-bookmark-card { width: 100%; }
.kg-bookmark-container {
    display: flex;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
.kg-bookmark-content { padding: 16px; flex: 1; }
.kg-bookmark-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.kg-bookmark-description { font-size: 0.82rem; color: var(--ap-text-muted); }
.kg-bookmark-thumbnail { width: 160px; flex-shrink: 0; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.kg-video-card { position: relative; }
.kg-video-card video { width: 100%; }

.kg-callout-card {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--ap-whisper);
    border-radius: var(--ap-radius);
    margin: 24px 0;
}

/* ============================================================
   HERO IMAGE
   ============================================================ */

.ap-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.ap-hero-full { height: 85vh; min-height: 480px; max-height: 800px; }
.ap-hero-sm   { height: 40vh; min-height: 260px; max-height: 440px; }

.ap-hero-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.03);
    transition: transform 8s ease;
}

.ap-hero:hover .ap-hero-img { transform: scale(1); }

.ap-hero-placeholder {
    background: linear-gradient(135deg, #7a9b5e 0%, #5a7a3a 40%, #3d5a28 100%);
}

.ap-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(30,15,5,0.15) 0%, rgba(30,15,5,0.55) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.ap-hero-title {
    font-family: var(--ap-font-brand);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
    line-height: 1.1;
    margin-bottom: 12px;
}

.ap-hero-tagline {
    font-family: var(--ap-font-ui);
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: rgba(255,255,255,0.88);
    letter-spacing: 0.08em;
    font-style: italic;
    text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

@media (max-width: 768px) {
    .ap-hero-full { height: 60vh; }
    .ap-hero-sm   { height: 30vh; }
}
