/* ============================================
   UNIFIED STYLESHEET - style-20260912.css
   John D. Cressler Website
   ============================================ */

/* ============ BASE RESET & VARIABLES ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --emerald: #339966;
    --dark-emerald: #2a7a54;   /* text-safe: >=4.8:1 on white, cream and light-gray */
    --emerald-deep: #1f5c3f;   /* hover step, now that controls sit on --dark-emerald */
    --focus-ring: #2b2b2b;     /* >=11.6:1 on cream/white/light-gray, drawn outside the element */
    /* One elevation scale. There were 15 distinct shadow values across 25 declarations,
       including 5 tinted glows, with nothing distinguishing them semantically. */
    --shadow-card:  0 1px 3px rgba(0,0,0,0.05), 0 6px 20px rgba(0,0,0,0.07);
    --shadow-lift:  0 2px 6px rgba(0,0,0,0.07), 0 10px 28px rgba(0,0,0,0.11);
    --shadow-cover: 0 10px 28px rgba(0,0,0,0.18);
    --gold: #d4a574;
    --cream: #faf8f3;
    --dark-gray: #333;
    --light-gray: #f5f5f5;
    --text-gray: #555;
}

/* The off-canvas nav panel is fixed and parked outside the viewport, which still
   counts toward the document's scroll width — every page could be dragged ~240px
   sideways into empty space on a phone. `clip` (not `hidden`) removes that without
   creating a scroll container, so the sticky sidebars below keep working. */
html {
    overflow-x: clip;
}

body {
    font-family: 'Georgia', serif;
    line-height: 1.7;
    color: var(--text-gray);
    background-color: var(--cream);
    font-size: 18px;
    overflow-x: clip;
}

/* ============ HEADER ============ */
/* Side padding clears the fixed hamburger button (top-right, ~81px wide incl. margin)
   so a long title can never run underneath it. Kept symmetric to stay optically centred. */
header.hero {
    background: var(--cream);
    text-align: center;
    padding: 2.4rem 5.5rem 1.6rem;
    border-bottom: 1px solid rgba(42, 122, 84, 0.18);
}

.hero-eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--dark-emerald);
    margin-bottom: 0.7rem;
}

.hero-eyebrow a {
    color: inherit;
    text-decoration: none;
}

.hero-eyebrow a:hover,
.hero-eyebrow a:focus-visible {
    text-decoration: underline;
}

header.hero h1 {
    font-size: 2.3rem;
    font-weight: 400;
    color: var(--dark-gray);
    line-height: 1.2;
    margin: 0;
    text-wrap: balance;
}

/* Gold rule, drawn rather than marked up so no page needs extra HTML. */
header.hero h1::after {
    content: "";
    display: block;
    width: 60px;
    height: 2px;
    background: var(--gold);
    margin: 1rem auto 0;
}

/* ============ LAYOUT ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-top: 2rem;
}

/* ============ BOOK COVER SECTION ============ */
/* .sidebar is the aside used by the non-fiction + gateway pages; it was never
   given a rule, so those pages lost the sticky cover and the mobile centring below. */
.book-cover-section,
.sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.book-cover {
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow-cover);
    transition: transform 0.3s ease;
    max-width: 400px;
    height: auto;
}

.book-cover:hover {
    transform: scale(1.05);
}

.book-info {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1.5rem;
	text-align: center;
    box-shadow: var(--shadow-card);
}

.book-info h3 {
    color: var(--dark-emerald);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.price {
    font-size: 1.5rem;
    color: var(--dark-emerald);
    font-weight: bold;
    margin: 1rem 0;
}

.buy-button {
    display: block;
    background: var(--dark-emerald);
    color: white;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.buy-button:hover {
    color: white;
	background: var(--emerald-deep);
	transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
}

/* ============ SERIES NAVIGATION ============ */
.series-navigation {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-card);
}

.series-navigation h3 {
    color: var(--dark-emerald);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-align: center;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
}

.series-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.series-link {
    display: block;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--light-gray);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    text-decoration: none;
}

.series-link:hover {
    background: linear-gradient(135deg, rgba(51, 153, 102, 0.1), rgba(212, 165, 116, 0.1));
    border-color: var(--dark-emerald);
    transform: translateX(5px);
    text-decoration: none;
}

.series-link.active {
    background: linear-gradient(135deg, rgba(51, 153, 102, 0.15), rgba(212, 165, 116, 0.15));
    border-color: var(--dark-emerald);
    pointer-events: none;
}

