/* =====================================================================
   ProductHunt-parity product submission flow (RTL / Persian).
   Scoped under .ph-submit. Light surface, pinned regardless of theme.
   ===================================================================== */
.ph-submit {
    --ph-accent: #DA552F;
    --ph-accent-soft: #F96A57;
    --ph-accent-dark: #BE431F;
    --ph-text: #21293C;
    --ph-text-muted: #4B587C;
    --ph-text-subtle: #6C7488;
    --ph-border: #E1E4EA;
    --ph-border-soft: #EEF0F3;
    --ph-input-bg: #FFFFFF;
    --ph-radius: 8px;
    --ph-radius-lg: 12px;
    --tint-mainrow: #FDF6E5;
    --tint-media: #EEF3FF;
    --tint-makers: #F3EFFF;
    --tint-extras: #FDEEEA;
    --tint-checklist: #EAF6EE;
    --ic-main: #F5A623;
    --ic-media: #5B7CFA;
    --ic-makers: #8B5CF6;
    --ic-extras: #F0432B;
    --ic-checklist: #16A34A;
    --ph-peach: #FDF1EA;

    max-width: 1080px;
    margin-inline: auto;
    padding: clamp(1rem, 3vw, 2.25rem);
    color: var(--ph-text);
    font-family: var(--nh-font);
}

/* Bulletproof hide: never let a display:grid/flex rule beat [hidden]. */
.ph-submit [hidden] { display: none !important; }

/* Pin a light surface even under the site's dark theme (PH is always light). */
.ph-submit,
.ph-submit .ph-input,
.ph-submit .nh-subnav-item,
.ph-submit .ph-chip,
.ph-submit .ph-mdbar button { background-color: #fff; }

/* ---- typography ---------------------------------------------------- */
.ph-h { font-size: clamp(24px, 3.4vw, 31px); font-weight: 800; letter-spacing: -.01em; margin: 0 0 8px; color: var(--ph-text); }
.ph-sub { font-size: 16px; color: var(--ph-text-muted); margin: 0 0 24px; line-height: 1.7; }
.ph-hr { border: 0; border-top: 1px solid var(--ph-border); margin: 28px 0; }
.ph-block-title { font-size: 21px; font-weight: 800; margin: 0 0 14px; color: var(--ph-text); }

/* ---- fields -------------------------------------------------------- */
.ph-field { margin-bottom: 20px; }
.ph-label-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 8px; }
.ph-label { font-size: 14px; font-weight: 700; color: var(--ph-text); display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.ph-optional { font-size: 13px; color: var(--ph-text-subtle); font-weight: 400; }
.ph-count { font-size: 13px; color: var(--ph-text-subtle); font-variant-numeric: tabular-nums; }
.ph-help { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--ph-border); color: var(--ph-text-subtle); font-size: 11px; cursor: help; line-height: 1; }
.ph-helper { font-size: 13px; color: var(--ph-text-subtle); margin-top: 6px; line-height: 1.6; }

