/*
Theme Name: Kestrel
Template: colormag
Description: Design layer for sicilianvampire.com.
Version: 1.0
*/

/*
  SicilianVampire.com — ColorMag child theme
  Palette: "Midnight Felt" — deep casino-table green (#0b3d2e) and near-black
  ink (#10181f) on a cool paper white (#f7f8f7), with a restrained brass/gold
  accent (#b8860b / #8a6d1a) for links and highlights. Slate ramp for text:
  #10181f body, #3f4a54 secondary, #5b6670 muted (AA-safe on white).
  Type: system stack only. Radius: 10px cards, 6px controls. Shadows: Tailwind
  sm/md/lg equivalents.
*/

/* ---------- Base ---------- */

html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  background-color: #f7f8f7;
  color: #10181f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Prevent horizontal scroll from off-canvas mobile menu */
#page,
.site {
  overflow-x: hidden;
}

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

a {
  color: #0b3d2e;
  text-decoration: underline;
  text-decoration-color: #b8860b;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover,
a:focus {
  color: #8a6d1a;
  text-decoration-color: #8a6d1a;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #b8860b;
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4, h5, h6 {
  color: #10181f;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 1.5em 0 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
  margin: 0 0 1.25em;
}

ul, ol {
  margin: 0 0 1.25em;
  padding-left: 1.5em;
  line-height: 1.65;
}

li + li {
  margin-top: 0.375em;
}

strong, b {
  color: #10181f;
}

hr {
  border: 0;
  border-top: 1px solid #d8ded9;
  margin: 2.5rem 0;
}

/* ---------- Layout ---------- */

.cm-container {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.cm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.cm-primary {
  flex: 1 1 0;
  min-width: 0;
}

.cm-secondary {
  flex: 0 0 300px;
  max-width: 300px;
}

/* Readable measure for long-form body text */
.cm-post-content,
.cm-entry-summary {
  max-width: 68ch;
  line-height: 1.7;
  font-size: 1.0625rem;
}

.cm-post-content h2,
.cm-post-content h3 {
  margin-top: 2em;
}

.cm-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5em;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.cm-post-content th,
.cm-post-content td {
  padding: 0.625rem 0.75rem;
  border: 1px solid #d8ded9;
  text-align: left;
}

.cm-post-content th {
  background: #0b3d2e;
  color: #f7f8f7;
  font-weight: 600;
}

.cm-post-content tr:nth-child(even) td {
  background: #eef2ef;
}

.cm-post-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #b8860b;
  background: #eef2ef;
  border-radius: 0 10px 10px 0;
  color: #3f4a54;
}

.cm-post-content code {
  background: #eef2ef;
  border: 1px solid #d8ded9;
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.875em;
}

/* ---------- Header ---------- */

.cm-main-header,
.cm-header-1 {
  background: #10181f;
  border-bottom: 3px solid #b8860b;
}

.cm-header-1 .cm-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.cm-site-branding {
  min-width: 0;
}

.cm-site-title,
.cm-site-title a {
  color: #f7f8f7;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-decoration: none;
}

.cm-site-title a:hover,
.cm-site-title a:focus {
  color: #e9c46a;
}

.cm-site-title a::before {
  content: "♠ ";
  color: #b8860b;
}

.header-image-wrap,
.header-image {
  display: block;
  max-width: 100%;
}

/* Primary navigation */
.cm-primary-nav {
  background: #0b3d2e;
}

.cm-primary-nav ul,
.cm-menu-primary-container ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

.cm-primary-nav li,
.cm-menu-primary-container li {
  margin: 0;
}

.cm-primary-nav a,
.cm-menu-primary-container a {
  display: block;
  padding: 0.875rem 1.125rem;
  color: #f7f8f7;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cm-primary-nav a:hover,
.cm-primary-nav a:focus,
.cm-menu-primary-container a:hover,
.cm-menu-primary-container a:focus {
  background: #0f523d;
  border-bottom-color: #b8860b;
  color: #ffffff;
}

.cm-primary-nav .menu-item-home a {
  color: #e9c46a;
}

.cm-menu-toggle {
  display: none;
  background: transparent;
  border: 2px solid #f7f8f7;
  border-radius: 6px;
  color: #f7f8f7;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
}

.cm-icon {
  display: inline-block;
  vertical-align: middle;
}

/* ---------- Post listings / cards ---------- */

.cm-posts article,
.hentry {
  background: #ffffff;
  border: 1px solid #d8ded9;
  border-top: 4px solid #0b3d2e;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 31, 0.06);
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cm-posts article:hover {
  box-shadow: 0 10px 24px rgba(16, 24, 31, 0.12);
  transform: translateY(-2px);
}

.cm-featured-image {
  margin: -1.5rem -1.5rem 1.25rem;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.cm-featured-image img {
  display: block;
  width: 100%;
}

.cm-entry-header {
  margin-bottom: 0.75rem;
}

.cm-entry-title,
.cm-entry-title a {
  color: #10181f;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.cm-entry-title a:hover,
.cm-entry-title a:focus {
  color: #0b3d2e;
  text-decoration: underline;
  text-decoration-color: #b8860b;
  text-underline-offset: 3px;
}

.cm-entry-header-meta,
.cm-below-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #5b6670;
  margin-bottom: 0.75rem;
}

.cm-entry-header-meta a,
.cm-below-entry-meta a {
  color: #3f4a54;
  text-decoration: none;
}

.cm-entry-header-meta a:hover,
.cm-below-entry-meta a:hover {
  color: #0b3d2e;
  text-decoration: underline;
}

.cm-post-date,
.cm-author,
.entry-date {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.cm-post-categories {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 0.75rem;
}

.cm-post-categories a {
  display: inline-block;
  background: #0b3d2e;
  color: #f7f8f7;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
}

.cm-post-categories a:hover,
.cm-post-categories a:focus {
  background: #b8860b;
  color: #10181f;
}

.cm-entry-summary p:last-child {
  margin-bottom: 0;
}

.cm-entry-button,
.cm-entry-button a {
  display: inline-block;
}

.cm-entry-button a {
  margin-top: 1rem;
  background: #b8860b;
  color: #10181f;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(16, 24, 31, 0.15);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.cm-entry-button a:hover,
.cm-entry-button a:focus {
  background: #8a6d1a;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 24, 31, 0.2);
}

/* ---------- Sidebar widgets ---------- */

.cm-secondary .widget {
  background: #ffffff;
  border: 1px solid #d8ded9;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 31, 0.06);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.cm-widget-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0b3d2e;
  line-height: 1.3;
  margin: 0 0 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 2px solid #b8860b;
}

.cm-secondary .widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cm-secondary .widget ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eef2ef;
  margin: 0;
}

.cm-secondary .widget ul li:last-child {
  border-bottom: 0;
}

.cm-secondary .widget a {
  color: #10181f;
  text-decoration: none;
}

.cm-secondary .widget a:hover,
.cm-secondary .widget a:focus {
  color: #0b3d2e;
  text-decoration: underline;
  text-decoration-color: #b8860b;
}

.textwidget p:last-child {
  margin-bottom: 0;
}

/* ---------- Forms & buttons ---------- */

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: #10181f;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
textarea,
select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #b9c2bb;
  border-radius: 6px;
  padding: 0.625rem 0.75rem;
  line-height: 1.5;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  border-color: #0b3d2e;
  outline: 3px solid rgba(184, 134, 11, 0.35);
  outline-offset: 0;
}

button,
input[type="submit"],
input[type="button"] {
  background: #0b3d2e;
  color: #f7f8f7;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  line-height: 1.5;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: #0f523d;
}

/* ---------- Author card ---------- */

.pbn-author {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: #10181f;
  color: #e4e9e6;
  border-radius: 10px;
  border-left: 4px solid #b8860b;
  box-shadow: 0 4px 10px rgba(16, 24, 31, 0.18);
  padding: 1.5rem;
  margin: 2.5rem 0;
  max-width: 68ch;
}

.pbn-author__avatar {
  flex: 0 0 72px;
}

.pbn-author__avatar img {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #b8860b;
  object-fit: cover;
}

.pbn-author__name {
  margin: 0 0 0.125rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: #f7f8f7;
}

.pbn-author__role {
  margin: 0 0 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
  color: #e9c46a;
}

.pbn-author__bio {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #c9d2cc;
}

.pbn-author__bio a {
  color: #e9c46a;
  text-decoration-color: #e9c46a;
}

/* ---------- Colophon footer ---------- */

.pbn-colophon {
  background: #10181f;
  color: #c9d2cc;
  margin-top: 3rem;
  border-top: 4px solid #b8860b;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.pbn-colophon__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1140px;
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
}

.pbn-colophon h3 {
  color: #f7f8f7;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  margin: 0 0 1rem;
  padding-bottom: 0.625rem;
  border-bottom: 2px solid #0b3d2e;
}

.pbn-colophon ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pbn-colophon ul li {
  margin: 0;
  padding: 0.375rem 0;
}

.pbn-colophon a {
  color: #c9d2cc;
  text-decoration: none;
  text-decoration-color: transparent;
}

.pbn-colophon a:hover,
.pbn-colophon a:focus {
  color: #e9c46a;
  text-decoration: underline;
  text-decoration-color: #b8860b;
}

.pbn-colophon__base {
  border-top: 1px solid #2a343c;
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #8fa39a;
}

/* ---------- ColorMag footer bar ---------- */

.cm-footer,
.cm-footer-bar {
  background: #0a1116;
  color: #8fa39a;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.cm-footer-bar-area {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.cm-footer-bar a,
.cm-footer a {
  color: #c9d2cc;
  text-decoration: none;
}

.cm-footer-bar a:hover,
.cm-footer a:hover {
  color: #e9c46a;
}

.cm-footer-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
}

.copyright {
  margin: 0;
}

/* Back-to-top */
.fa-chevron-up,
.cm-icon--chevron-up {
  line-height: 1.5;
}

/* ---------- Accessibility helpers ---------- */

.screen-reader-text,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  width: auto;
  height: auto;
  clip: auto;
  z-index: 100000;
  background: #b8860b;
  color: #10181f;
  font-weight: 700;
  line-height: 1.5;
  padding: 0.625rem 1rem;
  border-radius: 6px;
  text-decoration: none;
}

::selection {
  background: #b8860b;
  color: #10181f;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .cm-row {
    flex-direction: column;
    gap: 1.5rem;
  }

  .cm-secondary {
    flex: 1 1 auto;
    max-width: none;
  }

  .cm-header-1 .cm-container {
    flex-wrap: wrap;
  }

  .cm-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .cm-primary-nav ul,
  .cm-menu-primary-container ul {
    flex-direction: column;
  }

  .cm-primary-nav a,
  .cm-menu-primary-container a {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #0f523d;
  }

  .pbn-colophon__cols {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding: 2.25rem 1.25rem 1.5rem;
  }

  .pbn-colophon__base {
    flex-direction: column;
  }

  .pbn-author {
    flex-direction: column;
    align-items: flex-start;
  }

  .cm-footer-bar-area {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.3125rem; }

  .cm-posts article,
  .hentry {
    padding: 1.25rem;
  }

  .cm-featured-image {
    margin: -1.25rem -1.25rem 1rem;
  }
}

/* ---------------------------------------------------------------------------
   PATCH — not authored by Kimi K3.
   Its stylesheet cleared most of the gate first time, but left colormag's stock
   blue (#207daf) showing in three places it did not style: the primary nav, the
   footer copyright line, and the avatar box. Fixed narrowly — no redesign — so
   the comparison still reflects the model's own work.
   --------------------------------------------------------------------------- */
.cm-menu-primary-container { background: #0b3d2e; }
ul.menunav-menu > li { background: transparent; }
ul.menunav-menu > li > a { color: #f4efe2; background: transparent; }
ul.menunav-menu > li > a:hover { background: rgba(255, 255, 255, .14); color: #ffffff; }
ul.menunav-menu > li.current-menu-item > a { background: #12513c; color: #ffffff; }

.cm-footer-bar, .cm-footer-bar-area { background: #0b3d2e; }
.copyright, .copyright span, .cm-footer-bar__1, .cm-footer-bar__2 { color: #d9d2c2; }
.copyright a { color: #e9c46a; }
.copyright a:hover { color: #ffffff; }

#cm-primary, .cm-container, #page, .site { overflow-x: hidden; box-sizing: border-box; }
.pbn-author__avatar { flex: 0 0 auto; overflow: hidden; }
.pbn-author__avatar img { max-width: 100%; }


/* ---------------------------------------------------------------------------
   Stopgap before the from-scratch theme (plan-v3): the three defects that must
   not sit on a live site while the rebuild is decided.
   --------------------------------------------------------------------------- */
/* colormag ships html{font-size:10px}; every rem below was landing at 62.5%. */
html { font-size: 16px; }

/* The parent theme renders its own author card next to ours. */
.author-info, .author-bio, .author-description, .author-avatar,
.wp-post-author-meta, .entry-author-box, .cm-author-box, .about-author,
#author-info, .post-author-info { display: none; }

/* Flex was squashing a square avatar to 31x64. */
.pbn-author__avatar { flex: 0 0 auto; width: auto; }
.pbn-author__avatar img { width: 64px; height: 64px; object-fit: cover; max-width: none; }

/* Nothing under 14px on a reading site. */
body, p, li, td, th, a, span, div, figcaption { font-size: inherit; }
.entry-meta, .entry-meta a, .posted-on, .posted-on a, .cm-entry-header-meta,
.cm-entry-header-meta a, .cm-below-entry-meta, .cm-below-entry-meta a,
.byline, .byline a, .nav-subtitle, time, .date-box, .date-box span,
.pbn-author__role, .pbn-colophon__base, .widget label,
.wp-block-search__label, .cat-links, .cat-links a { font-size: 14px; }
.pbn-author__name { font-size: 16px; }
.pbn-author__bio { font-size: 15px; }
.postbox .date-box, .postbox .entry-author, .postbox .entry-comments { font-size: 14px; }
button, input, select, textarea, .wp-block-search__button { font-size: 15px; }
.cm-post-categories a, .morenews-categories, a.morenews-categories { font-size: 12.5px; }

/* Second pass on the 14px floor: chips, widget titles and footer headings were
   still landing at 12-12.8px. */
.cat-links, .cat-links a, .cm-post-categories a, .morenews-categories,
a.morenews-categories, .postbox .date-box, .postbox .date-box span,
span.nav-subtitle, .nav-links .nav-subtitle, label.wp-block-search__label,
.widget label, h2.wp-block-heading, .widget .wp-block-heading, .widget h2,
.widget-title, .cm-widget-title, .cm-widget-title span,
.pbn-colophon h3, .pbn-colophon a, .pbn-colophon li, .pbn-colophon p,
.pbn-colophon__base, .entry-meta, .entry-meta a, .posted-on, .posted-on a,
.cm-entry-header-meta, .cm-entry-header-meta a, .cm-below-entry-meta,
.cm-below-entry-meta a, time, .byline, .byline a { font-size: 14px; }

/* Final stopgap pass: these few selectors are outranked by the parent's own
   sizing, so the floor is enforced explicitly. The from-scratch theme removes
   the need for this entirely. */
.cat-links a, .cat-links, a.morenews-categories, .morenews-categories,
.category-color-1, label.wp-block-search__label, .wp-block-search__button,
.item-metadata, .posts-date, span.item-metadata, .entry-meta a, .author a,
a.url.fn.n, .pbn-author__role, .cm-post-categories a { font-size: 14px !important; }

/* charliewellbeing: the author card had no inner padding. */
.pbn-author { padding: 1.25rem; box-sizing: border-box; }
