/* =====================================================================
   HowToFixIt.info — Public Site Redesign (2026)
   Scope: only public visitor pages (howto-theme, NOT admin).
   Brand kept: orange (#ff7a1a) + blue (#1273d4) + navy (#0b3d70).
   Layered on top of styles.css + howtofixit-brand.css.
   ===================================================================== */

body.howto-theme:not(.admin-theme) {
  --hf-orange: #ff7a1a;
  --hf-orange-deep: #ef6206;
  --hf-blue: #1273d4;
  --hf-blue-deep: #0f5f9e;
  --hf-navy: #0b3d70;
  --hf-navy-ink: #0a2a4a;
  --hf-ink: #16304a;
  --hf-muted: #51687e;
  --hf-line: rgba(15, 64, 110, 0.12);
  --hf-line-strong: rgba(15, 64, 110, 0.2);
  --hf-surface: #ffffff;
  --hf-surface-2: #f4f8fd;
  --hf-radius: 18px;
  --hf-radius-sm: 12px;
  --hf-shadow-sm: 0 2px 10px rgba(11, 45, 80, 0.07);
  --hf-shadow: 0 14px 34px rgba(11, 45, 80, 0.12);
  --hf-shadow-lg: 0 22px 50px rgba(11, 45, 80, 0.18);
  --hf-font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  color: var(--hf-ink);
  font-family: var(--hf-font);
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(255, 122, 26, 0.12), transparent 60%),
    radial-gradient(1000px 520px at 100% 0%, rgba(18, 115, 212, 0.14), transparent 58%),
    linear-gradient(180deg, #eef4fb 0%, #f5f9fd 38%, #f8fbfe 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.howto-theme:not(.admin-theme) .page-bg {
  background: none;
}

/* ---- Typography ------------------------------------------------------ */
body.howto-theme:not(.admin-theme) h1,
body.howto-theme:not(.admin-theme) h2,
body.howto-theme:not(.admin-theme) h3,
body.howto-theme:not(.admin-theme) h4 {
  font-family: var(--hf-font);
  color: var(--hf-navy-ink);
  letter-spacing: -0.015em;
  line-height: 1.18;
}

body.howto-theme:not(.admin-theme) .eyebrow {
  color: var(--hf-orange-deep);
  font-weight: 800;
  letter-spacing: 0.13em;
  font-size: 0.76rem;
}

body.howto-theme:not(.admin-theme) a {
  color: var(--hf-blue-deep);
}

/* ---- Header tweaks --------------------------------------------------- */
body.howto-theme:not(.admin-theme) .site-header {
  background:
    linear-gradient(118deg, #08305c 0%, #0f5f9e 60%, #1576c4 100%);
  box-shadow: 0 8px 26px rgba(8, 35, 67, 0.22);
}

body.howto-theme:not(.admin-theme) .main-nav .button,
body.howto-theme:not(.admin-theme) .main-nav .button-small {
  background: linear-gradient(135deg, var(--hf-orange) 0%, var(--hf-orange-deep) 100%);
  border: 0;
  box-shadow: 0 8px 18px rgba(239, 98, 6, 0.32);
  font-weight: 700;
}

/* ---- Hero ------------------------------------------------------------ */
body.howto-theme:not(.admin-theme) .hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(620px 280px at 92% -40%, rgba(255, 122, 26, 0.16), transparent 60%),
    linear-gradient(140deg, #ffffff 0%, #f3f8fe 100%);
  border: 1px solid var(--hf-line);
  border-radius: 22px;
  box-shadow: var(--hf-shadow);
  padding: clamp(1.5rem, 3vw, 2.6rem);
}

body.howto-theme:not(.admin-theme) .hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--hf-orange), var(--hf-blue));
}

body.howto-theme:not(.admin-theme) .hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

body.howto-theme:not(.admin-theme) .hero > p {
  color: var(--hf-muted);
  font-size: 1.06rem;
  max-width: 64ch;
}

/* ---- Search bar ------------------------------------------------------ */
body.howto-theme:not(.admin-theme) .guide-search-form label {
  font-weight: 700;
  color: var(--hf-navy-ink);
  font-size: 0.92rem;
}

body.howto-theme:not(.admin-theme) .guide-search-row {
  gap: 0.55rem;
}

body.howto-theme:not(.admin-theme) .guide-search-row input[type="search"] {
  border: 1px solid var(--hf-line-strong);
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  background: #fff;
  box-shadow: var(--hf-shadow-sm);
  font-size: 1rem;
}

