@font-face {
  font-family: Atkinson;
  src: url(assets/fonts/atkinson-00.ttf) format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Atkinson;
  src: url(assets/fonts/atkinson-01.ttf) format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Newsreader;
  src: url(assets/fonts/newsreader-02.ttf) format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f8f4eb;
  --panel: #f0e9dd;
  --ink: #211b17;
  --secondary: #51473e;
  --rule: #bdb0a2;
  --accent: #9b3515;
  --focus: #88400e;
  --band: #f1dfca;
  --night-paper: #161411;
  --night-panel: #221e19;
  --night-ink: #fbf1e3;
  --night-secondary: #cabeb0;
  --night-rule: #625548;
  --night-accent: #ffa675;
  --night-focus: #ffbf8d;
  --night-band: #322219;
  font-family: Atkinson, Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: var(--night-paper);
  --panel: var(--night-panel);
  --ink: var(--night-ink);
  --secondary: var(--night-secondary);
  --rule: var(--night-rule);
  --accent: var(--night-accent);
  --focus: var(--night-focus);
  --band: var(--night-band);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: var(--night-paper);
    --panel: var(--night-panel);
    --ink: var(--night-ink);
    --secondary: var(--night-secondary);
    --rule: var(--night-rule);
    --accent: var(--night-accent);
    --focus: var(--night-focus);
    --band: var(--night-band);
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 1.0625rem; line-height: 1.55; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: var(--accent); text-decoration-thickness: .12em; }
:focus-visible { outline: .1875rem solid var(--focus); outline-offset: .25rem; }
[id] { scroll-margin-top: 1.25rem; }
h1, h2, h3 { margin: 0; font-family: Newsreader, Georgia, serif; font-weight: 700; line-height: 1.06; }
p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; }
.shell { width: min(76rem, calc(100% - clamp(2rem, 7vw, 7rem))); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 5;
  inset: 1rem auto auto 1rem;
  max-inline-size: calc(100% - 2rem);
  padding: .65rem 1rem;
  background: var(--paper);
  color: var(--ink);
  border: .125rem solid var(--focus);
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.masthead { border-block-start: .375rem solid var(--accent); border-block-end: 1px solid var(--rule); }
.masthead-main { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1.5rem; padding-block: 1.125rem; }
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.brand img { width: 3rem; height: 3rem; flex: none; border-radius: .475rem; }
.brand h1 { font-size: clamp(2rem, 3.1vw, 3.25rem); letter-spacing: -.048em; }
.brand p { color: var(--secondary); font-size: .8125rem; line-height: 1.2; }
.masthead-tools { display: flex; flex-wrap: wrap; gap: .45rem; }

.tool-link, .action, .archive-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .5rem .85rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
  color: var(--ink);
}
.tool-link { background: transparent; border: 1px solid var(--rule); }
.tool-link:hover { color: var(--accent); border-color: var(--accent); }
.action { background: #953412; color: #fff8f0; border: 1px solid #953412; }
.action:hover { background: #75270e; color: #fff8f0; }

.category-bar { border-top: 1px solid var(--rule); }
.category-bar .shell { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem .7rem; }
.category-bar a, .category-menu a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding-block: .3rem;
  font-weight: 700;
  text-decoration: none;
}
.category-bar a:hover, .category-menu a:hover { text-decoration: underline; }
.category-menu { display: none; }
.category-menu summary { width: fit-content; min-height: 2.75rem; padding: .55rem 0; cursor: pointer; font-weight: 700; }
.category-menu nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem .8rem; padding: .4rem 0 .8rem; }

