/* مكتبة عزيز — main stylesheet (RTL) */

:root {
    --ink: #0d2a24;
    --green-900: #0b2621;
    --green-800: #123b33;
    --green-700: #1a4d43;
    --green-100: #e3ece7;
    --gold: #c9a54c;
    --gold-600: #b08a33;
    --gold-100: #f4ead0;
    --paper: #faf6ee;
    --paper-2: #f3ede0;
    --card: #ffffff;
    --line: #e6dfcf;
    --muted: #6b726c;
    --text: #1d2723;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(13, 42, 36, .06), 0 2px 8px rgba(13, 42, 36, .05);
    --shadow: 0 2px 6px rgba(13, 42, 36, .06), 0 14px 34px -10px rgba(13, 42, 36, .22);
    --shadow-lg: 0 30px 60px -20px rgba(11, 38, 33, .45);
    --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    --font-display: "Amiri", "Times New Roman", serif;
    --header-h: 76px;
    /* Eight-point star tile, inspired by Moroccan zellige. */
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23c9a54c' stroke-width='1'%3E%3Cpath d='M40 10l8.3 11.7L62.4 17.6 58.3 31.7 70 40l-11.7 8.3 4.1 14.1-14.1-4.1L40 70l-8.3-11.7-14.1 4.1 4.1-14.1L10 40l11.7-8.3-4.1-14.1 14.1 4.1z'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3Cpath d='M0 0l10 10M80 0L70 10M0 80l10-10M80 80L70 70'/%3E%3C/g%3E%3C/svg%3E");
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.3; margin: 0; color: var(--ink); }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100;
    background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.icon {
    width: 1.25em; height: 1.25em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    padding: .8em 1.5em; border-radius: 999px; border: 1.5px solid transparent;
    font-weight: 600; font-size: .98rem; line-height: 1.2; cursor: pointer; white-space: nowrap;
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--green-800); color: #fff; box-shadow: 0 8px 20px -8px rgba(18, 59, 51, .7); }
.btn-primary:hover { background: var(--green-700); }
.btn-gold { background: var(--gold); color: var(--green-900); box-shadow: 0 8px 20px -8px rgba(176, 138, 51, .8); }
.btn-gold:hover { background: #d6b45e; }
.btn-ghost { border-color: rgba(18, 59, 51, .25); color: var(--green-800); background: transparent; }
.btn-ghost:hover { border-color: var(--green-800); background: rgba(18, 59, 51, .04); }
.btn-ghost-light { border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-ghost-light:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

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

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(250, 246, 238, .82);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(13, 42, 36, .5); }

.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.logo { width: 46px; height: 46px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; color: var(--ink); }
.brand-sub { font-size: .78rem; color: var(--muted); }
.brand--light .brand-name { color: #fff; }
.brand--light .brand-sub { color: rgba(255, 255, 255, .6); }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
    position: relative; padding: 8px 14px; border-radius: 999px;
    font-weight: 500; color: #3a4440; transition: color .2s ease, background-color .2s ease;
}
.site-nav a:hover { color: var(--green-800); background: rgba(18, 59, 51, .06); }
.site-nav a.active { color: var(--green-800); font-weight: 600; }
.site-nav a.active::after {
    content: ""; position: absolute; bottom: 2px; inset-inline: 40%; height: 2px; border-radius: 2px; background: var(--gold);
}
.site-nav .nav-cta {
    display: inline-flex; align-items: center; gap: 8px; margin-inline-start: 8px;
    background: var(--green-800); color: #fff; padding: 9px 18px;
}
.site-nav .nav-cta:hover { background: var(--green-700); color: #fff; }

.nav-toggle {
    display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px;
    background: #fff; cursor: pointer; padding: 0; position: relative;
}
.nav-toggle > span:not(.sr-only) {
    position: absolute; inset-inline: 12px; height: 2px; border-radius: 2px; background: var(--ink);
    transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle > span:nth-child(1) { top: 15px; }
.nav-toggle > span:nth-child(2) { top: 21px; }
.nav-toggle > span:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] > span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] > span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] > span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(1000px 500px at 85% -10%, rgba(201, 165, 76, .18), transparent 60%),
        radial-gradient(800px 600px at 0% 110%, rgba(26, 77, 67, .12), transparent 60%),
        var(--paper);
    padding: clamp(48px, 8vw, 96px) 0 clamp(64px, 9vw, 120px);
}
.hero-pattern {
    position: absolute; inset: 0; background-image: var(--pattern); background-size: 80px;
    opacity: .14; pointer-events: none;
    mask-image: radial-gradient(ellipse at 20% 40%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 20% 40%, #000 0%, transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-grid > *, .spotlight-grid > *, .about-grid > *, .visit-grid > *, .detail-grid > * { min-width: 0; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px 6px 16px; border-radius: 999px;
    background: var(--gold-100); color: #7a5f1c; font-weight: 600; font-size: .9rem;
    border: 1px solid rgba(201, 165, 76, .45);
}
.hero h1 { margin: 22px 0 18px; display: flex; flex-direction: column; }
.hero-title {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(3.2rem, 8vw, 5.8rem); line-height: 1.05; color: var(--green-800);
}
.hero-lead {
    font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 3.6vw, 2.5rem);
    color: var(--gold-600); line-height: 1.4;
}
.hero-text { font-size: 1.1rem; color: #4a534f; max-width: 54ch; }

.hero-search {
    margin-top: 30px; display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: 6px 18px 6px 6px; box-shadow: var(--shadow); max-width: 560px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.hero-search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 165, 76, .18), var(--shadow); }