body.howto-theme:not(.admin-theme) .guide-search-row input[type="search"]:focus {
  outline: none;
  border-color: var(--hf-blue);
  box-shadow: 0 0 0 4px rgba(18, 115, 212, 0.16);
}

body.howto-theme:not(.admin-theme) .guide-search-row .button {
  border-radius: 999px;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, var(--hf-blue) 0%, var(--hf-blue-deep) 100%);
  border: 0;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 95, 158, 0.3);
}

body.howto-theme:not(.admin-theme) .guide-search-row .button-ghost {
  background: #fff;
  color: var(--hf-blue-deep);
  border: 1px solid var(--hf-line-strong);
  box-shadow: none;
}

/* ---- Generic card on public ----------------------------------------- */
body.howto-theme:not(.admin-theme) .card {
  background: var(--hf-surface);
  border: 1px solid var(--hf-line);
  border-radius: var(--hf-radius);
  box-shadow: var(--hf-shadow-sm);
  padding: clamp(1.1rem, 2.2vw, 1.6rem);
}

/* ---- Guide cards grid ------------------------------------------------ */
body.howto-theme:not(.admin-theme) .post-preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

body.howto-theme:not(.admin-theme) .post-preview-card {
  position: relative;
  border: 1px solid var(--hf-line);
  border-radius: var(--hf-radius);
  background: var(--hf-surface);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--hf-shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body.howto-theme:not(.admin-theme) .post-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hf-shadow);
  border-color: rgba(18, 115, 212, 0.32);
}

body.howto-theme:not(.admin-theme) .post-preview-cover {
  aspect-ratio: 16 / 10;
  border-radius: 0;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(18, 115, 212, 0.16), transparent 55%),
    linear-gradient(135deg, #0f5f9e 0%, #1576c4 55%, #ff7a1a 160%);
}

body.howto-theme:not(.admin-theme) .post-preview-placeholder {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #eaf3ff;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

body.howto-theme:not(.admin-theme) .post-preview-placeholder svg {
  width: 38px;
  height: 38px;
  opacity: 0.95;
}

body.howto-theme:not(.admin-theme) .post-preview-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.1rem 1.2rem;
}

body.howto-theme:not(.admin-theme) .post-preview-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.66rem;
  border-radius: 999px;
  background: rgba(18, 115, 212, 0.1);
  color: var(--hf-blue-deep);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

body.howto-theme:not(.admin-theme) .post-preview-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
}

body.howto-theme:not(.admin-theme) .post-preview-card h3 a {
  color: var(--hf-navy-ink);
  text-decoration: none;
}

body.howto-theme:not(.admin-theme) .post-preview-card:hover h3 a {
  color: var(--hf-blue-deep);
}

body.howto-theme:not(.admin-theme) .post-preview-cta {
  margin-top: 0.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--hf-orange-deep);
  font-weight: 700;
  font-size: 0.92rem;
}

body.howto-theme:not(.admin-theme) .post-preview-cta::after {
  content: "→";
  transition: transform 160ms ease;
}

body.howto-theme:not(.admin-theme) .post-preview-card:hover .post-preview-cta::after {
  transform: translateX(4px);
}

/* Make the whole card clickable via cover/title; keep cover image fill */
body.howto-theme:not(.admin-theme) .post-preview-cover img {
  transition: transform 320ms ease;
}

body.howto-theme:not(.admin-theme) .post-preview-card:hover .post-preview-cover img {
  transform: scale(1.04);
}

/* ---- Article reading layout ----------------------------------------- */
body.howto-theme:not(.admin-theme) .guide-main > .card {
  border-radius: var(--hf-radius);
}

body.howto-theme:not(.admin-theme) .content-rich {
  width: min(100%, 74ch);
  font-size: 1.06rem;
  line-height: 1.74;
  color: #25405a;
}

body.howto-theme:not(.admin-theme) .content-rich :is(h2, h3) {
  color: var(--hf-navy-ink);
  margin-top: 1.9rem;
  margin-bottom: 0.6rem;
}

body.howto-theme:not(.admin-theme) .content-rich h2 {
  font-size: 1.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--hf-line);
}

body.howto-theme:not(.admin-theme) .content-rich h3 {
  font-size: 1.2rem;
}

body.howto-theme:not(.admin-theme) .content-rich :is(ul, ol) {
  padding-left: 1.2rem;
}

body.howto-theme:not(.admin-theme) .content-rich li {
  margin-bottom: 0.4rem;
}