.ph-input { width: 100%; height: 48px; padding: 0 14px; font: inherit; font-size: 15px; color: var(--ph-text); background: var(--ph-input-bg); border: 1px solid var(--ph-border); border-radius: var(--ph-radius); transition: border-color .15s, box-shadow .15s; }
textarea.ph-input { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.85; resize: vertical; }
.ph-input::placeholder { color: #9AA1AE; }
.ph-input:focus { outline: none; border-color: var(--ph-accent); box-shadow: 0 0 0 3px rgba(218, 85, 47, .15); }
select.ph-input { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236C7488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: left 14px center; padding-inline-end: 40px; }

.ph-prefix { display: flex; gap: 8px; align-items: center; }
.ph-prefix__tag { color: var(--ph-text-subtle); font-size: 14px; white-space: nowrap; }

/* ---- buttons / links ---------------------------------------------- */
.ph-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer; border: 1px solid transparent; border-radius: 999px; padding: 13px 28px; transition: background .15s, opacity .15s, border-color .15s; text-decoration: none; }
.ph-btn--primary { background: var(--ph-accent); color: #fff; }
.ph-btn--primary:hover { background: var(--ph-accent-dark); }
.ph-btn--ghost { background: #fff; color: var(--ph-text); border-color: var(--ph-border); }
.ph-btn--ghost:hover { background: #F6F7F9; }
.ph-btn:disabled, .ph-btn.is-disabled { opacity: .5; cursor: default; pointer-events: none; }
.ph-link { color: var(--ph-accent); font-weight: 700; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; text-decoration: none; }
.ph-link:hover { text-decoration: underline; }
.ph-actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; }

/* ---- two-column details layout ------------------------------------ */
.ph-layout { display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: start; }
.ph-sidebar { position: sticky; top: 24px; }
.ph-content { max-width: 720px; min-width: 0; }

.ph-prodcard { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.ph-prodcard__thumb { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; border: 1px solid var(--ph-border); background: #F1F2F4; flex: none; display: flex; align-items: center; justify-content: center; color: #B7BCC6; }
.ph-prodcard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph-prodcard__name { font-weight: 800; font-size: 15px; color: var(--ph-text); line-height: 1.3; word-break: break-word; }
.ph-prodcard__status { font-size: 13px; color: var(--ph-text-muted); margin-top: 2px; }

.ph-navlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ph-submit .nh-subnav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--ph-text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: start; transition: background .15s; }
.ph-submit .nh-subnav-item:hover { background: #F5F6F8; }
.ph-navic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.ph-navic svg { width: 19px; height: 19px; }
.ph-navlabel { flex: 1 1 auto; }
.nh-subnav-item[data-goto="main"] .ph-navic { background: var(--tint-mainrow); color: var(--ic-main); }
.nh-subnav-item[data-goto="media"] .ph-navic { background: var(--tint-media); color: var(--ic-media); }
.nh-subnav-item[data-goto="makers"] .ph-navic { background: var(--tint-makers); color: var(--ic-makers); }
.nh-subnav-item[data-goto="extras"] .ph-navic { background: var(--tint-extras); color: var(--ic-extras); }
.nh-subnav-item[data-goto="checklist"] .ph-navic { background: var(--tint-checklist); color: var(--ic-checklist); }
.ph-submit .nh-subnav-item[data-goto="main"].is-active { background: var(--tint-mainrow); font-weight: 800; }
.ph-submit .nh-subnav-item[data-goto="media"].is-active { background: var(--tint-media); font-weight: 800; }
.ph-submit .nh-subnav-item[data-goto="makers"].is-active { background: var(--tint-makers); font-weight: 800; }
.ph-submit .nh-subnav-item[data-goto="extras"].is-active { background: var(--tint-extras); font-weight: 800; }
.ph-submit .nh-subnav-item[data-goto="checklist"].is-active { background: var(--tint-checklist); font-weight: 800; }
.ph-submit .nh-subnav-item.is-complete .ph-navlabel::after { content: '✓'; margin-inline-start: 6px; color: var(--ic-checklist); font-weight: 800; }

/* ---- section switching (never relies on [hidden] alone) ----------- */
.ph-sec { display: none; }
.ph-sec.is-active { display: block; animation: ph-fade .18s ease; }
@keyframes ph-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- chips / topics ------------------------------------------------ */
.ph-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-submit .ph-chip { display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--ph-border); border-radius: 999px; font-size: 14px; cursor: pointer; color: var(--ph-text-muted); transition: background .15s, border-color .15s, color .15s; }
.ph-submit .ph-chip.is-active { background: var(--tint-mainrow); border-color: var(--ph-accent); color: var(--ph-accent-dark); font-weight: 700; }

/* ---- radio cards --------------------------------------------------- */
.ph-radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; cursor: pointer; }
.ph-radio + .ph-radio { border-top: 1px solid var(--ph-border-soft); }
.ph-radio input { margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--ph-accent); flex: none; }
.ph-radio__t { font-weight: 700; color: var(--ph-text); }
.ph-radio__d { font-size: 13px; color: var(--ph-text-muted); margin-top: 2px; }

.ph-check { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 600; color: var(--ph-text); }
.ph-check input { width: 18px; height: 18px; accent-color: var(--ph-accent); }

/* ---- markdown editor ---------------------------------------------- */
.ph-submit .ph-mdbar { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; border: 1px solid var(--ph-border); border-bottom: 0; border-radius: 8px 8px 0 0; padding: 6px; background: #FAFBFC; }
.ph-submit .ph-mdbar button { border: 1px solid var(--ph-border); border-radius: 6px; padding: 4px 9px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ph-text-muted); }
.ph-submit .ph-mdbar button:hover { background: #F0F1F4; }
.ph-submit .ph-mdbar button.is-active { background: var(--tint-mainrow); border-color: var(--ph-accent); color: var(--ph-accent-dark); }
.ph-submit .ph-mdbar + .ph-input { border-radius: 0 0 8px 8px; }
.ph-md-preview { border: 1px solid var(--ph-border); border-radius: 8px; padding: 14px; margin-top: 8px; }

/* ---- media / thumbnail -------------------------------------------- */
.ph-thumb-row { display: flex; gap: 18px; align-items: flex-start; }
.ph-thumb-box { width: 108px; height: 108px; border: 1px dashed var(--ph-border); border-radius: 12px; background: #FAFBFC; display: flex; align-items: center; justify-content: center; color: #C2C7D0; flex: none; overflow: hidden; }
.ph-thumb-box img { width: 100%; height: 100%; object-fit: cover; }
.ph-submit input[type=file].ph-file { font: inherit; font-size: 14px; color: var(--ph-text-muted); max-width: 100%; }
.ph-submit input[type=file].ph-file::file-selector-button { font: inherit; font-weight: 700; color: var(--ph-text); background: #fff; border: 1px solid var(--ph-border); border-radius: 999px; padding: 9px 18px; margin-inline-end: 12px; cursor: pointer; }
.ph-submit input[type=file].ph-file::file-selector-button:hover { background: #F6F7F9; }
.ph-preview-row { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.ph-preview-row__thumb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; border: 1px solid var(--ph-border); background: #F1F2F4; flex: none; }
.ph-preview-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph-metrics { margin-inline-start: auto; display: flex; gap: 14px; }
.ph-metric { display: inline-flex; flex-direction: column; align-items: center; min-width: 42px; }
.ph-metric b { font-size: 14px; }
.ph-metric span { font-size: 11px; color: var(--ph-text-subtle); }

.ph-makers-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.ph-makers-list li { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--ph-border); border-radius: 10px; }

.ph-promo-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ---- launch checklist --------------------------------------------- */
.ph-req-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ph-req-head .ph-h { margin: 0; }
.ph-req-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--tint-mainrow); color: #93701C; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; list-style: none; margin: 16px 0 0; padding: 0; }
.ph-check-grid li { font-size: 15px; color: var(--ph-text-muted); display: flex; align-items: center; gap: 4px; }
.ph-warn { background: #FEF7E7; border: 1px solid #F6D98A; border-radius: 12px; padding: 16px 20px; margin: 24px 0; }
.ph-warn ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ph-warn li { color: #B5691B; font-size: 14px; font-weight: 600; }
.ph-warn li::before { content: '•'; margin-inline-end: 8px; }

/* ---- landing + fetching (peach panel + tangram + fox) ------------- */
.ph-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); border: 1px solid var(--ph-border); border-radius: 20px; overflow: hidden; min-height: 540px; }
.ph-split__art { position: relative; background: var(--ph-peach); overflow: hidden; }
.ph-split__art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ph-split__body { padding: clamp(24px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; }
.ph-help-card { margin-top: 26px; padding: 18px 20px; border: 1px solid var(--ph-border); border-radius: 14px; background: #FAFBFC; }
.ph-help-card b { display: block; margin-bottom: 4px; }
.ph-help-card p { margin: 0; font-size: 14px; color: var(--ph-text-muted); line-height: 1.7; }

.ph-fetching { align-items: center; text-align: center; }
.ph-fox { width: 168px; height: auto; animation: ph-bob 2.6s ease-in-out infinite; }
.ph-fetching__text { margin: 22px 0 0; font-size: 18px; font-weight: 600; color: var(--ph-text-muted); }
@keyframes ph-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---- notices (paused / login / done) ------------------------------ */
.ph-notice { max-width: 560px; margin: 40px auto; text-align: center; padding: 40px 28px; border: 1px solid var(--ph-border); border-radius: 20px; background: var(--ph-peach); }
.ph-notice--plain { background: #fff; }
.ph-notice__icon { font-size: 2rem; }
.ph-notice__title { font-size: 20px; font-weight: 800; margin: 12px 0 6px; }
.ph-notice p { color: var(--ph-text-muted); margin: 0 0 18px; }
.ph-notice .ph-actions { justify-content: center; }

/* ---- responsive ---------------------------------------------------- */
@media (max-width: 720px) {
    .ph-layout { grid-template-columns: 1fr; gap: 24px; }
    .ph-sidebar { position: static; }
    .ph-navlist { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .ph-submit .nh-subnav-item { width: auto; font-size: 13px; padding: 7px 10px; }
    .ph-navic { width: 26px; height: 26px; }
    .ph-navic svg { width: 15px; height: 15px; }
    .ph-prodcard { margin-bottom: 14px; }
    .ph-split { grid-template-columns: 1fr; }
    .ph-split__art { min-height: 180px; order: -1; }
    .ph-check-grid { grid-template-columns: 1fr; }
    .ph-promo-grid { grid-template-columns: 1fr; }
}
