/* Import font system first */
@import url('./fonts.css');

/* Import layout styles */
@import url('./layouts.css');
@import url('./blocks/affiliate-item.css');
@import url('./blocks/button.css');
@import url('./blocks/comparison-badges.css');
@import url('./collection.css');
@import url('./home.css');
@import url('./article.css');
@import url('./adsense.css');
@import url('../../site/plugins/custom-embed-renderer/index.css');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --padding: 1.5rem;
  --page-padding: 2vw;
  /* Horizontal inset is applied once on body — avoid repeating on .page, sections, footer, etc. */
  --color-black: #000;
  --color-white: #F7F7F3;
  --color-grey: #777;
  --color-light: #efefef;
  --color-cream: #e4e3dc;
  --color-blue: #0300c4;
  --color-light-grey: #909090;
  --color-text: var(--color-black);
  --color-text-grey: var(--color-grey);
  --color-background: var(--color-white);
  --color-code-light-grey:  #cacbd1;
  --color-code-comment:     #a9aaad;
  --color-code-white:       #c5c9c6;
  --color-code-red:         #d16464;
  --color-code-orange:      #de935f;
  --color-code-yellow:      #f0c674;
  --color-code-green:       #a7bd68;
  --color-code-aqua:        #8abeb7;
  --color-code-blue:        #7e9abf;
  --color-code-purple:      #b294bb;
  /* Legacy font variables - now using fonts.css system */
  --font-family-sans: var(--font-body);
  --font-family-mono: var(--font-misc);
}

html {
  font-family: var(--font-family-sans);
  color: var(--color-text);
  background: var(--color-background);
  overflow-x: hidden;
}
img {
  width: 100%;
}
body { 
  padding: 0 var(--page-padding); 
  background: var(--color-white);
  max-width: 3200px;
  margin: 0 auto;
  overflow-x: hidden;
}
li {
  list-style: none;
}
a {
  color: currentColor;
  text-decoration: none;
}
button {
  font: var(--font-misc);
  background: none;
  border: 0;
  color: currentColor;
  cursor: pointer;
}
strong, b {
  font-weight: 600;
}
small {
  font-size: inherit;
  color: var(--color-text-grey);
}

.bg-light {
  background-color: var(--color-light);
}
.color-grey {
  color: var(--color-text-grey);
}

/* Global page header (used by multiple pages) */
.page-header { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 1.5rem; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(0,0,0,0.14); }
.page-title { margin: 0; font-family: var(--font-heading); font-size: clamp(1.75rem, 5vw, var(--font-size-6xl)); line-height: 1; }

/* Minimal form fields — transparent, bottom border only */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="password"],
textarea {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 0;
  outline: none;
  box-shadow: none;
  padding: 0.5rem 0;
  color: inherit;
  font: inherit;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  box-shadow: none;
  border-bottom-color: rgba(0, 0, 0, 0.55);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-grey);
  opacity: 1;
}
.page-description {
  margin: 0;
  color: var(--color-text-grey);
  max-width: 68ch;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
}

/* Page root + grid system (global defaults via CSS vars) */
.page { margin: 0 auto; padding: 2rem 0; }
.page { --grid-min: 260px; --grid-gap: 2rem; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--grid-min), 1fr)); gap: var(--grid-gap); }

/* Per-page sensible defaults (override the vars only) */
.page--articles { --grid-min: 300px; }
.page--categories { --grid-min: 260px; }
.page--brands { --grid-min: 200px; }
.page--brand { --grid-min: 260px; }
.page--collections { --grid-min: 240px; --grid-gap: 1.75rem; }
.page--collection { --grid-min: 200px; --grid-gap: 1.25rem; }

/* Breadcrumbs — shared across detail/listing pages */
.breadcrumbs {
  margin-bottom: 1.25rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  font-family: var(--font-misc);
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin: 0 0.45rem;
  color: var(--color-grey);
}

.breadcrumb-link {
  color: var(--color-grey);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: var(--color-black);
}