.series-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-emerald);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.series-title {
    font-size: 1rem;
    color: var(--dark-gray);
    font-weight: 500;
    line-height: 1.3;
}

.series-link.active .series-title {
    color: var(--dark-emerald);
    font-weight: 600;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow-card);
}

.section {
    margin-bottom: 3rem;
}

/* Without the 1fr/2fr grid, .main-content spans the full 1056px and prose ran to
   ~115 characters. Capped for text only; grids and galleries keep the full width. */
.section > p,
.section > ul,
.section > ol,
.section > .interview-qa {
    max-width: 34em;
}

.section p {
    margin-bottom: 1rem;
}

.section h2 {
    color: var(--dark-emerald);
    font-size: 1.65rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gold);
    padding-bottom: 0.5rem;
}

.section h3 {
    color: var(--dark-emerald);
    font-size: 1.2rem;
    margin: 1.5rem 0 1rem;
}

/* ============ QUOTES ============ */
.quote {
    background: var(--light-gray);
    border-left: 4px solid var(--emerald);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.quote-author {
    text-align: right;
    font-weight: bold;
    color: var(--dark-emerald);
    margin-top: 1rem;
    font-style: normal;
}

/* ============ VIDEO ============ */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    margin: 2rem 0;
    box-shadow: var(--shadow-cover);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ============ LISTS ============ */
ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ============ LINKS ============ */
a {
    color: var(--dark-emerald);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--emerald-deep);
    text-decoration: underline;
}

/* ============ SKIP LINK (Accessibility) ============ */
/* Hidden by its own height rather than a fixed -40px: the box is ~47px tall at the
   inherited 18px/1.7, so the old offset left a green sliver showing on every page. */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-100%);
    background: var(--dark-emerald);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0 0 8px 0;
    transition: transform 0.3s ease;
}

.skip-link:focus {
    transform: translateY(0);
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ============ VIDEO INFO ============ */
.video-info {
    color: var(--text-gray);
    font-style: italic;
    margin-bottom: 1rem;
    text-align: center;
}

/* ============ NONFICTION GALLERY GRID ============ */
.nonfiction-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.nonfiction-gallery figure {
    margin: 0;
    text-align: center;
}

.nonfiction-gallery img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-cover);
    transition: transform 0.3s ease;
}

.nonfiction-gallery img:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .nonfiction-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .nonfiction-gallery {
        grid-template-columns: 1fr;
    }
}

/* ============ FOOTER ============ */
footer {
    background: var(--dark-gray);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer p {
    margin: 0.5rem 0;
}

/* ============ SCROLL TO TOP ============ */
/* Now rendered as a real <button>, so reset the UA button styling. */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--dark-emerald);
    color: white;
    border: none;
    font-family: inherit;
    font-size: 1.5rem;
    line-height: 1;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lift);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
}

.scroll-top:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--emerald-deep);
    transform: translateY(-5px);
}

/* ============ HIGHLIGHT BOX ============ */
.highlight-box {
    background: linear-gradient(135deg, rgba(51, 153, 102, 0.1), rgba(212, 165, 116, 0.1));
    border: 2px solid var(--emerald);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.highlight-box h3 {
    margin-top: 0;
}

/* ============ FLIP CARDS ============ */
.flip-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.flip-container {
    width: 100%;
    height: 310px;
    perspective: 1000px;
    cursor: pointer;
    perspective-origin: center;
}

.flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    transform: rotateX(0deg) rotateY(0deg);
}

.flip-container:hover .flipper {
    transform: rotateX(0deg) rotateY(180deg);
}

.front,
.back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow-card);
    backface-visibility: hidden;
    padding: 2rem;
}

.front {
    background: linear-gradient(135deg, rgba(51, 153, 102, 0.1), rgba(212, 165, 116, 0.1));
    border: 1px solid var(--gold);
    border-radius: 10px;
    color: var(--dark-emerald);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: rotateX(0deg) rotateY(0deg) translateZ(1px);
}

.back {
    background: white;
    color: var(--dark-gray);
    transform: rotateX(0deg) rotateY(180deg);
    overflow-y: auto;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    border: 1px solid var(--light-gray);
    cursor: pointer;
}

.card-title {
    font-size: 1.9rem;
    font-weight: 700;
	color: var(--dark-gray);
	text-align: center;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
	text-align: center;
    text-transform: uppercase;
    font-weight: 600;
}

.card-back-content {
    width: 100%;
    margin-top: 0.5rem;
}

