/* Photo guide rankings */
.photo-guides {
  --photo-guide-ink: #18313c;
  --photo-guide-teal: #006776;
  margin-block: 44px;
  color: var(--photo-guide-ink);
}

#home-photo-guides:not(:has(li)), .photo-guides[hidden] { display: none; }

.photo-guides > h2.wp-block-heading {
  margin: 0 0 20px;
  padding: .8em 1em;
  border: 0;
  border-radius: 4px;
  background: var(--oc-heading-bg, #17a9c4);
  color: #fff;
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.45;
}

.photo-guides > h2.wp-block-heading::before,
.photo-guides > h2.wp-block-heading::after { content: none; }

.photo-guides .photo-guides-empty {
  margin: 0;
  color: #40545d;
  font-size: 16px;
  line-height: 1.65;
}

.photo-guides .photo-guides-list {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-auto-rows: 1fr;
  gap: 14px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.photo-guides .photo-guides-list > li {
  min-width: 0;
  margin: 0;
  padding: 0;
}

.photo-guides .photo-guides-list > li::before { content: none; }

.photo-guides .photo-guides-list > li:first-child { grid-row: 1; }
.photo-guides .photo-guides-list > li:first-child:nth-last-child(3) { grid-row-end: span 2; }
.photo-guides .photo-guides-list > li:first-child:nth-last-child(4) { grid-row-end: span 3; }
.photo-guides .photo-guides-list > li:first-child:nth-last-child(5) { grid-row-end: span 4; }
.photo-guides .photo-guides-list > li:only-child { grid-column: 1 / -1; width: min(100%, 600px); }
.photo-guides .photo-guides-list > li:not(:first-child) { grid-column: 2; }

.photo-guides .photo-guide-card {
  display: grid;
  grid-template-columns: 40% minmax(0, 1fr);
  min-height: 100%;
  overflow: hidden;
  border: 1px solid #dce8eb;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 3px 12px rgb(22 62 72 / 7%);
}

.photo-guides li:first-child .photo-guide-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
}

.photo-guides .photo-guide-card:hover .photo-guide-title,
.photo-guides .photo-guide-card:focus-visible .photo-guide-title {
  color: var(--photo-guide-teal);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.photo-guides .photo-guide-card:focus-visible {
  outline: 3px solid var(--photo-guide-teal);
  outline-offset: 3px;
}

.photo-guides .photo-guide-picture {
  position: relative;
  display: grid;
  min-width: 0;
  background: #edf5f6;
}

.photo-guides .photo-guide-picture img {
  display: block;
  align-self: center;
  width: 100%;
  height: auto;
  margin: 0;
}

.photo-guides .photo-guide-rank {
  position: absolute;
  top: 0;
  left: 8px;
  padding: 4px 8px 12px;
  background: #005865;
  color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 83%, 0 100%);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.photo-guides .photo-guide-rank span { margin-left: 1px; font-size: .57em; }
.photo-guides li:first-child .photo-guide-rank {
  left: 16px;
  padding: 10px 12px 20px;
  background: #edbe52;
  color: #332500;
  font-size: clamp(29px, 4vw, 40px);
}
.photo-guides li:nth-child(2) .photo-guide-rank { background: #526576; }
.photo-guides li:nth-child(3) .photo-guide-rank { background: #8d512b; }

.photo-guides .photo-guide-copy {
  align-self: center;
  padding: 12px 15px;
}

.photo-guides li:first-child .photo-guide-copy {
  align-self: start;
  padding: clamp(16px, 2vw, 25px);
}

.photo-guides .photo-guide-card h3.photo-guide-title {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.photo-guides .photo-guide-card h3.photo-guide-title::before,
.photo-guides .photo-guide-card h3.photo-guide-title::after { content: none; }
.photo-guides li:first-child h3.photo-guide-title { font-size: clamp(20px, 2.5vw, 27px); }

.photo-guides .photo-guide-summary {
  margin: .65em 0 0;
  color: #40545d;
  font-size: 16px;
  line-height: 1.75;
}

@media (max-width: 760px) {
  .photo-guides { margin-block: 32px; }
  .photo-guides .photo-guides-list {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
    gap: 10px;
  }
  .photo-guides .photo-guides-list > li:nth-child(n) { grid-column: 1; grid-row: auto; }
  .photo-guides .photo-guide-card { grid-template-columns: minmax(0, 34%) minmax(0, 1fr); }
  .photo-guides .photo-guide-copy { padding: 10px 12px; }
  .photo-guides .photo-guide-card h3.photo-guide-title { font-size: 16px; }
  .photo-guides li:first-child h3.photo-guide-title { font-size: 20px; }
  .photo-guides .photo-guide-rank { left: 5px; font-size: 19px; }
}
