/* pacific-northwest-scallops-guide.css
   Print-friendly Letter layout with 1-inch margins.
   All printable content is constrained to the printable area (6.5in width).
*/

:root {
  --text: #111;
  --muted: #444;
  --rule: #ccc;
  --bg: #fff;
  --callout-border: #333;
  --callout-bg: #fafafa;
}

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

html,
body {
  padding: 0;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:focus,
button:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.wrap {
  /* Constrain content to Letter width minus 1-inch margins on each side */
  max-width: 6.5in;
  margin: 0 auto;
  padding: 0 0.125in; /* minor inner padding; still within page margins */
}

.page-header {
  border-bottom: 1px solid var(--rule);
  padding: 0.3in 0 0.15in;
}

.kicker {
  margin: 0 0 0.08in 0;
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

h1 {
  margin: 0 0 0.08in 0;
  font-size: 1.7rem;
  line-height: 1.2;
}

.subtitle {
  margin: 0 0 0.12in 0;
  color: var(--muted);
}

.meta {
  margin: 0.12in 0 0.08in 0;
  padding: 0.12in 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.meta p {
  margin: 0.04in 0;
}

.actions {
  margin: 0.12in 0 0;
}

button {
  font: inherit;
  padding: 0.08in 0.14in;
  border: 1px solid #000;
  background: #fff;
  cursor: pointer;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.08in 0.12in;
  display: inline-block;
  margin: 0.12in;
  border: 1px solid #000;
}

main {
  padding: 0.2in 0 0.35in;
}

h2 {
  margin: 0.22in 0 0.08in 0;
  font-size: 1.2rem;
}

h3 {
  margin: 0.18in 0 0.06in 0;
  font-size: 1.05rem;
}

h4 {
  margin: 0.14in 0 0.05in 0;
  font-size: 1rem;
}

p {
  margin: 0.08in 0;
}

ul,
ol {
  margin: 0.06in 0 0.1in 0.22in;
  padding: 0;
}

li {
  margin: 0.03in 0;
}

.small {
  font-size: 0.92rem;
  color: var(--muted);
}

.toc {
  border: 1px solid var(--rule);
  padding: 0.14in 0.16in;
  margin: 0.12in 0 0.18in;
}

.toc h2 {
  margin-top: 0;
}

.toc ol {
  margin-left: 0.22in;
}

.callout {
  border: 2px solid var(--callout-border);
  background: var(--callout-bg);
  padding: 0.12in 0.14in;
  margin: 0.12in 0;
}

.callout-title {
  margin-top: 0;
}

.callout.warning {
  border-color: #000;
}

.callout.note {
  border-style: solid;
}

.table-wrap {
  margin: 0.12in 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* encourages wrapping so tables remain within margins */
}

th,
td {
  border: 1px solid var(--rule);
  padding: 0.07in 0.08in;
  vertical-align: top;
  text-align: left;
  word-break: break-word;
  hyphens: auto;
}

thead th {
  font-weight: 700;
}

.recipe {
  border-top: 1px solid var(--rule);
  padding-top: 0.14in;
  margin-top: 0.16in;
}

.recipe-meta p {
  margin-top: 0;
}

.refs {
  margin-left: 0.18in;
}

.url {
  display: inline-block;
  word-break: break-all; /* keeps long URLs within margins */
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92rem;
}

.page-footer {
  border-top: 1px solid var(--rule);
  margin-top: 0.22in;
  padding-top: 0.12in;
}

/* Print rules */
@media print {
  @page {
    size: Letter;
    margin: 1in;
  }

  body {
    background: #fff !important;
  }

  .no-print {
    display: none !important;
  }

  /* Ensure the wrapper never exceeds printable width. */
  .wrap {
    max-width: 6.5in;
    padding: 0;
  }

  a {
    text-decoration: underline;
  }

  /* Reduce risk of awkward page breaks */
  h2, h3, h4 {
    break-after: avoid-page;
  }

  table, .callout, .recipe {
    break-inside: avoid-page;
  }
}