.front-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(18rem, 1fr);
  gap: clamp(1.75rem, 4vw, 4rem);
  align-items: start;
  margin-block: clamp(1.6rem, 3.65vw, 3.25rem) clamp(2.25rem, 4.7vw, 4.5rem);
}
.opening-label { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-bottom: .65rem; }
.opening-label span { border-left: .25rem solid var(--accent); padding-left: .55rem; font-weight: 700; }
.opening-label a { color: var(--accent); }
.opening h2 { font-size: clamp(2.55rem, 5vw, 5.3rem); letter-spacing: -.048em; text-wrap: balance; overflow-wrap: anywhere; }
.opening h2 a, .news-list h3 a, .read-list h3 a { text-decoration: none; }
.opening h2 a:hover, .news-list h3 a:hover, .read-list h3 a:hover { text-decoration: underline; }
.opening-summary { margin-top: .65rem; max-width: 58ch; font-size: clamp(1.0625rem, 1.55vw, 1.275rem); color: var(--secondary); text-wrap: pretty; }
.byline { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .8rem; font-size: .9375rem; color: var(--secondary); }
.opening-visual { margin-top: 1.1rem; border: 1px solid var(--rule); background: var(--panel); }
.opening-visual img { width: 100%; height: auto; aspect-ratio: 2.35; object-fit: cover; object-position: center 43%; }

.latest {
  padding: clamp(1.15rem, 2.7vw, 2.125rem);
  background: var(--panel);
  border-block-start: .25rem solid var(--accent);
}
.latest h2, .home-section h2, .newsletter h2 { font-size: clamp(2rem, 3.2vw, 3.35rem); letter-spacing: -.036em; }
.news-list, .category-grid, .services-grid, .read-list { list-style: none; }
.news-list { margin-top: .6rem; }
.news-list li { padding: .8rem 0 .85rem; border-bottom: 1px solid var(--rule); }
.news-list h3 { margin-top: .23rem; font-size: clamp(1.23rem, 1.7vw, 1.65rem); line-height: 1.15; letter-spacing: -.016em; }
.news-list h3 a, .read-list h3 a { display: flex; align-items: center; min-height: 2.75rem; }
.news-meta { display: flex; flex-wrap: wrap; gap: .15rem .65rem; font-size: .875rem; color: var(--secondary); }
.news-meta span { color: var(--accent); font-weight: 700; }
.archive-link { justify-content: flex-start; color: var(--accent); margin-top: .5rem; padding-inline: 0; }
.archive-link:hover { text-decoration: underline; }