body.howto-theme:not(.admin-theme) .content-rich li::marker {
  color: var(--hf-orange);
}

body.howto-theme:not(.admin-theme) .content-rich a {
  color: var(--hf-blue-deep);
  text-underline-offset: 0.18em;
}

body.howto-theme:not(.admin-theme) .guide-title-image {
  border-radius: var(--hf-radius);
  border: 1px solid var(--hf-line);
  box-shadow: var(--hf-shadow);
  max-height: clamp(240px, 46vh, 460px);
}

/* ---- Sidebar / TOC --------------------------------------------------- */
body.howto-theme:not(.admin-theme) .guide-sidebar {
  background: linear-gradient(160deg, #ffffff, #f4f9fe);
  border: 1px solid var(--hf-line);
  border-radius: var(--hf-radius);
  box-shadow: var(--hf-shadow-sm);
}

body.howto-theme:not(.admin-theme) .guide-sidebar h2 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hf-orange-deep);
}

body.howto-theme:not(.admin-theme) .guide-toc a {
  color: var(--hf-muted);
  border-left: 3px solid var(--hf-line-strong);
  font-size: 0.95rem;
  padding: 0.32rem 0.6rem;
  font-weight: 600;
}

body.howto-theme:not(.admin-theme) .guide-toc a:hover {
  background: rgba(18, 115, 212, 0.08);
  border-left-color: var(--hf-orange);
  color: var(--hf-navy-ink);
}

/* ---- FAQ accordion --------------------------------------------------- */
body.howto-theme:not(.admin-theme) .faq-item {
  border: 1px solid var(--hf-line);
  border-radius: var(--hf-radius-sm);
  background: var(--hf-surface);
  margin-bottom: 0.7rem;
  overflow: hidden;
}

body.howto-theme:not(.admin-theme) .faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 1.1rem;
  font-weight: 700;
  color: var(--hf-navy-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

body.howto-theme:not(.admin-theme) .faq-item summary::-webkit-details-marker {
  display: none;
}

body.howto-theme:not(.admin-theme) .faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--hf-orange);
  transition: transform 180ms ease;
}

body.howto-theme:not(.admin-theme) .faq-item[open] summary::after {
  transform: rotate(45deg);
}

body.howto-theme:not(.admin-theme) .faq-item summary:hover {
  background: var(--hf-surface-2);
}

body.howto-theme:not(.admin-theme) .faq-answer {
  padding: 0 1.1rem 1.05rem;
  color: #2f4a64;
  line-height: 1.65;
}

/* ---- Related guides -------------------------------------------------- */
body.howto-theme:not(.admin-theme) .list-clean li {
  border: 1px solid var(--hf-line);
  border-radius: var(--hf-radius-sm);
  padding: 0.7rem 0.9rem;
  background: var(--hf-surface);
  transition: border-color 160ms ease, transform 160ms ease;
}

body.howto-theme:not(.admin-theme) .list-clean li:hover {
  border-color: rgba(18, 115, 212, 0.32);
  transform: translateX(3px);
}

body.howto-theme:not(.admin-theme) .list-clean li a {
  font-weight: 700;
  text-decoration: none;
}

/* ---- Buttons (generic public) --------------------------------------- */
body.howto-theme:not(.admin-theme) .button {
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  background: linear-gradient(135deg, var(--hf-blue) 0%, var(--hf-blue-deep) 100%);
  color: #fff;
  border: 0;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(15, 95, 158, 0.26);
}

body.howto-theme:not(.admin-theme) .button-ghost {
  background: #fff;
  color: var(--hf-blue-deep);
  border: 1px solid var(--hf-line-strong);
  box-shadow: none;
}

/* ---- Footer ---------------------------------------------------------- */
body.howto-theme:not(.admin-theme) .site-footer {
  background: linear-gradient(120deg, #0a2f57, #0f4f86);
  border-top: 3px solid var(--hf-orange);
}

/* ---- Maintenance page ------------------------------------------------ */
body.howto-theme:not(.admin-theme) .maintenance-card {
  border-radius: var(--hf-radius);
  box-shadow: var(--hf-shadow);
  border-left: 5px solid var(--hf-orange);
}

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 760px) {
  body.howto-theme:not(.admin-theme) .hero {
    border-radius: 16px;
  }
  body.howto-theme:not(.admin-theme) .post-preview-grid {
    grid-template-columns: 1fr;
  }
  body.howto-theme:not(.admin-theme) .content-rich {
    font-size: 1.02rem;
  }
}
