/* Recommended, set like a page of the same travel book as the home page: a small title in spaced capitals over the
   swelled rule, then a painted plate (a shelf on the wall with a stack of books, a radio wearing a pair of
   headphones, and a small television), and the six recommendations under it in three columns, one for each thing on
   the shelf: books under the books, podcasts under the radio, videos under the television.
   This file sets everything, so the page stands with the script blocked: the shelf and the three things on it are
   ordinary pictures here. js/recommended.js only stands the three things up off the wall as paper cutouts.

     --W   the page's one measure: the plate is that wide, and so is the list under it (its three columns are a third
           each, so each column's middle is under its thing on the shelf).
     --u   one unit of the plate's painting (it is 640 wide, 174 high; 360 by 174 on phones). */

main.pg-rec { --W: min(calc(100vw - 80px), 860px); --pw: 640; --u: calc(var(--W) / var(--pw)); --gut: 20px; }
@media (min-width: 1180px) { main.pg-rec { --W: clamp(600px, min(calc((100vw - var(--nav)) * .72), calc(100vw - 2 * var(--nav) - 120px)), 940px); } }
@media (max-width: 700px) { main.pg-rec { --W: min(calc(100vw - 40px), 460px); --pw: 360; } }

/* the page's column, centred. From 1180px, where the menu is a rail down the left, it is centred on the window, not
   on the space beside the rail (as the home page is): the content is moved back by half the rail. */
main.pg-rec .c-rec { padding: 64px var(--gut) 72px; }
main.pg-rec .c-rec .c-in { padding: 0; max-width: none; display: flex; flex-direction: column; align-items: center; }
@media (min-width: 1180px) { main.pg-rec .c-rec { padding-right: calc(var(--gut) + var(--nav)); } }
@media (max-width: 1179px) { main.pg-rec .c-rec { padding-top: 54px; } }
@media (max-width: 700px) { main.pg-rec .c-rec { padding-top: 40px; padding-bottom: 56px; } }

/* ---------------------------------------------------------------------------------------------- the title */
main.pg-rec .rec-head { display: block; width: 100%; text-align: center; }
main.pg-rec .rec-head #rec-h { font-size: clamp(24px, calc(var(--W) * .04), 36px); line-height: 1.25; letter-spacing: .3em; text-transform: uppercase;
  max-width: none; padding: 0 0 0 .3em; text-wrap: initial; }    /* (the left padding is the spacing the last letter carries after it, so the letters themselves are centred) */
/* the swelled rule under it, drawn with the same pen as the home page's */
/* (on a narrow phone the spaced word is set to the measure: about 12.2em wide with its spacing) */
@media (max-width: 700px) { main.pg-rec .rec-head #rec-h { font-size: min(24px, calc(var(--W) / 12.6)); } }
main.pg-rec .rec-head #rec-h::after { content: ''; display: block; width: clamp(130px, calc(var(--W) * .2), 180px); height: 11px; margin: 16px auto 0;
  transform: translateX(-.15em);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 20' preserveAspectRatio='none'%3E%3Cpath fill='%231B242C' fill-rule='evenodd' d='M238 9.68l-32.71-1.35-13.11-0.74-19.62-0.48-13.08 0.33-6.52 0.36-10.9 0.31-4.36 0.49-2.19 0.41-0.02 2.07 2.17 0.57 4.36 0.69 6.54 0.06 17.47-0.44 8.73-0.06 19.64 0.31 32.69-1.21 6.55-0.42 4.36-0.4zM2 10.24l10.9 0.8 10.92 0.28 61.06 1.1 6.53 0.1 6.52-0.02 4.4-0.67 2.18-0.62-0.01-2.18-2.19-0.39-4.34-0.48-6.56-0.23-17.45-0.48-13.07 0.19-13.1-0.25-6.54 0.11-8.73 0.32-19.62 1.34-10.89 0.58zM119.81 17.94l8.09-7.92-8.02-7.85-7.93 7.56z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }

/* ---------------------------------------------------------------------------------------------- the plate */
/* Its box is kept by this stylesheet (an aspect ratio), so nothing moves when the pictures arrive. The top of the
   painting is empty wall (room for the aerials): the plate is pulled up over its own title gap by that much. */
