/*
 * Shared page-scoped styles for the Artway information pages:
 *   /shipping/  /returns/  /ts-cs  /modern-slavery-statement/
 * Linked via {{cdn 'assets/css/pages/info-pages.css'}} in each page's head partial.
 * Everything is scoped under .aw-page so nothing leaks into the wider theme.
 */

/* =========================================================================
   REQUIRED BC CUSTOM-PAGE FIXES
   =========================================================================
   1. Container breakout — BC wraps non-home pages in <div class="container">,
      capping width and centring. Override so .aw-page spans the full viewport.
   2. Footer-gap removal — BC leaves a bottom margin that opens a gap above
      the footer on custom pages.
   ========================================================================= */
.body > .container:has(> .aw-page) {
  max-width: none;
  padding: 0;
  width: 100%;
}

.body:has(> .container > .aw-page) {
  margin-bottom: 0;
}

/* =========================================================================
   TOKENS — Artway brand palette
   ========================================================================= */
.aw-page {
  --ink: #1a1a1a;
  --mute: #5a5a5a;
  --accent: #00aeee;
  --accent-deep: #0b7196;
  --cta: #721313;
  --cta-dark: #501313;
  --line: #e6e2d8;
  --soft: #f5f3ee;
  --white: #fff;
  --pale-white: #f0ede7;
}

/* =========================================================================
   BASE — resets against BC global styles
   =========================================================================
   The theme's common_style.scss applies these globally, which bleed in:
     h1–h6  { font-weight: normal; margin: 0 0 20px; }
     p      { font-size: 14px; margin: 0 0 20px; line-height: 24px; }
     a      { color: #721313; }
     li     { margin-bottom: 10px; line-height: 18px; list-style: none; }
   ========================================================================= */
.aw-page {
  margin: 0;
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}

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

.aw-page h1,
.aw-page h2,
.aw-page h3 {
  text-transform: none;
  font-weight: 700;
  margin: 0;
  padding: 0;
  color: var(--ink);
  line-height: 1.2;
}

.aw-page p {
  font-size: inherit;
  line-height: inherit;
  margin: 0 0 16px;
}

.aw-page p:last-child {
  margin-bottom: 0;
}

.aw-page a {
  color: var(--accent-deep);
  text-decoration: underline;
  transition: color 0.15s ease;
}

.aw-page a:hover,
.aw-page a:focus {
  color: var(--cta);
}

.aw-page ul,
.aw-page ol {
  margin: 0;
  padding: 0;
}

.aw-page li {
  margin-bottom: 0;
  line-height: inherit;
  list-style: none;
}

.aw-page .container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 479px) {
  .aw-page .container {
    padding: 0 16px;
  }
}

/* =========================================================================
   HERO
   ========================================================================= */
.aw-page .hero {
  background: var(--pale-white);
  padding: 56px 0;
}

.aw-page .hero h1 {
  font-size: 42px;
  line-height: 1.15;
  margin: 0 0 16px;
}

.aw-page .hero-lead {
  font-size: 19px;
  color: var(--mute);
  margin: 0 0 16px;
  max-width: 760px;
}

.aw-page .hero-lead:last-child {
  margin-bottom: 0;
}

.aw-page .updated {
  font-size: 14px;
  color: var(--mute);
  margin: 0;
}

/* Pages with no table of contents get a centred hero header */
.aw-page:not(:has(.toc)) .hero {
  text-align: center;
}

.aw-page:not(:has(.toc)) .hero-lead {
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================================
   BODY LAYOUT
   ========================================================================= */
.aw-page .section {
  padding: 64px 0;
}

/* Two-column layout (sticky TOC + prose) for longer pages */
.aw-page .content-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}

/* Single-column prose (short pages with no TOC) */
.aw-page .container > .prose {
  margin: 0 auto;
}

/* Table of contents */
.aw-page .toc {
  position: sticky;
  top: 90px;
}

.aw-page .toc-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
  margin: 0 0 12px;
  font-weight: 700;
}

.aw-page .toc nav {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--line);
}

.aw-page .toc nav a {
  color: var(--mute);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 0 7px 16px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  line-height: 1.4;
}

.aw-page .toc nav a:hover,
.aw-page .toc nav a.is-active {
  color: var(--ink);
  border-left-color: var(--accent-deep);
}

/* Prose blocks */
.aw-page .prose {
  max-width: 760px;
}

.aw-page .block {
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
}

.aw-page .block:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.aw-page .block h2 {
  font-size: 26px;
  margin: 0 0 16px;
  padding-top: 16px;
  position: relative;
}

.aw-page .block h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--accent-deep);
}

.aw-page .block h3 {
  font-size: 18px;
  margin: 24px 0 10px;
}

/* Bulleted lists — list-style:none on both ul and li so the theme's native
   disc marker can't render alongside our custom ::before dot. */