.breadcrumb-current,
.breadcrumb-text {
  color: var(--color-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Standard content wrapper */
.content { margin-top: 1.5rem; }

@media (max-width: 900px) {
  .page-header {
    grid-template-columns: 1fr;
    gap: .75rem;
    margin-bottom: 1.4rem;
  }
}

.header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin: 0; /* remove large margins */
}

.logo {
  padding: 1rem;
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.menu {
  display: flex;
}
.menu a {
  padding: 1rem;
  display: block;
}
.menu a[aria-current] {
  text-decoration: underline;
}

.social {
  display: flex;
  padding: 0 .5rem;
}
.social a {
  padding: 1rem .5rem;
}

.section {
  padding: 3rem 0;
}

.grid {
  --columns: 12;
  --gutter: 3rem;
  display: grid;
  grid-gap: var(--gutter);
  grid-template-columns: 1fr;
}
.grid > .column {
  margin-bottom: var(--gutter);
}

.autogrid {
  --gutter: 3rem;
  --min: 10rem;
  display: grid;
  grid-gap: var(--gutter);
  grid-template-columns: repeat(auto-fit, minmax(var(--min), 1fr));
  grid-auto-flow: dense;
}


.text {
  line-height: var(--line-height-normal);
}
.text a {
  text-decoration: underline;
}
.text :first-child {
  margin-top: 0;
}
.text :last-child {
  margin-bottom: 0;
}
.text p,
.text ul,
.text ol {
  margin-bottom: 1.5rem;
}
.text ul,
.text ol {
  margin-left: 1rem;
}
.text ul p,
.text ol p {
  margin-bottom: 0;
}
.text ul > li {
  list-style: disc;
}
.text ol > li {
  list-style: decimal;
}
.text ul ol,
.text ul ul,
.text ol ul,
.text ol ol {
  margin-bottom: 0;
}
/* Prose headings – hierarchy must be h1 > h2 > h3 > h4 > h5 > h6 */
.text h1,
.h1,
.intro {
  font-size: var(--font-size-4xl);
  margin-bottom: 1.5rem;
  line-height: var(--line-height-snug);
}
.text h2,
.h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-normal);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  line-height: var(--line-height-snug);
}
.text h3,
.h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-normal);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: var(--line-height-snug);
}
.text h4,
.h4 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-normal);
  margin-top: 1.25rem;
  margin-bottom: 0.375rem;
  line-height: var(--line-height-normal);
}
.text h5,
.h5 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-normal);
  margin-top: 1rem;
  margin-bottom: 0.375rem;
  line-height: var(--line-height-normal);
}
.text h6,
.h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  line-height: var(--line-height-normal);
}
.text h2:first-child,
.text h2:first-of-type { margin-top: 0; }
.text h3:first-child,
.text h3:first-of-type { margin-top: 1rem; }
.text .codeblock {
  display: grid;
}
.text code {
  font-family: var(--font-family-mono);
  font-size: 1em;
  background: var(--color-light);
  padding: 0 .5rem;
  display: inline-block;
  color: var(--color-black);
}
.text pre {
  margin: 3rem 0;
  background: var(--color-black);
  color: var(--color-white);
  padding: 1.5rem;
  overflow-x: scroll;
  overflow-y: hidden;
  line-height: 1.5rem;
}
.text pre code {
  padding: 0;
  background: none;
  color: inherit;
}
.text hr {
  margin: 2.5rem 0;
}
.text dt {
  font-weight: 600;
}
.text blockquote {
  font-size: var(--font-size-xl);
  line-height: 1.325em;
  border-left: 2px solid var(--color-black);
  padding-left: 1rem;
  margin: 3rem 0;
  max-width: 25rem;
}
.text blockquote footer {
  font-size: var(--font-size-sm);
  font-style: italic;
}
.text figure {
  margin: 3rem 0;
}
.text figcaption {
  padding-top: .75rem;
  color: var(--color-text-grey);
}
.text figure ul {
  line-height: 0;
  display: grid;
  gap: 1.5rem;
  margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.text figure ul li {
  list-style: none;
}

hr {
  border: 0;
  background: currentColor;
  height: 2px;
  width: 1.5rem;
  margin: 3rem auto;
}

.align-center {
  text-align: center;
}

.intro {
  max-width: 40rem;
}
.intro *:not(:last-child) {
  margin-bottom: 1em;
}

.cta {
  background: var(--color-black);
  color: var(--color-white);
  display: inline-flex;
  justify-content: center;
  padding: .75rem 1.5rem;
  border: 4px solid var(--color-white);
  outline: 2px solid var(--color-black);
}

.box {
  background: var(--color-light);
  padding: 1.5rem;
  border: 4px solid var(--color-white);
  outline: 2px solid var(--color-light);
}

.video,
.img {
  position: relative;
  display: block;
  --w: 1;
  --h: 1;
  padding-bottom: calc(100% / var(--w) * var(--h));
  background: var(--color-black);
}
.img img,
.video iframe {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
.img[data-contain] img {
  object-fit: contain;
}
.img-caption,
.video-caption {
  padding-top: .75rem;
  line-height: var(--line-height-normal);
}

.footer {
  padding: 9rem 0 6rem;
  line-height: var(--line-height-normal);
}
.footer:before {
  content: "";
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--color-black);
  margin-bottom: 1.5rem;
}

.footer h2 {
  font-weight: normal;
  margin-bottom: .75rem;
}
.footer ul,
.footer p {
  color: var(--color-text-grey);
}
.footer p {
  max-width: 15rem;
}
.footer a:hover {
  color: var(--color-text);
}


.map {
  --w: 2;
  --h: 1;
  padding-bottom: calc(100% / var(--w) * var(--h));
  position: relative;
  overflow: hidden;
  background: var(--color-black);
}
.map iframe {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.margin-s {
  margin-bottom: .75rem;
}
.margin-m {
  margin-bottom: 1.5rem;
}
.margin-l {
  margin-bottom: 3rem;
}
.margin-xl {
  margin-bottom: 4.5rem;
}
.margin-xxl {
  margin-bottom: 6rem;
}


@media screen and (min-width: 60rem) {
  body {
    --padding: 3rem;
  }

  .grid {
    grid-template-columns: repeat(12, 1fr);
  }
  .grid > .column {
    grid-column: span var(--columns);
  }

}

.pagination {
  display: flex;
  padding-top: 6rem;
}
.pagination > span {
  color: var(--color-text-grey);
}
.pagination > * {
  padding: .5rem;
  width: 3rem;
  text-align: center;
  border: 2px solid currentColor;
  margin-right: 1.5rem;
}
.pagination > a:hover {
  background: var(--color-black);
  color: var(--color-white);
  border-color: var(--color-black);
}

.note-excerpt {
  line-height: var(--line-height-normal);
}
.note-excerpt header {
  margin-bottom: 1.5rem;
}
.note-excerpt figure {
  margin-bottom: .5rem;
}
.note-excerpt-title {
  font-weight: 600;
}
.note-excerpt-date {
  color: var(--color-text-grey);
}


