/* Underwear Considered - single stylesheet, no frameworks, no web fonts. */

:root {
  --paper: #fbf7f0;
  --card: #fffdf9;
  --ink: #1e1a16;
  --muted: #6d6257;
  --accent: #8f3f2f;
  --accent-soft: #f0e2dc;
  --rule: #e6dccc;
  --shadow: 0 1px 2px rgba(30, 26, 22, .05), 0 8px 24px rgba(30, 26, 22, .05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 44rem;
}

html[data-theme="dark"] {
  --paper: #14120f;
  --card: #1c1917;
  --ink: #ece5da;
  --muted: #a0958a;
  --accent: #e0937a;
  --accent-soft: #33241f;
  --rule: #2e2823;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --paper: #14120f;
    --card: #1c1917;
    --ink: #ece5da;
    --muted: #a0958a;
    --accent: #e0937a;
    --accent-soft: #33241f;
    --rule: #2e2823;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: .06em; }
a:hover { text-decoration-thickness: .12em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.wrap-wide { max-width: 62rem; margin: 0 auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- header ---------- */

.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); }
.masthead-inner {
  display: flex; align-items: center; gap: 1rem;
  padding-top: .9rem; padding-bottom: .9rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-size: 1.35rem; font-weight: 700;
  letter-spacing: -.015em; color: var(--ink); text-decoration: none; margin-right: auto;
  display: inline-flex; align-items: center; gap: .55rem;
}
.brand .brand-name span { color: var(--accent); }
.brand .mark { width: 1.7rem; height: 1.7rem; flex: none; display: block; }
.brand .mark .b { fill: var(--accent); }
.brand .mark .w { fill: var(--paper); }
.brand .mark .s { stroke: var(--paper); }
@media (max-width: 420px) { .brand .mark { display: none; } }
.nav { display: flex; gap: 1.1rem; font-family: var(--sans); font-size: .875rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }

.tools { display: flex; align-items: center; gap: .5rem; }

.searchbox { position: relative; display: flex; }
.searchbox input {
  font: inherit; font-family: var(--sans); font-size: .85rem;
  padding: .38rem .7rem; width: 11rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: 999px;
}
.searchbox input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.theme-toggle {
  font: inherit; font-family: var(--sans); font-size: .8rem; cursor: pointer;
  background: var(--card); color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: .38rem .7rem; line-height: 1;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- generic blocks ---------- */

.eyebrow {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .45rem;
}
.eyebrow a { color: var(--accent); text-decoration: none; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.22; letter-spacing: -.015em; }
h1 { font-size: 2.15rem; margin: .2rem 0 .6rem; }
h2 { font-size: 1.4rem; margin: 2.3rem 0 .7rem; }
h3 { font-size: 1.12rem; margin: 1.8rem 0 .5rem; }

.dek { font-size: 1.14rem; color: var(--muted); margin: 0 0 1.2rem; }
.meta { font-family: var(--sans); font-size: .8rem; color: var(--muted); margin: 0 0 1.6rem; }
.meta a { color: var(--muted); }

hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 2.6rem 0; }

/* ---------- home ---------- */

.hero { padding: 3rem 0 1.6rem; text-align: center; }
.hero h1 { font-size: 2.6rem; margin-bottom: .5rem; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 34rem; margin: 0 auto; }

.cat-grid {
  display: grid; gap: 1rem; padding: 1.5rem 0 .5rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.cat-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: .7rem;
  padding: 1.1rem 1.2rem; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow);
}
.cat-card:hover { border-color: var(--accent); }
.cat-card strong { display: block; font-size: 1.1rem; margin-bottom: .25rem; }
.cat-card span { font-size: .92rem; color: var(--muted); }
.cat-card em {
  display: block; font-style: normal; font-family: var(--sans);
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-top: .6rem;
}

.section-title {
  font-family: var(--sans); font-size: .75rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--rule); padding-bottom: .5rem; margin: 2.8rem 0 .4rem;
}

