/*
  Blog article common CSS.
  CMS target: /parts/css/blog_article_common.css

  Use this file for reusable article readability and decoration.
  Keep per-article CSS only for exceptional article-specific layouts.
*/

.page {
  --page-green: #51ba4b;
  --page-light-green: #eef8ed;
  --page-blue: #2294d6;
  --page-light-blue: #f0f8fc;
  --page-gray: #5e6c77;
  --page-light-gray: #f2f3f4;
  --page-red: #e22400;
  --page-light-red: #fef6f5;
  --page-table-border: #89949c;
  color: #121212;
}

.page a {
  color: var(--page-blue);
  text-decoration: underline;
}

.page a:hover {
  opacity: 1;
  text-decoration: underline;
}

.page img {
  height: auto;
  max-width: 100%;
}

.page .colored {
  color: var(--page-red);
}

.page .marker {
  background: linear-gradient(to bottom, rgba(255, 255, 204, 0) 60%, #ffffcc 60%);
  font-weight: normal;
}

.page .note {
  color: #666;
  font-size: 0.9em;
  line-height: 1.8;
}

.page .i {
  font-style: italic;
}

.page header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.page header h2 {
  font-size: 1rem;
  font-weight: bold;
  margin: 1rem 0 0;
  padding: 0;
}

.page header .cat {
  font-size: 0.9rem;
  margin: 1rem 0 0;
  padding: 0;
}

.page header .author {
  align-items: center;
  border: dotted 2px var(--page-blue);
  display: flex;
  font-size: 1rem;
  justify-content: space-between;
  margin: 2rem 3rem;
  padding: 1rem 2rem;
}

.page header .author img {
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 1.5rem;
}

.page header .author strong {
  color: var(--page-blue);
}

.page header .picture {
  display: block;
  flex-basis: 100%;
  text-align: center;
  width: 100%;
}

.page header .picture img {
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
  width: auto;
}

.page .toc {
  background-color: var(--page-light-gray);
  border: solid 1px var(--page-gray);
  margin: 4rem 3rem;
  padding: 2rem;
}

.page .toc p {
  color: var(--page-gray);
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.page .toc ol {
  counter-reset: toc-count;
  list-style: none;
  padding: 0;
}

.page .toc li {
  align-items: center;
  counter-increment: toc-count;
  display: flex;
  margin-bottom: 0.65rem;
}

.page .toc li::before {
  color: var(--page-gray);
  content: counter(toc-count, decimal-leading-zero);
  flex-shrink: 0;
  font-weight: bold;
  margin-right: 1rem;
  order: -2;
}

.page .toc li::after {
  color: var(--page-gray);
  content: "|";
  margin-right: 1rem;
  order: -1;
}

.page .toc li a {
  color: #000;
  line-height: 1.5;
}

.page .toc li a:hover {
  background: linear-gradient(transparent 20%, #ffffa3 20%);
}

.page section {
  margin-top: 3rem;
}

.page > section {
  margin-top: 6rem;
}

.page h3 {
  align-content: center;
  color: #fff;
  font-size: 1.7rem;
  margin: 0 0 2rem;
  padding: 0;
  position: relative;
}

.page h3 span {
  background-color: var(--page-green);
  color: #fff;
  display: block;
  line-height: 1.35;
  margin: 0;
  padding: 1rem 1.5rem 1.15rem;
  position: relative;
}

.page h3 span::after {
  border: solid transparent;
  border-bottom-width: 20px;
  border-left-width: 20px;
  border-right-width: 20px;
  border-top-color: var(--page-green);
  border-top-width: 20px;
  content: "";
  height: 0;
  left: 3rem;
  margin-left: -10px;
  position: absolute;
  top: 100%;
  width: 0;
}

.page h4 {
  align-items: center;
  background-color: var(--page-light-green);
  border-left: solid 5px var(--page-green);
  color: var(--page-gray);
  display: flex;
  flex-wrap: wrap;
  font-size: 1.35rem;
  font-weight: bold;
  margin: 0 0 1.5rem;
  padding: 0.45rem 0 0.45rem 0.8rem;
}

.page h4 img {
  margin-right: 0.5rem;
}

.page h5 {
  border-bottom: solid 2px #d7dadd;
  color: var(--page-gray);
  font-size: 1.35rem;
  margin: 0 0 1.5rem;
  padding-bottom: 0.35rem;
}

.page h3[id],
.page h4[id] {
  scroll-margin-top: 120px;
}

.page table {
  background-color: #fff;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 2rem 0;
  width: 100%;
}

.page table th,
.page table td {
  border: solid 1px var(--page-table-border);
  padding: 0.75rem 1rem;
  text-align: center;
  vertical-align: middle;
}

.page table th {
  background-color: var(--page-light-gray);
  font-weight: bold;
}

.page .comparison-table {
  table-layout: fixed;
}

.page .comparison-table th {
  text-align: center;
  vertical-align: middle;
}

.page .comparison-table td {
  line-height: 1.65;
  text-align: left;
  vertical-align: top;
}

.page .comparison-table th:nth-child(1),
.page .comparison-table td:nth-child(1) {
  width: 20%;
}

.page .comparison-table th:nth-child(2),
.page .comparison-table td:nth-child(2),
.page .comparison-table th:nth-child(3),
.page .comparison-table td:nth-child(3) {
  width: 40%;
}

.page .comparison-table tbody td:first-child {
  background-color: #f7faf7;
  font-weight: bold;
}

.page table tr:first-of-type th {
  border-bottom: solid 2px var(--page-table-border);
}

.page section ol:not([class]) {
  list-style: decimal;
  list-style-position: outside;
  margin: 1.5rem 0;
  padding-left: 2.25rem;
}

.page section ol:not([class]) > li {
  display: list-item;
  line-height: 1.8;
  list-style: decimal;
  margin-top: 0.45rem;
  padding-left: 0.15rem;
}

.page section ol:not([class]) > li:first-of-type {
  margin-top: 0;
}

.page section ol:not([class]) > li::marker {
  font-weight: bold;
}

.page .js-scrollable {
  overflow-x: auto;
}

.page .point {
  margin: 3rem;
  padding-bottom: 1.5rem;
}

.page .point dt {
  color: #fff;
  font-weight: bold;
  margin-bottom: 0.45em;
  padding: 0.25rem 1rem;
}

.page .point dd {
  padding: 0.75rem 2rem 0;
}

.page .point dd::before {
  content: "●";
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem 0 0;
}

.page p.point {
  padding: 1.2rem 2rem;
}

.page .point.green {
  background-color: var(--page-light-green);
  border: solid 1px var(--page-green);
}

.page .point.green dt {
  background-color: var(--page-green);
}

.page .point.green dd::before {
  color: var(--page-green);
}

.page .choice-guide {
  padding-bottom: 0;
}

.page .choice-guide dt {
  margin-bottom: 0;
}

.page .choice-guide dd {
  align-items: start;
  column-gap: 0.75rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(13em, 35%);
  line-height: 1.7;
  margin: 0;
  padding: 0.85rem 1.25rem;
}

.page .choice-guide dd + dd {
  border-top: solid 1px #cce4ca;
}

.page .choice-guide dd::before {
  grid-column: 1;
  padding: 0;
}

.page .choice-guide dd > strong {
  grid-column: 2;
}

.page .choice-guide dd > span {
  grid-column: 3;
  min-width: 0;
}

.page .point.red {
  background-color: var(--page-light-red);
  border: solid 1px var(--page-red);
}

.page .point.red dt {
  background-color: var(--page-red);
}

.page .point.red dd::before {
  color: var(--page-red);
}

.page .point.blue {
  background-color: var(--page-light-blue);
  border: solid 1px var(--page-blue);
}

.page .point.blue dt {
  background-color: var(--page-blue);
}

.page .point.blue dd::before {
  color: var(--page-blue);
}

.page .list {
  border: solid 3px var(--page-green);
  border-radius: 10px;
  margin: 3rem;
  padding: 1.5rem 0;
}

.page .list li {
  align-items: flex-start;
  display: flex;
  line-height: 1.8;
  padding: 0.5rem 2rem 0;
}

.page .list li:first-of-type {
  padding-top: 0;
}

.page .list li::before {
  color: var(--page-green);
  content: "●";
  flex: 0 0 auto;
  font-size: 0.85rem;
  line-height: 1.8;
  padding: 0 0.75rem 0 0;
}

.page .simple {
  list-style: none;
  margin: 1.5rem 0;
  padding-left: 0;
}

.page .simple dt {
  font-weight: bold;
  margin-bottom: 0.4rem;
}

.page .simple li {
  align-items: flex-start;
  display: flex;
  line-height: 1.8;
  padding-top: 0.35rem;
}

.page .simple li:nth-of-type(1) {
  margin-top: 0;
  padding-top: 0;
}

.page .simple dd::before,
.page .simple li::before {
  color: var(--page-gray);
  content: "●";
  flex: 0 0 auto;
  font-size: 0.85rem;
  line-height: 1.8;
  padding: 0 0.75rem 0 0;
}

.page .stacked-list li {
  align-items: start;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  row-gap: 0.05rem;
}

.page .stacked-list li + li {
  margin-top: 0.35rem;
}

.page .stacked-list li::before {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.page .stacked-list li > strong,
.page .stacked-list li > span {
  display: block;
  grid-column: 2;
}

.page .detail-list {
  border: solid 1px #c9d0d5;
  border-radius: 6px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.page .detail-list > div {
  display: grid;
  grid-template-columns: minmax(13.5em, 15em) minmax(0, 1fr);
}

.page .detail-list > div + div {
  border-top: solid 1px #c9d0d5;
}

.page .detail-list dt,
.page .detail-list dd {
  line-height: 1.75;
  margin: 0;
  padding: 0.9rem 1rem;
}

.page .detail-list dt {
  background-color: var(--page-light-gray);
  border-right: solid 1px #c9d0d5;
  font-weight: bold;
}

.page .detail-list dd {
  background-color: #fff;
}

.page .detail-list-risk dt {
  border-left: solid 4px var(--page-red);
}

.page .detail-list-check dt {
  border-left: solid 4px var(--page-green);
}

.page .layout_01 {
  align-items: center;
  display: grid;
  gap: 0 30px;
  grid-template-areas:
    "title title"
    "photo text";
  grid-template-columns: 400px 1fr;
  grid-template-rows: auto 1fr;
}

.page .layout_01 h4,
.page .layout_01 h5 {
  grid-area: title;
}

.page .layout_01 img {
  grid-area: photo;
  width: min(400px, 100%);
}

.page .layout_01 img + * {
  grid-area: text;
}

.page .image-block,
.page figure {
  margin: 2.5rem 0;
  text-align: center;
}

.page .image-block img,
.page figure img,
.page img.image-wide {
  display: block;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

/*
  Wide/readable images are meant for 16:9 artwork.
  max-height is a safety net so an accidental 4:3 / square / portrait image
  cannot dominate the viewport. The real fix is to generate 16:9 images
  (see project-sources/03_image_rule.md). object-fit keeps aspect ratio
  (letterboxed) instead of stretching when the guard kicks in.
*/
.page .image-block.image-wide img,
.page figure.image-wide img,
.page img.image-wide {
  width: min(940px, 100%);
  max-height: 540px;
  object-fit: contain;
}

.page .image-block.image-readable img,
.page figure.image-readable img,
.page img.image-readable {
  width: min(720px, 100%);
  max-height: 440px;
  object-fit: contain;
}

.page figcaption {
  color: #666;
  font-size: 0.9em;
  line-height: 1.7;
  margin-top: 0.75rem;
  text-align: left;
}

.page .status {
  font-weight: bold;
}

.page .status.ok {
  color: var(--page-red);
}

.page .status.warn {
  color: var(--page-blue);
}

.page .status.ng {
  color: var(--page-gray);
}

.page .faq > div {
  margin-top: 2rem;
}

.page .faq strong {
  font-weight: bold;
  padding-right: 0.5rem;
}

.page .faq p {
  border-left-style: solid;
  border-left-width: 3px;
  display: flex;
}

.page .faq p:nth-of-type(1) {
  background-color: var(--page-light-red);
  border-left-color: var(--page-red);
  font-weight: bold;
  padding: 0.25rem 0 0.25rem 1rem !important;
}

.page .faq p:nth-of-type(1) strong {
  color: var(--page-red);
}

.page .faq p:nth-of-type(2) {
  border-left-color: #fff;
  margin-top: 0.75rem;
  padding: 0 0 0 1rem !important;
}

.page .faq p:nth-of-type(2) strong {
  color: var(--page-blue);
}

@media screen and (min-width: 441px) {
  .page {
    font-size: 1.15rem;
    margin: 0 auto;
    padding: 0 0 2rem;
    width: 940px;
  }

  .page p:not(:first-of-type) {
    padding: 1rem 0 0;
  }
}

@media screen and (max-width: 440px) {
  .page {
    font-size: 0.85rem;
  }

  .page p:not(:first-of-type) {
    padding: 0.65rem 0 0;
  }

  .page header {
    display: block;
  }

  .page header h2 {
    font-size: 0.85rem;
    margin: 1rem 0 0;
    padding: 0 4%;
  }

  .page header .cat {
    font-size: 0.75rem;
    margin: 0;
    padding: 0 4%;
  }

  .page header .author {
    font-size: 0.75rem;
    margin: 1rem 4%;
    padding: 0.85rem;
  }

  .page header .author img {
    margin-right: 1rem;
  }

  .page header + div {
    margin: 1rem 4%;
  }

  .page .toc {
    margin: 2rem auto;
    padding: 1rem;
    width: 92%;
  }

  .page .toc p {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .page .toc li {
    align-items: flex-start;
    margin-bottom: 0.65rem;
  }

  .page .toc li:last-of-type {
    margin-bottom: 0;
  }

  .page .toc li::before,
  .page .toc li::after {
    margin-right: 0.75rem;
  }

  .page section {
    margin-top: 2rem;
  }

  .page > section {
    margin-top: 3rem;
  }

  .page > section > * {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 92%;
  }

  .page h3 {
    font-size: 1.15rem;
  }

  .page h3 span {
    line-height: 1.4;
    padding: 0.75rem 4%;
  }

  .page h4 {
    display: block;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0 0 1rem;
    padding: 0.35rem 0 0.35rem 0.6rem;
  }

  .page h4 img {
    margin: 0 !important;
    padding: 0;
    width: 1.25rem;
  }

  .page h5 {
    font-size: 1rem;
    margin: 0 0 1rem;
    padding-bottom: 0.35rem;
  }

  .page table {
    margin: 1rem 0;
    width: 600px;
  }

  .page table th,
  .page table td {
    padding: 0.75rem 1rem;
  }

  .page section ol:not([class]) {
    box-sizing: border-box;
    margin: 1.5rem auto;
    padding-left: 2rem;
    width: 92%;
  }

  .page .point {
    margin: 1.5rem 0;
    padding-bottom: 1rem;
  }

  .page .point dt {
    margin-bottom: 0.45em;
    padding: 0.25rem 0.5rem;
  }

  .page .point dd {
    padding: 0.5rem 1rem 0;
  }

  .page .point dd::before {
    padding: 0.25rem 0.5rem 0 0;
  }

  .page p.point {
    padding: 1rem;
  }

  .page .list {
    margin: 1.5rem 0;
    padding: 1rem;
  }

  .page .list li {
    padding: 0.5rem 0 0;
  }

  .page .list li:first-of-type {
    padding: 0;
  }

  .page .list li::before {
    padding: 0.25rem 0.5rem 0 0;
  }

  .page dl.simple dt {
    margin-bottom: 0.2rem;
  }

  .page dl.simple dd::before {
    padding: 0 0.5rem 0 0;
  }

  .page .choice-guide dd {
    grid-template-columns: auto 1fr;
    padding: 0.75rem 1rem;
  }

  .page .choice-guide dd > strong,
  .page .choice-guide dd > span {
    grid-column: 2;
  }

  .page .choice-guide dd > span {
    display: block;
    margin-top: 0.15rem;
  }

  .page .detail-list > div {
    display: block;
  }

  .page .detail-list dt {
    border-bottom: solid 1px #c9d0d5;
    border-right: 0;
    padding: 0.65rem 0.75rem;
  }

  .page .detail-list dd {
    padding: 0.75rem;
  }

  .page .layout_01 {
    display: block;
  }

  .page .layout_01 img {
    margin-bottom: 0.75rem;
    width: 100%;
  }
}