.hero-search > .icon { color: var(--muted); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 10px 0; font-size: 1.02rem; }
.hero-search .btn { padding: .75em 1.6em; }

.hero-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; }

/* Decorative shelf of book spines. */
.hero-art { position: relative; min-height: 380px; display: flex; flex-direction: column; justify-content: flex-end; }
.shelf { display: flex; align-items: flex-end; justify-content: center; gap: 6px; padding-inline: 20px; }
.spine {
    position: relative; width: 52px; border-radius: 5px 5px 2px 2px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset -6px 0 10px rgba(0, 0, 0, .18), inset 4px 0 6px rgba(255, 255, 255, .08), 0 10px 18px -8px rgba(0, 0, 0, .45);
    transform-origin: bottom center;
    animation: rise .9s cubic-bezier(.2, .8, .2, 1) both;
}
.spine::before, .spine::after {
    content: ""; position: absolute; inset-inline: 7px; height: 2px; background: rgba(201, 165, 76, .75);
}
.spine::before { top: 18px; box-shadow: 0 5px 0 rgba(201, 165, 76, .75); }
.spine::after { bottom: 18px; box-shadow: 0 -5px 0 rgba(201, 165, 76, .75); }
.spine span {
    writing-mode: vertical-rl; font-family: var(--font-display); font-weight: 700;
    color: #f5e9c8; font-size: 1rem; letter-spacing: .02em; white-space: nowrap;
}
.spine.h1 { height: 300px; } .spine.h2 { height: 270px; } .spine.h3 { height: 320px; } .spine.h4 { height: 250px; }
.spine.c1 { background: linear-gradient(90deg, #123b33, #1a4d43 60%, #0f332c); }
.spine.c2 { background: linear-gradient(90deg, #6b1f24, #84292f 60%, #5a1a1e); }
.spine.c3 { background: linear-gradient(90deg, #1f2f4d, #2a3f66 60%, #1a2842); }
.spine.c4 { background: linear-gradient(90deg, #5c4318, #7a5a22 60%, #4f3913); }
.spine.c5 { background: linear-gradient(90deg, #27332e, #36463f 60%, #202a26); }
.spine:nth-child(5) { transform: rotate(-6deg); margin-inline: 8px 2px; }
.spine:nth-child(1) { animation-delay: .05s; } .spine:nth-child(2) { animation-delay: .1s; }
.spine:nth-child(3) { animation-delay: .15s; } .spine:nth-child(4) { animation-delay: .2s; }
.spine:nth-child(5) { animation-delay: .25s; } .spine:nth-child(6) { animation-delay: .3s; }
.spine:nth-child(7) { animation-delay: .35s; } .spine:nth-child(8) { animation-delay: .4s; }
.spine:nth-child(5) { animation-name: rise-tilt; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes rise-tilt { from { opacity: 0; transform: translateY(30px) rotate(-6deg); } to { opacity: 1; transform: rotate(-6deg); } }
.shelf-board {
    height: 18px; border-radius: 4px; margin-top: -1px;
    background: linear-gradient(180deg, #8a6a33, #6b4f22);
    box-shadow: 0 18px 30px -12px rgba(60, 40, 10, .55);
}

.cover-fan { position: relative; height: 400px; }
.cover-fan img {
    position: absolute; bottom: 0; left: 50%; width: 220px; aspect-ratio: 1 / 1.414; object-fit: cover;
    border-radius: 6px; box-shadow: var(--shadow-lg); background: #fff; border: 1px solid var(--line);
    animation: .9s cubic-bezier(.2, .8, .2, 1) both;
}
.cover-fan img:nth-child(1) { --t: translateX(-5%) rotate(8deg); z-index: 1; }
.cover-fan img:nth-child(2) { --t: translateX(-95%) rotate(-8deg); z-index: 2; animation-delay: .1s; }
.cover-fan img:nth-child(3) { --t: translateX(-50%) translateY(-24px); z-index: 3; animation-delay: .2s; }
.cover-fan img { transform: var(--t); animation-name: fan; }
@keyframes fan { from { opacity: 0; transform: translateX(-50%) translateY(24px); } to { opacity: 1; transform: var(--t); } }

.seal {
    position: absolute; top: 6px; inset-inline-start: 0; z-index: 5;
    width: 118px; height: 118px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
    background: var(--green-800); color: var(--gold-100);
    border: 3px double var(--gold); box-shadow: var(--shadow);
    transform: rotate(-10deg); font-size: .82rem;
}
.seal strong { font-size: 1.7rem; color: var(--gold); font-family: var(--font-display); }

/* ---------- Stats ---------- */

.stats { position: relative; margin-top: -48px; z-index: 2; }
.stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    background: var(--green-800); color: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); overflow: hidden; position: relative;
}
.stats-grid::before {
    content: ""; position: absolute; inset: 0; background-image: var(--pattern); background-size: 64px; opacity: .08;
}
.stat { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; padding: 26px 30px; }
.stat + .stat { border-inline-start: 1px solid rgba(255, 255, 255, .1); }
.stat .icon { grid-row: span 2; width: 46px; height: 46px; padding: 11px; border-radius: 14px; background: rgba(201, 165, 76, .16); color: var(--gold); }
.stat strong { font-size: 1.9rem; font-weight: 700; line-height: 1.1; color: #fff; }
.stat span { color: rgba(255, 255, 255, .7); font-size: .95rem; }

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 8vw, 104px) 0; }
.section--flush { padding-top: 32px; }
.section--tinted { background: var(--paper-2); border-block: 1px solid var(--line); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 36px; }
.section-head h2, .about h2, .visit h2 { font-family: var(--font-display); font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 700; }

.kicker {
    display: inline-flex; align-items: center; gap: 10px; margin-bottom: 8px;
    color: var(--gold-600); font-weight: 600; font-size: .92rem; letter-spacing: .02em;
}
.kicker::before { content: ""; width: 26px; height: 2px; background: currentColor; border-radius: 2px; }
.kicker--light { color: var(--gold); }

.link-more { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--green-800); padding: 8px 0; }
.link-more .icon { transition: transform .2s ease; }
.link-more:hover .icon { transform: translateX(-4px); }

/* ---------- Book cards ---------- */

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: clamp(18px, 2.4vw, 30px); }
.book-grid--4 { grid-template-columns: repeat(4, 1fr); }
.book-grid > *, .genre-grid > *, .steps-grid > * { min-width: 0; }
.book-tags { min-width: 0; }

.book-card-link { display: flex; flex-direction: column; height: 100%; }
.book-cover {
    position: relative; aspect-ratio: 1 / 1.414; border-radius: 6px 10px 10px 6px; overflow: hidden;
    background: #fff; border: 1px solid var(--line);
    box-shadow: var(--shadow);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease;
}
/* Spine highlight on the binding edge (right side in RTL books). */
.book-cover::after {
    content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 10px;
    background: linear-gradient(90deg, rgba(0, 0, 0, .0), rgba(0, 0, 0, .12) 50%, rgba(255, 255, 255, .25));
    pointer-events: none;
}
.book-cover img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.book-card-link:hover .book-cover { transform: translateY(-8px) rotate(-.6deg); box-shadow: var(--shadow-lg); }

.cover-placeholder {
    width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    padding: 20px; text-align: center;
    background: linear-gradient(160deg, var(--green-700), var(--green-900));
    color: var(--gold-100); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.5;
    position: relative;
}
.cover-placeholder::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(201, 165, 76, .5); border-radius: 4px; }
.cover-placeholder .icon { width: 42px; height: 42px; color: var(--gold); }

.book-meta { padding-top: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.book-title {
    font-family: var(--font); font-size: 1rem; font-weight: 600; line-height: 1.55; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    transition: color .2s ease;
}
.book-card-link:hover .book-title { color: var(--green-700); }
.book-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    font-size: .78rem; font-weight: 500; padding: 2px 10px; border-radius: 999px;
    background: var(--green-100); color: var(--green-800);
}

.empty {
    display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
    padding: 64px 24px; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); background: rgba(255, 255, 255, .5);
}
.empty .icon { width: 44px; height: 44px; color: var(--gold); }

/* ---------- Genres ---------- */

.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.genre-card {
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px;
    padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
    box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.genre-card::after {
    content: ""; position: absolute; inset-inline-end: -30px; bottom: -30px; width: 120px; height: 120px;
    background-image: var(--pattern); background-size: 60px; opacity: 0; transition: opacity .3s ease;
}
.genre-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(201, 165, 76, .6); }
.genre-card:hover::after { opacity: .35; }
.genre-index { font-family: var(--font-display); color: var(--gold); font-size: 1.1rem; font-weight: 700; }
.genre-name { font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.genre-count { color: var(--muted); font-size: .92rem; }

/* ---------- About ---------- */

.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about-points { display: grid; gap: 16px; }
.point { padding: 22px 26px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); border-inline-start: 4px solid var(--gold); }
.point h3 { font-size: 1.12rem; margin-bottom: 6px; }
.point p { color: #4a534f; }

/* ---------- Visit ---------- */

.visit { background: var(--green-900); color: #fff; position: relative; overflow: hidden; }
.visit::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); background-size: 80px; opacity: .07; }
.visit-grid { position: relative; display: grid; grid-template-columns: .9fr 1.1fr; gap: 32px; align-items: stretch; }
.visit h2 { color: #fff; margin-bottom: 20px; }
.visit-card { padding: clamp(8px, 2vw, 24px) 0; display: flex; flex-direction: column; }
.visit-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 14px; }
.visit-list li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .85); font-size: 1.05rem; }
.visit-list .icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: rgba(201, 165, 76, .15); color: var(--gold); }
.visit-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; }
.map { border-radius: var(--radius); overflow: hidden; min-height: 340px; border: 1px solid rgba(255, 255, 255, .12); box-shadow: var(--shadow-lg); background: var(--green-800); }
.map iframe { width: 100%; height: 100%; min-height: 340px; border: 0; display: block; filter: saturate(.85); }

/* ---------- Books page ---------- */

.page-hero {
    position: relative; overflow: hidden; padding: 48px 0 44px;
    background: linear-gradient(160deg, var(--green-800), var(--green-900)); color: #fff;
}
.page-hero .hero-pattern { opacity: .1; mask-image: none; -webkit-mask-image: none; }
.page-hero .container { position: relative; }
.page-hero h1 { color: #fff; font-family: var(--font-display); font-size: clamp(2rem, 4.5vw, 3rem); margin: 8px 0 6px; }
.page-hero p { color: rgba(255, 255, 255, .75); }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .9rem; color: rgba(255, 255, 255, .6); }
.crumbs a:hover { color: var(--gold); }
.crumbs--dark { color: var(--muted); margin-bottom: 28px; }
.crumbs--dark a:hover { color: var(--green-800); }

.filters {
    display: grid; grid-template-columns: 1fr minmax(220px, 340px) auto; gap: 12px;
    padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
    margin-top: -64px; position: relative; z-index: 2;
}
.field { position: relative; display: flex; align-items: center; }
.field--search .icon { position: absolute; inset-inline-start: 14px; color: var(--muted); pointer-events: none; }
.field input, .field select {
    width: 100%; height: 50px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--paper);
    padding: 0 16px; outline: 0; transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.field--search input { padding-inline-start: 44px; }
.field select {
    appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b726c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: left 16px center;
}
.field input:focus, .field select:focus { border-color: var(--gold); background-color: #fff; box-shadow: 0 0 0 4px rgba(201, 165, 76, .16); }
.filters .btn { height: 50px; border-radius: var(--radius-sm); padding-inline: 28px; }

.genre-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip {
    padding: 6px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
    font-weight: 500; font-size: .9rem; transition: all .2s ease;
}
.chip:hover { border-color: var(--gold); color: var(--green-800); }
.chip.active { background: var(--green-800); border-color: var(--green-800); color: #fff; }

.results-bar { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 22px; color: var(--muted); }
.results-bar strong { color: var(--ink); font-size: 1.1rem; }
.link-reset { color: #a33b3b; font-weight: 500; font-size: .92rem; }
.link-reset:hover { text-decoration: underline; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 48px; }
.page-btn {
    min-width: 44px; height: 44px; padding: 0 14px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); background: var(--card); font-weight: 500; font-variant-numeric: tabular-nums; transition: all .2s ease;
}
a.page-btn:hover { border-color: var(--gold); color: var(--green-800); }
.page-btn.current { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.page-btn.disabled { opacity: .45; }
.page-btn.dots { border: 0; background: none; }

/* ---------- Book detail ---------- */

.book-detail { padding-top: 40px; }
.detail-grid { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.detail-cover {
    aspect-ratio: 1 / 1.414; border-radius: 6px 12px 12px 6px; overflow: hidden; background: #fff;
    border: 1px solid var(--line); box-shadow: var(--shadow-lg); position: sticky; top: calc(var(--header-h) + 24px);
}
.detail-cover img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.detail-info h1 { font-family: var(--font-display); font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.35; margin-bottom: 24px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 24px; }
.facts div { padding: 16px 20px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.in-stock { display: inline-flex; align-items: center; gap: 8px; color: #1f7a4d; }
.in-stock::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #2fa36a; box-shadow: 0 0 0 4px rgba(47, 163, 106, .18); }
.detail-note { color: #4a534f; font-size: 1.05rem; max-width: 60ch; }

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

.site-footer { background: var(--ink); color: rgba(255, 255, 255, .72); padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 20px 0; font-size: .88rem; color: rgba(255, 255, 255, .5); }

/* ---------- How it works ---------- */

.section-head--center { justify-content: center; text-align: center; }
.section-head--center .kicker { justify-content: center; }
.steps-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; position: relative; }
.steps-grid::before {
    content: ""; position: absolute; top: 58px; inset-inline: 16%; height: 2px;
    background: repeating-linear-gradient(90deg, var(--gold) 0 8px, transparent 8px 16px); opacity: .55;
}
.step {
    position: relative; text-align: center; padding: 34px 26px 30px; border-radius: var(--radius);
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease;
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.step-num {
    position: absolute; top: 14px; inset-inline-end: 18px; font-family: var(--font-display);
    font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--gold-100);
}
.step-icon {
    position: relative; z-index: 1; display: inline-flex; width: 64px; height: 64px; border-radius: 20px;
    align-items: center; justify-content: center; margin-bottom: 18px;
    background: var(--green-800); color: var(--gold); box-shadow: 0 10px 22px -10px rgba(18, 59, 51, .8);
}
.step-icon .icon { width: 30px; height: 30px; }
.step h3 { font-size: 1.2rem; margin-bottom: 8px; }
.step p { color: #4a534f; }

/* ---------- Spotlight ---------- */

.spotlight { position: relative; overflow: hidden; background: linear-gradient(150deg, var(--green-800), var(--green-900)); color: #fff; }
.spotlight-bg { position: absolute; inset: 0; background-image: var(--pattern); background-size: 90px; opacity: .08; }
.spotlight-grid { position: relative; display: grid; grid-template-columns: 340px 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.spotlight-cover {
    display: block; width: 100%; aspect-ratio: 1 / 1.414; border-radius: 6px 12px 12px 6px; overflow: hidden; background: #fff;
    box-shadow: 0 40px 70px -24px rgba(0, 0, 0, .7), 0 0 0 8px rgba(255, 255, 255, .06);
    transform: rotate(-3deg); transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.spotlight-cover:hover { transform: rotate(0) translateY(-6px); }
.spotlight-cover img { width: 100%; height: 100%; object-fit: contain; }
.spotlight-info h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.35; margin: 4px 0 14px; }
.spotlight-info p { color: rgba(255, 255, 255, .75); font-size: 1.05rem; max-width: 52ch; margin-top: 18px; }
.tag--light { background: rgba(201, 165, 76, .18); color: var(--gold-100); padding: 4px 14px; font-size: .88rem; }
.tag--light:hover { background: rgba(201, 165, 76, .3); }

/* ---------- Genre shelves ---------- */

.shelf-nav { display: flex; align-items: center; gap: 8px; }
.shelf-btn {
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--green-800);
    transition: background-color .2s ease, border-color .2s ease, opacity .2s ease;
}
.shelf-btn:hover { border-color: var(--gold); background: var(--gold-100); }
.shelf-btn:disabled { opacity: .35; cursor: default; }
.shelf-btn:not(.shelf-btn--next) .icon { transform: scaleX(-1); }
.shelf-nav .link-more { margin-inline-start: 8px; }
.shelf-track {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 190px); gap: 24px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    padding: 6px 4px 22px; margin-inline: -4px; scrollbar-width: thin; scrollbar-color: var(--gold) transparent;
    position: relative;
}
.shelf-track > * { scroll-snap-align: start; }
.shelf-track::after { content: ""; width: 1px; }
.shelf-section .book-cover { box-shadow: 0 2px 6px rgba(13, 42, 36, .06), 0 18px 30px -14px rgba(13, 42, 36, .35); }
.shelf-section .shelf-track { border-bottom: 10px solid #b08a4a; border-radius: 0 0 4px 4px; box-shadow: 0 14px 18px -12px rgba(60, 40, 10, .45); }

/* ---------- Call to action ---------- */

.cta { padding: 0 0 clamp(64px, 8vw, 104px); }
.cta-box {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
    padding: clamp(28px, 4vw, 48px) clamp(24px, 4vw, 56px); border-radius: 24px;
    background: linear-gradient(120deg, var(--gold-100), #fbf6e8 60%, #fff);
    border: 1px solid rgba(201, 165, 76, .45); box-shadow: var(--shadow);
}
.cta-pattern {
    position: absolute; inset-inline-end: -40px; top: -40px; width: 260px; height: 260px;
    background-image: var(--pattern); background-size: 64px; opacity: .35; border-radius: 50%;
}
.cta-text { position: relative; max-width: 560px; }
.cta-text h2 { font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin-bottom: 8px; }
.cta-text p { color: #4a534f; font-size: 1.05rem; }
.cta-actions { position: relative; display: flex; flex-wrap: wrap; gap: 12px; }
.btn-lg { padding: .95em 1.8em; font-size: 1.02rem; }

/* ---------- WhatsApp ---------- */

.icon--fill { fill: currentColor; stroke: none; }
.wa-float {
    position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 60;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 20px 12px 14px; border-radius: 999px;
    background: #25d366; color: #fff; font-weight: 600;
    box-shadow: 0 10px 28px -8px rgba(18, 140, 70, .65), 0 2px 6px rgba(0, 0, 0, .12);
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.wa-float:hover { transform: translateY(-3px); background: #1fbd5a; box-shadow: 0 14px 34px -8px rgba(18, 140, 70, .75); }
.wa-float .icon { width: 28px; height: 28px; }
.wa-float::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
    background: #25d366; animation: wa-pulse 2.4s ease-out infinite;
}
@keyframes wa-pulse { 0% { transform: scale(1); opacity: .55; } 80%, 100% { transform: scale(1.35); opacity: 0; } }
.btn-whatsapp { background: #25d366; color: #fff; box-shadow: 0 8px 20px -8px rgba(18, 140, 70, .7); }
.btn-whatsapp:hover { background: #1fbd5a; }

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .book-grid--4 { grid-template-columns: repeat(3, 1fr); }
    .filters { grid-template-columns: 1fr 1fr; }
    .filters .field--search { grid-column: 1 / -1; }
    .filters .btn { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .hero-grid, .about-grid, .visit-grid, .detail-grid, .spotlight-grid { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr; }
    .steps-grid::before { display: none; }
    .spotlight-cover { max-width: 260px; margin-inline: auto; }
    .spotlight-info { text-align: center; }
    .spotlight-info p { margin-inline: auto; }
    .spotlight-info .hero-actions { justify-content: center; }
    .cta-box { flex-direction: column; align-items: flex-start; }
    .hero-art { min-height: 300px; max-width: 520px; width: 100%; margin-inline: auto; }
    .spine { width: 42px; }
    .spine.h1 { height: 230px; } .spine.h2 { height: 205px; } .spine.h3 { height: 250px; } .spine.h4 { height: 190px; }
    .cover-fan { height: 320px; }
    .cover-fan img { width: 170px; }
    .detail-cover { position: static; max-width: 360px; width: 100%; margin-inline: auto; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid > :first-child { grid-column: 1 / -1; }

    .nav-toggle { display: block; }
    .site-nav {
        position: fixed; top: var(--header-h); inset-inline: 0;
        flex-direction: column; align-items: stretch; gap: 4px; padding: 16px;
        background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px -20px rgba(0, 0, 0, .3);
        transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .25s ease;
    }
    .site-nav.open { transform: none; opacity: 1; visibility: visible; }
    .site-nav a { padding: 12px 16px; border-radius: 12px; }
    .site-nav a.active::after { display: none; }
    .site-nav a.active { background: rgba(18, 59, 51, .06); }
    .site-nav .nav-cta { margin: 8px 0 0; justify-content: center; }
}

@media (max-width: 640px) {
    :root { --header-h: 64px; }
    body { font-size: 15px; }
    .section { padding: 48px 0; }
    .section-head { margin-bottom: 22px; gap: 10px; }
    .section-head h2, .about h2, .visit h2 { font-size: 1.75rem; }

    /* Hero: text first, compact, no decorative covers. */
    .hero { padding: 28px 0 64px; }
    .hero h1 { margin: 16px 0 12px; }
    .hero-title { font-size: 3.1rem; }
    .hero-lead { font-size: 1.6rem; }
    .hero-text { font-size: 1rem; }
    .hero-search { margin-top: 22px; padding: 5px 12px 5px 5px; }
    .hero-search input { font-size: 16px; }
    .hero-actions { margin-top: 16px; }
    .hero-art { display: none; }

    /* Stats: three small columns instead of three tall rows. */
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 16px 6px; }
    .stat + .stat { border-top: 0; border-inline-start: 1px solid rgba(255, 255, 255, .1); }
    .stat .icon { display: none; }
    .stat strong { font-size: 1.35rem; }
    .stat span { font-size: .78rem; line-height: 1.4; }

    /* Steps: icon beside the text. */
    .steps-grid { gap: 12px; }
    .step { display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; text-align: start; padding: 18px; align-items: start; }
    .step-icon { grid-row: span 2; width: 52px; height: 52px; border-radius: 16px; margin: 0; }
    .step-icon .icon { width: 24px; height: 24px; }
    .step h3 { font-size: 1.05rem; margin: 2px 0 4px; }
    .step p { font-size: .92rem; }
    .step-num { top: 10px; font-size: 1.8rem; }

    /* Spotlight. */
    .spotlight-cover { max-width: 210px; }
    .spotlight-info h2 { font-size: 1.6rem; }
    .spotlight-info p { font-size: .95rem; }

    /* Genres: two compact columns. */
    .genre-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .genre-card { padding: 14px; border-radius: 14px; }
    .genre-index { font-size: .9rem; }
    .genre-name { font-size: .95rem; line-height: 1.5; }
    .genre-count { font-size: .8rem; }

    /* Book cards: keep the genre label on one line. */
    .book-tags .tag { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .book-meta { padding-top: 10px; gap: 6px; }

    .about-points { gap: 12px; }
    .point { padding: 16px 18px; }
    .cta-box { padding: 24px 20px; }
    .map, .map iframe { min-height: 260px; }
    .page-hero { padding: 32px 0 56px; }
    .detail-info h1 { font-size: 1.9rem; margin-bottom: 18px; }
    .facts { grid-template-columns: 1fr 1fr; }
    .facts div { padding: 12px 14px; }
    .pagination { margin-top: 32px; }
    .page-btn { min-width: 40px; height: 40px; }
    /* Room so the WhatsApp button never covers the last lines. */
    .site-footer { padding-bottom: 72px; }
    .logo { width: 40px; height: 40px; }
    .brand-name { font-size: 1.35rem; }
    .stats { margin-top: -32px; }
    .book-grid, .book-grid--4 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .shelf-track { grid-auto-columns: 46%; gap: 16px; }
    .shelf-btn { display: none; }
    .cta-actions, .cta-actions .btn { width: 100%; }
    .book-title { font-size: .93rem; }
    .section-head { flex-direction: column; align-items: flex-start; }
    .filters { grid-template-columns: 1fr; margin-top: -40px; }
    .genre-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 8px; scrollbar-width: none; }
    .genre-chips .chip { flex: none; }
    .hero-search { padding-inline-end: 14px; }
    .hero-search .btn { padding-inline: 1.1em; }
    .hero-actions .btn { flex: 1; padding-inline: 1em; }
    .seal { width: 92px; height: 92px; font-size: .72rem; }
    .seal strong { font-size: 1.3rem; }
    .spine { width: 32px; }
    .spine span { font-size: .8rem; }
    .spine:nth-child(n+7) { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .wa-float { bottom: 16px; inset-inline-start: 16px; padding: 14px; }
    .wa-float .wa-label { display: none; }
}