.card-grid {
  display: grid; gap: 1rem; padding-top: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: .7rem;
  padding: 1.1rem 1.2rem 1.2rem; box-shadow: var(--shadow);
}
.card h3 { margin: .1rem 0 .4rem; font-size: 1.15rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; font-size: .95rem; color: var(--muted); }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--rule); padding: 1.05rem 0; }
.post-list h3 { margin: 0 0 .3rem; font-size: 1.18rem; }
.post-list h3 a { color: var(--ink); text-decoration: none; }
.post-list h3 a:hover { color: var(--accent); }
.post-list p { margin: 0; color: var(--muted); font-size: .96rem; }
.post-list .stamp {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); display: block; margin-bottom: .3rem;
}
.post-list .stamp a { color: var(--accent); text-decoration: none; }

/* ---------- article ---------- */

.article { padding: 2.4rem 0 1rem; }
.article p { margin: 0 0 1.15rem; }
.article ul { margin: 0 0 1.15rem; padding-left: 1.2rem; }
.article li { margin-bottom: .4rem; }
.article h2 { scroll-margin-top: 2rem; }
.article strong { font-weight: 700; }

.disclosure {
  font-family: var(--sans); font-size: .82rem; line-height: 1.55;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  color: var(--ink); padding: .75rem .95rem; border-radius: 0 .4rem .4rem 0;
  margin: 0 0 1.8rem;
}
.disclosure a { color: var(--accent); }

a.aff {
  font-family: var(--sans); font-size: .86rem; font-weight: 600;
  display: inline-block; text-decoration: none; color: var(--accent);
  background: var(--accent-soft); border: 1px solid transparent;
  border-radius: .35rem; padding: .08rem .45rem; line-height: 1.45;
}
a.aff:hover { border-color: var(--accent); }
a.aff::after { content: " \2197"; font-size: .8em; opacity: .7; }

.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: 2rem 0 0; }
.tag-row a {
  font-family: var(--sans); font-size: .76rem; text-decoration: none;
  color: var(--muted); border: 1px solid var(--rule); border-radius: 999px;
  padding: .18rem .6rem;
}
.tag-row a:hover { color: var(--accent); border-color: var(--accent); }

.related { padding: .5rem 0 2rem; }

/* ---------- ads ---------- */

.ad {
  margin: 2.4rem 0; text-align: center; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
}
.ad-placeholder {
  width: 100%; border: 1px dashed var(--rule); border-radius: .5rem;
  color: var(--muted); font-family: var(--sans); font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; padding: 2rem 1rem;
}
.ad-label {
  font-family: var(--sans); font-size: .65rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); display: block; margin-bottom: .3rem;
}

/* ---------- search ---------- */

