/* The story page (/about): Jenny's photo and opening, her story as one
   readable column, what she learned in three groups, and the certificates
   themselves. Colors and type come from home.css. */

.story-top { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.story-photo { width: 100%; height: auto; border-radius: 36px; box-shadow: var(--shadow); }
.lead-in { font-size: 1.25rem; max-width: 52ch; margin: 1.2rem 0 0; }

.story { max-width: 760px; padding-top: 2rem; font-size: 1.15rem; line-height: 1.75; }
.story h2 { font-size: 1.7rem; font-weight: 900; margin: 2.2rem 0 .4rem; color: var(--teal); }
.story p { margin: 0 0 1rem; }
.motto { margin: 2.5rem 0 0; padding: 1.8rem 2rem; background: var(--ink); color: #fff; border-radius: 28px; }
.motto p { margin: 0; font-size: 1.35rem; font-weight: 700; line-height: 1.5; }
.motto footer { margin-top: .7rem; color: var(--sun); }

.learned { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; margin-top: 1.4rem; }
.learned > div { background: #fff; border-radius: 24px; padding: 1.5rem; box-shadow: var(--shadow); }
.learned h3 { margin: 0 0 .7rem; font-size: 1.4rem; }
.learned ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.learned b { color: var(--teal); margin-inline-end: .35rem; }

.certs-title { margin: 3rem 0 .2rem; font-size: 1.5rem; }
.certs { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1rem;
         grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.certs figure { margin: 0; height: 100%; background: #fff; border-radius: 16px; padding: .6rem; box-shadow: var(--shadow); }
.certs a { display: flex; align-items: center; justify-content: center; height: 200px; overflow: hidden; }
.certs img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
/* The year on its own line, so an English name does not pull it to the left. */
.certs figcaption { margin-top: .6rem; font-size: .9rem; line-height: 1.35; }
.certs figcaption b { display: block; color: var(--teal); }
.certs figcaption span { display: block; color: var(--ink-soft); font-size: .8rem; }

/* A certificate opened large: it grows into the middle of the screen over a
   dark background and shrinks back when closed. */
.cert-view { box-sizing: border-box; overflow: hidden; border: 0; padding: 1rem; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
             background: transparent; display: grid; place-items: center; }
.cert-view:not([open]) { display: none; }
.cert-view img { max-width: min(92vw, 900px); max-height: 86dvh; width: auto; height: auto; border-radius: 16px;
                 background: #fff; box-shadow: 0 24px 60px rgb(0 0 0 / .35); }
.cert-view::backdrop { background: rgb(16 47 54 / .82); }
.cert-close { position: fixed; top: 1rem; inset-inline-end: 1rem; width: 48px; height: 48px; border-radius: 50%;
              border: 0; background: #fff; color: var(--ink); font: inherit; font-size: 1.3rem; font-weight: 900;
              cursor: pointer; box-shadow: var(--shadow); }
.cert-view form { display: contents; }
html:has(.cert-view[open]) { overflow: hidden; }

@media (prefers-reduced-motion: no-preference) {
  .certs img { transition: transform .25s ease; }
  .certs a:hover img { transform: scale(1.04); }
  .cert-view, .cert-view::backdrop {
    transition: opacity .3s ease, display .3s allow-discrete, overlay .3s allow-discrete; opacity: 0; }
  .cert-view img { transition: transform .35s cubic-bezier(.2, .8, .3, 1.1); transform: scale(.85); }
  .cert-view[open], .cert-view[open]::backdrop { opacity: 1; }
  .cert-view[open] img { transform: none; }
  @starting-style {
    .cert-view[open], .cert-view[open]::backdrop { opacity: 0; }
    .cert-view[open] img { transform: scale(.85); }
  }
}

.story-cta { text-align: center; }
.story-cta p { font-size: 1.2rem; margin: .6rem auto 1.4rem; max-width: 46ch; }

@media (max-width: 760px) {
  .story-top { grid-template-columns: 1fr; gap: 1.5rem; }
  .story-photo { max-width: 300px; margin: 0 auto; }
  .certs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .certs a { height: 150px; }
}
