/* ============================================================
   site.css — sandrajtmevers.nl
   Primary  : #1da1f2
   Secondary: #14171a
   BG       : #f0f2f4
   Text     : #1a1a2e
   Font     : Roboto, sans-serif
   ============================================================ */

/* --- Custom properties --------------------------------------- */
:root {
    --color-primary:     #1da1f2;
    --color-primary-dk:  #1281c7;
    --color-secondary:   #14171a;
    --color-white:       #ffffff;
    --color-bg:          #f0f2f4;
    --color-surface:     #ffffff;
    --color-text:        #1a1a2e;
    --color-text-muted:  #4b5563;
    --color-border:      #e1e4e8;
    --radius:            0.625rem;
    --shadow-sm:         0 1px 3px rgb(0 0 0 / .08), 0 1px 2px rgb(0 0 0 / .06);
    --shadow-md:         0 4px 12px rgb(0 0 0 / .08), 0 2px 4px rgb(0 0 0 / .05);
    --shadow-lg:         0 10px 24px rgb(0 0 0 / .10), 0 4px 8px rgb(0 0 0 / .06);
    --transition:        150ms ease;
    --max-width:         1200px;
}

/* --- Skip link (accessibility) ------------------------------- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--color-secondary);
    color: var(--color-white);
    font-weight: 700;
    border-radius: 0 0 0.375rem 0.375rem;
    text-decoration: none;
    transition: top 200ms ease;
}

.skip-link:focus {
    top: 0;
}

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

html {
    font-size: 16px;
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: Roboto, sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.25;
}

p {
    margin: 0;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --- Layout -------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding-block: 1.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .layout-grid {
        grid-template-columns: 1fr 240px;
        gap: 1.5rem;
    }
    /* Sidebar is first in DOM but visually goes to column 2 on desktop */
    .sidebar      { grid-column: 2; grid-row: 1; }
    .main-content { grid-column: 1; grid-row: 1; }
}

/* --- Header -------------------------------------------------- */
.site-header {
    background: var(--color-primary);
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgb(0 0 0 / .15);
}

.site-header .top {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: space-between;
}