.search-page input[type="search"] {
  font: inherit; font-family: var(--sans); width: 100%;
  padding: .8rem 1rem; border-radius: .6rem;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
}
.search-page input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#search-status { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin: 1rem 0 .5rem; }
mark { background: var(--accent-soft); color: inherit; padding: 0 .12em; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--rule); margin-top: 3.5rem;
  padding: 2rem 0 3rem; font-family: var(--sans); font-size: .85rem; color: var(--muted);
}
.footer-cols { display: flex; flex-wrap: wrap; gap: 2.4rem; }
.footer h4 {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .11em;
  text-transform: uppercase; margin: 0 0 .6rem; color: var(--ink);
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .35rem; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer .fine { margin-top: 2rem; font-size: .78rem; line-height: 1.6; }

/* ---------- cookie banner ---------- */

.cookie {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 60;
  max-width: 40rem; margin: 0 auto;
  background: var(--card); border: 1px solid var(--rule); border-radius: .7rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
  padding: 1.1rem 1.2rem; font-family: var(--sans); font-size: .85rem; line-height: 1.55;
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0 0 .8rem; }
.cookie-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cookie button {
  font: inherit; font-family: var(--sans); font-size: .82rem; font-weight: 600;
  cursor: pointer; border-radius: .4rem; padding: .5rem .95rem; border: 1px solid var(--rule);
  background: var(--paper); color: var(--ink);
}
.cookie button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.cookie button:hover { border-color: var(--accent); }

@media (max-width: 34rem) {
  h1 { font-size: 1.8rem; }
  .hero h1 { font-size: 2.05rem; }
  .searchbox input { width: 8.5rem; }
  .masthead-inner { gap: .6rem; }
  .nav { order: 3; width: 100%; justify-content: space-between; gap: .5rem; }
}

/* ---------- breadcrumbs ---------- */

.crumbs { font-family: var(--sans); font-size: .78rem; margin: 0 0 1rem; }
.crumbs ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem;
}
.crumbs li { color: var(--muted); }
.crumbs li + li::before { content: "\203A"; margin-right: .35rem; opacity: .6; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs li[aria-current] {
  color: var(--muted); max-width: 22rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- table of contents ---------- */

.toc {
  font-family: var(--sans); background: var(--card);
  border: 1px solid var(--rule); border-radius: .6rem;
  padding: 1rem 1.2rem .9rem; margin: 0 0 2rem;
}
.toc h2 {
  font-family: var(--sans); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 .6rem; padding: 0; border: 0;
}
.toc ol { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
.toc li { margin-bottom: .3rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- product cards ---------- */

.product {
  background: var(--card); border: 1px solid var(--rule);
  border-left: 4px solid var(--accent); border-radius: .2rem .6rem .6rem .2rem;
  padding: 1.2rem 1.3rem 1rem; margin: 2rem 0; box-shadow: var(--shadow);
}
.product-kicker {
  font-family: var(--sans); font-size: .66rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 .35rem;
}
.product-name { font-size: 1.25rem; line-height: 1.25; margin: 0; }
.product-brand {
  font-family: var(--sans); font-size: .8rem; color: var(--muted);
  margin: .15rem 0 0;
}
.product-best { font-size: .98rem; margin: .7rem 0 0; }
.product-best strong { font-family: var(--sans); font-size: .78rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.product-lists {
  display: flex; flex-wrap: wrap; gap: 1.4rem; margin: 1rem 0 0;
}
.product-lists > div { flex: 1 1 12rem; }
.product-lists h4 {
  font-family: var(--sans); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .35rem;
}
.product-lists ul { margin: 0; padding: 0; list-style: none; font-size: .93rem; }
.product-lists li { margin-bottom: .3rem; padding-left: 1.1rem; position: relative; }
.product-lists .pros li::before { content: "+"; position: absolute; left: 0; color: var(--accent); }
.product-lists .cons li::before { content: "\2212"; position: absolute; left: 0; color: var(--muted); }
.product-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
  margin: 1.1rem 0 0;
}
.product-cta {
  font-family: var(--sans); font-size: .85rem; font-weight: 600;
  text-decoration: none; background: var(--accent); color: #fff;
  border-radius: .4rem; padding: .5rem 1rem; display: inline-block;
}
.product-cta:hover { filter: brightness(1.08); }
.product-cta::after { content: " \2197"; font-size: .85em; opacity: .8; }
.product-price { font-family: var(--sans); font-size: .88rem; color: var(--muted); margin: 0; }
.product-fine {
  font-family: var(--sans); font-size: .7rem; color: var(--muted);
  margin: .8rem 0 0;
}

/* ---------- author box ---------- */

.author {
  display: flex; gap: 1rem; align-items: flex-start;
  border-top: 1px solid var(--rule); margin: 2.4rem 0 0; padding: 1.4rem 0 0;
}
.author-mark {
  flex: none; width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: .95rem; font-weight: 700; letter-spacing: .02em;
}
.author-name { font-family: var(--sans); font-size: .95rem; font-weight: 700; margin: 0; }
.author-name span {
  font-weight: 400; color: var(--muted); font-size: .85rem;
}
.author-name span::before { content: " \00b7 "; }
.author-bio {
  font-size: .95rem; color: var(--muted); margin: .3rem 0 0; line-height: 1.55;
}
.author-links { font-family: var(--sans); font-size: .8rem; margin: .5rem 0 0; }
.author-links a { margin-right: .9rem; color: var(--accent); text-decoration: none; }
.author-links a:hover { text-decoration: underline; }
.byline { color: var(--ink); }

/* ---------- newsletter ---------- */

.newsletter {
  background: var(--accent-soft); border-radius: .7rem;
  padding: 1.4rem 1.5rem 1.2rem; margin: 2.4rem 0 0;
}
.newsletter h2 {
  font-size: 1.2rem; margin: 0 0 .35rem; padding: 0; border: 0; line-height: 1.3;
}
.newsletter > p { font-size: .95rem; color: var(--muted); margin: 0 0 .9rem; }
.newsletter form { display: flex; flex-wrap: wrap; gap: .5rem; }
.newsletter input[type="email"] {
  font: inherit; font-family: var(--sans); font-size: .9rem;
  flex: 1 1 14rem; padding: .6rem .8rem; border-radius: .4rem;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
}
.newsletter input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.newsletter button {
  font: inherit; font-family: var(--sans); font-size: .88rem; font-weight: 600;
  cursor: pointer; border: 1px solid var(--accent); border-radius: .4rem;
  padding: .6rem 1.2rem; background: var(--accent); color: #fff;
}
.newsletter button:hover { filter: brightness(1.08); }
.newsletter-fine {
  font-family: var(--sans); font-size: .72rem; color: var(--muted); margin: .7rem 0 0;
}

/* ---------- contact form ---------- */

.contact-form {
  background: var(--accent-soft); border-radius: .7rem;
  padding: 1.4rem 1.5rem 1rem; margin: 1.8rem 0 2rem;
}
.contact-form .field { margin: 0 0 1rem; }
.contact-form label {
  display: block; font-family: var(--sans); font-size: .82rem;
  font-weight: 600; letter-spacing: .01em; margin: 0 0 .35rem;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  font: inherit; font-family: var(--sans); font-size: .92rem;
  display: block; width: 100%; box-sizing: border-box;
  padding: .6rem .8rem; border-radius: .4rem;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
}
.contact-form textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }
.contact-form input:focus, .contact-form textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.contact-form .hint {
  display: block; font-family: var(--sans); font-size: .74rem;
  color: var(--muted); margin: .3rem 0 0;
}
.contact-form button {
  font: inherit; font-family: var(--sans); font-size: .88rem; font-weight: 600;
  cursor: pointer; border: 1px solid var(--accent); border-radius: .4rem;
  padding: .6rem 1.4rem; background: var(--accent); color: #fff;
}
.contact-form button:hover { filter: brightness(1.08); }
.contact-form .hp {
  position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}

/* ---------- article imagery ---------- */

.hero-shot { margin: 0 0 1.8rem; }
.hero-shot img { border-radius: .5rem; width: 100%; }
.hero-shot figcaption {
  font-family: var(--sans); font-size: .78rem; color: var(--muted);
  margin-top: .5rem;
}
.article figure { margin: 2rem 0; }
.card.has-thumb { overflow: hidden; }
.card .thumb { display: block; margin: -1.1rem -1.2rem .9rem; }
.card .thumb img {
  width: 100%; height: 9.5rem; object-fit: cover;
  border-radius: .7rem .7rem 0 0;
}

@media print {
  .masthead, .footer, .cookie, .ad, .theme-toggle, .searchbox,
  .newsletter, .toc, .product-cta { display: none !important; }
}

.tag-row .tag-plain {
  font-family: var(--sans); font-size: .76rem; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px; padding: .18rem .6rem;
}

/* The accent flips to a pale terracotta in the dark palette, so anything
   sitting on top of it has to flip from white to near black to stay legible. */
html[data-theme="dark"] .cookie button.primary,
html[data-theme="dark"] .product-cta,
html[data-theme="dark"] .newsletter button,
html[data-theme="dark"] .contact-form button,
html[data-theme="dark"] .skip { color: #14120f; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .cookie button.primary,
  html:not([data-theme="light"]) .product-cta,
  html:not([data-theme="light"]) .newsletter button,
  html:not([data-theme="light"]) .contact-form button,
  html:not([data-theme="light"]) .skip { color: #14120f; }
}
