/*
Theme Name: KRBrief HybridMag Child
Theme URI: https://krbrief.com/
Description: KRBrief editorial child theme for HybridMag. Keeps HybridMag's magazine layout while applying KRBrief navigation, sidebar, footer and editorial styling.
Author: KRBrief
Template: hybridmag
Version: 1.0.6
Text Domain: krbrief-hybridmag-child
*/

:root {
  --krb-blue: #2767d8;
  --krb-line-soft: rgba(127, 127, 127, 0.22);
}

/*
 * IMPORTANT: keep HybridMag's page shell full width.
 * v1.0.0 accidentally constrained .site and .site-content themselves,
 * which made the whole magazine layout stick to the left on wide screens.
 */
#page.site,
.site {
  width: 100% !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

#content.site-content,
.site-content {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* HybridMag's native geometry uses .hm-container throughout header/content/footer. */
.hm-container,
.site-header .hm-container,
.site-content > .hm-container,
.site-footer .hm-container,
#colophon .hm-container {
  width: calc(100% - 48px) !important;
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* Preserve HybridMag's own light/dark palette instead of forcing light colors. */
.site-title,
.site-title a,
.custom-logo-link + .site-title a,
.main-navigation,
.main-navigation a,
#site-navigation,
#site-navigation a,
.entry-title,
.entry-title a,
.widget-title,
.entry-meta,
.entry-meta a,
.posted-on,
.byline,
.cat-links {
  color: inherit;
}

.main-navigation a,
#site-navigation a {
  font-weight: 600;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
#site-navigation a:hover,
#site-navigation .current-menu-item > a,
.entry-title a:hover {
  color: var(--krb-blue);
}

/* Category chips: restrained blue accent, readable in either color mode. */
.cat-links a,
.entry-categories a,
.post-categories a {
  border-radius: 3px;
  font-weight: 700;
  text-transform: none;
}

/* Sidebar: keep HybridMag card colors; only refine spacing and KRBrief widgets. */
#secondary .widget,
.widget-area .widget {
  padding: 20px;
  margin-bottom: 22px;
  border-color: var(--krb-line-soft);
  box-shadow: none;
}

#secondary .widget-title,
.widget-area .widget-title {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--krb-blue);
  font-size: 19px;
  line-height: 1.25;
  color: inherit;
}

#secondary .widget p,
.widget-area .widget p {
  color: inherit;
}

.krb-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.krb-side-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--krb-line-soft);
}

.krb-side-item:first-child { padding-top: 0; }
.krb-side-item:last-child { border-bottom: 0; padding-bottom: 0; }

.krb-side-thumb {
  width: 74px;
  height: 54px;
  object-fit: cover;
  border-radius: 3px;
  background: rgba(127, 127, 127, 0.16);
}

.krb-side-title {
  display: block;
  color: inherit !important;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
}

.krb-side-title:hover { color: var(--krb-blue) !important; }
.krb-side-meta {
  margin-top: 4px;
  color: inherit;
  opacity: 0.62;
  font-size: 11px;
}

.krb-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.krb-category-list li + li { border-top: 1px solid var(--krb-line-soft); }
.krb-category-list a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  color: inherit !important;
  font-weight: 650;
}
.krb-category-list a:hover { color: var(--krb-blue) !important; }

/* Footer: editorial rather than generic WordPress footer. */
.site-footer,
#colophon {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #18222b 0%, #222d36 52%, #17242f 100%);
  color: #dbe3ea;
  border-top: 3px solid var(--krb-blue);
}

.site-footer::before,
#colophon::before {
  content: "";
  position: absolute;
  right: -110px;
  top: -140px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(74, 134, 235, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 48px rgba(74, 134, 235, 0.035),
    0 0 0 96px rgba(74, 134, 235, 0.025);
  pointer-events: none;
}

.site-footer .hm-container,
#colophon .hm-container {
  position: relative;
  z-index: 1;
}

