/* =====================================================================
   Jill Magdalene — responsive layer
   Every layout rule lives inside a max-width query, so the desktop
   design (> 1280px) is untouched.
   ===================================================================== */

/* mobile menu button — hidden on desktop */
.nav-toggle { display: none }

/* touch screens: no custom cursor */
@media (hover: none), (pointer: coarse) {
    body { cursor: auto }
    #cursor-dot, #cursor-ring { display: none }
}

/* ---------- small laptops ---------- */
@media (max-width: 1280px) {
    nav { padding: 18px 40px }
    .nav-right { gap: 24px }
    .nav-links { gap: 24px }
}

@media (max-width: 1200px) {
    .hero-left { padding: 100px 50px }
    .hero-right { padding: 50px }
    .hero-god { font-size: 74px }
    .hero-to { font-size: 88px }
    .hero-gov { font-size: 56px; letter-spacing: 6px }
    .hero-bg-num { font-size: 170px }

    .section-wrap { padding: 100px 50px }
    .about-author { gap: 60px }
    .book-grid { gap: 56px }
    .newsletter { padding: 80px 50px }
    footer { padding: 70px 50px 40px }
    .feat-content { padding: 50px 40px }
    .blog-card { padding: 40px }
}

/* ---------- tablet: hamburger menu + stacked hero ---------- */
@media (max-width: 1100px) {
    html { overflow-x: clip }

    nav { padding: 14px 32px }
    .nav-right { gap: 14px }

    .nav-toggle {
        display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
        width: 40px; height: 40px; padding: 0; margin-right: -8px;
        background: transparent; border: 0; cursor: pointer; color: var(--fg);
    }
    .nav-toggle span {
        display: block; width: 22px; height: 1.5px; background: currentColor;
        transition: transform .35s ease, opacity .25s ease;
    }
    nav.menu-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg) }
    nav.menu-open .nav-toggle span:nth-child(2) { opacity: 0 }
    nav.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg) }

    .nav-links {
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; gap: 0;
        background: var(--nav-bg); border-bottom: 1px solid var(--border);
        padding: 6px 32px 22px;
        max-height: calc(100vh - 70px); overflow-y: auto;
        box-shadow: 0 30px 50px -20px var(--shadow);
        opacity: 0; visibility: hidden; transform: translateY(-8px);
        transition: opacity .3s ease, transform .3s ease, visibility .3s;
    }
    nav.menu-open .nav-links { opacity: 1; visibility: visible; transform: none }
    .nav-links li { border-bottom: 1px solid var(--border) }
    .nav-links li:last-child { border-bottom: 0 }
    .nav-links a { display: block; padding: 18px 0; font-size: 14px }
    .nav-links a::after { display: none }

    /* hero */
    .hero { grid-template-columns: 1fr; min-height: 0 }
    .hero-left { padding: 90px 40px 80px; border-right: 0; border-bottom: 1px solid var(--border) }
    .hero-right { padding: 90px 40px 100px }
    .hero-deco { top: 32px; right: 32px }
    /* keep "Governor" on its own line, as on desktop */
    .reveal span.hero-gov { display: block }
}

@media (max-width: 1024px) {
    .section-wrap { padding: 90px 40px }
    .sec-title { font-size: 46px }
    .sec-sig { font-size: 60px }

    /* 2-up product grid; an odd last card spans the row */
    .products-grid, .products-grid.columns-3, .woocommerce-page .products-grid { grid-template-columns: 1fr 1fr }
    .product-img-area { aspect-ratio: 4/5 }
    .products-grid > .product-card:last-child:nth-child(odd) { grid-column: 1 / -1 }
    .products-grid > .product-card:last-child:nth-child(odd) .product-img-area { aspect-ratio: auto; min-height: 380px }

    .newsletter { padding: 70px 40px; gap: 40px }
    .nl-sig { font-size: 46px }

    footer { padding: 64px 40px 36px }
    .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 40px 32px }
    .footer-grid > :first-child { grid-column: 1 / -1 }
}

