/* ============================================================
   Automation Beyond — redesign stylesheet
   Loaded after the legacy neulane theme; overrides legacy chrome
   with a clean, responsive, accessible design.
   ============================================================ */

:root {
  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Apple Garamond", Georgia,
                "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --fs-xs: 0.8125rem;   /* 13px */
  --fs-sm: 0.9375rem;   /* 15px */
  --fs-base: 1.0625rem; /* 17px */
  --fs-md: 1.1875rem;   /* 19px */
  --fs-lg: 1.4375rem;   /* 23px */
  --fs-xl: 1.875rem;    /* 30px */
  --fs-2xl: 2.5rem;     /* 40px */

  --lh-tight: 1.25;
  --lh-snug: 1.4;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;

  /* Light theme (default) */
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-soft: #f3f2ee;
  --border: #e4e2dc;
  --border-strong: #c8c5bc;
  --text: #1c1c1a;
  --text-muted: #5a5a55;
  --text-subtle: #7d7d77;
  --accent: #b35a1f;        /* warm umber */
  --accent-strong: #8c4515;
  --accent-soft: #f4ead9;
  --link: #1a558d;
  --link-hover: #0d3a66;
  --code-bg: #f3f2ee;
  --shadow-sm: 0 1px 2px rgba(28, 28, 26, 0.04);
  --shadow-md: 0 4px 16px rgba(28, 28, 26, 0.06);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --maxw-content: 72ch;
  --maxw-page: 1180px;
  --gutter: clamp(1rem, 3vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14140f;
    --surface: #1c1c17;
    --surface-soft: #23231d;
    --border: #2c2c25;
    --border-strong: #41413a;
    --text: #ececea;
    --text-muted: #b3b3ad;
    --text-subtle: #8a8a83;
    --accent: #e0853a;
    --accent-strong: #f0a05f;
    --accent-soft: #2a1f12;
    --link: #87baee;
    --link-hover: #b6d3f3;
    --code-bg: #23231d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  }
}

/* ----- Reset / base ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 0% 0%, var(--accent-soft), transparent 60%),
    radial-gradient(circle at 100% 100%, var(--accent-soft), transparent 70%);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: #fff; }

/* Hide legacy emoji shims, ad slots, tracker pixels */
img.wp-smiley, img.emoji { display: inline; }
img[src*="google-analytics"], img[src*="topsy"], img[src$=".gif"][width="1"] {
  display: none !important;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}
a:hover, a:focus { color: var(--link-hover); }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }

hr, .hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

/* ----- Typography -------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  margin: 1.6em 0 0.6em;
  font-weight: 600;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
h5, h6 { font-size: var(--fs-base); }

p, li {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}
pre {
  background: var(--code-bg);
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border);
}
pre code { background: transparent; padding: 0; }

/* ----- Layout overrides for legacy WP theme ------------------------ */
body > div[style*="width: 0"] { display: none !important; }

.content {
  width: 100% !important;
  max-width: none !important;
  background: transparent !important;
  padding: 0 !important;
}
.wrap, .marginauto {
  width: 100% !important;
  max-width: var(--maxw-page) !important;
  margin: 0 auto !important;
  padding: 0 var(--gutter) !important;
  background: transparent !important;
}

/* ----- Header / banner --------------------------------------------- */
.banner {
  display: flex;
  flex-direction: column-reverse;
  gap: 1.5rem;
  padding: 2.5rem 0 1.5rem;
  background: transparent !important;
  border: 0 !important;
  height: auto !important;
  position: relative;
}

h1.logo {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text) !important;
  background: none !important;
  display: block !important;
  height: auto !important;
  width: auto !important;
}
h1.logo a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
}
h1.logo a::before {
  content: "AB";
  display: inline-grid;
  place-items: center;
  width: 2.4rem; height: 2.4rem;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: var(--font-sans);
  flex-shrink: 0;
}
h1.logo img { display: none !important; }
h1.logo span {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
  margin-top: 0.4rem;
  line-height: var(--lh-snug);
}

/* ----- Primary navigation (was: dropdown-categories) --------------- */
ul.dropdown-categories,
ul.dropdown-pages {
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  background: transparent !important;
  border: 0 !important;
  height: auto !important;
  width: auto !important;
  position: static !important;
  float: none !important;
}
ul.dropdown-categories > li,
ul.dropdown-pages > li {
  position: relative;
  list-style: none;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
ul.dropdown-categories > li > a,
ul.dropdown-pages > li > a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted) !important;
  text-decoration: none !important;
  border-radius: 999px;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
  text-transform: none !important;
  letter-spacing: 0;
}
ul.dropdown-categories > li > a:hover,
ul.dropdown-pages > li > a:hover,
ul.dropdown-categories > li.current_page_item > a,
ul.dropdown-pages > li.current_page_item > a {
  color: var(--text) !important;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* Submenus: convert from absolute hover dropdowns to inline disclosure */
ul.dropdown-categories ul.children,
ul.dropdown-pages ul.children,
ul.dropdown-categories ul,
ul.dropdown-pages ul {
  position: static !important;
  display: none;
  background: transparent !important;
  border: 0 !important;
  width: auto !important;
  padding: 0.25rem 0 0.25rem 1rem !important;
  margin: 0 !important;
  list-style: none !important;
  box-shadow: none !important;
}
ul.dropdown-categories > li:hover ul.children,
ul.dropdown-pages > li:hover ul.children,
ul.dropdown-categories > li:focus-within ul.children,
ul.dropdown-pages > li:focus-within ul.children {
  display: block;
  position: absolute !important;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 240px;
  padding: 0.5rem !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
}
ul.dropdown-categories ul.children li,
ul.dropdown-pages ul.children li {
  display: block;
  list-style: none;
  margin: 0;
}
ul.dropdown-categories ul.children li a,
ul.dropdown-pages ul.children li a {
  display: block;
  padding: 0.4rem 0.7rem;
  font-size: var(--fs-sm);
  color: var(--text) !important;
  text-decoration: none !important;
  border-radius: var(--radius-sm);
}
ul.dropdown-categories ul.children li a:hover,
ul.dropdown-pages ul.children li a:hover {
  background: var(--surface-soft);
  color: var(--accent-strong) !important;
}

.topbars {
  margin-top: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent !important;
  height: auto !important;
}
.pages-left, .pages-right { display: none; }
.subscribe {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  margin-top: 0.5rem;
}
.subscribe a {
  color: var(--text-muted);
  text-decoration: none;
}
.subscribe a:hover { color: var(--accent-strong); }

/* ----- Main grid: posts + sidebar ---------------------------------- */
.post-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin: 2rem 0 4rem;
  background: transparent !important;
  width: 100% !important;
}
.indexposts {
  width: 100% !important;
  background: transparent !important;
  padding: 0 !important;
}
.sidebar-wrap {
  background: transparent !important;
  width: 100% !important;
  padding: 0 !important;
}

