/* ============================================================
   Instagram grid maker tool (tool-instagram-grid-maker.php)
   2026-07-26 · V2 language, .gm- namespace, no other stylesheet needed.
   ============================================================ */

.gm {
  --gm-ink: #464646;
  --gm-body: #666;
  --gm-orange: #ff6900;
  --gm-cream: #fcfaf4;
  --gm-line: #e9e2d8;
  --gm-peach: #ffdda5;
  --gm-lav: #e7e2f6;
  --gm-powder: #cfdcf3;
  --gm-radius: 20px;
  --gm-font-display: "Bricolage Grotesque", "DM Sans", sans-serif;
  --gm-font-body: "DM Sans", -apple-system, sans-serif;
  font-family: var(--gm-font-body);
  color: var(--gm-body);
  background: var(--gm-cream);
  font-size: 16px;
  line-height: 1.55;
}
.gm-container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.gm-h1 { font-family: var(--gm-font-display); font-weight: 800; font-size: clamp(36px, 4vw, 54px); line-height: 1.12; color: var(--gm-ink); margin: 0 0 14px; }
.gm-h2 { font-family: var(--gm-font-display); font-weight: 700; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.18; color: var(--gm-ink); margin: 0 0 22px; }
.gm h3 { font-family: var(--gm-font-display); font-weight: 700; font-size: 19px; color: var(--gm-ink); margin: 0 0 6px; }
.gm-arrow { flex: 0 0 auto; }

/* ---- Buttons ---- */
.gm-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; line-height: 1; padding: 14px 24px; border-radius: 12px; text-decoration: none; border: 1.5px solid var(--gm-ink); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.gm-btn:active { transform: translateY(1px); }
/* #ff6900 with white text is 2.89:1 and fails WCAG AA for BOTH normal and
   large text (measured 2026-07-28, codex tri-review). The deep brand orange
   is 4.79:1 and passes. This file already used #c24e00 for the diagram cell
   for the same reason; the button was missed. */
