/*
Theme Name:   Revision Fareof
Theme URI:    https://fareof.com
Description:  Fareof brand child theme for Revision. Matches the Next.js app header, footer, palette, and typography. Reversible — switch back to Revision in Appearance > Themes.
Author:       Fareof
Author URI:   https://fareof.com
Template:     revision
Version:      1.0.2
Text Domain:  revision-fareof
*/

/* Brand tokens (mirrors apps/web globals.css).
   Also overrides Revision parent's accent (purple #5955D1) with Fareof amber. */
:root {
  --fareof-paper: hsl(42 50% 97%);
  --fareof-paper-dim: hsl(42 35% 92%);
  --fareof-ink: #0f172a;
  --fareof-ink-soft: #334155;
  --fareof-muted: #64748b;
  --fareof-line: #e2e8f0;
  --fareof-amber: #f59e0b;
  --fareof-amber-hover: #fbbf24;
  --fareof-amber-bg: #fffbeb;
  --fareof-amber-bg-h: #fef3c7;
  --fareof-amber-line: #fcd34d;
  --fareof-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;

}
/* Override Revision theme accent + button gradient (was purple #5955D1 / #9895FF → #514DCC).
   !important + multiple selectors to win over parent's [data-scheme=light] block that
   loads AFTER this child stylesheet (csco-styles-css). */
:root,
[data-scheme],
[data-scheme="light"],
[data-scheme="dark"],
body.cs-site-scheme-light,
body.cs-site-scheme-dark {
  --cs-light-accent-color: #f59e0b !important;
  --cs-dark-accent-color: #f59e0b !important;
  --cs-color-accent: #f59e0b !important;
  --cs-color-accent-rgb: 245, 158, 11 !important;
  --cs-color-box-shadow-rgb: 245, 158, 11 !important;

  /* Button gradient (filled CTAs) */
  --cs-light-button-background-start: #f59e0b !important;
  --cs-light-button-background-end: #d97706 !important;
  --cs-dark-button-background-start: #f59e0b !important;
  --cs-dark-button-background-end: #d97706 !important;
  --cs-color-button: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;

  /* Button hover */
  --cs-light-button-hover-background-start: #fbbf24 !important;
  --cs-light-button-hover-background-end: #f59e0b !important;
  --cs-dark-button-hover-background-start: #fbbf24 !important;
  --cs-dark-button-hover-background-end: #f59e0b !important;
  --cs-color-button-hover: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%) !important;

  /* Button text on amber stays dark slate for contrast */
  --cs-light-button-color: #0f172a !important;
  --cs-light-button-hover-color: #0f172a !important;
  --cs-dark-button-color: #0f172a !important;
  --cs-dark-button-hover-color: #0f172a !important;
  --cs-color-button-contrast: #0f172a !important;
  --cs-color-button-hover-contrast: #0f172a !important;

body,
body.cs-site-scheme-light,
body.cs-site-scheme-dark {
  background: var(--fareof-paper);
  color: var(--fareof-ink);
  font-family: var(--fareof-font);
}

/* Header */
.fareof-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(250, 246, 235, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}
.fareof-bar__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.fareof-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.fareof-brand img {
  height: 1.75rem;
  width: auto;
  display: block;
}
.fareof-brand__tag {
  font-size: 0.75rem;
  color: var(--fareof-muted);
  border-left: 1px solid #cbd5e1;
  padding-left: 0.75rem;
}
@media (max-width: 640px) {
  .fareof-brand__tag { display: none; }
}

.fareof-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}
@media (max-width: 1023px) {
  .fareof-nav { display: none; }
}
.fareof-nav__link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fareof-ink-soft);
  text-decoration: none;
  border-radius: 0.25rem;
  transition: color 150ms ease;
}
.fareof-nav__link:hover { color: var(--fareof-ink); }