@media (max-width: 880px) {
  .post-wrap { grid-template-columns: 1fr; }
}

/* ----- Posts ------------------------------------------------------- */
.entry-title {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
  line-height: var(--lh-tight);
}
.entry-title a {
  color: var(--text);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s ease, color 0.15s ease;
}
.entry-title a:hover {
  color: var(--accent-strong);
  background-size: 100% 1px;
}

.post {
  background: var(--surface) !important;
  padding: 1.75rem 1.75rem 1.5rem !important;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem !important;
  width: auto !important;
}
.post.smallindex { padding: 1.5rem !important; }

.post > span,
.post .meta,
.entry-title + span {
  display: inline-block;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  margin-bottom: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.entry-content {
  color: var(--text);
  line-height: var(--lh-relaxed);
  max-width: var(--maxw-content);
}
.entry-content p { margin: 0.85em 0; }
.entry-content a { color: var(--link); }
.entry-content img {
  border-radius: var(--radius-md);
  display: block;
  margin: 1.25rem 0;
  box-shadow: var(--shadow-sm);
}
.entry-content ul, .entry-content ol {
  padding-left: 1.4rem;
}
.entry-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: var(--fs-sm);
}
.entry-content th, .entry-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
  text-align: left;
}
.entry-content th {
  background: var(--surface-soft);
  font-weight: 600;
}

.pagination {
  margin: 2rem 0;
  font-size: var(--fs-sm);
}
.pagination a {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  background: var(--surface);
  color: var(--text);
}
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* ----- Sidebar widgets --------------------------------------------- */
.widget,
.middlewidget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  width: auto !important;
}
.widget h3,
.widgettitle,
.middle-title {
  font-family: var(--font-serif);
  font-size: var(--fs-base);
  font-weight: 600;
  margin: 0 0 0.85rem;
  color: var(--text);
  background: none !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  border: 0 !important;
  padding: 0 !important;
}
.widget ul,
.middle ul,
ul.middle {
  list-style: none;
  margin: 0;
  padding: 0;
}
.widget li,
.middle li {
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  background: none !important;
  list-style: none;
}
.widget li:last-child,
.middle li:last-child { border-bottom: 0; }
.widget li a,
.middle li a {
  color: var(--text);
  text-decoration: none;
}
.widget li a:hover,
.middle li a:hover { color: var(--accent-strong); }
.middlebottom { display: none; }

/* Calendar */
#wp-calendar {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-xs);
  margin-top: 0.25rem;
}
#wp-calendar caption {
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-align: left;
  color: var(--text-muted);
}
#wp-calendar th, #wp-calendar td {
  text-align: center;
  padding: 0.3rem 0;
  color: var(--text-muted);
}
#wp-calendar thead th {
  font-weight: 600;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border);
}
#wp-calendar #today {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
}

/* Search */
.searchform { display: flex; }
.searchform input[type="text"],
.searchform input.form-control {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-sm);
  font-family: inherit;
}
.searchform input[type="submit"] {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
}
.searchform input[type="submit"]:hover { background: var(--accent-strong); }

/* ----- Footer ------------------------------------------------------ */
.footer {
  margin-top: 3rem;
  padding: 1.75rem var(--gutter);
  background: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  height: auto !important;
  width: 100% !important;
}
.footer a {
  color: var(--text-muted);
  text-decoration: underline;
}
.footer a:hover { color: var(--accent-strong); }

.license_block {
  background: var(--surface) !important;
  border-top: 1px solid var(--border);
  padding: 1.25rem var(--gutter);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  width: 100% !important;
}
.wp_license { max-width: var(--maxw-page); margin: 0 auto; }
.wp_license img {
  display: inline-block;
  margin: 0 auto 0.5rem;
  vertical-align: middle;
}

/* ----- Hide noise ---------------------------------------------------*/
script + br, br + br + br { display: none; }

/* Comments specific tweaks */
.comments, #comments, .commentlist, ol.commentlist {
  list-style: none;
  padding-left: 0;
}
.comment, li.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin: 0.75rem 0;
  list-style: none;
}

/* Avoid the legacy Cufon canvas elements pushing layout when JS off */
canvas.cufon-canvas { display: none; }

/* ----- Print ------------------------------------------------------- */
@media print {
  body { background: white; color: black; }
  .banner, .topbars, .sidebar-wrap, .footer, .license_block { display: none; }
  .post { border: 0; box-shadow: none; padding: 0 !important; }
}