@media (max-width: 480px) {
    .site-header .top {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

.site-header h1 {
    color: var(--color-white);
    font-size: clamp(1.1rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Header book CTA */
.header-book-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    padding: 0.55rem 1.2rem;
    background: #fff;
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 2rem;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgb(0 0 0 / .18);
    transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.header-book-cta:hover {
    background: var(--color-secondary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgb(0 0 0 / .25);
}

.header-book-cta svg {
    flex-shrink: 0;
}

/* --- Sidebar / nav ------------------------------------------- */

/* Mobile first: sidebar is a sticky bar at the top of the page */
.sidebar {
    background: var(--color-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    top: 0;
    z-index: 200;
}

/* On mobile the sidebar is first in DOM, so it naturally appears above main */

.sidebar nav {
    display: flex;
    flex-direction: column;
}

/* Toggle button — visible on mobile only */
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0.9rem 1.25rem;
    cursor: pointer;
    gap: 0.75rem;
}

.nav-title {
    color: var(--color-white);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.6;
    /* reset margin that was on the old element */
    margin: 0;
}

/* Chevron icon */
.nav-toggle-icon {
    display: block;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 250ms ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
    transform: rotate(180deg);
}

/* Nav links — collapsed by default on mobile */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 300ms ease;
    padding: 0 1.25rem;
}

.nav-links__title{
    color: var(--color-white);
    font-weight: 700;
}

.nav-links.is-open {
    max-height: 600px; /* large enough for all links */
    padding-bottom: 0.75rem;
}

.nav-links a {
    color: rgba(255 255 255 / .82);
    font-size: 0.875rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.375rem;
    transition: background var(--transition), color var(--transition);
}

.nav-links a:hover {
    background: rgba(255 255 255 / .1);
    color: var(--color-white);
}

.nav-links a:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

/* Desktop: restore sidebar to right column, always expanded */
@media (min-width: 1024px) {
    .sidebar {
        position: sticky;
        top: 1.5rem;
        margin-bottom: 0;
        padding: 1.25rem;
    }

    .nav-toggle {
        display: none;
    }

    .nav-links {
        max-height: none;
        overflow: visible;
        padding: 0;
        gap: 0.25rem;
        padding-bottom: 0;
    }

    .nav-title {
        display: block;
        margin-bottom: 0.75rem;
    }
}

/* --- Card ---------------------------------------------------- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.card h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
}

/* Hero-image cards (Seychelles, Anthropology of Children & Youth) */
.card--hero {
    padding: 0;
    overflow: hidden;
}

.card-hero-image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
}

@media (min-width: 768px) {
    .card-hero-image { height: 280px; }
}

.card--hero .card-body {
    padding: 1.75rem;
}

/* --- About section ------------------------------------------- */
.about-flex {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .about-flex {
        flex-direction: row;
        align-items: flex-start;
    }
    .about-text  { flex: 3; }
    .about-photo { flex: 1; }
}

.about-photo img {
    border-radius: var(--radius);
    width: 100%;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

/* --- Section intro text -------------------------------------- */
.section-intro {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.9625rem;
    line-height: 1.75;
}

.section-intro strong {
    color: var(--color-text);
    font-weight: 700;
}

/* --- Photo grids --------------------------------------------- */
.photo-grid {
    display: grid;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}

.photo-grid--2 { grid-template-columns: repeat(2, 1fr); }
.photo-grid--3 { grid-template-columns: repeat(2, 1fr); }
.photo-grid--4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 560px) {
    .photo-grid--3 { grid-template-columns: repeat(3, 1fr); }
    .photo-grid--4 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
    .photo-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.photo-grid a {
    display: block;
    overflow: hidden;
    border-radius: 0.375rem;
    line-height: 0;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 0.375rem;
    transition: transform 300ms ease, opacity 300ms ease;
}

.photo-grid--cover img {
    object-fit: contain;
}

.photo-grid a:hover img {
    transform: scale(1.04);
    opacity: 0.9;
}

/* --- Results / books ----------------------------------------- */
.results {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.results h3 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.6rem;
}

.results > p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.book-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.book-grid img {
    height: 120px;
    width: auto;
    border-radius: 0.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 250ms ease, box-shadow 250ms ease;
}

.book-grid img:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --- Publications list --------------------------------------- */
.publication-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1.5rem;
}

.pub-item {
    padding: 1rem 1rem 1rem 1.25rem;
    border-left: 3px solid transparent;
    position: relative;
}

.pub-item--left {
    border-left-color: var(--color-primary);
}

.pub-item--right {
    border-right: 3px solid var(--color-primary);
    border-left: none;
    padding-left: 1rem;
    padding-right: 1.25rem;
    text-align: right;
}

.pub-item:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
}

.pub-year {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.pub-item h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.pub-item p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* --- Publications: see more ---------------------------------- */
.pub-item--hidden {
    display: none;
}

.pub-toggle-wrap {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
}

.pub-toggle-btn {
    background: none;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.55rem 1.4rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.pub-toggle-btn:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.pub-toggle-count {
    font-weight: 400;
    opacity: 0.8;
}

/* --- Awards list --------------------------------------------- */
.award-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.award-list li {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
}

.award-list li:last-child {
    border-bottom: none;
}

.award-year {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.875rem;
    min-width: 2.75rem;
}

/* --- Video embed --------------------------------------------- */
.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 1.5rem;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
}

/* --- Contact form -------------------------------------------- */
.contact-form {
    margin-inline: auto;
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 0.7rem 0.875rem;
    border: 1.5px solid var(--color-border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--color-text);
    background: var(--color-white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgb(29 161 242 / .15);
}

.form-field textarea {
    resize: vertical;
}

.btn-primary {
    width: auto;
    align-self: flex-start;
    padding: 0.8rem 1.75rem;
    background: var(--color-primary);
    color: var(--color-white);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-primary:hover {
    background: var(--color-primary-dk);
    box-shadow: 0 4px 12px rgb(29 161 242 / .3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
}

/* Flash messages */
.flash-message {
    display: none;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.flash-message:not([hidden]) {
    display: block;
}

.flash-message--success {
    background: #dcfce7;
    color: #166534;
}

.flash-message--error {
    background: #fee2e2;
    color: #991b1b;
}

/* --- Book for sale section ----------------------------------- */

/* Book video wrapper — holds video + play overlay */
.book-video-wrap {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    background: #000;
    margin-bottom: 1.75rem;
    overflow: hidden;
}

/* Book video — full width, native aspect ratio */
.book-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

/* Custom play button overlay */
.book-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 250ms ease;
}

.book-video-play svg {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
    transition: transform 200ms ease;
}

.book-video-play:hover svg {
    transform: scale(1.1);
}

/* Hide overlay once video is playing */
.book-video-wrap.is-playing .book-video-play {
    opacity: 0;
    pointer-events: none;
}

/* --- Book title block --------------------------------------- */
.book-title-block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.75rem;
}

.book-title-main {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    line-height: 1.15;
    margin: 0;
    text-transform: uppercase;
}

.book-title-sub {
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    font-weight: 500;
    color: var(--color-primary);
    letter-spacing: 0.01em;
    margin: 0;
    line-height: 1.4;
}

.book-title-divider {
    width: 3rem;
    height: 2px;
    background: var(--color-border);
    margin: 0.6rem 0;
}

.book-title-author {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    letter-spacing: 0.01em;
}

.book-title-byline {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 0;
    letter-spacing: 0.02em;
}

/* --- Book section layout ------------------------------------- */
.book-layout {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
}

.book-layout > .book-more-btn {
    align-self: center;
}

/* Two covers side by side */
.book-covers-images {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .book-covers-images {
        flex-wrap: nowrap;
        gap: 4rem;
    }
}

.book-covers-images a {
    display: block;
    line-height: 0;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

@media (min-width: 1024px) {
    .book-covers-images a {
        width: 50%;
    }
}

.book-covers-images a:first-child:hover {
    transform: translateY(-5px) rotate(-1deg);
    box-shadow: 0 16px 32px rgb(0 0 0 / .2);
}

.book-covers-images a:last-child:hover {
    transform: translateY(-5px) rotate(1deg);
    box-shadow: 0 16px 32px rgb(0 0 0 / .2);
}

.book-covers-images img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* Buy buttons block */
.book-info {
    margin: 0 auto;
}

.book-info-heading {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin: 0 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
}

/* "More information" popup trigger */
.book-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.03em;
    transition: color var(--transition);
}

.book-more-btn:hover {
    color: var(--color-primary);
}

.book-more-icon {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 4l4 4-4 4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* Book detail popup */
.book-popup {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.book-popup[hidden] {
    display: none;
}

.book-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / .5);
    cursor: pointer;
}

.book-popup-panel {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
}

.book-popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color var(--transition);
    padding: 0.25rem 0.5rem;
}

.book-popup-close:hover {
    color: var(--color-text);
}

/* Two-column layout inside popup */
.book-popup-columns {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

@media (min-width: 600px) {
    .book-popup-columns {
        flex-direction: row;
        align-items: flex-start;
        gap: 2rem;
    }
    .book-popup-summary { flex: 3; }
    .book-popup-meta    { flex: 2; }
}

.book-popup-summary p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.75;
    margin-bottom: 0.65rem;
}

.book-popup-summary p:last-child { margin-bottom: 0; }

.book-popup-meta {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 0.625rem;
    border: 1px solid var(--color-border);
}

/* --- Buy buttons (direct Stripe links) ----------------------- */
.book-buy-agree {
    margin-bottom: 1rem;
}

.book-buy-agree-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1.5;
}

.book-buy-agree-check {
    margin-top: 0.15rem;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.book-buy-agree-link {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.book-buy-buttons {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
}

@media (min-width: 480px) {
    .book-buy-buttons {
        flex-direction: row;
        align-items: stretch;
        gap: 2rem;
    }
}

.book-buy-buttons--stacked {
    flex-direction: column !important;
    align-items: stretch !important;
}

/* Card wrapper */
.btn-buy-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1.25rem 1.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgb(0 0 0 / .08);
    background: var(--color-white);
    min-width: 240px;
}

.book-buy-buttons--stacked .btn-buy-card {
    min-width: 0;
    width: 100%;
}

.book-buy-buttons--stacked .btn-buy {
    width: 100%;
}

.btn-buy-card-type {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #1da1f2;
}

.btn-buy-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.btn-buy-card-price {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.btn-buy-card-price small {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
}

.btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, opacity 180ms ease;
}

/* Shimmer sweep on hover */
.btn-buy::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgb(255 255 255 / .18) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 400ms ease;
}

.btn-buy--physical,
.btn-buy--ebook {
    background: linear-gradient(135deg, #1da1f2 0%, #0e85d4 100%);
    color: var(--color-white);
    box-shadow: 0 4px 16px rgb(29 161 242 / .4), inset 0 1px 0 rgb(255 255 255 / .15);
}

.btn-buy:not([aria-disabled="true"]):hover::after {
    transform: translateX(100%);
}

.btn-buy:not([aria-disabled="true"]):hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.btn-buy--physical:not([aria-disabled="true"]):hover,
.btn-buy--ebook:not([aria-disabled="true"]):hover {
    box-shadow: 0 8px 24px rgb(29 161 242 / .5), inset 0 1px 0 rgb(255 255 255 / .15);
}

.btn-buy:not([aria-disabled="true"]):active {
    transform: translateY(0);
    filter: brightness(0.97);
}

.btn-buy:focus-visible {
    outline: 3px solid var(--color-white);
    outline-offset: 3px;
}

/* Disabled state */
.btn-buy[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Wrapper so hover works even when the button has pointer-events: none */
.btn-buy-wrapper {
    position: relative;
    display: inline-flex;
}

.book-buy-buttons--stacked .btn-buy-wrapper {
    width: 100%;
}

/* Tooltip — hidden by default */
.btn-buy-tooltip {
    pointer-events: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgb(15 23 42 / .92);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgb(0 0 0 / .18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 160ms ease, visibility 160ms ease;
    z-index: 10;
    text-align: center;
    max-width: 240px;
    white-space: normal;
}

/* Tooltip arrow */
.btn-buy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgb(15 23 42 / .92);
}

/* Show tooltip when hovering wrapper and button is disabled */
.btn-buy-wrapper:hover .btn-buy-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Only show tooltip when the button is actually disabled */
.btn-buy-wrapper:has(.btn-buy:not([aria-disabled="true"])):hover .btn-buy-tooltip {
    opacity: 0;
    visibility: hidden;
}

/* Checkbox highlight — pulse on attention state */
@keyframes agree-pulse {
    0%   { outline-color: transparent; outline-offset: 3px; }
    30%  { outline-color: #f59e0b; outline-offset: 1px; }
    70%  { outline-color: #f59e0b; outline-offset: 1px; }
    100% { outline-color: transparent; outline-offset: 3px; }
}

.book-buy-agree-check--attention {
    animation: agree-pulse 1s ease forwards;
    outline: 2px solid transparent;
    border-radius: 2px;
}

.book-buy-agree-label--attention {
    color: #b45309;
    transition: color 300ms ease;
}

.btn-icon {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
}

/* Meta block (shared between book section and any future use) */

.book-meta-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.book-meta-heading {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin: 0 0 0.35rem;
}

.book-meta-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
}

.book-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.85rem;
}

.book-meta-row:last-child {
    border-bottom: none;
}

.book-meta-row dt {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.book-meta-row dd {
    color: var(--color-text);
    font-weight: 500;
    text-align: right;
    margin: 0;
}

.book-meta-note {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 0;
}

/* --- Book cover zoom icon ------------------------------------ */
.book-cover-link {
    position: relative;
}

.book-zoom-icon {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    opacity: 1;
    transition: opacity 220ms ease, transform 220ms ease;
    pointer-events: none;
    transform: scale(0.85);
}

.book-zoom-icon svg {
    display: block;
}

.book-cover-link:hover .book-zoom-icon {
    transform: scale(1);
}



/* --- Text link ----------------------------------------------- */
.text-link {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition);
}

.text-link:hover {
    color: var(--color-primary-dk);
}

.text-center { text-align: center; }

/* --- Footer -------------------------------------------------- */
.site-footer {
    background: var(--color-secondary);
    color: rgba(255 255 255 / .6);
    text-align: center;
    padding: 1.25rem 1.25rem 1.5rem;
    font-size: 0.875rem;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
}

/* Footer legal links */
.footer-legal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-legal-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    color: rgba(255 255 255 / .45);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition);
}

.footer-legal-btn:hover {
    color: rgba(255 255 255 / .85);
}

.footer-legal-sep {
    color: rgba(255 255 255 / .25);
    font-size: 0.75rem;
    user-select: none;
}

/* --- Legal popups -------------------------------------------- */
.legal-popup {
    position: fixed;
    inset: 0;
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.legal-popup[hidden] {
    display: none;
}

.legal-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / .55);
    cursor: pointer;
}

.legal-popup-panel {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 540px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
}

.legal-popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color var(--transition);
    padding: 0.25rem 0.5rem;
}

.legal-popup-close:hover {
    color: var(--color-text);
}

.legal-popup-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 1rem;
    padding-right: 2rem;
}

.legal-popup-body {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.75;
}

.legal-popup-body p {
    margin-top: 0.625rem;
}

/* --- Scroll-to-top button ------------------------------------ */
.scroll-top {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 250ms ease, visibility 250ms ease, transform 250ms ease, background 150ms ease;
    z-index: 100;
}

.scroll-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--color-primary-dk);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.scroll-top:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}
