/* ============================================================
   Refugio Interior — Hub theme
   Hand-written CSS, no build step.
   ============================================================ */

:root {
    --green:        #0F6E56;
    --green-dark:   #0A4E3D;
    --cream:        #F7F3EA;
    --cream-2:      #EFE8D8;
    --ink:          #2B2A26;
    --gray:         #6F6B62;
    --gold:         #C9A24B;
    --gold-dark:    #b08c38;
    --white:        #ffffff;

    --radius:       18px;
    --radius-lg:    26px;
    --radius-pill:  999px;
    --maxw:         1120px;
    --maxw-narrow:  720px;

    --shadow-sm:    0 2px 10px rgba(43, 42, 38, 0.06);
    --shadow-md:    0 14px 40px rgba(43, 42, 38, 0.10);

    --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
            Ubuntu, Cantarell, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
    /* Custom-fonts support: Ghost injects --gh-font-heading / --gh-font-body
       when the user picks fonts in Settings → Design. Fall back to system. */
    --font: var(--gh-font-body, var(--font-system));
    --font-heading: var(--gh-font-heading, var(--font));
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.6;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); line-height: 1.18; margin: 0 0 0.4em; color: var(--ink); font-weight: 700; }

p { margin: 0 0 1em; }

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

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}
.container--narrow { max-width: var(--maxw-narrow); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    font-weight: 600;
    font-size: 0.97rem;
    line-height: 1;
    padding: 0.85em 1.5em;
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
    text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn-block { width: 100%; }

.btn-pill { background: var(--green); color: var(--white); }
.btn-pill:hover { background: var(--green-dark); color: var(--white); }

.btn-gold { background: var(--gold); color: #2a2105; }
.btn-gold:hover { background: var(--gold-dark); color: #2a2105; }

.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: var(--green-dark); color: var(--white); }

.btn-outline-light { background: transparent; color: var(--cream); border-color: rgba(247, 243, 234, 0.55); }
.btn-outline-light:hover { background: rgba(247, 243, 234, 0.12); color: var(--white); }

.btn-platform { color: var(--white); }
.btn-spotify { background: #1DB954; }
.btn-spotify:hover { background: #18a049; color: var(--white); }
.btn-youtube { background: #FF0000; }
.btn-youtube:hover { background: #d90000; color: var(--white); }
.btn-apple { background: #FA243C; }
.btn-apple:hover { background: #d81e33; color: var(--white); }
.btn-ytmusic { background: #FF0033; }
.btn-ytmusic:hover { background: #d9002b; color: var(--white); }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 243, 234, 0.92);
    backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid transparent;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.site-header.is-scrolled {
    box-shadow: var(--shadow-sm);
    border-bottom-color: rgba(43, 42, 38, 0.06);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 16px;
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-kicker {
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gray);
    font-weight: 600;
}
.brand-name { font-size: 1.18rem; font-weight: 700; color: var(--green-dark); }

.site-nav { display: flex; align-items: center; }
.nav-list {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-item a {
    display: inline-block;
    padding: 0.5em 0.85em;
    color: var(--ink);
    font-weight: 500;
    font-size: 0.97rem;
    border-radius: var(--radius-pill);
}
.nav-item a:hover { color: var(--green-dark); background: rgba(15, 110, 86, 0.07); }
.nav-current a { color: var(--green-dark); font-weight: 600; }
.nav-cta-mobile { display: none; }
.header-cta { white-space: nowrap; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    padding: 8px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
}

/* ---------- Sections (shared) ---------- */
.section { padding: 84px 0; }
.section-head { margin-bottom: 40px; max-width: 640px; }
.section-head--row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    max-width: none;
    gap: 20px;
}
.kicker {
    display: inline-block;
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 0.6em;
}
.kicker--light { color: var(--gold); }
.section-title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.section-title--light { color: var(--cream); }
.section-link { font-weight: 600; white-space: nowrap; }
.empty-state { color: var(--gray); font-style: italic; }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: var(--cream);
    padding: 96px 0 104px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    width: 540px; height: 540px;
    right: -160px; top: -160px;
    background: radial-gradient(circle, rgba(201,162,75,0.22), transparent 70%);
    pointer-events: none;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 48px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.hero-title {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    color: var(--white);
    margin-bottom: 0.25em;
    letter-spacing: -0.01em;
}
.hero-subtitle { font-size: 1.22rem; color: var(--cream); max-width: 30ch; }
.hero-note { color: rgba(247, 243, 234, 0.78); font-size: 1rem; margin-bottom: 1.8em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-figure { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.alma-label {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin: 0;
}

/* Alma avatar placeholder (CSS gradient circle) — TODO: swap for real image */
.alma-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #f4e4bd 0%, var(--gold) 45%, var(--green) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 50px rgba(10, 78, 61, 0.35);
    border: 4px solid rgba(247, 243, 234, 0.5);
}
.alma-avatar--hero { width: 240px; height: 240px; }
.alma-avatar--dark { border-color: rgba(201, 162, 75, 0.5); }
.alma-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.alma-initial {
    font-size: 5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    font-family: Georgia, "Times New Roman", serif;
}

/* ---------- Música ---------- */
.section-musica { background: var(--cream); }
.platform-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.platform-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(43, 42, 38, 0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.platform-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.platform-name { font-size: 1.4rem; font-weight: 700; }
.platform-spotify .platform-name { color: #1DB954; }
.platform-youtube .platform-name { color: #FF0000; }
.platform-apple .platform-name { color: #FA243C; }
.platform-ytmusic .platform-name { color: #FF0033; }
.platform-desc { color: var(--gray); margin: 0; }

/* Decorative CSS waveform */
.waveform { display: flex; align-items: flex-end; gap: 3px; height: 30px; }
.waveform span {
    display: block;
    width: 4px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.85;
    animation: wave 1.1s ease-in-out infinite;
}
.platform-spotify .waveform { color: #1DB954; }
.platform-youtube .waveform { color: #FF0000; }
.waveform span:nth-child(1) { height: 40%; animation-delay: 0s; }
.waveform span:nth-child(2) { height: 78%; animation-delay: 0.12s; }
.waveform span:nth-child(3) { height: 55%; animation-delay: 0.24s; }
.waveform span:nth-child(4) { height: 100%; animation-delay: 0.36s; }
.waveform span:nth-child(5) { height: 62%; animation-delay: 0.48s; }
.waveform span:nth-child(6) { height: 85%; animation-delay: 0.60s; }
.waveform span:nth-child(7) { height: 45%; animation-delay: 0.72s; }
@keyframes wave {
    0%, 100% { transform: scaleY(0.55); }
    50%      { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
    .waveform span { animation: none; }
}

/* ---------- Parrilla / segmentos ---------- */
.section-parrilla { background: var(--cream); }
.segment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.segment-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(43, 42, 38, 0.05);
    border-top: 4px solid var(--green);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.segment-sol    { border-top-color: var(--gold); }
.segment-tierra { border-top-color: var(--green); }
.segment-cielo  { border-top-color: var(--green-dark); }
.segment-emoji { font-size: 2rem; }
.segment-title { font-size: 1.22rem; margin: 0; }
.segment-desc { color: var(--gray); margin: 0; flex: 1; }
.cadence-pill {
    align-self: flex-start;
    background: var(--cream-2);
    color: var(--green-dark);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.5em 1em;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
}
.segment-format { font-size: 0.9rem; color: var(--ink); font-weight: 600; margin: 0; }
.segment-link {
    align-self: flex-start;
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--green-dark);
    text-decoration: none;
}
.segment-link:hover { text-decoration: underline; }

/* ---------- Tienda ---------- */
.section-tienda { background: var(--cream-2); }
.badge-checkout {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gold-dark);
    background: rgba(201, 162, 75, 0.16);
    border: 1px solid rgba(201, 162, 75, 0.4);
    padding: 0.4em 0.8em;
    border-radius: var(--radius-pill);
    margin-left: 10px;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(43, 42, 38, 0.05);
    display: flex;
    flex-direction: column;
}
.product-cover {
    height: 170px;
    display: flex;
    align-items: flex-end;
    padding: 18px;
    position: relative;
}
.cover-gold   { background: linear-gradient(140deg, #e7c97a 0%, var(--gold) 60%, var(--gold-dark) 100%); }
.cover-green  { background: linear-gradient(140deg, #2c8c70 0%, var(--green) 60%, var(--green-dark) 100%); }
.cover-bundle { background: linear-gradient(140deg, var(--gold) 0%, #6aa18c 55%, var(--green-dark) 100%); }
.cover-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.02em;
    background: rgba(0, 0, 0, 0.18);
    padding: 0.4em 0.9em;
    border-radius: var(--radius-pill);
    backdrop-filter: blur(2px);
}
.cover-gold .cover-label { color: #2a2105; background: rgba(255, 255, 255, 0.35); }
.product-card .product-title { font-size: 1.18rem; margin: 22px 22px 0; }
.product-desc { color: var(--gray); margin: 8px 22px 0; flex: 1; }
.product-card .btn { margin: 22px; width: auto; align-self: stretch; }

/* ---------- Blog ---------- */
.section-blog { background: var(--cream); }
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}
.section-archive .post-grid { grid-template-columns: repeat(3, 1fr); }
.post-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(43, 42, 38, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card-link { display: block; color: inherit; }
.post-card-image { aspect-ratio: 16 / 10; background: var(--cream-2); overflow: hidden; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-card-image--placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
}
.post-card-image--placeholder span {
    color: rgba(247, 243, 234, 0.7);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
}
.post-card-body { padding: 22px; }
.post-card-date {
    display: block;
    font-size: 0.78rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5em;
}
.post-card-title { font-size: 1.2rem; margin: 0; color: var(--ink); }
.post-card:hover .post-card-title { color: var(--green-dark); }
.post-card-excerpt { color: var(--gray); margin: 0.7em 0 0; font-size: 0.95rem; }

/* ---------- Sobre Alma ---------- */
.section-alma { background: var(--green-dark); padding: 92px 0; }
.alma-inner {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
    align-items: center;
}
.alma-figure { display: flex; justify-content: center; }
.alma-text { color: rgba(247, 243, 234, 0.9); font-size: 1.1rem; max-width: 56ch; }

/* ---------- Single post / page ---------- */
.single { padding: 64px 0 80px; }
.single-header { margin-bottom: 28px; }
.single-tag {
    display: inline-block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--green);
    margin: 0 6px 10px 0;
}
.single-title { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.single-meta { color: var(--gray); font-size: 0.92rem; display: flex; flex-wrap: wrap; gap: 8px; }
.single-author { font-weight: 600; color: var(--ink); }
.single-feature { margin: 0 0 36px; border-radius: var(--radius-lg); overflow: hidden; }
.single-feature figcaption { font-size: 0.85rem; color: var(--gray); text-align: center; padding: 10px 0; }
.single-content { font-size: 1.12rem; }
.single-content img { border-radius: var(--radius); margin: 1.6em auto; }
.single-content h2 { margin-top: 1.6em; }
.single-content h3 { margin-top: 1.4em; }
.single-content blockquote {
    margin: 1.6em 0;
    padding: 0.4em 1.2em;
    border-left: 4px solid var(--gold);
    color: var(--gray);
    font-style: italic;
}
.single-content a { text-decoration: underline; }
.single-footer { margin-top: 48px; }
.single-tags { margin-bottom: 28px; }
.single-cta {
    background: var(--cream-2);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
}
.single-cta p { font-weight: 600; margin-bottom: 1em; }

/* ---------- Archive heads ---------- */
.archive-head { text-align: center; margin-left: auto; margin-right: auto; }
.archive-desc { color: var(--gray); }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 56px;
    flex-wrap: wrap;
}
.pagination-link {
    font-weight: 600;
    padding: 0.7em 1.3em;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(15, 110, 86, 0.3);
    color: var(--green-dark);
}
.pagination-link:hover { background: rgba(15, 110, 86, 0.08); }
.pagination-disabled { opacity: 0.4; pointer-events: none; }
.pagination-status { color: var(--gray); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-dark); color: var(--cream); padding: 56px 0 32px; }
.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(247, 243, 234, 0.14);
}
.footer-name { font-size: 1.3rem; font-weight: 700; color: var(--white); }
.footer-tagline { color: rgba(247, 243, 234, 0.78); margin: 0.5em 0 0; max-width: 38ch; }
.footer-social { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-social a { color: var(--cream); font-weight: 500; }
.footer-social a:hover { color: var(--gold); }
.footer-legal { padding-top: 24px; }
.footer-ai { font-size: 0.88rem; color: rgba(247, 243, 234, 0.78); margin: 0 0 0.5em; }
.ai-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gold);
    border: 1px solid rgba(201, 162, 75, 0.5);
    border-radius: var(--radius-pill);
    padding: 0.2em 0.7em;
    margin: 0 2px;
}
.footer-disclaimer { font-size: 0.82rem; color: rgba(247, 243, 234, 0.6); margin: 0; }

/* ---------- Koenig editor cards (gh-content) ---------- */
.gh-content { position: relative; }

/* Card widths: required by Ghost/GScan. The content column is centered and
   narrow; wide/full cards break out wider than the text column. */
.gh-content > * {
    margin-left: auto;
    margin-right: auto;
    max-width: 720px;
}
.gh-content .kg-width-wide {
    max-width: 1040px;
}
.gh-content .kg-width-full {
    max-width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}
.gh-content .kg-width-full img { width: 100%; }

.gh-content figure { margin: 1.6em auto; }
.gh-content figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray);
    padding-top: 8px;
}
.gh-content .kg-image { border-radius: var(--radius); }

/* Embeds / galleries / bookmarks responsiveness */
.kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.kg-embed-card iframe { max-width: 100%; }
.kg-gallery-container { display: flex; flex-direction: column; }
.kg-gallery-row { display: flex; flex-direction: row; justify-content: center; gap: 8px; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }

.kg-bookmark-card,
.kg-bookmark-publisher { position: relative; width: 100%; }
.kg-bookmark-container {
    display: flex;
    border: 1px solid rgba(43, 42, 38, 0.12);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--ink);
    text-decoration: none;
}
.kg-bookmark-content { padding: 18px 20px; flex: 1; }
.kg-bookmark-title { font-weight: 700; }
.kg-bookmark-thumbnail { flex: 0 0 33%; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.kg-callout-card {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--cream-2);
}
.kg-callout-emoji { font-size: 1.3rem; }

.kg-button-card a.kg-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.8em 1.6em;
    border-radius: var(--radius-pill);
    background: var(--green);
    color: var(--white);
    font-weight: 600;
    text-decoration: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-copy { order: 2; }
    .hero-figure { order: 1; }
    .hero-actions { justify-content: center; }
    .hero-subtitle { max-width: none; }
    .platform-grid,
    .segment-grid,
    .product-grid,
    .post-grid,
    .section-archive .post-grid { grid-template-columns: 1fr; }
    .alma-inner { grid-template-columns: 1fr; text-align: center; }
    .alma-figure { order: -1; }
    .alma-text { margin-left: auto; margin-right: auto; }
}

@media (max-width: 760px) {
    .section { padding: 60px 0; }
    .header-cta { display: none; }
    .nav-toggle { display: flex; }
    .site-nav { position: static; }
    .nav-list {
        display: none;
        position: absolute;
        left: 0; right: 0;
        top: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        background: var(--cream);
        padding: 12px 24px 20px;
        box-shadow: var(--shadow-md);
        border-top: 1px solid rgba(43, 42, 38, 0.06);
    }
    .nav-list.is-open { display: flex; }
    .nav-item a { padding: 0.7em 0.6em; }
    .nav-cta-mobile { display: block; margin-top: 8px; }
    .nav-cta-mobile a { width: 100%; }
    .section-head--row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    body { font-size: 16px; }
    .alma-avatar, .alma-avatar--hero { width: 170px; height: 170px; }
    .badge-checkout { display: block; margin: 10px 0 0; width: fit-content; }
}