.site-footer a,
#colophon a {
  color: #eef4f8;
  text-decoration: none;
}

.site-footer a:hover,
#colophon a:hover {
  color: #79a8ff;
}

.site-footer .widget-title,
#colophon .widget-title {
  color: #ffffff;
  border: 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.site-footer .widget,
#colophon .widget {
  color: inherit;
  padding-top: 34px;
  padding-bottom: 28px;
}

.site-footer p,
#colophon p {
  color: inherit;
}

.krb-footer-brand {
  font-size: 30px;
  line-height: 1;
  font-weight: 850;
  color: #fff;
  letter-spacing: -0.04em;
  margin-bottom: 10px;
}

.krb-footer-kicker {
  color: #9fc0ff;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 750;
  letter-spacing: 0.015em;
  margin-bottom: 10px;
}

.krb-footer-copy {
  max-width: 330px;
  color: #cdd6de;
  font-size: 13px;
  line-height: 1.7;
}

.krb-footer-contact {
  margin-top: 15px;
  font-size: 13px;
  font-weight: 650;
}

.krb-footer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ffffff !important;
  border-bottom: 1px solid rgba(255,255,255,0.35);
  padding-bottom: 2px;
}

.krb-footer-contact a:hover {
  color: #9fc0ff !important;
  border-bottom-color: #9fc0ff;
}

.krb-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.krb-footer-links li {
  margin: 0 0 9px;
}

.krb-footer-links a {
  position: relative;
  display: inline-block;
  font-size: 13px;
  line-height: 1.45;
  color: #dbe3ea !important;
  transition: transform 0.15s ease, color 0.15s ease;
}

.krb-footer-links a:hover {
  transform: translateX(3px);
  color: #9fc0ff !important;
}

.site-info,
.site-footer .site-info,
#colophon .site-info {
  border-top-color: rgba(255,255,255,0.12) !important;
  color: #aeb9c3;
}

.site-info a,
.site-footer .site-info a,
#colophon .site-info a {
  color: #cfd8e0;
}

/* Content typography: stay close to HybridMag demo. */
.entry-content,
.entry-summary { line-height: 1.7; }

/* Defensive dark-mode compatibility for child-only content.
 * HybridMag has its own dark mode; these selectors only make sure our custom
 * widgets never retain a light-mode text color if the parent changes mode.
 */
body[class*="dark"] .krb-side-title,
body[class*="dark"] .krb-category-list a,
body[class*="dark"] #secondary .widget p,
body[class*="dark"] .widget-area .widget p,
html[class*="dark"] .krb-side-title,
html[class*="dark"] .krb-category-list a,
html[class*="dark"] #secondary .widget p,
html[class*="dark"] .widget-area .widget p,
body[data-theme="dark"] .krb-side-title,
body[data-theme="dark"] .krb-category-list a,
html[data-theme="dark"] .krb-side-title,
html[data-theme="dark"] .krb-category-list a {
  color: inherit !important;
}

@media (max-width: 900px) {
  .hm-container,
  .site-header .hm-container,
  .site-content > .hm-container,
  .site-footer .hm-container,
  #colophon .hm-container {
    width: calc(100% - 32px) !important;
  }

  .krb-side-item { grid-template-columns: 64px minmax(0,1fr); }
  .krb-side-thumb { width: 64px; height: 48px; }
}

@media (max-width: 640px) {
  .hm-container,
  .site-header .hm-container,
  .site-content > .hm-container,
  .site-footer .hm-container,
  #colophon .hm-container {
    width: calc(100% - 24px) !important;
  }

  #secondary .widget,
  .widget-area .widget { padding: 16px; }
}


/* ==========================================================
 * v1.0.4 — stable homepage reset + balanced footer
 * Built from the known-good v1.0.2 geometry.
 * ========================================================== */

/* Clean editorial homepage: the child owns only the actual feed + sidebar.
 * Parent widths/floats must not shrink grid items inside this container. */
