.bp *, .bp *::before, .bp *::after { box-sizing: border-box; }

.bp {
  --paper:  #FFF4E9;
  --card:   #FDFBF6;
  --ink:    #2A2119;
  --muted:  #6E6055;
  --rule:   #C9B6A0;
  --stamp:  #A03323;

  --serif: "IBM Plex Serif", Georgia, serif;
  --flare: Optima, "URW Classico", Marcellus, Candara, "Gill Sans", sans-serif;

  --measure: 34rem;   /* reading width for prose */
  --page: 62rem;      /* overall content width — the one knob to turn */

  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;

  /* Fill whatever column the theme gives us — no viewport tricks, they assume
     the theme's container is centered in the window and yours is not. */
  width: 100%;
  margin: 0;
  container-type: inline-size;
  container-name: bp;

  /* Block themes cap each direct child of a constrained layout, so the cap
     lands on this element. That rule is written with :where(), which carries
     no specificity, so a plain class selector clears it. */
  max-width: none;
  padding: 0 clamp(1rem, 3vw, 2.5rem) 5rem;
}

.bp .wrap { max-width: var(--page); margin: 0 auto; }

/* Prose keeps a readable measure however wide the page gets. */
.bp .wrap > p,
.bp .wrap > h2,
.bp .wrap > h3,
.bp .wrap > ul,
.bp .wrap > .note,
.bp .hero-text > p { max-width: var(--measure); }

/* Headline and sample card sit side by side once there's room.
   Measured against this container, not the browser window — the page may be
   inside a narrow theme column on a wide screen. */
.bp .hero { padding-top: .25rem; }

@container bp (min-width: 54rem) {
  .bp .hero {
    display: grid;
    grid-template-columns: minmax(22rem, 1fr) 22rem;
    gap: 3.5rem;
    align-items: end;
  }
  .bp .hero-text,
  .bp .hero-card { padding-bottom: .5rem; }
  .bp .hero h1 { margin-top: .75rem; }
  .bp .caption { margin-bottom: 0; }
}

/* ---------- masthead ---------- */
.bp .mast {
  font-family: var(--flare);
  font-size: .95rem;
  letter-spacing: .01em;
  color: var(--muted);
  padding: 2.25rem 0 0;
}
.bp .mast a { color: inherit; }

/* ---------- hero ---------- */
.bp h1 {
  font-family: var(--flare);
  font-weight: 400;
  font-size: clamp(2.3rem, 8vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -.005em;
  margin: 1.5rem 0 .9rem;
}
.bp .standfirst {
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 2.25rem;
  max-width: 30rem;
}

/* ---------- the sample card ---------- */
.bp .cardstage { margin: 0 0 .85rem; perspective: 900px; }
.bp .bizcard {
  aspect-ratio: 3.5 / 2;
  width: 100%;
  max-width: 25rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: 0 1px 0 var(--rule), 0 14px 26px -18px rgba(42,33,25,.55);
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.bp .bizcard .biz {
  padding-right: 5.5rem;
  font-family: var(--flare);
  font-size: 1.28rem;
  line-height: 1.15;
  margin: 0;
}
.bp .bizcard .what {
  font-size: .92rem;
  line-height: 1.4;
  color: var(--muted);
  margin: .35rem 0 0;
}
.bp .bizcard .foot {
  font-size: .82rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink);
  border-top: 1px solid var(--rule);
  padding-top: .55rem;
}
.bp .bizcard .foot span:last-child { color: var(--muted); }
.bp .stamp {
  position: absolute;
  right: -.5rem;
  top: .9rem;
  transform: rotate(-7deg);
  font-family: var(--flare);
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  border-radius: 3px;
  padding: .18rem .5rem;
  opacity: .9;
  background: rgba(253,251,246,.75);
}
.bp .caption {
  font-size: .85rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 2.5rem;
}

/* ---------- prose ---------- */
.bp h2 {
  font-family: var(--flare);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 2.75rem 0 .75rem;
}
.bp h3 {
  font-family: var(--flare);
  font-weight: 400;
  font-size: 1.12rem;
  margin: 1.75rem 0 .5rem;
}
.bp p { margin: 0 0 1rem; }
.bp a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.bp a:hover { color: var(--stamp); }

.bp ul.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
.bp ul.plain li {
  padding: .5rem 0 .5rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.bp ul.plain li:first-child { border-top: 1px solid var(--rule); }
.bp ul.plain li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.08em;
  width: .38rem; height: .38rem;
  background: var(--ink);
}
.bp .note {
  font-size: .95rem;
  color: var(--muted);
  border-left: 2px solid var(--rule);
  padding-left: 1rem;
  margin: 1.5rem 0;
}

/* ---------- reply card (the form) ---------- */
.bp .reply {
  margin: 3.25rem 0 0;
  border: 2px dashed var(--rule);
  border-radius: 4px;
  background: var(--card);
  padding: 1.75rem 1.5rem 2rem;
}
.bp .reply h2 { margin-top: 0; }
.bp .reply .lede { color: var(--muted); font-size: .97rem; margin-bottom: 1.5rem; }

.bp fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }
.bp legend {
  font-family: var(--flare);
  font-size: 1rem;
  padding: 0;
  margin-bottom: .5rem;
}
.bp .who { display: flex; flex-wrap: wrap; gap: .5rem; }
.bp .who label {
  flex: 1 1 11rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .7rem .85rem;
  cursor: pointer;
  font-size: .95rem;
  background: var(--paper);
}
.bp .who input { margin-right: .5rem; accent-color: var(--stamp); }
.bp .who label:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.bp .field { margin: 0 0 1.05rem; }
.bp .field label {
  display: block;
  font-size: .92rem;
  margin-bottom: .3rem;
}
.bp .hint { color: var(--muted); font-size: .85rem; display: block; margin-top: .15rem; }
.bp input[type="text"],
.bp input[type="email"],
.bp input[type="url"],
.bp textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .6rem .7rem;
}
.bp select {
  width: 100%;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .6rem .7rem;
}
.bp textarea { resize: vertical; min-height: 5.5rem; line-height: 1.5; }

