/* Zakhrafay — Chunk 2 Homepage UI & Card System v1.2.0. Clean Sky only. Mobile-first, RTL-safe (logical properties). */

/* Tight homepage spacing: kill the empty gap above the generator.
   Note: .zh-home sits INSIDE <main>, so target the parent via body.home. */
body.home .zh-main { padding-block-start: 0.75rem; padding-block-end: 1.5rem; }
.zh-home .zh-container { inline-size: min(100% - 2rem, 1160px); }

.zh-hero { text-align: center; padding-block: 1.25rem 1rem; }
.zh-hero h1 { margin-block-end: 0.4rem; font-size: clamp(1.6rem, 5vw, 2.4rem); }
.zh-hero__desc { color: var(--zh-muted); max-inline-size: 640px; margin-inline: auto; margin-block-end: 0; font-size: 1.05rem; line-height: 1.8; }

/* Generator card */
.zh-generator { background: var(--zh-card); border: 1px solid var(--zh-border); border-radius: 16px; box-shadow: var(--zh-shadow-sm); padding: 1.25rem; margin-block-start: 0.5rem; }
.zh-generator__head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; }
.zh-generator__head h2 { margin: 0; font-size: 1.3rem; }
.zh-preview-badge { display: inline-block; font-size: 0.8rem; font-weight: 700; background: #FFF7E6; color: #7A4A00; border: 1px solid #F5D98B; border-radius: 999px; padding: 0.25rem 0.7rem; }
.zh-generator__note { color: var(--zh-muted); font-size: 0.95rem; margin-block: 0.6rem 1rem; }

/* Tabs */
.zh-tabs { display: flex; gap: 0.5rem; background: var(--zh-light-blue); border: 1px solid var(--zh-border); border-radius: 12px; padding: 0.3rem; max-inline-size: 420px; margin-block-end: 1rem; }
.zh-tab { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 0.6rem 1rem; font-family: var(--zh-font-heading); font-weight: 700; color: var(--zh-navy); cursor: pointer; min-block-size: 44px; }
.zh-tab.is-active { background: var(--zh-card); box-shadow: var(--zh-shadow-sm); color: var(--zh-blue); }

/* Input */
.zh-field { margin-block-end: 1rem; }
.zh-input { inline-size: 100%; font-family: var(--zh-font-body); font-size: 1.15rem; padding: 0.85rem 1rem; border: 1.5px solid var(--zh-border); border-radius: 12px; background: #fff; color: var(--zh-ink); }
.zh-input:focus { outline: none; border-color: var(--zh-blue); box-shadow: 0 0 0 3px rgba(22,105,232,0.15); }
.zh-input::placeholder { color: #8AA0B8; }
.zh-field__hint { color: var(--zh-muted); font-size: 0.9rem; margin-block: 0.5rem 0; }

/* Filters */
.zh-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block-end: 1.1rem; }
.zh-filter { border: 1px solid var(--zh-border); background: #fff; color: var(--zh-navy); border-radius: 999px; padding: 0.45rem 1rem; font-family: var(--zh-font-heading); font-weight: 700; font-size: 0.9rem; cursor: pointer; min-block-size: 40px; }
.zh-filter.is-active { background: var(--zh-navy); color: #fff; border-color: var(--zh-navy); }

/* Results */
.zh-results__heading { font-size: 1.1rem; margin-block: 0 0.75rem; }
.zh-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.zh-result { border: 1px solid var(--zh-border); border-radius: 12px; padding: 0.9rem; background: #fff; display: flex; flex-direction: column; gap: 0.7rem; min-block-size: 108px; }
.zh-result__text { font-size: 1.25rem; text-align: center; overflow-wrap: anywhere; line-height: 1.6; }
.zh-result__actions { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-block-start: auto; }
.zh-btn--sm { padding: 0.45rem 1rem; min-block-size: 38px; font-size: 0.9rem; }
.zh-fav { inline-size: 38px; block-size: 38px; display: grid; place-items: center; border: 1px solid var(--zh-border); background: #fff; border-radius: 999px; cursor: pointer; font-size: 1.2rem; color: var(--zh-muted); line-height: 1; }
.zh-fav.is-active { color: #D6336C; border-color: #F3B7CD; background: #FFF0F5; }
.zh-result.is-hidden, .is-hidden { display: none !important; }
.zh-results__empty { color: var(--zh-muted); text-align: center; }
.zh-toast { min-block-size: 1.5em; color: var(--zh-navy); font-weight: 700; text-align: center; margin: 0.75rem 0 0; }

/* How-to */
.zh-howto { margin-block: 1.5rem 0.5rem; }
.zh-howto h2 { font-size: 1.25rem; text-align: center; }
.zh-howto__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.zh-howto__list li { background: var(--zh-card); border: 1px solid var(--zh-border); border-radius: 12px; padding: 1rem; text-align: center; }
.zh-howto__list li::before { counter-increment: step; content: counter(step); display: block; inline-size: 32px; block-size: 32px; line-height: 32px; margin-inline: auto; margin-block-end: 0.5rem; border-radius: 999px; background: var(--zh-light-blue); color: var(--zh-blue); font-weight: 800; }

/* Empty-input state */
.zh-empty-state { display: flex; align-items: center; gap: 0.6rem; background: var(--zh-light-blue); border: 1px solid var(--zh-border); border-radius: 10px; padding: 0.6rem 0.9rem; margin-block-end: 1rem; color: var(--zh-navy); }
.zh-empty-state__icon { font-size: 1.2rem; margin: 0; }
.zh-empty-state__text { margin: 0; font-size: 0.95rem; }
.zh-empty-state.is-hidden { display: none !important; }

/* Shared section rhythm */
.zh-tools, .zh-howto, .zh-examples, .zh-info, .zh-faq { margin-block: 2rem 0; }
.zh-tools h2, .zh-examples h2, .zh-info h2, .zh-faq h2 { font-size: 1.35rem; text-align: center; margin-block-end: 0.4rem; }
.zh-section-note { color: var(--zh-muted); text-align: center; font-size: 0.95rem; margin-block: 0 1rem; }

/* D: Related tools grid — 3 cols desktop, 2 tablet, 1 mobile (2 only if readable: we use 1 under 640 for clarity) */
.zh-tools__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.zh-tool-card { background: var(--zh-card); border: 1px solid var(--zh-border); border-radius: 14px; padding: 1.1rem; text-align: center; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.zh-tool-card:hover { border-color: var(--zh-blue); box-shadow: var(--zh-shadow-md); transform: translateY(-2px); }
.zh-tool-card__icon { display: grid; place-items: center; inline-size: 48px; block-size: 48px; margin-inline: auto; margin-block-end: 0.6rem; border-radius: 12px; background: var(--zh-light-blue); color: var(--zh-blue); }
.zh-tool-card__icon svg { inline-size: 26px; block-size: 26px; }
.zh-tool-card h3 { font-size: 1.05rem; margin-block-end: 0.3rem; }
.zh-tool-card p { color: var(--zh-muted); font-size: 0.93rem; margin: 0; line-height: 1.7; }

/* E: How-it-works — keep 3-card layout, support subtitle spans */
.zh-howto__list li span { display: block; color: var(--zh-muted); font-size: 0.93rem; margin-block-start: 0.25rem; }

/* F: Examples — before / after */
.zh-examples__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.zh-example { background: var(--zh-card); border: 1px solid var(--zh-border); border-radius: 14px; padding: 1rem; }
.zh-example h3 { font-size: 1.05rem; margin-block-end: 0.6rem; text-align: center; }
.zh-example__row { display: flex; align-items: center; justify-content: center; gap: 0.6rem; margin: 0.45rem 0; font-size: 1.05rem; }
.zh-example__before { color: var(--zh-muted); }
.zh-example__arrow { color: var(--zh-blue); font-weight: 800; }
.zh-example__after { color: var(--zh-navy); font-weight: 700; }

/* G: Useful info */
.zh-info__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.zh-info__grid article { background: var(--zh-card); border: 1px solid var(--zh-border); border-radius: 14px; padding: 1.1rem; }
.zh-info__grid h3 { font-size: 1.05rem; margin-block-end: 0.4rem; }
.zh-info__grid p { color: var(--zh-muted); margin: 0; line-height: 1.85; }

/* H: FAQ accordion */
.zh-faq__list { display: grid; gap: 0.6rem; max-inline-size: 820px; margin-inline: auto; }
.zh-faq__item { background: var(--zh-card); border: 1px solid var(--zh-border); border-radius: 12px; overflow: hidden; }
.zh-faq__item h3 { margin: 0; }
.zh-faq__btn { inline-size: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: start; background: transparent; border: 0; cursor: pointer; padding: 0.9rem 1.1rem; font-family: var(--zh-font-heading); font-weight: 700; font-size: 1rem; color: var(--zh-navy); min-block-size: 52px; }
.zh-faq__btn[aria-expanded="true"] { color: var(--zh-blue); }
.zh-faq__icon { font-size: 1.3rem; line-height: 1; color: var(--zh-blue); }
.zh-faq__panel { padding: 0 1.1rem 1rem; }
.zh-faq__panel p { color: var(--zh-muted); margin: 0; }

/* Mobile: tighter hero/generator, single-column results, stacked sections */
@media (max-width: 900px) {
  .zh-tools__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .zh-hero { padding-block: 0.9rem 0.75rem; }
  .zh-generator { padding: 1rem; border-radius: 14px; }
  .zh-results { grid-template-columns: 1fr; }
  .zh-howto__list { grid-template-columns: 1fr; }
  .zh-result__text { font-size: 1.35rem; }
  .zh-tools__grid, .zh-examples__grid, .zh-info__grid { grid-template-columns: 1fr; }
  .zh-tools, .zh-howto, .zh-examples, .zh-info, .zh-faq { margin-block: 1.5rem 0; }
}

/* Simplified mobile footer (applies site-wide via foundation override below;
   kept here too so the homepage preview matches even standalone). */
@media (max-width: 560px) {
  .zh-footer { padding-block: 1.25rem 1rem; }
  .zh-footer__grid { gap: 1rem; }
  .zh-footer__tagline, .zh-footer__note--mobile-hide { display: none; }
  .zh-footer__heading { margin-block-end: 0.5rem; }
  .zh-footer__list { gap: 0.35rem; }
  .zh-footer__bottom { margin-block-start: 1rem; padding-block-start: 0.75rem; }
}

/* v1.4.0 — on-page prominence: real style counter + platform section */
.zh-count { display: inline-block; font-size: 0.85rem; font-weight: 700; background: var(--zh-light-blue); color: var(--zh-navy); border: 1px solid var(--zh-border); border-radius: 999px; padding: 0.3rem 0.85rem; }
.zh-count strong { color: var(--zh-blue); }
.zh-platforms { margin-block: 2rem 0; }
.zh-platforms h2 { font-size: 1.35rem; text-align: center; margin-block-end: 0.4rem; }
.zh-platforms__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.zh-platforms__grid article { background: var(--zh-card); border: 1px solid var(--zh-border); border-radius: 14px; padding: 1.1rem; }
.zh-platforms__grid h3 { font-size: 1.05rem; margin-block-end: 0.4rem; }
.zh-platforms__grid p { color: var(--zh-muted); margin: 0; line-height: 1.85; }
@media (max-width: 640px) {
  .zh-platforms__grid { grid-template-columns: 1fr; }
  .zh-platforms { margin-block: 1.5rem 0; }
}
