/* Route-scoped refinements in the portfolio's existing paper, ink and bronze. */
@media screen and (min-width:741px){
  /* A final closed card can use the whole row, including after a search or expansion. */
  .iist-story .iist-chapter-cards{
    --chapter-card-gap:13px;
    display:flex;flex-wrap:wrap;align-items:stretch;gap:var(--chapter-card-gap);
  }
  .iist-chapter-cards>.iist-contribution-card{flex:1 1 calc((100% - var(--chapter-card-gap))/2)}
  .iist-chapter#origins .iist-contribution-card,
  .iist-chapter-cards>.iist-contribution-card[open]{flex-basis:100%}
  .iist-chapter-cards>.iist-contribution-card:not([open])>summary{box-sizing:border-box;height:100%}
  .iist-contribution-card:not([open]) .iist-card-copy{align-self:stretch;display:flex;flex-direction:column}
  .iist-contribution-card:not([open]) .iist-card-read{margin-top:auto;padding-top:16px}
}

@media screen{
  /* These are reading cards. No course is preselected and they are not buttons. */
  body[data-page=teaching] .course-grid>.course-card{
    display:flex;flex-direction:column;min-width:0;background:#fff;border-color:var(--line);
    transition:none;
  }
  body[data-page=teaching] .course-grid .course-topics{margin-block-start:auto}
  /* A short reference panel beside an enquiry column of variable height. */
  .contact-grid>.contact-affiliation{
    align-self:start;min-width:0;border:1px solid var(--line);border-top-color:#b6a27a;
  }
  /* Echo the book frames without adding another moving track or changing card widths. */
  .focus-rail-ready .focus-viewport{padding-block:8px 16px}
  .focus-rail-ready .focus-track>.focus-card{
    border-color:#d5d1c6;border-top-color:#b6a27a;
    box-shadow:0 9px 18px -13px rgba(24,43,54,.28),0 1px 2px rgba(24,43,54,.035);
  }
  .focus-rail-ready .focus-track>.focus-card:has(:focus-visible){
    border-color:var(--bronze-dark);box-shadow:0 12px 20px -14px rgba(24,43,54,.30);
  }
}
@media screen and (hover:hover) and (pointer:fine){
  body[data-page=teaching] .course-grid>.course-card:hover{background:#f5f1e8;border-color:#ae9872}
  .focus-rail-ready:not(.is-dragging) .focus-track>.focus-card:hover{
    border-color:#a48b5c;box-shadow:0 16px 25px -16px rgba(24,43,54,.3),0 2px 5px rgba(24,43,54,.05);
  }
}
@media screen and (prefers-reduced-motion:no-preference){
  .focus-rail-ready .focus-track>.focus-card{
    transition:border-color .25s ease,box-shadow .3s ease,transform .45s cubic-bezier(.2,.7,.2,1);
  }
  .focus-rail-ready .focus-photo img{transition:transform .6s cubic-bezier(.2,.7,.2,1)}
  /* translate is independent of the hover transform and the carousel's track. */
  .focus-rail-ready.focus-frame-entered .focus-track>.focus-card{
    animation:focus-frame-arrive .62s cubic-bezier(.2,.7,.2,1) backwards;
    animation-delay:var(--focus-frame-delay,0ms);
  }
  .focus-rail-ready [data-focus-item="1"]{--focus-frame-delay:55ms}
  .focus-rail-ready [data-focus-item="2"]{--focus-frame-delay:110ms}
  @keyframes focus-frame-arrive{from{opacity:.84;translate:0 9px}to{opacity:1;translate:0 0}}
}
@media screen and (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .focus-rail-ready:not(.is-dragging) .focus-track>.focus-card:hover{transform:translateY(-4px)}
  .focus-rail-ready:not(.is-dragging) .focus-card:hover .focus-photo img{transform:scale(1.025)}
}
@media screen and (max-width:600px){
  .focus-rail-ready .focus-viewport{padding-block:5px 10px}
}
/* No motion is needed to convey the frame or the story link's keyboard focus. */
@media(prefers-reduced-motion:reduce){
  .focus-rail-ready .focus-track>.focus-card,.focus-rail-ready .focus-photo img{
    animation:none;transition:none;transform:none;translate:none;
  }
}