@media (max-width: 900px) {
    .about-author { grid-template-columns: 1fr; gap: 60px }
    .portrait-wrap { max-width: 420px; width: 100%; margin: 16px auto 0 }
    .book-grid { grid-template-columns: 1fr; gap: 50px }

    .newsletter { grid-template-columns: 1fr; gap: 28px }

    .blog-featured { grid-template-columns: 1fr }
    .blog-featured > * { min-width: 0 }
    .feat-img { min-height: 260px; border-right: 0; border-bottom: 1px solid var(--border); overflow: hidden }
    .feat-img img { max-width: 100%; height: auto; display: block }
}

/* ---------- mobile ---------- */
@media (max-width: 768px) {
    body { font-size: 17px }

    nav { padding: 12px 20px }
    .nav-links { padding: 4px 20px 18px }
    .nav-logo { font-size: 19px; letter-spacing: 3px }
    .nav-brand:hover .nav-logo { letter-spacing: 3px }
    .nav-right { gap: 8px }
    .nav-icons { gap: 0 }

    /* hero */
    .hero-left { padding: 70px 20px 64px }
    .hero-right { padding: 70px 20px 90px }
    .hero-bg-num { font-size: 120px; left: 20px; bottom: 16px }
    .eyebrow { font-size: 13px; letter-spacing: 5px; margin-bottom: 22px }
    .hero-god { font-size: 60px }
    .hero-to { font-size: 72px }
    .hero-gov { font-size: 44px; letter-spacing: 4px }
    .hero-subtitle { font-size: 21px; margin: 26px 0 40px }
    .hero-cta { font-size: 14px; letter-spacing: 3px; padding: 16px 28px }
    .hero-deco { top: 24px; right: 20px; font-size: 12px; letter-spacing: 4px }
    .book-hero-cover { width: 260px; height: 390px }

    /* sections */
    .section-wrap { padding: 70px 20px }
    .sec-label { font-size: 13px; letter-spacing: 4px }
    .sec-title { font-size: 36px }
    .sec-sig { font-size: 52px }
    .sec-rule { margin-bottom: 36px }

    .bio-text p, .book-synopsis p, .shop-intro p { font-size: 19px; line-height: 1.85 }
    .bio-text p:first-of-type::first-letter { font-size: 60px; margin: 8px 14px 0 0 }
    .stats-grid { margin-top: 40px }
    .stat-box { padding: 24px 8px }
    .stat-n { font-size: 32px }
    .stat-l { font-size: 12px; letter-spacing: 2px }

    .gtag { font-size: 13px; letter-spacing: 2px; padding: 8px 14px }
    .genre-tags { margin-bottom: 34px }
    .meta-table td { padding: 14px 8px }
    .meta-table td:first-child { font-size: 13px; letter-spacing: 2px; width: 104px }
    .meta-table td:last-child { font-size: 18px }
    .pull-quote { padding: 32px 24px }
    .pull-quote:hover { transform: none }
    .pull-quote blockquote { font-size: 28px; line-height: 1.6 }
    .pull-quote cite, .praise-head { font-size: 13px; letter-spacing: 3px }
    .praise-card { padding: 30px 22px }
    .praise-item p { font-size: 18px }
    .praise-item span { font-size: 13px }

    .shop-intro { margin-bottom: 44px }

    /* products: one per row */
    .products-grid, .products-grid.columns-3, .woocommerce-page .products-grid { grid-template-columns: 1fr }
    .products-grid > .product-card:last-child:nth-child(odd) { grid-column: auto }
    .product-img-area,
    .products-grid > .product-card:last-child:nth-child(odd) .product-img-area { aspect-ratio: auto; min-height: 340px; padding: 40px 28px }
    .product-card:hover { transform: none }
    .product-badge { font-size: 12px; letter-spacing: 2px; padding: 6px 12px }
    .product-info { padding: 24px 22px 26px }
    .p-price { font-size: 24px }
    .p-pages, .pfmt { font-size: 13px }
    .p-btn { font-size: 14px }

    /* newsletter */
    .newsletter { padding: 60px 20px }
    .nl-sig { font-size: 40px }
    .nl-title { font-size: 26px }
    .nl-sub { font-size: 18px }
    .nl-input { min-width: 0 }
    .nl-note { font-size: 13px; letter-spacing: 1.5px }

    /* journal */
    .blog-grid { grid-template-columns: 1fr }
    .feat-content { padding: 40px 22px }
    .blog-card { padding: 36px 22px }
    .blog-card:hover { transform: none }
    .b-issue { top: 18px; right: 20px; font-size: 48px }
    .b-title { font-size: 20px }
    .b-excerpt { font-size: 18px; line-height: 1.8 }
    .b-meta { flex-wrap: wrap; gap: 10px 16px }
    .b-date, .b-read, .feat-badge, .feat-lbl { font-size: 13px; letter-spacing: 2px }

    /* footer */
    footer { padding: 56px 20px 32px }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px 24px; margin-bottom: 48px }
    .f-brand-sig { font-size: 46px }
    .f-col h4 { font-size: 14px; margin-bottom: 20px }
    .f-col ul li a { font-size: 13px; letter-spacing: 1px; word-break: break-word }
    .footer-bottom { flex-direction: column-reverse; gap: 18px; text-align: center }
    .f-copy { font-size: 12px; letter-spacing: 1.5px }
    .f-socials { flex-wrap: wrap; justify-content: center; gap: 12px 22px }
    .f-socials a { font-size: 12px }

    /* journal article meta */
    .ba-meta-line { flex-wrap: wrap; gap: 8px 12px; font-size: 12px; letter-spacing: 1.5px }
    .ba-meta-line > span { white-space: nowrap }
    .ba-meta-line span+span::before { margin-right: 12px }

    /* WooCommerce pages */
    .jill-pdp-img .p3d-cover { width: 220px; height: 330px }
    .jill-pdp-img .ebook-device { transform: scale(1.3) }
    .jill-pdp-price .p-price { font-size: 32px }
    .jill-product-summary form.cart .single_add_to_cart_button { min-width: 0 }
    .jill-breadcrumb { font-size: 11px; letter-spacing: 2px; margin-bottom: 32px }
    .jill-bc-sep { margin: 0 8px }
    .jill-shop .woocommerce-ordering, .jill-shop .woocommerce-ordering select { width: 100%; min-width: 0 }
    .woocommerce .sec-title { font-size: 34px }
    .woocommerce .u-columns h2 { font-size: 40px }
    .woocommerce-message, .woocommerce-info, .woocommerce-error { padding: 18px 20px; font-size: 17px }
    .woocommerce-message .button, .woocommerce-info .button { margin-left: 0 }
}