.aw-page ul.bullets {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.aw-page ul.bullets li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  line-height: 1.55;
  list-style: none;
}

.aw-page ul.bullets li:last-child {
  margin-bottom: 0;
}

.aw-page ul.bullets li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-deep);
}

/* Numbered lists — custom counter so it survives the theme's list-style:none */
.aw-page ol.numbered {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  counter-reset: item;
}

.aw-page ol.numbered > li {
  position: relative;
  padding-left: 38px;
  margin-bottom: 14px;
  line-height: 1.55;
  list-style: none;
}

.aw-page ol.numbered > li:last-child {
  margin-bottom: 0;
}

.aw-page ol.numbered > li::before {
  counter-increment: item;
  content: counter(item);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================================
   TABLE (e.g. privacy policy legal-basis table)
   ========================================================================= */
.aw-page .table-wrap {
  overflow-x: auto;
}

.aw-page .basis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.aw-page .basis-table th,
.aw-page .basis-table td {
  text-align: left;
  padding: 12px 16px;
  border: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.5;
}

.aw-page .basis-table thead th {
  background: var(--soft);
  font-weight: 700;
}

.aw-page .basis-table td:last-child {
  white-space: nowrap;
  font-weight: 700;
  color: var(--accent-deep);
}

/* Company / signature details block */
.aw-page .details-block {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 24px;
  font-size: 15px;
  line-height: 1.7;
}

.aw-page .signature {
  margin-top: 8px;
  font-size: 16px;
}

.aw-page .signature strong {
  display: block;
  font-weight: 700;
}

/* =========================================================================
   GENERIC EDITOR-DRIVEN PAGES (info-page.html)
   =========================================================================
   Styles raw HTML typed into the BigCommerce WYSIWYG editor, scoped to
   .prose--editor so the hand-built (class-based) pages are unaffected.
   The TOC is built by JS from the H2s; layout adapts via :has().
   ========================================================================= */

/* Auto layout: two columns when a TOC exists, single centred column when it
   doesn't (JS removes the .toc element when there are fewer than 2 headings). */
.aw-page .content-grid:not(:has(.toc)) {
  display: block;
}

.aw-page .content-grid:not(:has(.toc)) .prose {
  margin: 0 auto;
}

/* Section headings */
.aw-page .prose--editor h2 {
  font-size: 26px;
  margin: 48px 0 16px;
  padding-top: 16px;
  position: relative;
  scroll-margin-top: 90px;
}

.aw-page .prose--editor h2:first-child {
  margin-top: 0;
}

.aw-page .prose--editor h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--accent-deep);
}

.aw-page .prose--editor h3 {
  font-size: 18px;
  margin: 24px 0 10px;
}

.aw-page .prose--editor p {
  margin: 0 0 16px;
}

.aw-page .prose--editor a {
  color: var(--accent-deep);
  text-decoration: underline;
}

.aw-page .prose--editor a:hover,
.aw-page .prose--editor a:focus {
  color: var(--cta);
}

/* Bulleted lists — custom dot, no native marker */
.aw-page .prose--editor ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.aw-page .prose--editor ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  line-height: 1.55;
  list-style: none;
}

.aw-page .prose--editor ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-deep);
}

/* Numbered lists — custom counter (survives the theme's list-style:none) */
.aw-page .prose--editor ol {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  counter-reset: item;
}

.aw-page .prose--editor ol > li {
  position: relative;
  padding-left: 38px;
  margin-bottom: 14px;
  line-height: 1.55;
  list-style: none;
}

.aw-page .prose--editor ol > li::before {
  counter-increment: item;
  content: counter(item);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tables typed in the editor */
.aw-page .prose--editor table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 0 0 16px;
}

.aw-page .prose--editor th,
.aw-page .prose--editor td {
  text-align: left;
  padding: 12px 16px;
  border: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.5;
}

.aw-page .prose--editor thead th {
  background: var(--soft);
  font-weight: 700;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 860px) {
  .aw-page .content-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .aw-page .toc {
    position: static;
  }

  .aw-page .toc nav {
    border-left: 0;
  }

  .aw-page .toc nav a {
    border-left: 0;
    padding-left: 0;
  }

  .aw-page .toc nav a.is-active {
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .aw-page .hero {
    padding: 40px 0;
  }

  .aw-page .hero h1 {
    font-size: 28px;
  }

  .aw-page .hero-lead {
    font-size: 16px;
  }

  .aw-page .section {
    padding: 40px 0;
  }

  .aw-page .block h2 {
    font-size: 22px;
  }

  .aw-page .basis-table td:last-child {
    white-space: normal;
  }

  .aw-page .prose--editor h2 {
    font-size: 22px;
    margin-top: 36px;
  }
}