.home .krb-home-content {
  padding-top: 34px;
  padding-bottom: 56px;
}

.home .krb-home-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 310px !important;
  gap: 32px !important;
  align-items: start !important;
}

.home .krb-home-grid > #primary,
.home .krb-home-grid > .content-area,
.home .krb-home-grid > #secondary,
.home .krb-home-grid > .widget-area {
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.krb-feed-card {
  display: grid;
  grid-template-columns: minmax(220px, 38%) minmax(0, 1fr);
  min-height: 210px;
  margin: 0 0 22px;
  overflow: hidden;
  border: 1px solid var(--krb-line-soft);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(14, 27, 42, 0.045);
}

.krb-feed-media {
  display: block;
  min-height: 210px;
  background: rgba(127,127,127,.08);
}

.krb-feed-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
}

.krb-feed-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 24px 26px 22px;
}

.krb-feed-category {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 9px;
  padding: 4px 8px;
  border-radius: 3px;
  background: #eaf2ff;
  color: #215fc4 !important;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .02em;
}

.krb-feed-title {
  margin: 0 0 10px;
  font-size: clamp(21px, 1.7vw, 27px);
  line-height: 1.14;
  letter-spacing: -.025em;
}

.krb-feed-title a {
  color: inherit !important;
  text-decoration: none;
}

.krb-feed-title a:hover { color: var(--krb-blue) !important; }

.krb-feed-excerpt {
  margin: 0 0 13px;
  color: inherit;
  opacity: .78;
  font-size: 14px;
  line-height: 1.58;
}

.krb-feed-meta {
  margin-top: auto;
  color: inherit;
  opacity: .62;
  font-size: 11.5px;
  line-height: 1.4;
}

.krb-feed-pagination { margin-top: 30px; }
.krb-feed-pagination .nav-links { display:flex; flex-wrap:wrap; gap:8px; }
.krb-feed-pagination .page-numbers {
  display:inline-flex;
  min-width:36px;
  min-height:36px;
  align-items:center;
  justify-content:center;
  padding:7px 11px;
  border:1px solid var(--krb-line-soft);
  border-radius:4px;
  color:inherit;
  text-decoration:none;
}
.krb-feed-pagination .current,
.krb-feed-pagination a:hover {
  border-color:var(--krb-blue);
  background:var(--krb-blue);
  color:#fff !important;
}

.krb-no-posts {
  padding:34px;
  border:1px solid var(--krb-line-soft);
  border-radius:5px;
  text-align:center;
}

/* Child-owned feed cards follow the parent's dark mode. */
body[class*="dark"] .krb-feed-card,
html[class*="dark"] .krb-feed-card,
body[data-theme="dark"] .krb-feed-card,
html[data-theme="dark"] .krb-feed-card {
  background:#222;
  border-color:rgba(255,255,255,.14);
  box-shadow:none;
}
body[class*="dark"] .krb-feed-category,
html[class*="dark"] .krb-feed-category,
body[data-theme="dark"] .krb-feed-category,
html[data-theme="dark"] .krb-feed-category {
  background:rgba(63,125,233,.18);
  color:#91b6ff !important;
}

/* CSS fallbacks for known/likely HybridMag magazine strips.
 * The JS cleanup is the primary removal mechanism and only runs on home. */
.home .hm-featured-posts,
.home .hybridmag-featured-posts,
.home .featured-posts-section,
.home .featured-posts-wrapper,
.home .front-page-featured,
.home .hm-latest-posts,
.home .hybridmag-latest-posts,
.home .latest-posts-section,
.home .front-page-latest {
  display:none !important;
}

/* Footer: preserve exactly three parent footer widget areas and make their
 * visual weight intentional. The third area contains Company + Legal. */
.site-footer::before,
#colophon::before {
  right:-78px;
  top:-88px;
  width:270px;
  height:270px;
  box-shadow:
    0 0 0 38px rgba(74,134,235,.028),
    0 0 0 76px rgba(74,134,235,.018);
}