.card-back-content h3 {
    color: var(--dark-emerald);
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.card-back-content p {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    line-height: 1.6;
}

.card-back-content .back-link {
    color: var(--dark-emerald);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
    margin-top: 1rem;
    display: block;
}

.card-back-content .back-link:hover {
    color: var(--emerald-deep);
}

.arrow {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.8rem;
    /* was white, drawn on a 10%-tint card: effectively invisible */
    color: var(--dark-emerald);
    opacity: 0.85;
    transition: opacity 0.3s, transform 0.3s;
}

.flip-container:hover .arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* ============ INDEX PAGE STYLES ============ */
.author-cover-section {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.author-photo {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow-cover);
    transition: transform 0.3s ease;
}

.author-photo:hover {
    transform: scale(1.05);
}

.author-info {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.author-info h2 {
    color: var(--dark-emerald);
    font-size: 1.8rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.author-info h3 {
    color: var(--dark-emerald);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.author-info p {
    color: var(--text-gray);
    font-size: 1rem;
    margin: 0.5rem 0;
    line-height: 1.6;
}

.author-info .highlight {
    color: var(--dark-emerald);
    font-weight: bold;
}

.author-info-title {
    margin-top: 1rem;
}

/* ============ AUTHOR PAGE STYLES ============ */
.author-photo-section {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.interview-qa {
    margin-bottom: 2rem;
}

.interview-qa h4 {
    color: var(--dark-emerald);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: bold;
}

/* ============ BOOKS SECTION ============ */
.books-section {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow-card);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.books-grid a {
    display: block;
    transition: transform 0.3s ease;
}

.books-grid a:hover {
    transform: scale(1.05);
}

.books-grid img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-cover);
}

/* ============ SECTION HEADINGS ============ */
.section-heading {
    color: var(--dark-emerald);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    margin-top: 0;
    border-bottom: 3px solid var(--gold);
    padding-bottom: 0.5rem;
}

/* ============ NON-FICTION SECTION ============ */
.non-fiction-section {
    margin-top: 2rem;
}

/* ============ GATEWAY SPOTLIGHT (HOMEPAGE) ============ */
.gateway-spotlight {
    background: linear-gradient(135deg, rgba(51, 153, 102, 0.08), rgba(212, 165, 116, 0.12));
    border-bottom: 3px solid var(--gold);
    padding: 1rem 0;
}

/* .container plus the .content-grid columns, so the banner aligns with the page content below it */
.gateway-spotlight-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.gateway-spotlight-cover {
    display: block;
}

.gateway-spotlight-cover img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow-cover);
    transition: transform 0.3s ease;
}

.gateway-spotlight-cover:hover img {
    transform: scale(1.05);
}

.gateway-spotlight-info h2 {
    font-size: 2.25rem;
    line-height: 1.25;
    margin: 0 0 0.5rem 0;
    text-wrap: balance;
}

.gateway-spotlight-info h2 a {
    color: var(--dark-emerald);
    text-decoration: none;
}

.gateway-spotlight-info h2 a:hover {
    text-decoration: underline;
}

.gateway-release {
    color: var(--dark-emerald);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.gateway-spotlight-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.gateway-spotlight-buttons .buy-button {
    margin-top: 0;
    flex: 0 1 auto;
}

.gateway-description {
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* ============ 4-COLUMN GRID ============ */
.books-grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.book-card {
    background: linear-gradient(135deg, rgba(51, 153, 102, 0.05), rgba(212, 165, 116, 0.05));
    border: 1px solid var(--gold);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.book-card h3 {
    color: var(--dark-gray);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-card .book-cover-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 1rem;
    height: 280px;
}

.book-card .book-cover-wrapper img {
    max-height: 280px;
    width: auto;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-cover);
    transition: transform 0.3s ease;
}

.book-card .book-cover-wrapper img:hover {
    transform: scale(1.03);
}

.book-card .book-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

.book-card .trailer-link {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-print {
    background: var(--dark-emerald);
    color: white;
}

.btn-print:hover {
    background: var(--emerald-deep);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
}

.btn-kindle {
    background: var(--gold);
    color: var(--dark-gray);
}

.btn-kindle:hover {
    background: #c49564;
    color: var(--dark-gray);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
}

.btn-nook {
    background: var(--dark-gray);
    color: white;
}

.btn-nook:hover {
    background: #222;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
}

/* ============ NON-FICTION STORE GRID ============ */
.nonfiction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.nonfiction-card {
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.nonfiction-card:hover {
    box-shadow: var(--shadow-card);
}

.nonfiction-card h3 {
    color: var(--dark-gray);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.nonfiction-card .book-cover-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 1rem;
    height: 220px;
}

.nonfiction-card .book-cover-wrapper img {
    max-height: 220px;
    width: auto;
    max-width: 100%;
    border-radius: 6px;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease;
}

.nonfiction-card .book-cover-wrapper img:hover {
    transform: scale(1.03);
}

.nonfiction-card .btn {
    margin-top: auto;
}

/* ============ STORE PAGE STYLES ============ */

/* 2-Column Grid for al-Andalus Series */
.store-books-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-top: 2rem;
}

.store-book-card {
    background: white;
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.store-book-card:hover {
    box-shadow: var(--shadow-lift);
    transform: translateY(-4px);
}

.store-book-cover {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.store-book-cover img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-cover);
    transition: transform 0.3s ease;
}

.store-book-cover img:hover {
    transform: scale(1.03);
}

.store-book-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
    gap: 0.25rem;
}

.store-book-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-emerald);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.store-book-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin: 0.25rem 0;
    font-style: italic;
    line-height: 1.3;
}

.store-book-year {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
}

.store-book-links {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    width: 100%;
}

.btn-trailer {
    display: inline-block;
    background: transparent;
    color: var(--dark-emerald);
    border: 2px solid var(--emerald);
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-trailer:hover,
.btn-trailer:focus {
    background: var(--emerald-deep);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
    outline: none;
}

.btn-trailer:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.btn-trailer-placeholder {
    height: 42px;
    width: 100%;
}

/* ============ STORE NON-FICTION GRID ============ */
.store-nonfiction-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.store-nonfiction-card {
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.store-nonfiction-card:hover {
    box-shadow: var(--shadow-lift);
    transform: translateY(-4px);
}

.store-nonfiction-card .store-book-cover {
    width: 100%;
    margin-bottom: 1rem;
}

.store-nonfiction-card .store-book-cover img {
    width: 100%;
    height: auto;
    box-shadow: var(--shadow-cover);
}

.store-nonfiction-card .store-book-info {
    margin-bottom: 1rem;
}

.store-nonfiction-card .store-book-title {
    font-size: 1.1rem;
    font-style: normal;
}

.store-nonfiction-card .store-book-year {
    font-size: 0.85rem;
}

.store-nonfiction-card .btn {
    margin-top: auto;
    width: 100%;
}

/* ============ WHERE TO BUY SECTION ============ */
.store-where-to-buy {
    border-top: 1px solid var(--light-gray);
    padding-top: 2rem;
}

.store-links-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin-top: 1.5rem;
}

.store-links-column h3 {
    color: var(--dark-emerald);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold);
}

.store-links-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.store-links-column li {
    margin-bottom: 0.75rem;
}

.store-links-column a {
    color: var(--dark-emerald);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.store-links-column a:hover,
.store-links-column a:focus {
    color: var(--emerald-deep);
    text-decoration: underline;
}

/* ============ ACCESSIBILITY ============ */
.btn:focus,
.store-links-column a:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible),
.store-links-column a:focus:not(:focus-visible) {
    outline: none;
}

.btn:focus-visible,
.store-links-column a:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* This previously covered only the store page, so a reader who had asked the OS to
   stop motion still got the cover zooms, the card flip and the scroll-top lift. */
@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;
    }

    .book-cover:hover,
    .author-photo:hover,
    .books-grid a:hover,
    .nonfiction-gallery img:hover,
    .book-card .book-cover-wrapper img:hover,
    .nonfiction-card .book-cover-wrapper img:hover,
    .store-book-card:hover,
    .store-nonfiction-card:hover,
    .store-book-cover img:hover,
    .gateway-spotlight-cover:hover img,
    .series-link:hover,
    .buy-button:hover,
    .btn-print:hover,
    .btn-kindle:hover,
    .btn-nook:hover,
    .btn-trailer:hover,
    .btn-trailer:focus,
    .scroll-top:hover,
    .search-result:hover {
        transform: none;
    }

    /* The flip cards rely on a 3D rotation; show the back face outright instead. */
    .flip-container:hover .flipper,
    .flip-container:focus-within .flipper {
        transform: none;
    }
}

