/* Shared responsive refinements. Loaded after each page's existing styles. */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 84px;
}
img, video { max-width: 100%; }
h1, h2, h3, p, li, a { overflow-wrap: break-word; }
button, a, summary { touch-action: manipulation; }
.nav-logo, .hero-text, .review-card, .bl-card, .footer-section,
.substack-pitch, .substack-recent, .form-group { min-width: 0; }
.mobile-menu-btn { flex-shrink: 0; }
.workshop-card .coming-soon-badge { padding: 0; }
.workshop-card .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px;
    text-decoration: none;
}
.reviews-grid, .bl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.review-more summary {
    min-height: 44px;
    padding: 10px 0;
    line-height: 1.5;
}
html.menu-open, body.menu-open { overflow: hidden; overscroll-behavior: none; }
.menu-open .floating-buy-btn { visibility: hidden; pointer-events: none; }

/* The full navigation needs more room than a tablet or small laptop provides. */
@media (max-width: 1280px) {
    .main-nav { padding-top: env(safe-area-inset-top, 0px); }
    .main-nav .nav-container {
        height: 64px;
        padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
        gap: 12px;
    }
    .main-nav .nav-logo { flex: 1; }
    .main-nav .logo-text {
        display: block;
        font-size: clamp(0.75rem, 4vw, 1rem);
        letter-spacing: 0;
        line-height: 1.35;
    }
    .mobile-menu-btn { display: flex; }
    .main-nav .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        height: calc(100vh - 64px - env(safe-area-inset-top, 0px));
        height: calc(100dvh - 64px - env(safe-area-inset-top, 0px));
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
        background: #0d1117;
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
    }
    .main-nav .nav-links.active { transform: none; opacity: 1; visibility: visible; }
    .main-nav .nav-link {
        min-height: 48px;
        width: 100%;
        padding: 12px 20px;
        justify-content: center;
        font-size: 1.0625rem;
        border-bottom: 1px solid rgba(88, 166, 255, 0.12);
    }
    .main-nav .social-links {
        flex-wrap: wrap;
        justify-content: center;
        margin: 16px 0 0;
        padding: 0;
        border: 0;
        gap: 12px;
    }
    .main-nav .nav-buy-btn { min-height: 44px; margin: 0; padding: 10px 22px; }
    .floating-nav { display: none; }
    .main-nav.simple-nav .nav-links {
        position: static;
        width: auto;
        height: auto;
        flex-direction: row;
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        overflow: visible;
    }
    .main-nav.simple-nav .nav-link { width: auto; padding: 10px 12px; border: 0; }
}

