/* ============================================================
   Instaloop — shared styles for the content pages
   (Help Centre, Refund Policy, Privacy Policy, Terms of Service)

   Loaded *after* styles.css, so it inherits the tokens, nav,
   buttons and footer from the landing page and only adds what
   these long-form pages need.
   ============================================================ */

/* ---------------- page header ---------------- */
.page-hero{
  padding:72px 0 56px;
  background:var(--cream);
  border-bottom:1px solid #F0E6D4;
}
.page-hero .container{ max-width:900px; }
.page-kicker{
  color:var(--amber-deep); font-size:12.5px; font-weight:600; letter-spacing:.12em;
  text-transform:uppercase;
}
.page-title{
  margin-top:14px;
  font-size:clamp(32px, 4.4vw, 54px); font-weight:700;
  letter-spacing:-.03em; line-height:1.08;
}
.page-lede{ margin-top:18px; color:#5A5348; font-size:17px; max-width:60ch; }
.page-updated{
  margin-top:22px; display:inline-block;
  background:#fff; border:1px solid #EFE2CC; border-radius:999px;
  padding:7px 15px; font-size:13px; font-weight:500; color:#6B6257;
}

/* ---------------- two-column doc layout ---------------- */
.doc-layout{
  display:grid; grid-template-columns:250px minmax(0, 1fr);
  gap:64px; align-items:start;
  /* padding-block only — this element is also .container, and the shorthand
     would wipe out its padding-inline and push content to the screen edge */
  padding-block:64px 96px;
}

.toc{ position:sticky; top:118px; }
.toc h2{
  font-size:12.5px; font-weight:600; letter-spacing:.12em;
  text-transform:uppercase; color:var(--grey-2);
}
.toc ol{ margin-top:16px; display:grid; gap:2px; counter-reset:none; }
.toc a{
  display:block; padding:7px 12px; border-radius:9px;
  font-size:14px; line-height:1.4; color:var(--grey);
  border-left:2px solid transparent;
}
.toc a:hover{ background:#F7F7F7; color:var(--ink); }
.toc a.is-active{
  background:var(--cream); color:var(--ink); font-weight:600;
  border-left-color:var(--amber);
}

/* ---------------- long-form body ---------------- */
/* min-width:0 — as a grid item this defaults to min-width:auto, which refuses
   to shrink below the widest thing inside it. The retention table sets
   min-width:520px, so without this the whole page widens past a phone screen
   instead of letting the table scroll inside its own wrapper. */
.doc{ max-width:76ch; min-width:0; }
.toc{ min-width:0; }
.doc > p:first-child{ margin-top:0; }
.doc p{ margin-top:16px; color:#3F3F3F; font-size:16px; line-height:1.72; }
.doc section{ scroll-margin-top:120px; }
.doc section + section{ margin-top:52px; }

.doc h2{
  font-size:clamp(22px, 2.3vw, 27px); font-weight:700;
  letter-spacing:-.02em; line-height:1.25;
  padding-bottom:14px; border-bottom:1px solid var(--line);
}
.doc h3{
  margin-top:34px; font-size:17.5px; font-weight:600; letter-spacing:-.01em;
}
.doc h2 + p, .doc h2 + ul{ margin-top:18px; }

.doc ul{ margin-top:16px; display:grid; gap:10px; }
.doc ul li{
  position:relative; padding-left:24px;
  color:#3F3F3F; font-size:16px; line-height:1.7;
}
.doc ul li::before{
  content:""; position:absolute; left:6px; top:11px;
  width:6px; height:6px; border-radius:50%; background:var(--amber);
}
.doc ol.doc-steps{ margin-top:16px; display:grid; gap:10px; counter-reset:step; }
.doc ol.doc-steps li{
  position:relative; padding-left:34px;
  color:#3F3F3F; font-size:16px; line-height:1.7;
  counter-increment:step;
}
.doc ol.doc-steps li::before{
  content:counter(step);
  position:absolute; left:0; top:3px;
  width:22px; height:22px; border-radius:50%;
  background:var(--cream-2); color:var(--amber-deep);
  display:grid; place-items:center;
  font-size:12px; font-weight:700;
}

.doc strong{ font-weight:600; color:var(--ink); }
.doc a:not(.btn){
  color:var(--amber-deep); text-decoration:underline; text-underline-offset:3px;
}
.doc a:not(.btn):hover{ color:var(--ink); }

/* the all-caps disclaimer paragraphs in the Terms */
.doc .legalese{
  margin-top:18px; font-size:14px; line-height:1.75; color:#4A4A4A;
  background:#FAFAFA; border:1px solid var(--line); border-radius:12px;
  padding:18px 20px;
}

/* callout for "email us at ..." style blocks */
.doc .callout{
  margin-top:22px;
  background:var(--cream); border:1px solid #F0E6D4; border-radius:var(--radius-md);
  padding:22px 24px;
}
.doc .callout p{ margin-top:8px; }
.doc .callout p:first-child{ margin-top:0; }
.doc .callout h3{ margin-top:0; }

/* retention table in the Privacy Policy */
.doc-table-wrap{ margin-top:20px; overflow-x:auto; }
.doc-table{
  width:100%; border-collapse:collapse; font-size:15px; min-width:520px;
}
.doc-table th, .doc-table td{
  text-align:left; vertical-align:top;
  padding:13px 16px; border-bottom:1px solid var(--line);
  line-height:1.6;
}
.doc-table th{
  font-weight:600; font-size:13px; letter-spacing:.04em; text-transform:uppercase;
  color:var(--grey-2); background:#FAFAFA;
}
.doc-table td:first-child{ font-weight:600; color:var(--ink); width:34%; }

/* ============================================================
   HELP CENTRE
   ============================================================ */
.help-search{ margin-top:28px; max-width:560px; position:relative; }
.help-search input{
  width:100%; font:inherit; font-size:16px; color:var(--ink);
  background:#fff; border:1px solid #E6DAC6; border-radius:999px;
  padding:16px 20px 16px 50px;
}
.help-search input:focus{
  outline:none; border-color:var(--amber); box-shadow:0 0 0 3px rgba(245,179,1,.18);
}
.help-search input::placeholder{ color:#B4ADA2; }
.help-search svg{
  position:absolute; left:19px; top:50%; transform:translateY(-50%);
  width:19px; height:19px; color:#A79E90; pointer-events:none;
}

/* padding-block only — see the note on .doc-layout */
.help-main{ padding-block:56px 96px; }

.help-count{
  font-size:14.5px; color:var(--grey); margin-bottom:26px;
}
.help-count[hidden]{ display:none; }

.help-empty{
  border:1px dashed #DDD5C6; border-radius:var(--radius-md);
  padding:44px 24px; text-align:center; color:var(--grey);
}
.help-empty[hidden]{ display:none; }
.help-empty strong{ display:block; font-size:17px; color:var(--ink); margin-bottom:8px; }

/* category jump grid */
.help-nav{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr));
  gap:12px; margin-bottom:56px;
}
.help-nav a{
  display:flex; align-items:center; gap:11px;
  border:1px solid var(--line); border-radius:12px;
  padding:14px 16px; font-size:14.5px; font-weight:500;
  transition:border-color .15s ease, background .15s ease, transform .15s ease;
}
.help-nav a:hover{ border-color:#D8D8D8; background:#FCFCFC; transform:translateY(-1px); }
.help-nav .n{
  flex:0 0 26px; width:26px; height:26px; border-radius:8px;
  background:var(--cream-2); color:var(--amber-deep);
  display:grid; place-items:center; font-size:12px; font-weight:700;
}

.help-cat{ scroll-margin-top:120px; }
.help-cat + .help-cat{ margin-top:56px; }
.help-cat[hidden]{ display:none; }
.help-cat-head{ display:flex; align-items:flex-start; gap:14px; }
.help-cat-head .n{
  flex:0 0 34px; width:34px; height:34px; border-radius:10px;
  background:var(--amber-soft); color:var(--ink);
  display:grid; place-items:center; font-size:14px; font-weight:700;
  margin-top:2px;
}
.help-cat h2{ font-size:23px; font-weight:700; letter-spacing:-.02em; }
.help-cat-head p{ margin-top:6px; color:var(--grey); font-size:15px; }

.help-sub{
  margin-top:26px; font-size:13px; font-weight:600;
  letter-spacing:.1em; text-transform:uppercase; color:var(--grey-2);
}

.help-list{ margin-top:18px; border-top:1px solid var(--line); }
.help-list details{ border-bottom:1px solid var(--line); }
.help-list details[hidden]{ display:none; }
.help-list summary{
  list-style:none; cursor:pointer;
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  padding:17px 2px;
  font-size:15.5px; font-weight:500; letter-spacing:-.005em;
}
.help-list summary::-webkit-details-marker{ display:none; }
.help-list summary:hover{ color:var(--amber-deep); }
/* chevron drawn in CSS — there are ~150 of these, so it stays out of the markup */
.help-list summary::after{
  content:""; flex:0 0 18px; width:18px; height:18px; opacity:.5;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / 18px;
  transition:transform .18s ease, opacity .18s ease;
}
.help-list details[open] summary::after{ transform:rotate(180deg); opacity:1; }
.help-list details > div{
  padding:0 40px 20px 2px;
  color:var(--grey); font-size:15px; line-height:1.7;
}
.help-list details > div p + p{ margin-top:12px; }
.help-list details ul{ margin-top:12px; display:grid; gap:8px; }
.help-list details ul li{ position:relative; padding-left:20px; }
.help-list details ul li::before{
  content:""; position:absolute; left:4px; top:9px;
  width:5px; height:5px; border-radius:50%; background:var(--amber);
}
.help-list details a{ color:var(--amber-deep); text-decoration:underline; text-underline-offset:3px; }

/* mark the search hit */
.help-list mark{ background:#FEF187; color:inherit; border-radius:3px; padding:0 2px; }

/* ---------------- contact support ---------------- */
.support{
  margin-top:80px; scroll-margin-top:120px;
  background:var(--cream); border-radius:var(--radius-lg);
  padding:48px 44px;
}
.support h2{ font-size:clamp(24px, 2.6vw, 32px); font-weight:700; letter-spacing:-.025em; }
.support > p{ margin-top:12px; color:#5A5348; font-size:16px; max-width:52ch; }

.support-form{
  margin-top:30px; display:grid; grid-template-columns:1fr 1fr; gap:0 20px;
  max-width:720px;
}
.support-form .field{ margin-top:18px; }
.support-form .field-wide{ grid-column:1 / -1; }
.support-form textarea{
  width:100%; font:inherit; font-size:15.5px; color:var(--ink);
  background:#fff; border:1px solid #E0DAD0; border-radius:12px;
  padding:13px 14px; min-height:132px; resize:vertical;
}
.support-form textarea:focus{
  outline:none; border-color:var(--amber); box-shadow:0 0 0 3px rgba(245,179,1,.18);
}
.support-form textarea::placeholder{ color:#B4ADA2; }
.support-actions{ grid-column:1 / -1; margin-top:26px; }
.support-actions .btn{ padding:16px 34px; font-size:16px; }
.support-note{
  grid-column:1 / -1; margin-top:16px;
  font-size:13.5px; color:#6B6257; line-height:1.6;
}
.support-note a{ color:var(--amber-deep); text-decoration:underline; text-underline-offset:3px; }

/* ---------------- cross-links between the policy pages ---------------- */
.doc-more{ margin-top:64px; padding-top:34px; border-top:1px solid var(--line); }
.doc-more h2{ font-size:15px; font-weight:600; letter-spacing:.02em; border:0; padding:0; }
.doc-more-grid{
  margin-top:18px; display:grid;
  grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:12px;
}
.doc-more-grid a{
  border:1px solid var(--line); border-radius:12px; padding:16px 18px;
  font-size:14.5px; font-weight:500;
  transition:border-color .15s ease, background .15s ease;
}
.doc-more-grid a:hover{ border-color:#D8D8D8; background:#FCFCFC; }
.doc-more-grid a span{ display:block; margin-top:4px; font-size:13px; font-weight:400; color:var(--grey-2); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:980px){
  .doc-layout{ grid-template-columns:minmax(0, 1fr); gap:0; padding-block:44px 72px; }
  .toc{
    position:static; margin-bottom:38px;
    border:1px solid var(--line); border-radius:var(--radius-md); padding:18px 16px;
  }
  .toc ol{
    display:flex; flex-wrap:wrap; gap:6px;
    max-height:196px; overflow-y:auto;
  }
  /* padding tuned so each pill clears 40px tall — they are the only touch
     targets on these pages, and at 6px they came out at 33px. */
  .toc a{ border-left:0; border:1px solid var(--line); border-radius:999px; padding:10px 14px; font-size:13.5px; }
  .toc a.is-active{ border-color:var(--amber); }
}

@media (max-width:860px){
  .page-hero{ padding:44px 0 40px; }
  .page-lede{ font-size:16px; }

  .doc{ max-width:none; }
  .doc p, .doc ul li, .doc ol.doc-steps li{ font-size:15.5px; }
  .doc section + section{ margin-top:40px; }

  .help-main{ padding-block:40px 72px; }
  .help-nav{ grid-template-columns:1fr; gap:10px; margin-bottom:40px; }
  .help-cat + .help-cat{ margin-top:44px; }

  .support{ margin-top:56px; padding:32px 20px; border-radius:var(--radius-md); }
  .support-form{ grid-template-columns:1fr; }
  /* 16px minimum: iOS Safari zooms the whole page in when you focus an input
     with a smaller font, and the user has to pinch back out afterwards. */
  .support-form input,
  .support-form select,
  .support-form textarea,
  .help-search input{ font-size:16px; }
}