.site-footer .hm-container,
#colophon .hm-container {
  max-width:1180px !important;
}

.site-footer .footer-widgets,
#colophon .footer-widgets,
.site-footer .footer-widgets-wrapper,
#colophon .footer-widgets-wrapper,
.site-footer .footer-widget-area,
#colophon .footer-widget-area {
  box-sizing:border-box;
}

/* Cover the common HybridMag footer wrappers without changing site-wide grids. */
@media (min-width: 901px) {
  .site-footer .footer-widgets,
  #colophon .footer-widgets,
  .site-footer .footer-widgets-wrapper,
  #colophon .footer-widgets-wrapper {
    display:grid !important;
    grid-template-columns:minmax(0,1.35fr) minmax(150px,.72fr) minmax(300px,1.15fr) !important;
    column-gap:64px !important;
    align-items:start !important;
  }

  .site-footer .footer-widgets > *,
  #colophon .footer-widgets > *,
  .site-footer .footer-widgets-wrapper > *,
  #colophon .footer-widgets-wrapper > * {
    float:none !important;
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
  }
}

.krb-footer-copy {
  max-width:390px;
  font-size:13.5px;
  line-height:1.72;
}

.krb-footer-kicker { font-size:13.5px; }

.krb-footer-info-grid {
  display:grid;
  grid-template-columns:minmax(110px,.8fr) minmax(160px,1.2fr);
  gap:38px;
  align-items:start;
}

.krb-footer-subheading {
  margin:0 0 14px;
  color:#fff;
  font-size:17px;
  line-height:1.25;
  font-weight:750;
  letter-spacing:-.01em;
}

@media (max-width: 900px) {
  .home .krb-home-grid {
    grid-template-columns:1fr !important;
    gap:28px !important;
  }
  .krb-feed-card { grid-template-columns:38% minmax(0,1fr); }
  .krb-footer-info-grid { gap:24px; }
}

@media (max-width: 680px) {
  .home .krb-home-content { padding-top:22px; }
  .krb-feed-card { display:block; }
  .krb-feed-media,
  .krb-feed-media img {
    min-height:0;
    height:auto;
    aspect-ratio:16/9;
  }
  .krb-feed-body { padding:20px; }
  .krb-footer-info-grid {
    grid-template-columns:1fr 1fr;
    gap:22px;
  }
}


/* ==========================================================
 * v1.0.5 — clean HybridMag feed + exact footer geometry
 * The homepage now truncates parent header output at </header>,
 * so HybridMag's magazine Featured/Latest sections cannot render.
 * ========================================================== */

/* The child homepage starts directly with the chronological feed. */
.home .krb-home-content,
.blog .krb-home-content {
  padding-top: 34px !important;
  padding-bottom: 58px !important;
}

.home .krb-home-grid,
.blog .krb-home-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 300px !important;
  gap: 34px !important;
  align-items: start !important;
}

.home .krb-home-grid > #primary,
.blog .krb-home-grid > #primary,
.home .krb-home-grid > #secondary,
.blog .krb-home-grid > #secondary,
.home .krb-home-grid > .content-area,
.blog .krb-home-grid > .content-area,
.home .krb-home-grid > .widget-area,
.blog .krb-home-grid > .widget-area {
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
}

/* Footer is one child-owned grid instead of relying on three unequal
 * parent footer widget columns. This makes Brand / Explore / Company / Legal
 * align to a predictable rhythm at every desktop width. */
.site-footer .footer-widgets,
#colophon .footer-widgets,
.site-footer .footer-widgets-wrapper,
#colophon .footer-widgets-wrapper {
  display: block !important;
}

.site-footer .footer-widgets > *,
#colophon .footer-widgets > *,
.site-footer .footer-widgets-wrapper > *,
#colophon .footer-widgets-wrapper > * {
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

