/* Aesthetic Caption Generator — page-specific only */

.caption-shell {
  width: min(1050px,calc(100% - 32px));
  margin-inline: auto;
}

.reading-shell {
  width: min(900px,calc(100% - 32px));
  margin-inline: auto;
}

.caption-hero {
  padding: 58px 0 70px;
  overflow: hidden;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 52px;
  align-items: center;
}

.hero-copy h1 {
  margin: 18px 0 20px;
  font-size: clamp(3rem,7vw,5.4rem);
  line-height: .94;
  letter-spacing: -.065em;
}

.hero-lead {
  max-width: 670px;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-proof span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.hero-proof strong {
  color: var(--text);
  font-size: 12px;
}

.hero-preview {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: rotate(1deg);
}

.preview-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}

.preview-top span {
  font-size: 12px;
  font-weight: 850;
}

.preview-top small {
  color: var(--muted);
  font-size: 12px;
}

.hero-preview>button {
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: left;
}

.studio-section {
  padding: 22px 0 84px;
}

.studio-heading {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  margin-bottom: 16px;
}

.studio-heading h2 {
  margin: 0;
  font-size: clamp(2rem,4vw,3rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.studio-heading>p {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.caption-studio {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.studio-sticky-controls {
  position: sticky;
  top: var(--header-height,72px);
  z-index: 30;
  border-bottom: 1px solid var(--line);
  border-radius: 26px 26px 0 0;
  background: color-mix(in srgb,var(--surface) 96%,transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(220px,1.3fr) repeat(3,minmax(120px,.65fr)) auto;
  gap: 9px;
  padding: 13px 13px 8px;
}

.field label {
  display: flex;
  justify-content: space-between;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.field label span {
  color: var(--muted);
  font-weight: 700;
}

.field input,.field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.generate-button {
  align-self: end;
  min-height: 44px;
  white-space: nowrap;
}

.option-row {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 0 13px 13px;
}

.toggle-option,.mini-action {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.toggle-option input {
  accent-color: var(--primary);
}

.mini-action {
  cursor: pointer;
  font: inherit;
}

.mini-action.active {
  background: var(--text);
  color: var(--bg);
}

.mini-action b {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 12px;
}

.studio-body {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  align-items: start;
}

.results-pane {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
}

.results-head span {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.results-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.result-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.result-actions>span {
  color: var(--muted);
  font-size: 12px;
}

.result-actions>span strong {
  color: var(--text);
}

.result-actions button {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.caption-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}

.caption-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: .15s;
}

.caption-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb,var(--primary) 32%,var(--line));
  box-shadow: var(--shadow-sm);
}

.caption-copy {
  width: 100%;
  min-height: 118px;
  padding: 15px 12px 33px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.caption-value {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
}

.caption-meta {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.copy-state {
  position: absolute;
  left: 11px;
  bottom: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.caption-fav {
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

.caption-fav.is-favorite {
  color: var(--accent);
}

.empty-state {
  padding: 70px 20px;
  text-align: center;
}

.empty-state>span {
  font-size: 28px;
  color: var(--primary);
}

.empty-state p {
  color: var(--muted);
  font-size: 12px;
}

.preview-panel {
  position: sticky;
  top: calc(var(--header-height,72px) + 128px);
  padding: 18px;
  background: linear-gradient(160deg,var(--surface-2),var(--surface));
  border-radius: 0 0 26px 0;
}

.preview-panel-head {
  display: flex;
  justify-content: space-between;
}

.preview-panel-head span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.preview-panel-head button {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.post-preview {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.preview-photo {
  height: 145px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg,var(--surface-3),var(--surface-2));
  border: 1px solid var(--line);
}

.preview-photo span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 900;
}

.preview-account {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
}

.post-preview p {
  margin: 9px 0 6px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-line;
}

.post-preview small {
  color: var(--muted);
  font-size: 12px;
}

.preview-copy {
  width: 100%;
  margin-top: 9px;
}

.tip-card {
  margin-top: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.tip-card strong {
  font-size: 12px;
}

.tip-card p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.tip-card a {
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.ideas-section {
  padding: 76px 0;
  background: var(--surface-3);
  border-block: 1px solid var(--line);
}

.idea-groups {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
}

.idea-groups article {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.idea-groups article>span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.idea-groups h3 {
  margin: 6px 0 7px;
  font-size: 15px;
  line-height: 1.35;
}

.idea-groups p {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.idea-groups button {
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.how-grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 34px;
}

.steps {
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.steps li>span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.steps strong {
  font-size: 12px;
}

.steps p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.difference-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.difference-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--primary);
  font-weight: 900;
}

.difference-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.related-section {
  background: var(--surface-3);
  border-block: 1px solid var(--line);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 10px;
}

.related-tool-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.related-tool-card strong,.related-tool-card small {
  display: block;
}

.related-tool-card small {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width:1040px) {
  .control-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .field-topic {
    grid-column: 1/-1;
  }
  .generate-button {
    grid-column: 1/-1;
  }
  .studio-body {
    grid-template-columns: 1fr;
  }
  .results-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .preview-panel {
    position: relative;
    top: auto;
  }
  .hero-layout {
    grid-template-columns: 1fr;
  }
  .hero-preview {
    max-width: 600px;
    width: 100%;
    margin-inline: auto;
    transform: none;
  }
  .idea-groups {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width:700px) {
  .caption-shell,.reading-shell {
    width: min(100% - 20px,1050px);
  }
  .caption-hero {
    padding: 42px 0 50px;
  }
  .hero-copy h1 {
    font-size: clamp(2.7rem,15vw,4rem);
  }
  .studio-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }
  .studio-heading>p {
    text-align: left;
  }
  .control-grid {
    grid-template-columns: 1fr;
  }
  .field-topic,.generate-button {
    grid-column: auto;
  }
  .caption-grid {
    grid-template-columns: 1fr;
  }
  .how-grid,.related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:480px) {
  .idea-groups {
    grid-template-columns: 1fr;
  }
}