main.pg-rec .c-rec .shelf { position: relative; right: auto; top: auto; flex: none; transform: none;
  width: var(--W); aspect-ratio: var(--pw) / 174; margin: calc(var(--u) * -6) auto 0; pointer-events: none; user-select: none; }
main.pg-rec .sp { position: absolute; }
main.pg-rec .sp img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; -webkit-user-drag: none; }
main.pg-rec .sp--shelf { left: 0; top: 0; width: 100%; height: 100%; }
/* each thing: its picture is (w by 132) units with its foot at (w / 2, 128); x is where it stands on the shelf */
main.pg-rec .sp--books, main.pg-rec .sp--radio, main.pg-rec .sp--tv { --w: 110; top: 0; height: calc(132 / 174 * 100%);
  width: calc(var(--w) / var(--pw) * 100%); left: calc((var(--x) - var(--w) / 2) / var(--pw) * 100%); }
main.pg-rec .sp--books { --w: 150; --x: 106.67; }
main.pg-rec .sp--radio { --x: 320; }
main.pg-rec .sp--tv { --x: 533.33; }
@media (max-width: 700px) {
  main.pg-rec .sp--books { --x: 78; }
  main.pg-rec .sp--radio { --x: 196; }
  main.pg-rec .sp--tv { --x: 296; }
}
/* once a thing stands as a paper cutout (drawn by the script's canvas), its flat picture steps aside */
main.pg-rec .sp.is-card { visibility: hidden; }
main.pg-rec .rec-gl { position: absolute; left: 0; top: 0; display: block; pointer-events: none; }

/* ---------------------------------------------------------------------------------------------- the list */
/* Three columns, filled down: the two books, the two podcasts, the two videos. (No gap between the columns, only
   padding inside them, so each column's middle is exactly a sixth, a half and five sixths of the measure.) */
main.pg-rec .pack { width: var(--W); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto;
  grid-auto-flow: column; column-gap: 0; row-gap: 44px; margin-top: 30px; }
main.pg-rec .pack .pk { display: flex; flex-direction: column; align-items: center; gap: 0; text-align: center; transform: none; padding: 0 14px; font-size: 18px; line-height: 1.45; }
main.pg-rec .pack .pk > * { grid-column: auto; }
main.pg-rec .pk__ic { display: none; }
main.pg-rec .pk__type { font-size: 19px; line-height: 1.3; letter-spacing: .02em; }
main.pg-rec .pk__title { font-size: clamp(20px, calc(var(--W) * .026), 24px); line-height: 1.22; margin-top: 4px; text-wrap: balance; }
main.pg-rec .pk__by { font-size: 16.5px; margin-top: 4px; }
main.pg-rec .pk__why { max-width: 17em; margin-top: 6px; text-wrap: balance; }

/* phones: one column, the three kinds one after another, a small diamond of the rule's pen between kinds */
@media (max-width: 700px) {
  main.pg-rec .pack { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; row-gap: 34px; margin-top: 26px; }
  main.pg-rec .pack .pk { padding: 0; }
  main.pg-rec .pack .pk:nth-child(3), main.pg-rec .pack .pk:nth-child(5) { margin-top: 8px; }
  main.pg-rec .pack .pk:nth-child(3)::before, main.pg-rec .pack .pk:nth-child(5)::before { content: ''; display: block; width: 11px; height: 11px; margin: 0 auto 34px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill='%231B242C' d='M8.81 16.94l7.09-7.92-7.02-7.85-6.93 7.56z'/%3E%3C/svg%3E") center / contain no-repeat; }
}

/* ---------------------------------------------------------------------------------------------- the footer */
/* on the page's centre line, as on the home page */
main.pg-rec ~ .foot { max-width: none; justify-content: center; padding-left: var(--gut, 20px); padding-right: 20px; }
@media (min-width: 1180px) { main.pg-rec ~ .foot { padding-right: calc(20px + var(--nav)); } }
/* (comment mode: the picture takes the click itself, so a note on it lands on it and not on what lies under it) */
html.rv-commenting main.pg-rec .shelf { pointer-events: auto; }