.krb-footer-shell {
  display: grid;
  grid-template-columns: minmax(290px, 1.55fr) repeat(3, minmax(135px, .75fr));
  gap: clamp(36px, 5vw, 78px);
  align-items: start;
  width: 100%;
  padding: 4px 0 2px;
}

.krb-footer-col {
  min-width: 0;
}

.krb-footer-col .krb-footer-subheading,
.krb-footer-col > .widget-title {
  margin: 0 0 15px;
}

.krb-footer-shell .krb-footer-brand {
  margin-top: 0;
}

.krb-footer-shell .krb-footer-copy {
  max-width: 355px;
}

/* Disable legacy nested layout if old widget HTML is briefly cached. */
.krb-footer-shell .krb-footer-info-grid {
  display: contents;
}

@media (max-width: 1000px) {
  .krb-footer-shell {
    grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(115px, .8fr));
    gap: 32px;
  }
}

@media (max-width: 820px) {
  .home .krb-home-grid,
  .blog .krb-home-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .krb-footer-shell {
    grid-template-columns: 1fr 1fr;
    gap: 34px 26px;
  }

  .krb-footer-shell .krb-footer-copy {
    max-width: 440px;
  }
}

@media (max-width: 560px) {
  .krb-feed-card {
    grid-template-columns: 1fr;
  }

  .krb-feed-media,
  .krb-feed-media img {
    min-height: 190px;
  }

  .krb-footer-shell {
    grid-template-columns: 1fr;
    gap: 25px;
  }
}


/* v1.0.5 child-owned footer final geometry. */
.krb-site-footer > .hm-container {
  padding-top: 44px;
  padding-bottom: 0;
}

.krb-site-footer .krb-footer-shell {
  padding-bottom: 38px;
}

.krb-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 20px;
  border-top: 1px solid rgba(255,255,255,.13);
  color: #aeb9c3;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 560px) {
  .krb-site-footer > .hm-container { padding-top: 34px; }
  .krb-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}


/* ==========================================================
 * v1.0.6 — footer consistency across archives + mobile polish
 * ========================================================== */

/*
 * On parent archive/category templates the custom child footer can inherit the
 * width of an outer HybridMag content wrapper. Make the footer itself full
 * bleed, while its own .hm-container remains aligned with the site content.
 */
.krb-site-footer {
  position: relative;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  box-sizing: border-box;
  clear: both;
}

@supports (width: 100dvw) {
  .krb-site-footer {
    width: 100dvw !important;
    max-width: 100dvw !important;
    margin-left: calc(50% - 50dvw) !important;
    margin-right: calc(50% - 50dvw) !important;
  }
}

/* Keep the footer's inner alignment identical on home and category/archive. */
.krb-site-footer > .hm-container {
  width: calc(100% - 48px) !important;
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Mobile: keep article/sidebar text left-aligned for reading, but center the
 * brand/navigation footer. This feels calmer and avoids the long left-heavy
 * column shown in the 400px capture. */
@media (max-width: 560px) {
  .krb-site-footer > .hm-container {
    width: calc(100% - 32px) !important;
  }

  .krb-site-footer .krb-footer-shell {
    justify-items: center;
    text-align: center;
    gap: 24px;
  }

  .krb-site-footer .krb-footer-col,
  .krb-site-footer .krb-footer-brand-col {
    width: 100%;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
  }

  .krb-site-footer .krb-footer-copy {
    max-width: 330px;
    margin-left: auto;
    margin-right: auto;
  }

  .krb-site-footer .krb-footer-contact {
    display: flex;
    justify-content: center;
  }

  .krb-site-footer .krb-footer-links {
    display: grid;
    justify-items: center;
  }

  .krb-site-footer .krb-footer-links a:hover {
    transform: none;
  }

  .krb-site-footer .krb-footer-bottom {
    align-items: center;
    text-align: center;
  }
}
