/*
Theme Name: Image to Text Tool
Description: Responsive WordPress theme for a browser-based Image to Text converter.
Version: 1.0.0
Author: OpenAI
Text Domain: image-to-text-tool
*/

:root {
  --itt-primary: #6d4aff;
  --itt-primary-hover: #5635df;
  --itt-bg: #f7f8fc;
  --itt-text: #1e293b;
  --itt-muted: #64748b;
  --itt-border: #e2e8f0;
  --itt-card: #fff;
  --itt-radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--itt-bg); color: var(--itt-text);
  font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--itt-primary); }
a:hover { color: var(--itt-primary-hover); }
.site-header {
  background: #fff; border-bottom: 1px solid var(--itt-border);
  padding: 16px max(20px, calc((100% - 1180px)/2));
  display: flex; gap: 20px; align-items: center; justify-content: space-between;
}
.site-brand { color: var(--itt-primary); text-decoration: none; font-size: 1.2rem; font-weight: 800; white-space: nowrap; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; margin: 0; padding: 0; }
.site-nav a { color: var(--itt-text); text-decoration: none; font-size: .94rem; }
.site-nav a:hover { color: var(--itt-primary); }
.site-main { max-width: 1180px; padding: 42px 20px 64px; margin: 0 auto; }
.hero { text-align: center; max-width: 850px; margin: 0 auto 28px; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.04em; }
.subtitle { color: var(--itt-muted); margin: 0 auto 20px; max-width: 680px; }
.privacy-badge { display: inline-flex; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; padding: 5px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.upload-card, .result-card, .step-card, .faq-item, .tool-card {
  background: var(--itt-card); border: 1px solid var(--itt-border); border-radius: var(--itt-radius);
}
.upload-card {
  max-width: 850px; margin: 26px auto; padding: clamp(24px, 5vw, 48px);
  text-align: center; border: 2px dashed #cbd5e1; transition: .2s;
}
.upload-card.is-dragging { border-color: var(--itt-primary); background: #f5f3ff; }
.upload-card h2 { margin: 0 0 6px; font-size: 1.4rem; }
.muted { color: var(--itt-muted); }
.file-types { font-size: .9rem; margin: 0 0 22px; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 12px 20px; background: var(--itt-primary);
  color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--itt-primary-hover); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: #eef2ff; color: #4338ca; }
.btn-secondary:hover { background: #e0e7ff; color: #3730a3; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.privacy-note { color: #047857; font-size: .88rem; margin: 20px 0 0; }
.status { min-height: 1.5em; color: var(--itt-muted); margin: 14px 0 0; font-size: .92rem; }
.progress { width: 100%; max-width: 360px; height: 8px; margin: 12px auto; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.progress-bar { width: 0; height: 100%; background: var(--itt-primary); transition: width .2s; }
.result-card { max-width: 850px; margin: 22px auto; padding: 22px; text-align: left; }
.result-card h2 { margin: 0 0 10px; }
#output-text { display: block; width: 100%; min-height: 190px; resize: vertical; border: 1px solid var(--itt-border); border-radius: 10px; padding: 14px; color: var(--itt-text); background: #f8fafc; font: 15px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.ad-slot { max-width: 970px; min-height: 90px; padding: 10px; margin: 32px auto; display: flex; align-items: center; justify-content: center; text-align: center; color: #94a3b8; border: 1px dashed #cbd5e1; border-radius: 10px; font-size: .85rem; }
.section { margin: 56px auto 0; }
.section > h2 { text-align: center; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 24px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; }
.tool-card { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--itt-text); font-weight: 650; cursor: pointer; text-align: left; font: inherit; }
.tool-card:hover { border-color: #c4b5fd; box-shadow: 0 8px 24px #312e8110; transform: translateY(-1px); }
.tool-icon { font-size: 1.3rem; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.step-card { padding: 22px; }
.step-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--itt-primary); color: #fff; font-weight: 800; margin-bottom: 12px; }
.step-card h3 { margin: 0 0 6px; }
.step-card p { margin: 0; color: var(--itt-muted); }
.faq-list { display: grid; gap: 10px; max-width: 900px; margin: auto; }
.faq-item { padding: 0 18px; }
.faq-item summary { padding: 16px 0; cursor: pointer; font-weight: 700; }
.faq-item p { margin: 0; padding: 0 0 16px; color: var(--itt-muted); }
.site-footer { text-align: center; padding: 28px 20px; background: #fff; border-top: 1px solid var(--itt-border); color: var(--itt-muted); font-size: .9rem; }
.modal-overlay { display: none; position: fixed; inset: 0; padding: 20px; background: #0f172a99; z-index: 9999; align-items: center; justify-content: center; }
.modal-overlay.is-open { display: flex; }
.modal-content { width: min(100%, 520px); background: #fff; border-radius: 16px; padding: 26px; position: relative; box-shadow: 0 20px 60px #0003; }
.modal-close { position: absolute; right: 12px; top: 8px; border: 0; background: transparent; font-size: 1.8rem; cursor: pointer; color: var(--itt-muted); }
.modal-content h3 { margin: 0 30px 10px 0; }
.modal-content input { width: 100%; padding: 11px; border: 1px solid var(--itt-border); border-radius: 8px; margin: 8px 0 12px; font: inherit; }
.modal-result { margin-top: 14px; overflow-wrap: anywhere; }
.modal-result canvas, .modal-result img { max-width: 100%; height: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 720px) {
  .site-header { padding: 14px 18px; flex-direction: column; align-items: flex-start; }
  .site-nav ul { gap: 12px; }
  .site-main { padding: 30px 15px 48px; }
  .upload-card { padding: 25px 17px; }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .tool-card { padding: 12px; font-size: .9rem; }
}
@media (max-width: 390px) { .tools-grid { grid-template-columns: 1fr; } }