.newsletter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(5.25rem, 13vw, 9.25rem);
  align-items: center;
  gap: 1rem clamp(1.25rem, 4vw, 3rem);
  padding: clamp(1.3rem, 4vw, 3rem);
  background: var(--band);
  border-block: 1px solid var(--rule);
}
.newsletter p { max-width: 59ch; margin-block: .65rem 1rem; color: var(--secondary); }
.newsletter img { width: 100%; height: auto; justify-self: end; box-shadow: .3rem .5rem 0 #63361c30; }

.home-section { margin-top: clamp(2.5rem, 6vw, 5rem); padding-top: 1rem; border-top: .15rem solid var(--ink); }
.home-section h2 { margin-bottom: 1.1rem; }
.category-grid, .services-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.category-grid a {
  min-height: 3.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem .85rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  text-decoration: none;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.category-grid a:hover { border-color: var(--accent); }
.category-grid a span { color: var(--accent); font-size: 1.15rem; }
.services-grid { gap: 1.1rem 1.5rem; }
.services-grid li { min-width: 0; border-top: 1px solid var(--rule); padding-top: .55rem; }
.services-grid a { display: inline-block; font-weight: 700; color: var(--accent); padding-block: .5rem; }
.services-grid p { color: var(--secondary); max-width: 28ch; }
.read-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1.5rem; }
.read-list li { border-top: 1px solid var(--rule); padding-top: .6rem; }
.read-list h3 { font-size: 1.3rem; line-height: 1.18; }
.read-section { margin-bottom: clamp(2.75rem, 6vw, 5.5rem); }

.site-footer { border-top: .25rem solid var(--accent); background: var(--panel); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 1rem 2rem; padding-block: 1.75rem; }
.footer-brand { font: 700 2rem/1 Newsreader, Georgia, serif; margin-bottom: .5rem; }
.footer-links { display: flex; flex-wrap: wrap; align-content: flex-start; gap: .2rem 1rem; }
.footer-links a { padding-block: .3rem; }

.search-dialog { width: min(35rem, calc(100% - 2rem)); padding: clamp(1rem, 3.5vw, 2.3rem); background: var(--paper); color: var(--ink); border: 1px solid var(--rule); }
.search-dialog::backdrop { background: #120d09bf; }
.search-dialog h2 { margin-bottom: 1rem; font-size: 2rem; }
.search-dialog label { display: block; font-weight: 700; }
.search-dialog input { width: 100%; min-height: 2.75rem; margin: .25rem 0 1rem; padding: .5rem; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

@media (max-width: 60rem) {
  .category-bar { display: none; }
  .category-menu { display: block; border-top: 1px solid var(--rule); }
  .front-layout { gap: 1.5rem; }
  .category-grid, .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 44rem) {
  .front-layout { grid-template-columns: minmax(0, 1fr); }
  .opening-visual img { aspect-ratio: 2.4; }
  .masthead-main { padding-block: .75rem; }
  .brand img { width: 2.4rem; height: 2.4rem; }
  .opening h2 { font-size: clamp(2.2rem, 8.7vw, 3.1rem); }
  .byline { margin-top: .55rem; }
  .opening-visual { margin-top: .8rem; }
  .read-list, .footer-inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 27rem) {
  .masthead-tools .tool-link { padding-inline: .7rem; }
  .newsletter { grid-template-columns: minmax(0, 1fr); }
  .newsletter img { width: 5.5rem; justify-self: start; }
}

@media (max-width: 23rem) {
  .front-layout { row-gap: 1.125rem; margin-top: 1.25rem; }
  .opening h2 { font-size: 2rem; }
  .opening-visual { margin-top: .55rem; }
  .opening-visual img { aspect-ratio: 3.1; }
  .latest { padding-top: .95rem; }
}

.product-spotlight[hidden] { display: none; }

.product-spotlight:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr);
  align-items: center;
  gap: .75rem clamp(1rem, 3vw, 3rem);
  margin-top: 1.35rem;
  padding: 1rem clamp(1rem, 2.2vw, 2rem);
  border: 1px solid #59483d;
  border-inline-start: .25rem solid #ffad78;
  border-radius: .5rem;
  background: #241a15;
  color: #fff7ed;
}
.product-spotlight h2 { display: flex; flex-direction: column; gap: .3rem; font-size: clamp(2rem, 3vw, 3.125rem); }
.product-label { color: #ffd1b2; font: 700 .9rem/1 Atkinson, Arial, sans-serif; }
.product-copy p { margin-top: .28rem; color: #f1ddd0; line-height: 1.3; }
.product-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 2.75rem;
  padding: .5rem .85rem;
  border-radius: .3rem;
  background: #ffb283;
  color: #25160e;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.15;
}
.product-link:hover { background: #ffd0b0; color: #25160e; text-decoration: underline; }
.product-link:focus-visible { outline-color: #ffceae; }
.product-visual {
  width: 100%;
  height: clamp(4.5rem, 8vw, 7.2rem);
  object-fit: cover;
  object-position: 50% 20%;
  border: 1px solid #a38a7a;
  border-radius: .3rem;
}
.product-spotlight:not([hidden]) + .front-layout { margin-top: clamp(1.5rem, 3vw, 2.4rem); }

@media (max-width: 47.99rem) {
  .product-spotlight:not([hidden]) {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .5rem;
    margin-top: .65rem;
    padding: .5rem .65rem;
  }
  .product-spotlight h2 { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: .4rem; font-size: 1.55rem; }
  .product-label { font-size: .82rem; }
  .product-copy p { font-size: .875rem; }
  .product-link { padding-inline: .55rem; font-size: .9rem; }
  .product-visual { display: none; }
  .product-spotlight:not([hidden]) + .front-layout { margin-top: 1rem; row-gap: .9rem; }
  .product-spotlight:not([hidden]) + .front-layout .opening-visual img { aspect-ratio: 3.5; }
}

@media (max-width: 23rem) {
  .product-spotlight:not([hidden]) { padding-block: .4rem; }
  .product-spotlight:not([hidden]) + .front-layout { row-gap: .65rem; }
  .product-spotlight:not([hidden]) + .front-layout .opening-visual { display: none; }
}
