/* ==========================================================================
   Brand Colors — Light Mode
   ========================================================================== */

:root,
[data-md-color-scheme="default"] {
  --md-primary-fg-color: #722F37;
  --md-primary-fg-color--light: #9B5A63;
  --md-primary-fg-color--dark: #4A0E23;
  --md-accent-fg-color: #C9A96E;
  --md-typeset-a-color: #722F37;
}

/* ==========================================================================
   Brand Colors — Dark Mode (Slate)
   ========================================================================== */

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #6D0303;
  --md-primary-fg-color--light: #D4909F;
  --md-primary-fg-color--dark: #A85068;
  --md-accent-fg-color: #D4B87A;
  --md-typeset-a-color: #6D0303;
  --md-hue: 340;
}

/* ==========================================================================
   Table Styling
   ========================================================================== */

.md-typeset table:not([class]) th {
  background-color: #4A0E23;
  color: #fff;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.md-typeset table:not([class]) tr:nth-child(even) {
  background-color: rgba(114, 47, 55, 0.04);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tr:nth-child(even) {
  background-color: rgba(201, 117, 138, 0.08);
}

/* ==========================================================================
   Images
   ========================================================================== */

.md-typeset img:not(.shopify-badge--light):not(.shopify-badge--dark) {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  display: block;
  margin: 1rem auto;
  max-width: 90%;
}

@media (min-width: 769px) {
  .md-typeset img:not(.shopify-badge--light):not(.shopify-badge--dark) {
    max-width: 75%;
  }
}

/* Shopify App Store badge — theme-aware switching */
.shopify-badge {
  display: block;
  text-align: center;
  margin: 1rem 0;
}

.shopify-badge img,
img.shopify-badge--light,
img.shopify-badge--dark {
  height: 48px;
}

.shopify-badge--dark {
  display: none;
}

[data-md-color-scheme="slate"] .shopify-badge--light {
  display: none;
}

[data-md-color-scheme="slate"] .shopify-badge--dark {
  display: inline;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.md-footer {
  background-color: #3A0A1A;
  color: rgba(255, 255, 255, 0.7);
}

.md-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.md-footer a:hover {
  color: #C9A96E;
}

html .md-footer-meta.md-typeset a:not(:focus,:hover) {
  color: rgba(255, 255, 255, 0.7);
}

html .md-footer-meta.md-typeset a:hover {
  color: #C9A96E;
}

.md-footer .md-copyright {
  color: rgba(255, 255, 255, 0.55);
}

[data-md-color-scheme="slate"] .md-footer {
  background-color: #1A0510;
}

/* ==========================================================================
   Hero Section (index page)
   ========================================================================== */

.hero {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--md-primary-fg-color);
  margin-bottom: 0.25rem;
}

.hero h1 a.headerlink {
    display: none;
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--md-default-fg-color--light);
  margin-bottom: 1rem;
}

.hero img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  margin: 1rem auto;
}

.hero .shopify-badge {
  margin: 0.5rem 0;
}

[data-md-color-scheme="slate"] .hero img {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   CTA Buttons
   ========================================================================== */

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}

