/* ============================
   SIDEBAR WIDGETS (CLEAN BASE)
   ============================ */

.widget{
  border: var(--sbb-border);
  border-radius: var(--sbb-radius);
  background:#fff;
  box-shadow: var(--sbb-shadow);
  padding: 14px 14px 10px 14px;
  margin-bottom: 18px;
}

.widget-title{
  margin: 0 0 10px 0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Default widget lists: clean + consistent */
.widget ul{
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget li{
  margin: 0;
  padding: 0;
}

.widget a{
  font-weight: 800;
  text-decoration: none;
  color: var(--sbb-text);
}

.widget a:hover{
  color: var(--sbb-accent);
}

/* ============================
   MOST VIEWED / POSTS LIST WIDGET
   Only applies when a list item contains an image
   so categories/menus won't get wrecked.
   ============================ */

/* Modern browsers */
@supports selector(li:has(img)){

  .widget li:has(img){
    padding: 10px 0;
  }

  .widget li:has(img) > a{
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;

    font-size: 14px;
    font-weight: 750;
    line-height: 1.3;
    color: var(--sbb-text);
  }

  .widget li:has(img) img{
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
  }

  .widget li:has(img) + li:has(img){
    border-top: 1px solid rgba(17,17,19,.08);
  }
}

/* Fallback (if :has isn't supported) */
@supports not selector(li:has(img)){
  .widget li{
    padding: 8px 0;
  }
  .widget li + li{
    border-top: 1px solid rgba(17,17,19,.08);
  }
}

/* ============================
   ARCHIVE / SECTION HERO
   ============================ */

.hero{
  padding: 14px 0 6px 0;
}

.hero .hero-top{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:space-between;
  gap: 8px;
}

.hero .hero-title{
  margin: 6px 0 0 0;
}

.hero .hero-subtitle{
  margin: 8px 0 0 0;
  color: var(--sbb-muted);
  font-weight: 700;
  max-width: 72ch;
}

/* If your hero has action buttons/links */
.hero .hero-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* ============================
   CARDS (POST LISTING)
   ============================ */

.sbb-card{
  border: var(--sbb-border);
  border-radius: var(--sbb-radius);
  background: #fff;
  box-shadow: var(--sbb-shadow);
  overflow:hidden;
}

.sbb-card .card-media{
  aspect-ratio: 16/9;
  background: #111113;
  overflow:hidden;
  display:block;
}

.sbb-card .card-media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  filter: saturate(1.05);
}

.sbb-card .card-body{
  padding: 16px 16px 14px 16px;
}

.sbb-card .card-title{
  margin: 8px 0 8px 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.sbb-card .card-title a:hover{
  color: var(--sbb-accent);
}

.sbb-card .card-excerpt{
  margin: 0 0 12px 0;
  color: var(--sbb-muted);
}

.sbb-card .card-meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  margin-top: 12px;
}
/* ============================
   HERO FIX: stop actions from flying to far right
   ============================ */

.hero .hero-top{
  justify-content: flex-start;  /* was space-between */
  align-items: flex-end;
  gap: 12px;
}

.hero .hero-actions{
  margin-left: 0;              /* don’t push to extreme right */
  width: 100%;                 /* actions drop under title area */
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
/* ============================
   HERO LAYOUT: editorial stack
   ============================ */

.hero .hero-top{
  display: block;          /* kill the side-by-side layout */
}

.hero .hero-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Make sure the rule sits snug under the hero */
.hero + .rule{
  margin-top: 14px;
}
/* ============================
   HERO INLINE SEARCH
   ============================ */

.hero-search{
  margin-top: 12px;
  max-width: 560px;
}

.hero-search .search-form{
  display:flex;
  gap:10px;
  align-items:center;
}

.hero-search input[type="search"],
.hero-search .wp-block-search__input{
  width:100%;
  padding: 12px 14px;
  border-radius: 999px;
  border: var(--sbb-border);
  outline:none;
  background:#fff;
}

.hero-search input[type="search"]:focus,
.hero-search .wp-block-search__input:focus{
  border-color: rgba(225,29,72,.55);
  box-shadow: 0 0 0 4px rgba(225,29,72,.12);
}

.hero-search input[type="submit"],
.hero-search button[type="submit"],
.hero-search .wp-block-search__button{
  border-radius: 999px;
}
/* ============================
   FIX: MOST VIEWED POSTS LAYOUT
   ============================ */

/* Force the row to actually use the widget width */
.widget li:has(img) > a{
  width: 100%;
}

/* Allow text column to shrink instead of collapsing */
.widget li:has(img){
  min-width: 0;
}

.widget li:has(img) > a{
  grid-template-columns: 72px minmax(0, 1fr);
}

/* Prevent weird word stacking */
.widget li:has(img) a{
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Optional: tighten vertical rhythm */
.widget li:has(img){
  align-items: flex-start;
}
/* ============================
   MOST VIEWED POSTS: ROBUST LAYOUT
   Works whether the widget outputs:
   1) <a><img>Title</a>
   2) <img><a>Title</a>
   ============================ */

/* Apply only to list items that contain an image */
@supports selector(li:has(img)){

  .widget li:has(img){
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    min-width: 0;
  }

  /* If the widget wraps everything in a link, keep it spanning both columns */
  .widget li:has(img) > a{
    display: contents;
  }

  /* Thumbnail */
  .widget li:has(img) img{
    grid-column: 1;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
  }

  /* Title link */
  .widget li:has(img) a{
    grid-column: 2;
    min-width: 0;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.3;
    color: var(--sbb-text);
    text-decoration: none;

    /* Prevent the weird vertical stacking */
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
  }

  .widget li:has(img) a:hover{
    color: var(--sbb-accent);
  }

  /* Divider */
  .widget li:has(img) + li:has(img){
    border-top: 1px solid rgba(17,17,19,.08);
  }
}

/* Fallback for browsers without :has()
   (keeps it readable, not perfect grid) */
@supports not selector(li:has(img)){
  .widget li{
    padding: 10px 0;
  }
  .widget li + li{
    border-top: 1px solid rgba(17,17,19,.08);
  }
}

/* ============================
   WIDGET: RECENT COMMENTS
   ============================ */

/* Target only the Recent Comments widget output */
.widget_recent_comments ul,
.widget_recent_comments ol{
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget_recent_comments li{
  padding: 12px 0;
  margin: 0;
  border-top: 1px solid rgba(17,17,19,.08);
}

.widget_recent_comments li:first-child{
  border-top: 0;
}

/* The "Name on" part */
.widget_recent_comments .comment-author-link,
.widget_recent_comments .comment-author-link a{
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--sbb-muted);
}

/* The post title link */
.widget_recent_comments a{
  font-weight: 850;
  color: var(--sbb-text);
}

/* If WP wraps the post title in <a> right after "on" */
.widget_recent_comments li a:hover{
  color: var(--sbb-accent);
}

/* Make the whole item feel like a row */
.widget_recent_comments li{
  border-radius: 12px;
  padding-left: 2px;
  padding-right: 2px;
}

.widget_recent_comments li:hover{
  background: rgba(17,17,19,.03);
}

.widget_recent_comments a{
  font-weight: 750;
  line-height: 1.35;
}

/* ============================
   FOOTER – CLEAN UPGRADE
   ============================ */

.footer{
  border-top: 1px solid rgba(17,17,19,.10);
  padding: 34px 0 42px 0;
  background: linear-gradient(180deg, rgba(17,17,19,.02), rgba(0,0,0,0));
}

.footer-inner{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
  align-items:start;
}

/* left block */
.footer .brand{
  min-width: unset; /* prevents weird “reserved space” */
}
.footer .brand .site-title{
  font-size: 18px;
}
.footer .footer-tagline{
  margin: 10px 0 0 0;
  color: var(--sbb-muted);
  font-weight: 650;
  max-width: 60ch;
}
.footer .footer-copyright{
  margin: 12px 0 0 0;
  color: var(--sbb-muted);
  font-weight: 700;
}

/* right column widget */
.footer .widget{
  margin: 0; /* prevent extra gaps */
  padding: 16px 16px 12px 16px;
  border-radius: 18px;
}

/* "Quick Links" heading */
.footer .widget-title{
  font-size: 12px;
  letter-spacing: .12em;
  margin: 0 0 10px 0;
}

/* Remove bullets & make links feel designed */
.footer .widget ul{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap: 8px;
}

.footer .widget li{
  margin:0;
  padding:0;
  border:0;
}

.footer .widget a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;

  padding: 10px 12px;
  border-radius: 14px;

  background: rgba(17,17,19,.03);
  border: 1px solid rgba(17,17,19,.08);

  font-weight: 850;
  color: var(--sbb-text);

  /* prevent email/long text from breaking ugly */
  overflow-wrap: anywhere;
  word-break: normal;
}

.footer .widget a:hover{
  background: rgba(225,29,72,.08);
  border-color: rgba(225,29,72,.25);
  color: var(--sbb-accent);
}

/* If a widget prints plain text (not a link), keep it neat */
.footer .widget li,
.footer .widget{
  overflow-wrap: anywhere;
}

/* Responsive: stack nicely */
@media (max-width: 980px){
  .footer-inner{
    grid-template-columns: 1fr;
  }
}