.gm-btn-primary { background: #c24e00; color: #fff; box-shadow: 3px 3px 0 var(--gm-ink); }
.gm-btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 4px 4px 0 var(--gm-ink); }
.gm-btn-outline { background: #fff; color: var(--gm-ink); box-shadow: 3px 3px 0 var(--gm-ink); }
.gm-btn-outline:hover { color: var(--gm-ink); transform: translateY(-1px); box-shadow: 4px 4px 0 var(--gm-ink); }

/* ---- Hero + tool ---- */
.gm-hero { padding: 64px 0 40px; }
.gm-sub { font-size: 18px; max-width: 62ch; margin: 0 0 30px; }
.gm-tool { background: #fff; border: 1.5px solid var(--gm-ink); border-radius: var(--gm-radius); box-shadow: 5px 5px 0 rgba(70, 70, 70, .16); padding: 28px; }
.gm-tool-controls { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }

.gm-dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 190px; padding: 24px; text-align: center; border: 2px dashed #cfc7b6; border-radius: 16px; background: var(--gm-cream); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.gm-dropzone:hover, .gm-dropzone.is-over { border-color: var(--gm-orange); background: #fff6ed; }
.gm-dropzone:focus-within { outline: 3px solid var(--gm-orange); outline-offset: 2px; }
.gm-dropzone.has-image { border-style: solid; border-color: var(--gm-ink); }
.gm-dropzone-icon { color: var(--gm-ink); line-height: 0; }
.gm-dropzone-main { font-family: var(--gm-font-display); font-weight: 700; font-size: 17px; color: var(--gm-ink); }
.gm-dropzone-hint { font-size: 14px; color: var(--gm-body); }
.gm-source-name { font-size: 13.5px; color: var(--gm-ink); font-weight: 700; word-break: break-all; }
/* Visually hidden but still focusable and clickable via the label. */
.gm-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.gm-rows { border: 0; margin: 0; padding: 0; }
.gm-rows-legend { font-family: var(--gm-font-display); font-weight: 700; font-size: 17px; color: var(--gm-ink); padding: 0; margin-bottom: 10px; }
.gm-rows-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-shape-note { margin: 8px 0 18px; font-size: 13.5px; }
.gm-row-btn { font-family: var(--gm-font-body); font-weight: 700; font-size: 15px; color: var(--gm-ink); background: #fff; border: 1.5px solid var(--gm-ink); border-radius: 10px; padding: 10px 14px; cursor: pointer; min-height: 44px; transition: background .15s ease, color .15s ease; }
.gm-row-btn:hover { background: var(--gm-peach); }
.gm-row-btn.is-active { background: var(--gm-ink); color: #fff; }

.gm-status { margin: 16px 0 0; font-size: 14.5px; min-height: 1.2em; }
.gm-status.is-error { color: #b3261e; font-weight: 700; }

.gm-result { margin-top: 22px; border-top: 1px solid var(--gm-line); padding-top: 22px; }
.gm-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.gm-tile-meta { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--gm-ink); }
.gm-grid { display: grid; grid-template-columns: repeat(var(--gm-cols, 3), 1fr); gap: 10px; }
.gm-tile { position: relative; border: 1.5px solid var(--gm-ink); border-radius: 12px; overflow: hidden; background: var(--gm-cream); }
.gm-tile img { display: block; width: 100%; height: auto; aspect-ratio: var(--gm-tile-aspect, 3 / 4); object-fit: cover; background: var(--gm-cream); }
.gm-tile-badge { position: absolute; top: 8px; left: 8px; background: var(--gm-ink); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 20px; }
/* Always visible: this is the primary action per tile, so it must not hide
   behind hover (and hover does not exist on touch at all). */
.gm-tile-dl { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.94); color: var(--gm-ink); border: 1.5px solid var(--gm-ink); border-radius: 8px; font-size: 13px; font-weight: 700; padding: 7px 12px; cursor: pointer; min-height: 34px; box-shadow: 2px 2px 0 rgba(70,70,70,.25); transition: background .15s ease; }
.gm-tile-dl:hover { background: var(--gm-peach); }
.gm-order-note { margin: 18px 0 0; font-size: 14.5px; }

/* ---- How it works + posting-order diagram (asymmetric; shares no layout
        family with any other section on the page) ---- */
.gm-how { padding: 44px 0 24px; }
.gm-how-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: start; }

/* Connected vertical flow, not a row of equal cards. */
.gm-flow { list-style: none; counter-reset: gm; margin: 0; padding: 0; position: relative; }
.gm-flow li { counter-increment: gm; position: relative; padding: 0 0 26px 56px; }
.gm-flow li:last-child { padding-bottom: 0; }
.gm-flow li::before { content: counter(gm); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 38px; height: 38px; background: #fff; border: 1.5px solid var(--gm-ink); border-radius: 50%; font-family: var(--gm-font-display); font-weight: 700; font-size: 16px; color: var(--gm-ink); box-shadow: 2px 2px 0 rgba(70,70,70,.2); z-index: 1; }
/* The connecting rule runs behind the markers. */
.gm-flow li:not(:last-child)::after { content: ""; position: absolute; left: 18.25px; top: 38px; bottom: 4px; width: 1.5px; background: var(--gm-line); }
.gm-flow p { margin: 0; font-size: 15.5px; max-width: 44ch; }

.gm-dia { background: linear-gradient(180deg, var(--gm-lav), #fff 88%); border: 1.5px solid var(--gm-ink); border-radius: var(--gm-radius); box-shadow: 5px 5px 0 rgba(70, 70, 70, .16); padding: 26px 28px 24px; }
.gm-dia-title { font-size: 20px; margin: 0 0 6px; }
.gm-dia-intro { margin: 0 0 18px; font-size: 15px; }
.gm-dia-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 264px; margin: 0 0 16px; }
.gm-dia-cell { display: grid; place-items: center; aspect-ratio: 3 / 4; background: #fff; border: 1.5px solid var(--gm-ink); border-radius: 10px; font-family: var(--gm-font-display); font-weight: 700; font-size: 19px; color: var(--gm-ink); }
/* Deep orange (brand token) not #ff6900: white-on-#ff6900 is ~2.9:1 and this
   cell carries meaning, so it needs to pass contrast. */
.gm-dia-cell.is-first { background: #c24e00; color: #fff; border-color: var(--gm-ink); }
.gm-dia-cell.is-last { background: var(--gm-ink); color: #fff; }
.gm-dia-key { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 16px; padding: 0; font-size: 14px; }
.gm-dia-key li { display: flex; align-items: center; gap: 7px; }
.gm-dia-swatch { width: 14px; height: 14px; border: 1.5px solid var(--gm-ink); border-radius: 4px; }
.gm-dia-swatch.is-first { background: #c24e00; }
.gm-dia-swatch.is-last { background: var(--gm-ink); }
.gm-inline-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--gm-ink); text-decoration: none; border-bottom: 2px solid var(--gm-orange); }
.gm-inline-link:hover { color: var(--gm-orange); }

/* ---- Product bridge ---- */
.gm-bridge { padding: 24px 0; }
.gm-bridge-card { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; background: linear-gradient(180deg, var(--gm-peach), #fff 90%); border: 1.5px solid var(--gm-ink); border-radius: var(--gm-radius); box-shadow: 5px 5px 0 rgba(70, 70, 70, .16); padding: 34px; }
.gm-bridge-text p { margin: 0 0 16px; }
.gm-bridge-list { list-style: none; margin: 0 0 22px; padding: 0; }
.gm-bridge-list li { position: relative; padding-left: 26px; margin: 9px 0; color: var(--gm-ink); font-size: 15.5px; }
.gm-bridge-list li::before { content: ""; position: absolute; left: 0; top: 4px; width: 15px; height: 15px; border: 1.5px solid var(--gm-ink); border-radius: 4px; background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10"><path d="M2 5.2 4.2 7.4 8 3" fill="none" stroke="%23ff6900" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>') center/9px no-repeat; }
.gm-bridge-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.gm-bridge-media img { display: block; width: 100%; height: auto; }

/* ---- FAQ (same proven pattern as the hub) ---- */
.gm-faq { padding: 34px 0 8px; }
.gm-faq-card { background: #fff; border: 1.5px solid var(--gm-ink); border-radius: var(--gm-radius); box-shadow: 5px 5px 0 rgba(70, 70, 70, .16); padding: 32px 36px; }
.gm-faq-acc { width: 100%; }
.gm-faq-acc .accordion-content-wrapper { display: none; }
.gm-faq-acc .brx-open .accordion-content-wrapper { display: block; }
.gm-faq-acc > .brxe-block { border-bottom: 1px solid var(--gm-line); }
.gm-faq-acc > .brxe-block:last-child { border-bottom: 0; }
.gm-faq-acc .accordion-title-wrapper { cursor: pointer; position: relative; padding: 20px 44px 20px 4px; text-align: left; }
.gm-faq-acc .brxe-heading { font-family: var(--gm-font-body); font-weight: 700; font-size: 17px; line-height: 1.35; color: var(--gm-ink); margin: 0; }
.gm-chevron { position: absolute; right: 8px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); transition: transform .2s ease; background: var(--gm-ink); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") center/contain no-repeat; }
.gm-faq-acc .brx-open .gm-chevron { transform: translateY(-50%) rotate(180deg); }
.gm-faq-body { padding: 0 4px 18px; font-size: 15.5px; max-width: 75ch; text-align: left; }

/* ---- More tools: slim band (deliberately NOT another card row) ---- */
.gm-more { padding: 30px 0 80px; }
.gm-more-band { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 28px; border-top: 1.5px solid var(--gm-ink); padding-top: 20px; }
.gm-more-title { font-family: var(--gm-font-display); font-weight: 700; font-size: 17px; color: var(--gm-ink); margin: 0; }
.gm-more-links { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; }
.gm-more-links a { font-weight: 700; font-size: 15.5px; color: var(--gm-ink); text-decoration: none; border-bottom: 1px solid transparent; }
.gm-more-links a:hover { color: var(--gm-orange); border-bottom-color: var(--gm-orange); }

@media (prefers-reduced-motion: reduce) {
  .gm-btn, .gm-tile-dl, .gm-more-card, .gm-row-btn, .gm-dropzone { transition: none; }
}

/* ---- Tablet ---- */
@media (max-width: 900px) {
  .gm-tool-controls { grid-template-columns: 1fr; }
  .gm-how-inner { grid-template-columns: 1fr; gap: 30px; }
  .gm-bridge-card { grid-template-columns: 1fr; }
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .gm-hero { padding: 40px 0 24px; }
  .gm-tool { padding: 18px; }
  .gm-dia, .gm-bridge-card { padding: 22px; }
  .gm-faq-card { padding: 22px 18px; }
  .gm-result-head { flex-direction: column; align-items: stretch; }
  .gm-result-head .gm-btn { justify-content: center; }
}