/* ---------- cart / checkout: mobile ---------- */
@media (max-width: 700px) {
    /* cart totals already have a <th> per row — no stacked-table labels here */
    .woocommerce .cart_totals table.shop_table_responsive tr {
        display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
        gap: 8px 16px; padding: 16px 0; border-bottom: 1px solid var(--border);
    }
    .woocommerce .cart_totals table.shop_table_responsive tr:last-child { border-bottom: 0 }
    .woocommerce .cart_totals table.shop_table_responsive th,
    .woocommerce .cart_totals table.shop_table_responsive td {
        display: block; padding: 0; border: 0; background: transparent;
    }
    .woocommerce .cart_totals table.shop_table_responsive td { text-align: right; margin-left: auto }
    .woocommerce .cart_totals table.shop_table_responsive td::before { display: none }
    .woocommerce .cart_totals table.shop_table .order-total th,
    .woocommerce .cart_totals table.shop_table .order-total td { padding-top: 0 }
    .cart_totals .order-total .amount { font-size: 26px }

    /* shipping row: label on top, methods + address below, left aligned */
    .woocommerce .cart_totals table.shop_table_responsive tr.shipping,
    .woocommerce .cart_totals table.shop_table_responsive tr.woocommerce-shipping-totals { display: block }
    .woocommerce .cart_totals table.shop_table_responsive tr.shipping th,
    .woocommerce .cart_totals table.shop_table_responsive tr.woocommerce-shipping-totals th { margin-bottom: 12px }
    .woocommerce .cart_totals table.shop_table_responsive tr.shipping td,
    .woocommerce .cart_totals table.shop_table_responsive tr.woocommerce-shipping-totals td { text-align: left; margin: 0 }
    .cart_totals .woocommerce-shipping-methods li { justify-content: flex-start }
    .cart_totals .woocommerce-shipping-methods label { font-size: 18px !important; color: var(--fg) }
    .cart_totals .woocommerce-shipping-destination { font-size: 16px; line-height: 1.6; color: var(--muted); margin-top: 6px }
    .cart_totals .woocommerce-shipping-calculator { margin-top: 10px }
    .cart_totals .shipping-calculator-button { display: inline-block }

    .cart-collaterals .cart_totals { padding: 28px 20px }
    .cart_totals > h2 { letter-spacing: 4px !important }

    /* buttons: centred text, tighter tracking so labels fit */
    .woocommerce .button, .woocommerce-page .button,
    .woocommerce button.button, .woocommerce-page button[type="submit"] {
        justify-content: center; text-align: center; letter-spacing: 2px; padding: 15px 20px; font-size: 14px;
    }
    .wc-proceed-to-checkout .checkout-button,
    .woocommerce a.checkout-button, #payment #place_order {
        display: flex; width: 100%; padding: 18px 16px; font-size: 14px; letter-spacing: 2.5px; line-height: 1.4;
    }

    /* coupon: input on top, button below */
    .woocommerce table.cart td.actions .coupon { display: flex; flex-direction: column; gap: 10px }
    .woocommerce table.cart td.actions .coupon .input-text { border-right: 1px solid var(--border) }
    .woocommerce table.cart td.actions .coupon .button { width: 100% }
}

