/* Free guides: each guide's own pages are the picture, one download is the action.
   The cover holds its place while the inside pages slide out from behind it. */
.guides{background:var(--paper);color:var(--navy);padding-top:140px}
.guides-intro{display:grid;grid-template-columns:1fr 1fr;gap:10vw;align-items:end;padding:0 var(--margin);margin-bottom:80px}
.guides-intro h2 .t-accent{display:block;font-family:"Instrument Serif",Georgia,serif;font-weight:400;font-size:1.35em;line-height:1.06;letter-spacing:-.025em}
.guides-intro p{max-width:440px}

.guides-shelf{display:grid;grid-template-columns:1fr 1fr}
.guide{--ground:var(--mist);--ink:var(--navy);--focus:var(--navy);display:flex;flex-direction:column;align-items:center;padding:72px var(--margin) 96px;background:var(--ground);color:var(--ink)}
/* Alternate grounds by position, so the shelf works with any guides the build puts there. */
.guide:nth-child(even){--ground:var(--navy);--ink:var(--paper);--focus:var(--lime)}

/* Three guides: one row of three on wide screens, the book a little shorter. */
@media(min-width:1101px){
 .guides-shelf:has(> .guide:nth-child(3)){grid-template-columns:repeat(3,1fr)}
 .guides-shelf:has(> .guide:nth-child(3)) .guide-book{height:clamp(360px,30vw,500px)}
 .guides-shelf:has(> .guide:nth-child(3)) .guide h3{font-size:clamp(28px,2.3vw,36px)}
}
@media(min-width:901px) and (max-width:1100px){
 .guides-shelf:has(> .guide:nth-child(3)) .guide:nth-child(3){grid-column:1/-1}
}
.guides-more{display:flex;justify-content:center;padding:56px var(--margin) 96px}
.guides-more .button:hover span{transform:translateX(4px)}
.guides-more .button span{transition:transform .25s}

/* The book: three real pages, the cover in front. --fan runs 0 (closed) to 1 (open). */
.guide-book{--fan:1;position:relative;display:block;width:100%;height:clamp(400px,38vw,580px);margin-bottom:56px}
.guide-book .leaf{--x:0%;--r:0deg;--lift:0px;position:absolute;left:50%;top:50%;height:90%;width:auto;max-width:none;object-fit:contain;transform-origin:50% 100%;transform:translate(calc(var(--base,-72%) + var(--x) * var(--fan)),calc(-50% - var(--lift))) rotate(calc(var(--r) * var(--fan)));transition:transform .7s var(--motion-ease),filter .3s}
.guide-book .leaf-back{--x:44%;--r:4deg;filter:brightness(.8)}
.guide-book .leaf-mid{--x:22%;--r:2deg;filter:brightness(.9)}
.guide:hover .guide-book{--fan:1.3}
.guide:hover .leaf-cover{--lift:10px}

.guide-copy{display:flex;flex-direction:column;flex:1;width:100%;max-width:560px}
.guide h3{font-size:var(--statement);line-height:1.08;letter-spacing:-.035em;font-weight:600}
.guide-summary{margin-top:16px}
.guide-facts{margin-top:12px;font-size:var(--small);font-variant-numeric:tabular-nums}

.guide-actions{display:flex;margin-top:auto;padding-top:36px}
.guide-actions .button:hover span{transform:translateY(3px)}

/* Entrance: the book opens once as it arrives; script adds the classes, so no script means an open book. */
.guides.is-animated .guide-book:not(.is-open){--fan:0}
.guide-book.is-entering .leaf{transition-duration:1.1s}
.guide-book.is-entering .leaf-mid{transition-delay:.12s}
.guide-book.is-entering .leaf-back{transition-delay:.24s}

@media(max-width:900px){
 .guides{padding-top:100px}
 .guides-intro{gap:40px;margin-bottom:56px}
 .guides-shelf{grid-template-columns:1fr}
 .guide{padding:64px var(--margin) 80px}
 .guide-book{height:440px}
}

@media(max-width:600px){
 .guides{padding-top:80px}
 .guides-intro{grid-template-columns:1fr;gap:22px;margin-bottom:44px}
 .guides-intro h2{font-size:36px}
 .guide{padding:48px var(--margin) 64px}
 .guide-book{height:320px;margin-bottom:40px}
 .guide-book{--base:-67%}
 .guide-book .leaf{height:84%}
 .guide-book .leaf-back{--x:34%;--r:3deg}
 .guide-book .leaf-mid{--x:17%;--r:1.5deg}
 .guide h3{font-size:28px}
}

@media(prefers-reduced-motion:reduce){
 .guide-book .leaf{transition:none!important}
 .guides.is-animated .guide-book:not(.is-open){--fan:1}
}