.cta-buttons .md-button {
  padding: 0.6rem 1.6rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cta-buttons .md-button--primary {
  background-color: var(--md-primary-fg-color);
  color: #fff;
  border: 2px solid var(--md-primary-fg-color);
}

.cta-buttons .md-button--primary:hover {
  background-color: var(--md-primary-fg-color--dark);
  border-color: var(--md-primary-fg-color--dark);
}

.cta-buttons .md-button:not(.md-button--primary) {
  color: var(--md-primary-fg-color);
  border: 2px solid var(--md-primary-fg-color);
  background: transparent;
}

.cta-buttons .md-button:not(.md-button--primary):hover {
  background-color: var(--md-primary-fg-color);
  color: #fff;
}

/* ==========================================================================
   Feature Card Grid
   ========================================================================== */

.grid.cards > ul > li {
  border: 1px solid rgba(114, 47, 55, 0.2);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.grid.cards > ul > li:hover {
  border-color: var(--md-accent-fg-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-md-color-scheme="slate"] .grid.cards > ul > li {
  border-color: rgba(201, 117, 138, 0.2);
}

[data-md-color-scheme="slate"] .grid.cards > ul > li:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Anchor Target Highlight
   ========================================================================== */

.md-typeset :target {
  text-decoration: underline;
  text-decoration-color: var(--md-accent-fg-color);
  text-underline-offset: 4px;
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(114, 47, 55, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(114, 47, 55, 0.5);
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb {
  background-color: rgba(201, 117, 138, 0.3);
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(201, 117, 138, 0.5);
}

/* ==========================================================================
   What's New / Changelog Timeline
   ========================================================================== */

.changelog {
  position: relative;
  padding-left: 8rem;
  margin-left: 0;
  margin-top: 2rem;
}

.changelog::before {
  content: "";
  position: absolute;
  left: 6.75rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--md-default-fg-color--lightest);
}

.changelog-entry {
  position: relative;
  padding-bottom: 1.25rem;
}

.changelog-entry::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.35rem;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: var(--md-default-bg-color);
  border: 2px solid var(--md-default-fg-color--lightest);
  transition: border-color 0.2s ease;
  z-index: 1;
}

.changelog-entry:hover::before {
  border-color: var(--md-primary-fg-color);
}

.changelog-entry--milestone {
  padding-bottom: 0;
}

.changelog-entry h3 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.15rem;
}

.changelog-entry h3 a {
  color: inherit;
  text-decoration: none;
}

.changelog-entry h3 a:hover {
  color: var(--md-accent-fg-color);
}

.changelog-entry p {
  font-size: 0.775rem;
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
  line-height: 1.5;
}

.md-typeset .changelog-entry img:not(.shopify-badge--light):not(.shopify-badge--dark) {
  margin-left: 0;
  margin-right: auto;
}


/* ---------- Date Label (left of timeline) ---------- */

.changelog-date {
  position: absolute;
  left: -7.5rem;
  top: 0;
  width: 5.5rem;
  text-align: right;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--md-default-fg-color--light);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* ---------- Changelog Filter ----------
   Renders inside Material's right-hand TOC sidebar on the What's New page
   (the JS replaces the auto-generated 'On this page' list). Material handles
   the sticky positioning and width; we only style the radio list itself. */

.changelog-filter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  margin-top: 6rem;
}

.changelog-filter__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--md-default-fg-color--light);
  margin-bottom: 0.2rem;
}

.changelog-filter__option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
  cursor: pointer;
  user-select: none;
  line-height: 1.4;
}

.changelog-filter__option input[type="radio"] {
  margin: 0;
  cursor: pointer;
  accent-color: var(--md-primary-fg-color);
}

.changelog-filter__option:has(input[type="radio"]:checked) {
  color: var(--md-default-fg-color);
  font-weight: 500;
}

.changelog-filter__clear {
  margin-top: 0.6rem;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.75rem;
  color: var(--md-primary-fg-color);
  cursor: pointer;
  text-align: left;
}

.changelog-filter__clear:hover {
  text-decoration: underline;
}

.changelog-entry--hidden {
  display: none;
}

/* ---------- Category Badges ---------- */

.changelog-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-top: 0.15rem;
}

.changelog-category {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--md-default-fg-color--light);
  background-color: rgba(114, 47, 55, 0.04);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.3rem;
  margin-top: 0.15rem;
  vertical-align: middle;
}

[data-md-color-scheme="slate"] .changelog-category {
  background-color: rgba(201, 117, 138, 0.06);
}

.changelog-badge--new {
  background-color: #d4edda;
  color: #155724;
}

.changelog-badge--improved {
  background-color: #cce5ff;
  color: #004085;
}

.changelog-badge--fixed {
  background-color: #fff3cd;
  color: #856404;
}

/* ---------- Dark Mode ---------- */

[data-md-color-scheme="slate"] .changelog-badge--new {
  background-color: rgba(40, 167, 69, 0.2);
  color: #81c784;
}

[data-md-color-scheme="slate"] .changelog-badge--improved {
  background-color: rgba(33, 150, 243, 0.2);
  color: #90caf9;
}

[data-md-color-scheme="slate"] .changelog-badge--fixed {
  background-color: rgba(255, 152, 0, 0.2);
  color: #ffb74d;
}

/* ---------- Mobile: hide timeline, inline dates ---------- */

@media (max-width: 768px) {
  .changelog {
    padding-left: 0;
  }

  .changelog::before {
    display: none;
  }

  .changelog-entry::before {
    display: none;
  }

  .changelog-date {
    position: static;
    width: auto;
    text-align: left;
    display: inline;
    margin-right: 0.5rem;
  }

  .changelog-entry + .changelog-entry {
    border-top: 1px solid var(--md-default-fg-color--lightest);
    padding-top: 1.25rem;
  }
}