@media (max-width: 768px) {
    .reviews-grid, .bl-grid { grid-template-columns: minmax(0, 1fr); }
    .video-header {
        height: auto;
        min-height: 100svh;
        padding: calc(84px + env(safe-area-inset-top, 0px)) 0 28px;
    }
    .hero-content {
        width: 100%;
        max-width: 620px;
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 0 24px;
    }
    .hero-book-cover { order: -1; margin: 0; }
    .hero-book-cover img { width: min(50vw, 210px); max-width: 210px; height: auto; }
    .hero-text { width: 100%; }
    .hero-title { font-size: clamp(1.375rem, 7vw, 2.4rem); line-height: 1.2; text-wrap: balance; }
    .hero-title .no-break { display: block; white-space: normal; }
    .hero-tagline { font-size: clamp(0.68rem, 2.8vw, 0.85rem); letter-spacing: 1px; }
    .hero-author { margin-bottom: 18px; }
    .hero-subtitle { font-size: 1.125rem; line-height: 1.6; }
    .hero-actions { gap: 12px; margin-top: 20px; }
    .hero-buy-link {
        min-height: 44px;
        max-width: 100%;
        justify-content: center;
        font-size: 0.85rem;
        letter-spacing: 0.5px;
        white-space: normal;
    }
    .section-header h2, .audience-header h2, .book-info-center h2 {
        font-size: clamp(1.5rem, 6.5vw, 2rem);
        line-height: 1.25;
        text-wrap: balance;
    }
    .amazon-btn, .ghost-btn {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 0.875rem;
        line-height: 1.5;
        gap: 8px;
        text-align: center;
    }
    .amazon-btn svg, .floating-buy-btn svg { flex-shrink: 0; }
    .newsletter-cta-btn {
        max-width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 0.875rem;
        line-height: 1.5;
        white-space: normal;
        text-align: center;
    }
    .floating-buy-btn {
        min-height: 48px;
        font-size: clamp(0.75rem, 3.6vw, 0.9rem);
        padding: 12px 14px;
        line-height: 1.4;
        text-align: center;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
    .site-footer { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
    .footer-section li a, .footer-legal a, .back-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding-top: 6px;
        padding-bottom: 6px;
    }
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
        min-width: 0;
        max-width: 100%;
        min-height: 44px;
        font-size: max(16px, 1rem);
    }
    .speaking-inquiry .speaking-btn { width: 100%; min-height: 48px; padding: 12px 16px; }
    .workshop-card .nav-link { font-size: 0.875rem; }
    .substack-subscribe { width: 100%; }
    .substack-subscribe button { min-height: 48px; white-space: normal; padding: 12px 16px; }
    .bl-post-hero h1 { font-size: clamp(1.4rem, 6vw, 1.7rem); text-wrap: balance; }
    .bl-book h2, .bl-subscribe h2 { font-size: 1.15rem; }
    .rp-reviews .section-header h2 { font-size: clamp(1.5rem, 6.5vw, 2rem); }
    .rp-reviews .review-card { padding: 22px; }
    .legal-page .legal-content { padding: 96px 24px 40px; }
    .legal-page .legal-content h1 { font-size: clamp(1.5rem, 7vw, 2rem); }
    .legal-page .legal-content h2 { font-size: 1.35rem; line-height: 1.4; }
    .legal-page .legal-content h3 { font-size: 1.15rem; }
    .legal-page .quote-highlight, .legal-page .section-intro { padding: 16px; }
    .legal-page .legal-content ul, .legal-page .legal-content ol { margin-left: 1.25rem; }
    .legal-page footer { padding: 20px 0; }
    .thank-you-page .thank-you-section { min-height: 100svh; padding: 96px 0 32px; }
    .thank-you-page .thank-you-content { padding: 28px 20px; }
    .thank-you-page .thank-you-title { font-size: 1.75rem; }
    .share-page .share-content { margin: 96px auto 40px; padding: 0 20px; }
    .share-page .share-content h1 { font-size: clamp(1.5rem, 6.5vw, 2rem); line-height: 1.3; }
    .share-page .share-card { padding: 22px 18px; }
    .share-page .share-quote { padding: 18px; }
    .share-page .share-address { overflow-wrap: anywhere; }
    .share-page .share-actions { display: flex; flex-direction: column; gap: 12px; }
    .share-page .share-actions > a, .share-page .share-actions > button {
        width: 100%;
        min-height: 48px;
        margin: 0 !important;
        padding: 12px !important;
        font-size: 0.875rem;
        line-height: 1.5;
    }
    .scroll-reveal, .animate-on-scroll, .animate-fade-up {
        opacity: 1;
        transform: none;
        animation: none;
        transition: none;
    }
}

.share-content { max-width: 800px; margin: 120px auto 80px; padding: 0 40px; }
.share-content h1 { font-size: clamp(2rem, 5vw, 4rem); }
.share-card { padding: 40px; }
.share-quote { padding: 25px; }
@media (max-width: 600px) {
    .social-follow-grid { grid-template-columns: minmax(0, 1fr); }
    .social-follow-card { padding: 20px; }
    .purchase-links-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .purchase-links-grid a { min-height: 44px; padding: 10px 8px; }
}
@media (hover: none) {
    .review-card:hover, .bl-card:hover, .bl-featured:hover, .rp-cover img:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .scroll-reveal, .animate-on-scroll, .animate-fade-up { opacity: 1; transform: none; }
}
