/*
 * The blog Brands renders at /blog/ with brands/blog.liquid and brands/post.liquid
 * (README.md, "Publishing with Brands"). Warm Editorial Stationery: the newest story
 * pinned to the board, the others as index cards, articles on a sheet of notepaper.
 * Colors and fonts are the @theme tokens of tailwind.css (with their values as
 * fallbacks); every rule is scoped to the blog's own classes.
 */
.om-blog,
.om-post {
  --om-ink: var(--color-primary, #032521);
  --om-ink-soft: var(--color-primary-container, #1b3b36);
  --om-text: var(--color-on-surface, #1c1c17);
  --om-muted: var(--color-on-surface-variant, #414846);
  --om-ochre: var(--color-secondary, #8f4e00);
  --om-terracotta: var(--color-oscar-strong, #a8452d);
  --om-paper: var(--color-surface, #fdf9f1);
  --om-card: var(--color-surface-container-lowest, #ffffff);
  --om-board: var(--color-surface-container-low, #f7f3eb);
  --om-border: #e6dccf;
  --om-rule: #d8cbba;
  --om-tape: rgba(254, 160, 71, 0.42);
  --om-serif: var(--font-serif, "Newsreader", Georgia, serif);
  --om-shadow-1:
    0 2px 8px rgba(27, 59, 54, 0.05), 0 1px 2px rgba(27, 59, 54, 0.03);
  --om-shadow-2:
    0 10px 28px rgba(27, 59, 54, 0.1), 0 2px 6px rgba(27, 59, 54, 0.05);
  max-width: 80rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
  color: var(--om-text);
}
@media (min-width: 40rem) {
  .om-blog,
  .om-post {
    padding: 3.5rem 1.5rem 4rem;
  }
}
@media (min-width: 64rem) {
  .om-blog,
  .om-post {
    padding-inline: 3rem;
  }
}

/* Shared pieces */
.om-blog h1,
.om-blog h2,
.om-blog h3,
.om-post h1,
.om-post h2,
.om-post h3 {
  font-family: var(--om-serif);
  font-weight: 600;
  color: var(--om-ink);
  text-wrap: balance;
}
.om-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  color: var(--om-ochre);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.om-eyebrow .icon {
  font-size: 1.25rem;
}
.om-meta {
  margin: 0;
  color: var(--om-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.om-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* A strip of masking tape (decorative, on ::before of its holder). */
.om-polaroid--taped::before,
.om-polaroid--taped::after,
.om-card::before,
.om-prose blockquote::before {
  content: "";
  position: absolute;
  z-index: 2;
  width: 6.5rem;
  height: 1.75rem;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.25),
      rgba(255, 255, 255, 0) 30%,
      rgba(255, 255, 255, 0.2)
    ),
    var(--om-tape);
  box-shadow: 0 1px 2px rgba(27, 59, 54, 0.08);
  /* Torn ends */
  clip-path: polygon(
    0 8%,
    4% 0,
    96% 4%,
    100% 0,
    98% 30%,
    100% 55%,
    97% 80%,
    100% 100%,
    3% 96%,
    0 100%,
    2% 70%,
    0 45%,
    3% 22%
  );
  pointer-events: none;
}

/* Blog home: masthead */
.om-masthead {
  position: relative;
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px dashed var(--om-rule);
}
@media (min-width: 48rem) {
  .om-masthead {
    grid-template-columns: 1fr auto;
    gap: 3rem;
  }
}
.om-masthead h1 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
@media (min-width: 40rem) {
  .om-masthead h1 {
    font-size: 3.25rem;
  }
}
@media (min-width: 64rem) {
  .om-masthead h1 {
    font-size: 4rem;
  }
}
.om-masthead__intro {
  max-width: 44rem;
  margin-top: 1rem;
  color: var(--om-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
}
@media (min-width: 40rem) {
  .om-masthead__intro {
    font-size: 1.1875rem;
  }
}
.om-masthead__intro p {
  margin: 0;
}
.om-masthead__intro p + p {
  margin-top: 0.75rem;
}
/* A postage stamp with the number of stories: perforations (half holes on every
   edge) in a 9px white margin, the 12px grid fitting its 144 x 168px size. */
.om-stamp {
  display: none;
  width: 144px;
  height: 168px;
  margin: 0;
  padding: 9px;
  background: radial-gradient(
      circle,
      transparent 3.5px,
      var(--om-card) 4px
    ) -6px -6px /
    12px 12px;
  transform: rotate(4deg);
  filter: drop-shadow(0 3px 5px rgba(27, 59, 54, 0.14));
}
@media (min-width: 48rem) {
  .om-stamp {
    display: block;
  }
}
.om-stamp__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  height: 100%;
  border: 2px solid var(--om-ink-soft);
  background:
    radial-gradient(
      circle at 70% 20%,
      rgba(254, 160, 71, 0.3),
      transparent 55%
    ),
    var(--color-primary-fixed, #c7eae2);
  color: var(--om-ink);
  text-align: center;
}
.om-stamp__inner .icon {
  font-size: 2rem;
}
.om-stamp__count {
  font-family: var(--om-serif);
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1;
}
.om-stamp__label {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Blog home: the latest story pinned to the board */
.om-pinned {
  margin-bottom: 4rem;
}
.om-pinned__note {
  position: relative;
  display: grid;
  gap: 1.75rem;
  padding: 1.75rem 1.25rem 1.5rem;
  background: var(--om-card);
  border: 1px solid var(--om-border);
  border-radius: 0.5rem;
  box-shadow: var(--om-shadow-1);
  color: inherit;
  text-decoration: none;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
@media (min-width: 48rem) {
  .om-pinned__note {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 2.75rem;
    align-items: center;
    padding: 2.5rem;
  }
  .om-pinned__note--text {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: clamp(2.5rem, 8vw, 6rem);
  }
}
.om-pinned__note:hover {
  box-shadow: var(--om-shadow-2);
  transform: translateY(-2px);
}
/* A push pin through the note */
.om-pin {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  z-index: 3;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: -0.75rem;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #f3a48e 0 18%,
    #c2593f 45%,
    #7a2b19 100%
  );
  box-shadow:
    0 3px 4px rgba(27, 59, 54, 0.3),
    2px 6px 8px rgba(27, 59, 54, 0.12);
}
.om-polaroid {
  position: relative;
  padding: 0.625rem 0.625rem 2.25rem;
  background: var(--om-card);
  border: 1px solid var(--om-border);
  box-shadow: var(--om-shadow-1);
  transform: rotate(-1.25deg);
}
.om-polaroid picture {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--om-board);
}
.om-pinned__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}
.om-tag {
  display: inline-flex;
  margin: 0;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--color-secondary-fixed, #ffdcc2);
  color: var(--color-on-secondary-container, #6d3a00);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.om-pinned__title {
  margin: 0.25rem 0 0;
  font-size: 1.875rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
@media (min-width: 64rem) {
  .om-pinned__title {
    font-size: 2.5rem;
  }
}
.om-pinned__excerpt {
  margin: 0;
  color: var(--om-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
}
.om-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  margin-top: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid #132d29;
  border-radius: 0.25rem;
  background: var(--om-ink-soft);
  color: #ffffff;
  font-weight: 700;
  transition: background-color 0.2s ease;
}
.om-button .icon {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}
.om-pinned__note:hover .om-button {
  background: #132d29;
}
.om-pinned__note:hover .om-button .icon {
  transform: translateX(3px);
}

/* Index cards */
.om-shelf__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 2rem;
}
.om-shelf__head h2 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.2;
}
@media (min-width: 40rem) {
  .om-shelf__head h2 {
    font-size: 2.25rem;
  }
}
.om-shelf__note {
  margin: 0;
  color: var(--om-muted);
}
.om-cards {
  display: grid;
  gap: 2.5rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 40rem) {
  .om-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 64rem) {
  .om-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.om-cards > li {
  display: flex;
}
.om-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0.625rem;
  background: var(--om-card);
  border: 1px solid var(--om-border);
  border-radius: 0.25rem;
  box-shadow: var(--om-shadow-1);
  color: inherit;
  text-decoration: none;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
/* Every third card is held up by tape, the others sit a little askew. */
.om-card::before {
  display: none;
  top: -0.85rem;
  left: 50%;
  margin-left: -3.25rem;
  transform: rotate(-2deg);
}
.om-cards > li:nth-child(3n + 2) .om-card::before {
  display: block;
}
@media (min-width: 40rem) {
  .om-cards > li:nth-child(3n + 1) .om-card {
    transform: rotate(-0.6deg);
  }
  .om-cards > li:nth-child(3n + 3) .om-card {
    transform: rotate(0.5deg);
  }
}
.om-cards > li .om-card:hover {
  box-shadow: var(--om-shadow-2);
  transform: translateY(-3px) rotate(0deg);
}
.om-card__photo {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--om-board);
}
.om-card__photo picture {
  display: block;
  height: 100%;
}
.om-card__photo .om-photo {
  transition: transform 0.4s ease;
}
.om-card:hover .om-card__photo .om-photo {
  transform: scale(1.03);
}
/* No photo: a paw print on squared paper, in Oscar's, Cleo's or the brand colors. */
.om-card__blank {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-oscar-strong, #a8452d);
  background:
    linear-gradient(rgba(27, 59, 54, 0.06) 1px, transparent 1px) 0 0 / 1.25rem
      1.25rem,
    linear-gradient(90deg, rgba(27, 59, 54, 0.06) 1px, transparent 1px) 0 0 /
      1.25rem 1.25rem,
    var(--color-secondary-fixed, #ffdcc2);
}
.om-cards > li:nth-child(3n + 2) .om-card__blank {
  color: var(--color-cleo-deep, #5f3c23);
  background-color: #f1e3d3;
}
.om-cards > li:nth-child(3n + 3) .om-card__blank {
  color: var(--om-ink-soft);
  background-color: var(--color-primary-fixed, #c7eae2);
}
.om-card__blank .icon {
  font-size: 4rem;
  transform: rotate(-12deg);
}
/* The ruled part of an index card: a red top line, faint blue-green lines
   under the excerpt that run on to the bottom of the card. */
.om-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem 0.75rem;
  margin-top: 0.625rem;
  border-top: 2px solid rgba(194, 89, 63, 0.55);
}
.om-card__title {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.75rem;
}
.om-card:hover .om-card__title {
  text-decoration: underline;
  text-decoration-color: var(--color-secondary-container, #fea047);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.om-card__excerpt {
  flex: 1;
  min-height: 3.5rem;
  margin: 0.25rem 0 0;
  background: repeating-linear-gradient(
    transparent 0,
    transparent calc(1.75rem - 1px),
    rgba(68, 100, 95, 0.16) calc(1.75rem - 1px),
    rgba(68, 100, 95, 0.16) 1.75rem
  );
  color: var(--om-muted);
  font-size: 0.9375rem;
  line-height: 1.75rem;
}

/* Article */
.om-article {
  max-width: 52rem;
  margin: 0 auto;
}
.om-article__head {
  max-width: 44rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}
.om-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 44px;
  margin-bottom: 1.25rem;
  padding: 0 0.875rem 0 0.5rem;
  border: 1px solid var(--om-border);
  border-radius: 999px;
  background: var(--om-card);
  color: var(--om-ink);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}
.om-back:hover {
  background: var(--om-board);
}
.om-back .icon {
  font-size: 1.25rem;
}
.om-article__head .om-eyebrow {
  justify-content: center;
}
.om-article__head h1 {
  margin: 0 0 1rem;
  font-size: 2.125rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
@media (min-width: 40rem) {
  .om-article__head h1 {
    font-size: 3rem;
  }
}
@media (min-width: 64rem) {
  .om-article__head h1 {
    font-size: 3.5rem;
  }
}
.om-article__photo {
  margin: 0 0 2.5rem;
}
.om-polaroid--taped {
  transform: rotate(-0.6deg);
}
.om-polaroid--taped::before {
  top: -0.5rem;
  left: -0.5rem;
  transform: rotate(-32deg);
}
.om-polaroid--taped::after {
  top: -0.5rem;
  right: -0.5rem;
  transform: rotate(32deg);
}
@media (min-width: 48rem) {
  .om-polaroid--taped::before {
    top: -0.75rem;
    left: -1.25rem;
  }
  .om-polaroid--taped::after {
    top: -0.75rem;
    right: -1.25rem;
  }
}
.om-article__photo figcaption {
  margin-top: 0.75rem;
  color: var(--om-muted);
  font-size: 0.875rem;
  text-align: center;
}
.om-article__photo figcaption a {
  color: inherit;
  text-decoration: underline;
}
/* A sheet of notepaper with a red margin line. */
.om-sheet {
  position: relative;
  padding: 2rem 1.25rem 1.75rem;
  background: var(--om-card);
  border: 1px solid var(--om-border);
  border-radius: 0.5rem;
  box-shadow: var(--om-shadow-1);
}
@media (min-width: 48rem) {
  .om-sheet {
    padding: 3.5rem 4rem 3rem 5.5rem;
    background:
      linear-gradient(
          90deg,
          transparent 3.5rem,
          rgba(194, 89, 63, 0.35) 3.5rem,
          rgba(194, 89, 63, 0.35) calc(3.5rem + 1px),
          transparent calc(3.5rem + 1px)
        )
        no-repeat,
      var(--om-card);
  }
}
.om-prose {
  max-width: 40rem;
  color: var(--om-text);
  font-size: 1.0625rem;
  line-height: 1.8;
  overflow-wrap: break-word;
}
@media (min-width: 40rem) {
  .om-prose {
    font-size: 1.125rem;
  }
}
.om-prose > * {
  margin: 0 0 1.25rem;
}
.om-prose > :last-child {
  margin-bottom: 0;
}
/* A drop cap on the first paragraph (after Oscar's italic byline, when there is one). */
.om-prose > p:first-child:not(:has(> em:only-child))::first-letter,
.om-prose > p:first-child:has(> em:only-child) + p::first-letter {
  float: left;
  margin: 0.375rem 0.625rem 0 0;
  color: var(--om-terracotta);
  font-family: var(--om-serif);
  font-size: 4.25rem;
  font-weight: 600;
  line-height: 0.8;
}
/* Oscar's italic byline ("Oscar's Training Corner, by Oscar...") as a standfirst. */
.om-prose > p:first-child:has(> em:only-child) {
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px dashed var(--om-rule);
  color: var(--om-muted);
  font-family: var(--om-serif);
  font-size: 1.25rem;
  line-height: 1.5;
}
.om-prose h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.75rem;
  line-height: 1.25;
}
.om-prose h2::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin-top: 0.625rem;
  border-radius: 2px;
  background: var(--color-secondary-container, #fea047);
}
.om-prose h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.375rem;
  line-height: 1.3;
}
.om-prose h4 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}
.om-prose a {
  color: var(--om-ochre);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.om-prose a:hover {
  color: var(--om-ink);
}
.om-prose strong {
  color: var(--om-ink);
  font-weight: 700;
}
.om-prose ul,
.om-prose ol {
  padding-left: 1.5rem;
}
.om-prose ul {
  list-style: disc;
}
.om-prose ol {
  list-style: decimal;
}
.om-prose li {
  margin: 0.5rem 0;
  padding-left: 0.25rem;
}
.om-prose li::marker {
  color: var(--om-ochre);
  font-weight: 700;
}
/* Quotes as a sticky note taped into the article. */
.om-prose blockquote {
  position: relative;
  margin: 2.25rem 0;
  padding: 1.75rem 1.5rem 1.5rem;
  background: #fff4e3;
  border: 1px solid #f2dcc0;
  box-shadow: var(--om-shadow-1);
  color: var(--om-text);
  font-family: var(--om-serif);
  font-size: 1.25rem;
  line-height: 1.6;
}
.om-prose blockquote::before {
  top: -0.85rem;
  left: 50%;
  margin-left: -3.25rem;
  transform: rotate(2deg);
}
.om-prose blockquote > :first-child {
  margin-top: 0;
}
.om-prose blockquote > :last-child {
  margin-bottom: 0;
}
.om-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.25rem;
}
.om-prose hr {
  border: 0;
  border-top: 1px dashed var(--om-rule);
  margin: 2.5rem 0;
}
.om-prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 1rem;
}
.om-prose th,
.om-prose td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--om-border);
  text-align: left;
}
.om-prose th {
  background: var(--om-board);
}
.om-prose code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.9375em;
}
.om-disclaimer {
  max-width: 40rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--om-rule);
}
.om-disclaimer p {
  margin: 0;
  color: var(--om-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}
.om-disclaimer a {
  color: var(--om-ochre);
  font-weight: 600;
  text-decoration: underline;
}

/* Newer and older story */
.om-turn {
  display: grid;
  gap: 1rem;
  max-width: 52rem;
  margin: 2.5rem auto 0;
}
@media (min-width: 40rem) {
  .om-turn {
    grid-template-columns: 1fr 1fr;
  }
  .om-turn__link--older:only-child {
    grid-column: 2;
  }
}
.om-turn__link {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-height: 44px;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--om-rule);
  border-radius: 0.5rem;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.om-turn__link:hover {
  background: var(--om-card);
  border-style: solid;
}
.om-turn__link--older {
  align-items: flex-end;
  text-align: right;
}
.om-turn__label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--om-ochre);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.om-turn__label .icon {
  font-size: 1.125rem;
}
.om-turn__title {
  color: var(--om-ink);
  font-family: var(--om-serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

/* More stories under an article */
.om-shelf--more {
  margin-top: 4.5rem;
  padding-top: 3rem;
  border-top: 1px dashed var(--om-rule);
}
.om-shelf__all {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 44px;
  color: var(--om-ochre);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.om-shelf__all .icon {
  font-size: 1.25rem;
}

/* The newsletter Brands adds after a blog page */
.om-blog ~ .brands-newsletter,
.om-post ~ .brands-newsletter {
  max-width: 52rem;
  margin: 0 auto 4rem;
  padding: 0 1rem;
}

.om-blog a:focus-visible,
.om-post a:focus-visible {
  outline: 3px solid var(--color-accent, #d9822b);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .om-cards > li .om-card:hover,
  .om-pinned__note:hover,
  .om-card:hover .om-card__photo .om-photo {
    transform: none;
  }
}