/* ============ RESPONSIVE - TABLETS ============ */
@media (max-width: 1100px) {
    .books-grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .store-nonfiction-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 968px) {
    .content-grid,
    .gateway-spotlight-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .book-cover-section,
    .sidebar,
    .author-cover-section,
    .author-photo-section,
    .gateway-spotlight-cover {
        position: static;
        max-width: 400px;
        margin: 0 auto;
    }

    .gateway-spotlight-info {
        text-align: center;
    }

    .gateway-spotlight-buttons {
        justify-content: center;
    }

    header.hero {
        padding: 2rem 4.75rem 1.4rem;
    }

    header.hero h1 {
        font-size: 1.9rem;
    }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .flip-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .store-books-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .store-book-card {
        padding: 1.5rem;
    }


    .store-book-title {
        font-size: 1.25rem;
    }

    .store-links-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ============ RESPONSIVE - MOBILE ============ */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    /* Hamburger shrinks to ~65px from the right edge at this width; keep clear of it. */
    header.hero {
        padding: 1.6rem 4.25rem 1.2rem;
    }

    header.hero h1 {
        font-size: 1.5rem;
    }

    .hero-eyebrow {
        font-size: 0.7rem;
        letter-spacing: 0.18em;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .flip-cards-container {
        grid-template-columns: 1fr;
    }

    .flip-container {
        height: 280px;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .books-section {
        padding: 1.5rem;
    }

    .author-info h2 {
        font-size: 1.5rem;
    }

    .section-heading {
        font-size: 1.5rem;
    }

    .gateway-spotlight-buttons {
        justify-content: center;
    }

    /* Was 2.25rem here, i.e. larger than the page's own h1 — and a 7-word title
       set at that size ran to five lines before any content was visible. */
    .gateway-spotlight-info h2 {
        font-size: 1.45rem;
        line-height: 1.3;
    }

    .gateway-release {
        font-size: 1rem;
    }

    .gateway-spotlight-buttons .buy-button {
        width: 100%;
    }

    .books-grid-4col {
        grid-template-columns: 1fr;
    }

    .book-card .book-cover-wrapper {
        height: 260px;
    }

    .book-card .book-cover-wrapper img {
        max-height: 260px;
    }

    .store-nonfiction-grid {
        grid-template-columns: 1fr;
    }


    .store-book-links {
        flex-direction: column;
    }

    .store-book-links .btn {
        width: 100%;
    }
}

/* ============ BIBLIOGRAPHY NUMBERING ============ */
/* .book-number is used 8 times in nonfiction.html but had no rule, so "New", "#1",
   "#2" rendered as unstyled bold fragments reading as a mistake rather than a label. */
.book-number {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dark-emerald);
    border: 1px solid rgba(42, 122, 84, 0.35);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    margin-bottom: 0.5rem;
}

/* ============ CALL-TO-ACTION PANEL ============ */
/* Used for the newsletter / pre-order blocks on the home and Gateway pages. */
.cta-panel {
    background: white;
    border: 1px solid rgba(42, 122, 84, 0.25);
    border-left: 4px solid var(--dark-emerald);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-card);
}

