/* IAM Roles: the figures on its slides, taken from the session 1 deck's
   stylesheet with them. Shared parts are in ../iam.css. */

/* 7. The Principal element. */
.pe { border-collapse: collapse; font-size: 14px; background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; }
.pe td { padding: 4px 8px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.pe td:first-child { width: 34px; }
.pe code { font: 12px var(--mono); overflow-wrap: anywhere; }
.pe-ex > b { display: block; font-size: 14px; margin-bottom: 5px; }
.pe-ex .hl.p { --c: #f3ecff; --cc: var(--role); }


/* Section 4, Roles, and the access keys or roles slide. */

/* 1. A role: the two policies side by side, what they do for alice under them. */
.rl { display: flex; flex-direction: column; gap: 10px; }
.ro-card { border: 2px dashed var(--role); border-radius: 10px; background: #fbf9ff; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ro-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ro-h b { font-size: 17px; }
.ro-h small { color: var(--sv-ink2); font-size: 12.5px; }
.ro-pols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
.ro-pol { background: #fff; border: 1px solid var(--sv-line); border-left: 4px solid var(--cc); border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ro-pol.trust { --cc: var(--role); } .ro-pol.perm { --cc: #ec7211; }
.ro-pol > span { font-size: 13px; color: var(--sv-ink2); }
.ro-pol .json { font-size: 11.5px; padding: 6px 8px; flex: 1; }
.ra { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  grid-template-areas: "ht . hp" "alice . s3" "sess arrow s3" "bob . s3";
  grid-template-rows: auto auto auto 1fr; row-gap: 6px; padding: 0 12px; }
.ra-h { font-size: 13px; font-weight: 600; color: var(--cc); border-top: 3px solid var(--cc); padding-top: 6px; }
.ra-h.trust { grid-area: ht; --cc: var(--role); } .ra-h.perm { grid-area: hp; --cc: #ec7211; }
.ra-h::before { content: "↓ "; font-size: 16px; }
.ra-alice { grid-area: alice; } .ra-sess { grid-area: sess; margin: 4px 0 0 32px; } .ra-bob { grid-area: bob; margin-top: 10px; }
.ra-who { display: flex; flex-direction: column; gap: 3px; }
.ra-res { font-size: 13.5px; font-weight: 600; padding-left: 4px; }
.who .ra-res { padding-left: 8px; }
.ra-res.ok, .ra-act.ok .ra-m { color: #1d8102; } .ra-res.no, .ra-act.no .ra-m { color: #d13212; }
.ra-arrow { grid-area: arrow; align-self: center; justify-self: center; font-size: 28px; font-weight: 700; line-height: 1; color: var(--role); }
.ra-s3 { grid-area: s3; align-self: stretch; border: 2px solid #3f8624; border-radius: 10px; background: #f6fbf3; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ra-s3h { display: flex; align-items: center; gap: 8px; } .ra-s3h img { width: 30px; height: 30px; } .ra-s3h b { font-size: 16px; }
.ra-bucket { background: #fff; border: 1px solid var(--sv-line); border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.ra-bucket small { font-size: 12px; color: var(--sv-ink2); }
.ra-bucket code { font: 600 12.5px var(--mono); overflow-wrap: anywhere; }
.ra-obj { align-self: flex-start; font: 12.5px var(--mono); background: #eef6ea; border: 1px solid #b7d7a8; border-radius: 4px; padding: 2px 8px; }
.ra-obj::before { content: "📄 "; }
.ra-acts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ra-act { text-align: left; display: grid; grid-template-columns: 18px auto minmax(0, 1fr); gap: 8px; align-items: baseline; background: #fff; border: 1px solid var(--sv-line); border-radius: 6px; padding: 4px 8px; font-size: 13.5px; }
.ra-act.no { background: #fff8f6; }
.ra-m { font-weight: 700; font-size: 15px; }
.ra-act code { font: 12.5px var(--mono); }
.ra .ra-act > span { text-align: left; }

/* 3. The sequence. */
.seq { width: 100%; max-height: 100%; }
.sq-actor { fill: #232f3e; }
.sq-at { fill: #fff; font-size: 15px; font-weight: 700; }
.sq-as { fill: #c6ccd2; font-size: 11.5px; }
.sq-life { stroke: #c6ccd2; stroke-width: 2; stroke-dasharray: 5 5; }
.sq-m { stroke: #545b64; stroke-width: 2; fill: none; }
.sq-head { fill: #545b64; }
.back .sq-m { stroke-dasharray: 7 4; }
.temp .sq-m { stroke: var(--role); stroke-width: 2.6; } .temp .sq-head { fill: var(--role); }
.sq-n { fill: #ec7211; }
.sq-nt { fill: #fff; font-size: 12px; font-weight: 700; }
.sq-a { font-size: 13px; font-weight: 600; fill: #16191f; }
.sq-b { font-size: 12px; fill: #545b64; }
.temp .sq-b { fill: var(--role); font-weight: 600; }
.sq-box { fill: #fff; stroke: #545b64; stroke-width: 1.4; }
.sq-box.iam { fill: #fff5f6; stroke: #dd344c; }
.sq-box.chk { fill: #fbf9ff; stroke: var(--role); }
.sq-bt { font-size: 12.5px; fill: #16191f; }

/* 4. The CLI run. */
.term.tall { font-size: 12.5px; line-height: 1.42; }

/* 5. The temporary credentials. */
.tc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tc-p { background: #fff; border: 1px solid var(--sv-line); border-top: 4px solid var(--role); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tc-p > code { font: 700 13px var(--mono); }
.tc-v { font: 12px var(--mono); color: var(--sv-ink2); overflow-wrap: anywhere; }
.tc-p small { font-size: 13px; }
.tc-p.tok { border-top-color: #ec7211; background: #fffaf4; }
.dur { border-collapse: collapse; background: #fff; border: 1px solid var(--sv-line); font-size: 14px; }
.dur th, .dur td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #eef0f3; }
.dur th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--sv-ink2); }
.dur code { font: 13px var(--mono); }

/* 6. Two screenshots. */
/* The bottom of the account menu over the Switch Role page. */
.two-shots { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; min-height: 0; }
.two-shots .shot:first-child img { width: 301px; }
.two-shots .shot:last-child img { max-height: calc(100vh - 420px); min-height: 260px; width: auto; }

/* 8. STS behind the scenes. */
.evw { border-collapse: collapse; background: #fff; border: 1px solid var(--sv-line); font-size: 13.5px; }
.evw th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--sv-ink2); padding: 6px 8px; }
.evw td { padding: 5px 8px; border-top: 1px solid #eef0f3; vertical-align: middle; }
.evw td:first-child { width: 36px; }
.evw td:first-child img { width: 28px; height: 28px; display: block; }
.evw code { font: 12px var(--mono); overflow-wrap: anywhere; }


/* 10. Keys or roles. */
.kr { border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; font-size: 14.5px; }
.kr th, .kr td { padding: 8px 12px; border-bottom: 1px solid #eef0f3; text-align: left; vertical-align: top; }
.kr tr:first-child th { font-size: 15px; }
.kr tr:first-child th .glyph { display: inline-block; vertical-align: middle; }
.kr th:first-child { color: var(--sv-ink2); font-weight: 600; white-space: nowrap; }
.kr td:last-child { background: #fbf9ff; }

@media (max-width: 860px) {
  .ro-pols { grid-template-columns: 1fr; gap: 10px; }
  .ra { grid-template-columns: 1fr; grid-template-areas: "ht" "alice" "sess" "bob" "hp" "s3"; grid-template-rows: none; padding: 0; }
  .ra-h.perm { margin-top: 10px; }
  .ra-arrow { display: none; }
  .tc { grid-template-columns: 1fr; }
  .two-shots .shot:last-child img { max-height: none; min-height: 0; width: 100%; }
  .evw td:last-child { display: none; }
}

/* The introduction: a role, and its sessions. */
.ri { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ri-sess { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* The sections' colours. */
[data-sec="intro"] { --sec: #334155; }
[data-sec="role"] { --sec: #4338ca; }
[data-sec="assume"] { --sec: #7c3aed; }
[data-sec="why"] { --sec: #3f6212; }