.fareof-cta { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.fareof-cta__ext {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  border: 1px solid var(--fareof-amber-line);
  background: var(--fareof-amber-bg);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fareof-ink-soft);
  text-decoration: none;
  transition: background 150ms ease;
}
.fareof-cta__ext:hover { background: var(--fareof-amber-bg-h); }
@media (max-width: 640px) { .fareof-cta__ext { display: none; } }
.fareof-cta__signin {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fareof-ink-soft);
  text-decoration: none;
}
.fareof-cta__signin:hover { color: var(--fareof-ink); }
@media (max-width: 640px) { .fareof-cta__signin { display: none; } }
.fareof-cta__primary {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--fareof-amber);
  color: var(--fareof-ink);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: background 150ms ease;
}
.fareof-cta__primary:hover { background: var(--fareof-amber-hover); color: var(--fareof-ink); }

/* Footer */
.fareof-foot {
  border-top: 1px solid var(--fareof-line);
  background: var(--fareof-paper);
  margin-top: 4rem;
}
.fareof-foot__cols {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  font-size: 0.875rem;
}
@media (min-width: 640px) { .fareof-foot__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .fareof-foot__cols { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

.fareof-foot__brand { grid-column: span 2; }
@media (min-width: 640px) { .fareof-foot__brand { grid-column: span 3; } }
@media (min-width: 1024px) { .fareof-foot__brand { grid-column: span 1; } }
.fareof-foot__brand img { height: 1.75rem; width: auto; display: block; }
.fareof-foot__brand p {
  color: var(--fareof-muted);
  max-width: 18rem;
  line-height: 1.6;
  margin: 0.75rem 0 0;
}
.fareof-foot__social { display: flex; gap: 0.75rem; margin-top: 0.75rem; }
.fareof-foot__social a {
  width: 2.25rem; height: 2.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  color: var(--fareof-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  transition: color 150ms ease, border-color 150ms ease;
}
.fareof-foot__social a:hover { color: var(--fareof-ink); border-color: var(--fareof-ink); }

.fareof-foot__col h6 {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fareof-muted);
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.fareof-foot__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.fareof-foot__col a { color: #334155; text-decoration: none; }
.fareof-foot__col a:hover { color: var(--fareof-ink); text-decoration: underline; text-underline-offset: 0.25rem; }

.fareof-foot__bottom { border-top: 1px solid var(--fareof-line); }
.fareof-foot__bottom-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  font-size: 0.75rem;
  color: var(--fareof-muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: space-between;
}
@media (min-width: 640px) { .fareof-foot__bottom-inner { flex-direction: row; } }

/* Hamburger button + mobile drawer */
.fareof-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.375rem;
  background: transparent;
  border: 0;
  color: var(--fareof-ink-soft);
  cursor: pointer;
  margin-left: 0.25rem;
}
.fareof-hamburger:hover { background: rgba(15, 23, 42, 0.05); }
.fareof-hamburger svg { width: 1.25rem; height: 1.25rem; }
@media (min-width: 1024px) { .fareof-hamburger { display: none; } }

/* Drawer hidden via display:none so it cannot leak into normal flow even if
   position:fixed gets overridden by a parent rule. Slide-in is keyframe-based
   to remain compatible with display:none → display:flex toggling. */
.fareof-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 200;
}
.fareof-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 210;
  width: min(340px, 100vw);
  background: #fff;
  border-left: 1px solid var(--fareof-line);
  flex-direction: column;
  overflow-y: auto;
}
body.fareof-drawer-open .fareof-drawer-backdrop {
  display: block;
  animation: fareofFadeIn 200ms ease;
}
body.fareof-drawer-open .fareof-drawer {
  display: flex;
  animation: fareofSlideIn 250ms ease;
}
body.fareof-drawer-open { overflow: hidden; }
@keyframes fareofFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fareofSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.fareof-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 4rem;
  border-bottom: 1px solid var(--fareof-line);
  flex-shrink: 0;
}
.fareof-drawer__head img { height: 1.5rem; width: auto; }
.fareof-drawer__close {
  width: 2.5rem; height: 2.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.375rem; background: transparent; border: 0;
  color: var(--fareof-ink-soft); cursor: pointer;
}
.fareof-drawer__close:hover { background: rgba(15, 23, 42, 0.05); }
.fareof-drawer__nav { flex: 1; padding: 0.5rem 0; }
.fareof-drawer__nav a {
  display: flex; align-items: center;
  padding: 0 1rem;
  min-height: 44px;
  font-size: 0.875rem; font-weight: 500;
  color: #334155; text-decoration: none;
  border-top: 1px solid var(--fareof-line);
}
.fareof-drawer__nav a:first-child { border-top: 0; }
.fareof-drawer__nav a:hover { color: var(--fareof-amber); }
.fareof-drawer__cta {
  flex-shrink: 0;
  border-top: 1px solid var(--fareof-line);
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.fareof-drawer__cta .fareof-cta__primary,
.fareof-drawer__cta .fareof-cta__signin {
  width: 100%; justify-content: center; display: inline-flex;
}
.fareof-drawer__cta .fareof-cta__signin { display: inline-flex !important; }

/* Hide parent theme's default header, footer, and floating overlays.
   The cs-header stub stays in DOM so parent scripts.js can find it without
   crashing (Cannot read properties of null), but it must not render. */
.cs-site > .cs-site-inner > .cs-header-before,
.cs-site > .cs-site-inner > .cs-header,
.cs-site .cs-footer,
.cs-offcanvas,
.cs-site-overlay,
.cs-search-overlay,
.cs-scroll-to-top { display: none !important; }

/* Blend content area into Fareof palette */
.cs-site, .cs-site-inner, .cs-site-primary { background: var(--fareof-paper) !important; }
.cs-main-content { background: transparent !important; }
.cs-entry__title, h1, h2, h3, h4 { color: var(--fareof-ink); }
.cs-main-content a { color: var(--fareof-ink); }
.cs-main-content a:hover { color: var(--fareof-amber); }

/* Push sticky sidebar + post metabar (reading time + share) below new header */
@media (min-width: 992px) {
  .cs-sticky-sidebar-enabled.cs-stick-to-top .cs-sidebar__inner,
  .cs-sticky-sidebar-enabled.cs-stick-last .cs-sidebar__inner .widget:last-child {
    top: calc(var(--cs-wpadminbar-height, 0px) + 4rem + 1rem) !important;
  }
  .cs-metabar-enabled .cs-entry__metabar-inner {
    top: calc(var(--cs-wpadminbar-height, 0px) + 4rem + 1.25rem) !important;
  }
}

/* Sidebar visual polish */
.cs-sidebar__area { color: var(--fareof-ink-soft); }
.cs-sidebar__area .widget {
  background: #fff;
  border: 1px solid var(--fareof-line);
  border-radius: 0.5rem;
  padding: 1.25rem;
}
.cs-sidebar__area .widget + .widget { margin-top: 1rem; }
.cs-sidebar__area .widget-title,
.cs-sidebar__area .widgettitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fareof-muted);
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.cs-sidebar__area a { color: #334155; text-decoration: none; }
.cs-sidebar__area a:hover { color: var(--fareof-amber); }
.cs-sidebar__area ul { list-style: none; padding: 0; margin: 0; }
.cs-sidebar__area li { padding: 0.25rem 0; border-bottom: 1px solid var(--fareof-line); }
.cs-sidebar__area li:last-child { border-bottom: 0; }
.cs-sidebar__area .tagcloud a {
  display: inline-block;
  margin: 0.125rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--fareof-line);
  border-radius: 9999px;
  font-size: 0.75rem !important;
  background: var(--fareof-paper-dim);
}
.cs-sidebar__area .tagcloud a:hover {
  background: var(--fareof-amber-bg);
  border-color: var(--fareof-amber-line);
}
.cs-sidebar__area .search-form,
.cs-sidebar__area form.search-form { display: flex; gap: 0.5rem; }
.cs-sidebar__area .search-field {
  flex: 1; min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--fareof-line);
  border-radius: 0.375rem;
  background: var(--fareof-paper);
  font-size: 0.875rem;
}
.cs-sidebar__area .search-submit {
  padding: 0.5rem 0.75rem;
  background: var(--fareof-amber);
  border: 0;
  border-radius: 0.375rem;
  color: var(--fareof-ink);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}
.cs-sidebar__area .search-submit:hover { background: var(--fareof-amber-hover); }