.cta-panel h2,
.cta-panel h3 {
    color: var(--dark-emerald);
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    border: none;
    padding: 0;
}

.cta-panel p {
    margin: 0 0 1rem;
    max-width: 46em;
}

.cta-panel p:last-child {
    margin-bottom: 0;
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cta-actions .buy-button,
.cta-actions .btn-secondary {
    margin-top: 0;
    flex: 0 1 auto;
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--dark-emerald);
    border: 2px solid var(--dark-emerald);
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: var(--dark-emerald);
    color: white;
    text-decoration: none;
}

/* ============ CONTACT PAGE ============ */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.contact-card {
    background: white;
    border: 1px solid rgba(42, 122, 84, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
}

.contact-card h3 {
    color: var(--dark-emerald);
    font-size: 1.15rem;
    margin: 0 0 0.5rem;
}

.contact-card p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    max-width: none;
}

.contact-card .buy-button,
.contact-card .btn-secondary {
    margin-top: auto;
}

/* ============ FOOTER ============ */
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-contact {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.footer-links {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    font-size: 0.95rem;
}

footer a {
    color: #f0ead9;
    text-decoration: underline;
    text-underline-offset: 2px;
}

footer a:hover,
footer a:focus-visible {
    color: white;
}

footer a:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.footer-legal {
    font-size: 0.85rem;
    color: #c9c9c9;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

@media (max-width: 600px) {
    .cta-actions {
        flex-direction: column;
    }

    .cta-actions .buy-button,
    .cta-actions .btn-secondary {
        width: 100%;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.6rem;
    }
}
