/* =====================================================
   BOOK UI – Elliott Wave Black Book
   ===================================================== */

/* ---------- Header ---------- */

.header {
    margin: 0 auto;
}

.header .font-headline {
    letter-spacing: 0.04em;
}

/* Author image */
.header figure img {
    border-radius: 50%;
}

/* ---------- Main spacing ---------- */

.main {
    margin-top: 0;
    padding-top: 0.75rem;
}


/* ---------- Orange bar ---------- */

.site-badge {
position: absolute;
    top: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f39c12;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.25rem 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 3;
    white-space: nowrap;

}


/* ---------- Navigation ---------- */

.nav-site {
    background: #fff;
    border-top: 2px solid #f39c12;
    border-bottom: 1px solid #eee;
    padding: 0.75rem 0 0.5rem;

}
.nav-wrapper {
  position: relative;
    margin-top: 0.5rem;
}
.site-content-wrapper {
    margin-top: 1.5rem;
}

.nav-site > div {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-site-link {
    display: block;
    text-align: center;
    padding: 0.75rem 0.5rem;
    max-width: 170px;
    margin: 0 auto;
    line-height: 1.25;
    color: #666;
}

.nav-site-link:hover {
    text-decoration: none;
    color: #000;
}

/* Active item */
.nav-site-link.active,
.nav-site-link strong {
    font-weight: 700;
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {

    .header {
        text-align: center;
    }



    #navToggle {
        width: 100%;
        padding: 0.8rem 1rem;
        font-weight: 700;
        letter-spacing: 0.05em;
    }

    .nav-site {
        display: none;
    }

    .nav-site-link {
        max-width: none;
        font-size: 0.75rem;
    }
	    .site-badge {
        width: 100%;
        text-align: center;
        margin: 1rem 0 0.75rem;
    }

    .nav-wrapper {
        margin-top: 0.75rem;
    }

}
/* ---------- Footer ---------- */

.site-footer-wrapper {
	max-width: 960px;
	margin: 0 auto;
	border: 1px solid #ddd;
	border-top: 0;
}

.footer-promo {
	border-top: 1px solid #eee;
	padding: 1.5rem;
}

.footer-links {
	border-top: 4px solid var(--color-orange);
	padding: 1.5rem;
}

.footer-projects {
	font-weight: 700;
	font-size: 0.8rem;
}

.footer-link {
	display: block;
	color: var(--color-orange);
	line-height: 1.3;
}

.footer-link:hover {
	text-decoration: none;
	color: #000;
}

.footer-affiliates img {
	max-width: 100%;
	height: auto;
}

.site-footer {
	max-width: 860px;
	margin: 1rem auto 0;
	padding: 1rem;
	font-size: 0.65rem;
	background: #fff;
}
/* ---------- Header Wrapper ---------- */

.site-header-wrapper {
	max-width: 1080px;
	margin: 0 auto;
}

/* Header inner spacing */
.site-header-wrapper .header {
	padding-top: 0.5rem;
}

/* Badge + nav container */
.site-header-wrapper .main {
	padding-bottom: 0.5rem;
}

/* Desktop fine-tuning */
@media (min-width: 992px) {
	.site-header-wrapper .header {
		padding-top: 0.75rem;
	}
}
/* ---------- Page Content ---------- */

.site-content-wrapper {
	max-width: 960px;
	margin: 0 auto;
	border: 1px solid #ddd;
	border-top: 0;
	background: #fff;
}

.page-content {
	padding: 1.5rem 1.25rem;
	box-shadow: inset 0 40px 40px -40px rgba(0, 0, 0, 0.08);
}

/* Desktop reading comfort */
@media (min-width: 768px) {
	.page-content {
		padding: 2rem 3rem;
	}
}

/* Typography rhythm (book-like) */
.page-content p {
	line-height: 1.7;
	margin-bottom: 1.25rem;
}

.page-content h2,
.page-content h3,
.page-content h4 {
	margin-top: 2.5rem;
	margin-bottom: 1rem;
	line-height: 1.25;
}
/* ---------- Book Chapter ---------- */

.book-chapter {
	margin: 0 auto;
}

.entry-title {
	font-size: clamp(1.6rem, 5vw, 2.4rem);
	line-height: 1.2;
	margin-bottom: 2rem;
	font-weight: 700;
	text-align: center;
}

/* Content typography */
.book-content {
	font-size: 1rem;
}

@media (min-width: 768px) {
	.book-content {
		font-size: 1.05rem;
	}
}

/* Images inside content */
.book-content img {
	max-width: 100%;
	height: auto;
	margin: 2rem auto;
	display: block;
}

/* Lists */
.book-content ul,
.book-content ol {
	margin: 1.5rem 0 1.5rem 1.5rem;
	line-height: 1.6;
}

/* Blockquotes */
.book-content blockquote {
	border-left: 4px solid var(--color-orange);
	padding-left: 1rem;
	color: #555;
	margin: 2rem 0;
	font-style: italic;
}

/* Page links */
.page-links {
	margin-top: 2rem;
	font-weight: 700;
	text-align: center;
}
/* ---------- Hero Title ---------- */

.site-title {
    display: block;
    text-align: center;
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
    color: #222;
}

.site-subtitle {
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

@media (max-width: 767px) {

    .site-title {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    .site-badge {
        position: static;
        transform: none;
        display: block;
        text-align: center;
        margin-bottom: -1rem;
    }

}
.page-content, .entry-content, .entry-summary {
 margin-top:0 !important;
}
@media (min-width: 992px) {

    /* Bring header elements closer */
    .site-header-wrapper .header {
        padding-top: 0.5rem;
        padding-bottom: 0.25rem;
    }

    /* Reduce gap between header and nav system */
    .site-header-wrapper .main {
        padding-top: 0.25rem;
    }
}
@media (min-width: 992px) {

    .header-author {
        max-width: 140px;
    }

    .header-author img {
        width: 80px;
        height: 80px;
              box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    }

    .header-author figcaption {
        margin-top: 0.35rem;
        font-size: 0.7rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
}

@media (min-width: 992px) {

    .site-title {
        margin-top: -0.75rem;
        margin-bottom: 0.9rem;
		margin-left: -260px;
    }
}
/* ---------- Next Chapter Navigation ---------- */

.next-chapter {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid #eee;
	text-align: center;
}

.next-chapter a {
	display: inline-block;
	text-decoration: none;
	color: #222;
}

.next-label {
	display: block;
	font-size: 0.65rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #999;
	margin-bottom: 0.25rem;
}

.next-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--color-orange);
}

.next-chapter a:hover .next-title {
	text-decoration: underline;
}

/* Mobile refinement */
@media (max-width: 767px) {
	.next-title {
		font-size: 1rem;
	}
}
/* ---------- Chapter Navigation (Prev / Next) ---------- */

.chapter-navigation {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.chapter-navigation a {
    flex: 1;
    text-decoration: none;
    color: #222;
}

.chapter-label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 0.3rem;
}

.chapter-title {
    font-size: 1rem;
    font-weight: 700;
}

/* Previous (subtle) */
.chapter-prev {
    text-align: left;
}

.chapter-prev .chapter-title {
    color: #666;
}

/* Next (primary) */
.chapter-next {
    text-align: right;
}

.chapter-next .chapter-title {
    color: var(--color-orange);
}

.chapter-navigation a:hover .chapter-title {
    text-decoration: underline;
}

/* Mobile stacking */
@media (max-width: 767px) {
    .chapter-navigation {
        flex-direction: column;
        text-align: center;
    }

    .chapter-prev,
    .chapter-next {
        text-align: center;
    }
}
/* ---------- Current Chapter Highlight ---------- */

.nav-site-link.is-current {
    color: #000;
    position: relative;
}

.nav-site-link.is-current::after {
    content: '';
    display: block;
    width: 28px;
    height: 2px;
    background-color: var(--color-orange);
    margin: 0.4rem auto 0;
}
@media (max-width: 767px) {
    .nav-site-link.is-current::after {
        margin-top: 0.3rem;
    }
}
/* =====================================================
   Book Typography System
   ===================================================== */

/* ---------- Base text ---------- */

.book-content {
    font-family: 'Rubik', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: #222;
}

/* Slightly larger on desktop */
@media (min-width: 768px) {
    .book-content {
        font-size: 1.05rem;
    }
}

/* ---------- Chapter Title (H1) ---------- */

.entry-title {
    font-family: 'Fjalla One', sans-serif;
    font-size: clamp(1.9rem, 4.5vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    margin: 2.5rem 0 3rem;
    color: #111;
}

/* ---------- Section Headings ---------- */

.book-content h2 {
    font-family: 'Fjalla One', sans-serif;
    font-size: 1.45rem;
    line-height: 1.25;
    margin: 3.5rem 0 1.25rem;
    letter-spacing: 0.04em;
    color: #111;
}

.book-content h3 {
    font-family: 'Fjalla One', sans-serif;
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 2.5rem 0 1rem;
    letter-spacing: 0.03em;
    color: #333;
}

.book-content h4 {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
}

/* ---------- Paragraphs ---------- */

.book-content p {
    margin-bottom: 1.5rem;
}

/* ---------- Strong & emphasis ---------- */

.book-content strong {
    font-weight: 600;
    color: #000;
}

.book-content em {
    font-style: italic;
    color: #444;
}

/* ---------- Lists ---------- */

.book-content ul,
.book-content ol {
    margin: 1.5rem 0 2rem 1.5rem;
    padding-left: 0.5rem;
}

.book-content li {
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

/* ---------- Horizontal rules ---------- */

.book-content hr {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 3rem 0;
}
/* =====================================================
   Sticky Top Promo Bar – Final Version
   (Desktop only, Book pages only)
   ===================================================== */


/* =====================================================
   Sticky Top Promo Bar – NO JUMP VERSION
   ===================================================== */

/* =====================================================
   Sticky Top Promo Bar – FINAL (NO OVERLAP)
   ===================================================== */

/* Reserve space */
.top-promo-spacer {
    height: 44px;
}

/* Bar */
.top-promo-bar {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,0.12);
}

/* Inner layout – FLEX ONLY */
.top-promo-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between; /* KEY FIX */
    gap: 1.5rem;
}

/* Text */
.top-promo-text {
    font-family: 'Work Sans', Helvetica, Arial, Lucida, sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #111;
    line-height: 1.3;
    white-space: nowrap; /* prevents wrapping under button */
}

/* Highlight */
.top-promo-text span {
    border-bottom: 2px solid var(--color-orange);
    padding-bottom: 2px;
}

/* CTA container */
.top-promo-cta {
    flex-shrink: 0; /* prevents text from pushing button */
}

/* CTA Button */
.top-promo-cta a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background-color: #ff5e29;
    color: #ffffff !important;

    font-family: 'DM Mono', monospace;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 0.02em;

    padding: 0.55rem 1.1rem;
    border-radius: 2px;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.top-promo-cta a:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    background-color: #ff4f14;
}

/* =====================================================
   Sticky – Desktop only
   ===================================================== */

@media (min-width: 992px) {
    body.page .top-promo-bar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 3000;
    }
	.top-promo-text {
	margin-left:75px;	
	}
	
}

/* =====================================================
   Mobile – stacked, no sticky
   ===================================================== */

@media (max-width: 991px) {

    .top-promo-spacer {
        display: none;
    }

    .top-promo-inner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .top-promo-text {
        white-space: normal;
		font-size:12px;
    }

    .top-promo-bar {
        position: static;
    }
}


/* =====================================================
   Fix Header Overlap with Sticky Promo
   ===================================================== */

@media (min-width: 992px) {

    /* Push header content away from promo bar */
    .site-header-wrapper {
        margin-top: 44px; /* same as promo bar height */
    }

    /* Tighten author image so it doesn’t creep upward */
    .header-author img {
        margin-top: 0.25rem;
    }
}