@media (max-width: 480px) {
    .nav-logo { font-size: 16px; letter-spacing: 2px }
    .nav-brand:hover .nav-logo { letter-spacing: 2px }
    .nav-icon { width: 34px; height: 34px }
    .theme-btn { width: 46px; height: 26px }
    .theme-knob { width: 18px; height: 18px }
    [data-theme="light"] .theme-knob { transform: translateX(20px) }

    .hero-god { font-size: 48px }
    .hero-to { font-size: 58px }
    .hero-gov { font-size: 34px; letter-spacing: 3px }
    .hero-subtitle { font-size: 19px }
    .hero-cta { align-self: stretch; justify-content: center; padding: 16px 20px }
    .book-hero-cover { width: 210px; height: 315px }
    .book-hero-spine { left: -16px; width: 16px }
    .spine-text { font-size: 10px; letter-spacing: 2px }

    .sec-title { font-size: 30px }
    .sec-sig { font-size: 44px }

    .stat-n { font-size: 26px }
    .stat-l { font-size: 10px; letter-spacing: 1.5px }

    .meta-table td:first-child { width: 88px; font-size: 12px; letter-spacing: 1.5px }
    .meta-table td:last-child { font-size: 17px }
    .pull-quote blockquote { font-size: 25px }

    .product-img-area,
    .products-grid > .product-card:last-child:nth-child(odd) .product-img-area { min-height: 300px }

    .nl-form { flex-direction: column; gap: 10px }
    .nl-input { border-right: 1px solid var(--border) }
    .nl-btn { width: 100% }
    .nl-btn:hover { transform: none }

    .footer-grid { grid-template-columns: 1fr }

    .jill-pdp-img .p3d-cover { width: 180px; height: 270px }
    .jill-pdp-img .ebook-device { transform: none }
    .woocommerce .sec-title { font-size: 28px }
}