/* ---------- uploads ---------- */
.bp .drop {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
  padding: .9rem 1rem;
  margin: 0 0 .9rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.bp .drop .thumb {
  flex: 0 0 auto;
  width: 4.5rem; height: 4.5rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: .7rem; color: var(--muted); text-align: center; padding: .2rem;
}
.bp .drop .thumb img { max-width: 100%; max-height: 100%; display: block; }
.bp .drop .meta { flex: 1 1 auto; min-width: 0; }
.bp .drop .meta > label { display: block; font-size: .95rem; margin-bottom: .2rem; }
.bp .drop input[type="file"] {
  font-family: var(--serif);
  font-size: .88rem;
  margin: .45rem 0 .25rem;
  max-width: 100%;
}
.bp .drop input[type="file"]::file-selector-button {
  font-family: var(--flare);
  font-size: .88rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .35rem .8rem;
  margin-right: .7rem;
  cursor: pointer;
}
.bp .drop .readout { font-size: .84rem; color: var(--muted); margin: .2rem 0 0; }
.bp .drop .readout.warn { color: var(--stamp); }
.bp .drop .drop-clear {
  font-family: var(--serif);
  font-size: .84rem;
  color: var(--muted);
  background: none; border: 0; padding: 0;
  text-decoration: underline; cursor: pointer;
}
.bp .drop .drop-clear:hover { color: var(--stamp); background: none; }
.bp .bar {
  height: 3px; background: var(--rule); border-radius: 2px;
  margin-top: .9rem; overflow: hidden; display: none;
}
.bp .bar div { height: 100%; width: 0; background: var(--stamp); }
.bp .row { display: flex; gap: .85rem; flex-wrap: wrap; }
.bp .row .field { flex: 1 1 12rem; }

.bp .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .35rem .85rem; }
.bp .checks label { font-size: .93rem; display: flex; align-items: center; gap: .45rem; }
.bp .checks input, .bp .single input { accent-color: var(--stamp); }
.bp .single { display: flex; gap: .55rem; align-items: flex-start; font-size: .95rem; margin: 0 0 1rem; }

.bp button {
  font-family: var(--flare);
  font-size: 1.02rem;
  color: var(--paper);
  background: var(--stamp);
  border: 0;
  border-radius: 3px;
  padding: .8rem 1.5rem;
  cursor: pointer;
}
.bp button:hover { background: #8C2A1B; }
.bp .afterbtn { font-size: .88rem; color: var(--muted); margin: .8rem 0 0; }

.bp :focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }

.bp .status {
  margin-top: 1.1rem;
  padding: .85rem 1rem;
  border-radius: 3px;
  font-size: .95rem;
  display: none;
}
.bp .status[data-state="ok"]   { display: block; background: #EFE6D8; border-left: 3px solid var(--ink); }
.bp .status[data-state="bad"]  { display: block; background: #F6E3DE; border-left: 3px solid var(--stamp); }

.bp .colophon {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: .88rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .bp * { transition: none !important; animation: none !important; }
}

/* Same cap, one level up, in case the shortcode sits inside a group or paragraph. */
.is-layout-constrained > :has(> .bp),
.entry-content > :has(> .bp),
.wp-block-post-content > :has(> .bp) { max-width: none; }

/* The form is the one element that should use the whole column. Its intro keeps
   a readable measure; the fields spread into two tracks when there's room. */
.bp .reply .lede { max-width: var(--measure); }

@container bp (min-width: 54rem) {
  .bp .reply { padding: 2rem 2.25rem 2.25rem; }
  .bp .reply .field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.75rem;
  }
  .bp .reply .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bp .drop { padding: 1.1rem 1.25rem; }
}

/* ==================================================================
   Public directory — [gazette_directory]
   ================================================================== */

.bp .dir-empty {
  font-style: italic;
  color: var(--muted);
  padding: 2rem 0;
}

.bp .dir-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.bp .dir-filter button {
  font-family: var(--serif);
  font-size: .9rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .35rem .95rem;
  cursor: pointer;
}
.bp .dir-filter button:hover { border-color: var(--ink); background: var(--card); }
.bp .dir-filter button.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.bp .dir-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@container bp (min-width: 34rem) {
  .bp .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container bp (min-width: 54rem) {
  .bp .dir-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
}

.bp .dir-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: 0 1px 0 var(--rule);
  padding: 1.15rem 1.25rem 1.25rem;
}
.bp .dir-card[hidden] { display: none; }

.bp .dir-top {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  margin-bottom: .5rem;
}
.bp .dir-logo {
  flex: 0 0 auto;
  width: 3rem; height: 3rem;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bp .dir-logo img { max-width: 100%; max-height: 100%; display: block; }

.bp .dir-name {
  font-family: var(--flare);
  font-weight: 400;
  font-size: 1.18rem;
  line-height: 1.2;
  margin: 0;
  padding-right: 1rem;
}
.bp .dir-what {
  font-size: .94rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 .9rem;
  flex: 1 1 auto;
}
.bp .dir-foot {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .9rem;
  font-size: .85rem;
  margin: 0;
  padding-top: .6rem;
  border-top: 1px solid var(--rule);
}
.bp .dir-foot span { color: var(--muted); }
.bp .dir-tag {
  position: absolute;
  top: .9rem; right: .9rem;
  font-family: var(--flare);
  font-size: .68rem;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: .1rem .4rem;
}
