.site-main .breadcrumb-bar {
  background: var(--uwsp-news-primary);
  padding: 10px 0;
  font-size: 0.8125rem;
  
  #breadcrumbs, .breadcrumb {
    margin: 0;
    color: #fff !important;
    
    a, i, span {
      color: #fff !important;
      text-decoration: none;
      
      &:hover {
        text-decoration: underline;
      }
    }
  }
}

.uwsp-news-archive-wrap {
  padding: 3rem 0;

  .uwsp-news-hero {
    background: var(--uwsp-news-primary);
    background-color: color-mix(in srgb, var(--uwsp-news-primary), #000 20%);
    color: #fff;
    margin-bottom: 3rem;

    .hero-title-area {
      padding: 2.5rem 0;
      
      h1 {
        margin: 0;
        font-size: 2.5rem;
        font-weight: 700;
        color: #fff !important;
        text-transform: uppercase;
        font-family: "Roboto Condensed", sans-serif;
      }
    }
  }

  .uwsp-news-archive-inner {
    display: flex;
    gap: 3rem;
    align-items: flex-start;

    @media (max-width: 1024px) {
      flex-direction: column;
      gap: 2rem;
    }
  }

  .uwsp-news-sidebar {
    flex: 0 0 300px;
    width: 300px;
    
    @media (max-width: 1024px) {
      flex: 1 1 100%;
      width: 100%;
    }

    .card {
      background: #fff;
      border: 1px solid var(--uwsp-card-border);
      border-radius: var(--uwsp-card-radius);
      margin-bottom: 1rem;
      overflow: visible;

      .card-header {
        padding: 1rem 1.25rem;
        background: var(--uwsp-sidebar-header-bg);
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        
        .sidebar-title {
          margin: 0;
          font-size: 1rem;
          font-weight: 700;
          color: var(--uwsp-sidebar-title-color);
          text-transform: uppercase;
          letter-spacing: 0.05em;
        }

        .sidebar-accordion-toggle {
          background: none;
          border: none;
          padding: 0;
          color: #94a3b8;
        }
      }

      .card-body {
        padding: 1.25rem;
        display: none;
        border-top: 1px solid var(--uwsp-card-border);
      }

      &.is-expanded .card-body {
        display: block;
      }
      
      &.search-card .card-body {
        display: block; /* Search always visible */
      }
    }

    .sidebar-actions {
      margin-top: 2rem;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;

      .button-primary {
        background: var(--uwsp-news-primary);
        color: #fff;
        border: none;
        padding: 0.75rem;
        border-radius: 4px;
        font-weight: 700;
        cursor: pointer;
        text-align: center;
      }

      .button-clear {
        text-align: center;
        color: #64748b;
        font-size: 0.875rem;
        text-decoration: underline;
        
        &:hover {
          color: var(--uwsp-news-primary);
        }
      }
    }
    
    /* Dept Tree Hierarchy (Inside Sidebar) */
    .uwsp-news-dept-tree {
      font-size: 0.85rem;
      padding: 0;
      margin: 0;
      list-style: none;

      &.level-0 {
        margin-bottom: 0.5rem;
      }

      ul {
        padding-left: 0.75rem;
        border-left: 1px solid #eee;
        margin-left: 0;
        list-style: none;
      }

      li {
        margin: 0;
        padding: 0;
        list-style: none;

        .dept-item-row {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 5px;
          padding: 2px 0;
          border-bottom: 1px solid #fafafa;
          &:hover { background: #fcfcfc; }
        }

        .dept-toggle {
          background: #fff;
          border: 1px solid #eee;
          border-radius: 2px;
          width: 18px;
          height: 18px;
          padding: 0;
          display: flex;
          align-items: center;
          justify-content: center;
          cursor: pointer;
          color: #999;
          font-size: 12px;
          line-height: 1;
          flex-shrink: 0;
          &:hover {
            background: #f0f0f0;
            color: #333;
            border-color: #ccc;
          }
        }

        .dept-checkbox-label {
          flex: 1;
          font-size: 0.875rem;
          line-height: 1.4;
          display: flex;
          align-items: flex-start;
          gap: 8px;
          padding: 6px 0;
          cursor: pointer;
          margin: 0;
          
          input[type="checkbox"] {
            margin: 4px 0 0 0;
            flex-shrink: 0;
          }
        }
      }
    }

    /* Date Filter Styling (Inside Sidebar) */
    .date-filter-row {
      margin-bottom: 1rem;
      
      label {
        display: block;
        font-size: 0.8125rem;
        font-weight: 600;
        color: #64748b;
        margin-bottom: 0.25rem;
      }

      select {
        width: 100%;
        padding: 0.5rem;
        border-radius: 4px;
        border: 1px solid var(--uwsp-card-border);
      }
    }

    .date-range-wrap {
      margin-top: 1.5rem;
      padding-top: 1rem;
      border-top: 1px dashed #e2e8f0;
      
      .range-inputs {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        
        select {
          flex: 1;
          padding: 0.4rem;
          font-size: 0.8125rem;
          border-radius: 4px;
          border: 1px solid var(--uwsp-card-border);
        }
      }
    }

    /* Tag Token Input (Inside Sidebar) */
    .tag-token-input-wrap {
      position: relative;
      width: 100%;
      margin-top: 5px;
      z-index: 1000;
      
      .tag-tokens {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px;
        border: 1px solid var(--uwsp-card-border);
        border-radius: 4px;
        background: #fff;
        cursor: text;
        min-height: 42px;
        box-sizing: border-box;
        
        &:focus-within {
          border-color: var(--uwsp-news-primary);
          box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
        }
      }

      .tag-token {
        display: flex;
        align-items: center;
        background: #f1f5f9;
        color: #334155;
        padding: 2px 8px;
        border-radius: 4px;
        font-size: 0.8125rem;
        font-weight: 500;
        border: 1px solid #e2e8f0;
        
        .tag-token-remove {
          cursor: pointer;
          margin-right: 6px;
          color: #94a3b8;
          font-size: 1.1rem;
          line-height: 1;
          
          &:hover {
            color: #ef4444;
          }
        }
      }

      .tag-filter-search {
        flex: 1;
        min-width: 60px;
        border: none !important;
        padding: 4px !important;
        font-size: 0.9rem !important;
        outline: none !important;
        box-shadow: none !important;
        background: transparent !important;
      }

      .tag-dropdown-results {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1000;
        background: white;
        border: 1px solid #ddd;
        border-top: none;
        max-height: 250px;
        overflow-y: auto;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        border-radius: 0 0 4px 4px;
        
        ul.tag-list {
          list-style: none !important;
          margin: 0 !important;
          padding: 0 !important;
          width: 100% !important;
          text-indent: 0 !important;
          
          li {
            list-style: none !important;
            margin: 0 !important;
            padding: 0 !important;
            border-bottom: 1px solid #eee;
            width: 100% !important;
            background: none !important;
            
            &.is-hidden { display: none !important; }
            
            &:before, &:after {
              display: none !important;
              content: none !important;
            }
            
            &:hover {
              background: #f8f8f8 !important;
            }

            label {
              display: flex !important;
              flex-direction: row !important;
              align-items: center !important;
              gap: 12px !important;
              padding: 10px 12px !important;
              cursor: pointer !important;
              width: 100% !important;
              margin: 0 !important;
              font-size: 0.95rem !important;
              box-sizing: border-box !important;
              background: transparent !important;
              line-height: 1.2 !important;
            }

            input[type="checkbox"] {
              margin: 0 !important;
              cursor: pointer !important;
              width: 18px !important;
              height: 18px !important;
              flex-shrink: 0 !important;
            }

            &.is-selected {
              background: #f0f7ff !important;
            }
          }
        }
      }
    }
  }

  .uwsp-news-content {
    flex: 1;
    min-width: 0;

    .results-meta-top {
      margin-bottom: 2.5rem !important;
      padding: 0 0.5rem !important;
      display: flex !important;
      flex-direction: row !important;
      align-items: center !important;
      flex-wrap: wrap !important;
      gap: 1rem !important;
      width: 100% !important;
      
      .results-count {
        font-size: 1rem !important;
        font-weight: 700 !important;
        color: #475569 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.025em !important;
        white-space: nowrap !important;
        margin-right: 1rem !important;
      }

      .quick-filter-link {
        display: inline-block !important;
        font-size: 0.8125rem !important;
        padding: 0.5rem 1rem !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 6px !important;
        text-decoration: none !important;
        color: var(--uwsp-news-primary) !important;
        font-weight: 600 !important;
        transition: all 0.2s ease !important;
        line-height: 1 !important;
        white-space: nowrap !important;

        &:hover {
          background: #f1f5f9 !important;
          border-color: var(--uwsp-news-primary) !important;
          text-decoration: none !important;
        }

        &.is-active {
          background: var(--uwsp-news-primary) !important;
          color: #fff !important;
          border-color: var(--uwsp-news-primary) !important;
        }
      }
      
      /* View Mode Toggles */
      .view-mode-wrap {
        display: flex;
        gap: 0.25rem;
        background: #e2e8f0;
        padding: 0.25rem;
        border-radius: 6px;
        margin-left: 0.5rem;

        .view-mode-btn {
          background: none;
          border: none;
          padding: 0.4rem;
          border-radius: 4px;
          color: #64748b;
          cursor: pointer;
          display: flex;
          align-items: center;
          justify-content: center;
          transition: all 0.2s ease;

          &:hover {
            background: #f1f5f9;
            color: var(--uwsp-news-primary);
          }

          &.is-active {
            background: #fff;
            color: var(--uwsp-news-primary);
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
          }

          .dashicons {
            font-size: 1.25rem;
            width: 1.25rem;
            height: 1.25rem;
          }
        }
      }
    }

    .uwsp-news-results-header {
      margin-bottom: 2.5rem;
      
      .results-filter-card {
        background: #f8fafc;
        border: 1px solid var(--uwsp-card-border);
        border-radius: var(--uwsp-card-radius);
        padding: 1.5rem;

        .results-filter-row {
          display: flex;
          gap: 1.5rem;
          align-items: center;

          .header-search-wrap {
            flex: 1;
            min-width: 0;

            input {
              width: 100%;
              padding: 0.75rem 1rem;
              border: 1px solid var(--uwsp-card-border);
              border-radius: 4px;
              font-size: 0.9375rem;
              background: #fff;
              
              &:focus {
                outline: none;
                border-color: var(--uwsp-news-primary);
                box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
              }
            }
          }

          .page-size-wrap {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 0.875rem;
            color: #64748b;
            white-space: nowrap;

            select {
              padding: 0.5rem;
              border-radius: 4px;
              border: 1px solid var(--uwsp-card-border);
              background: #fff;
              cursor: pointer;
            }
          }
        }
      }
    }

    .uwsp-news-results {
      margin-bottom: 3rem;
      
      &.is-loading {
        opacity: 0.5;
        pointer-events: none;
      }
    }

    .uwsp-news-pagination {
      display: flex;
      justify-content: center;
      gap: 0.5rem;
      margin-bottom: 1em;
      
      .page-numbers {
        display: inline-block;
        padding: 0.5rem 1rem;
        border: 1px solid var(--uwsp-card-border);
        border-radius: 4px;
        text-decoration: none;
        color: #475569;
        transition: all 0.2s ease;

        &.current {
          background: var(--uwsp-news-primary);
          color: #fff;
          border-color: var(--uwsp-news-primary);
        }

        &:hover:not(.current) {
          background: #f8fafc;
          border-color: #cbd5e1;
        }
      }
    }
  }
}

/* Shared Results Layout (Archive & Block) */
.uwsp-news-results-items, .uwsp-newsblock {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 3rem;
  width: 100%;

  @media (max-width: 1200px) {
    grid-template-columns: repeat(2, 1fr);
  }

  @media (max-width: 640px) {
    grid-template-columns: 1fr;
  }

  /* List View Overrides */
  &.is-view-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    .news-list-item {
      display: flex;
      flex-direction: row;
      gap: 1.25rem;
      align-items: center !important;
      padding: 0.75rem 0;
      border-bottom: 1px solid #e2e8f0;

      .news-list-item-image {
        flex: 0 0 180px;
        width: 180px;
        height: 120px;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: #f8fafc;
        border-radius: 6px;
        
        a {
          display: flex;
          align-items: center;
          justify-content: center;
          width: 100%;
          height: 100%;
        }

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          object-position: center;
        }

        @media (max-width: 480px) {
          flex: 0 0 100px;
          width: 100px;
          height: 80px;
        }
      }

      .news-list-item-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
      }

      .news-list-item-header {
        padding: 0;
        margin-bottom: 0.125rem;
        
        .news-list-item-title {
          font-size: 1.125rem;
          margin-bottom: 0.125rem;
          
          a {
            color: var(--uwsp-news-primary);
            text-decoration: none;
            font-weight: 700;
            
            &:hover {
              text-decoration: underline;
            }
          }
        }
        
        .news-list-item-date {
          font-size: 0.8125rem;
          color: #64748b;
        }
      }

      .news-list-item-excerpt {
        font-size: 0.9375rem;
        line-height: 1.5;
        margin-bottom: 0.25rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }

      .news-list-item-details {
        font-size: 0.75rem;
        color: #64748b;
        
        .news-list-item-detail {
          margin-right: 1rem;
          display: flex;
          gap: 0.5rem;
          align-items: flex-start;
          margin-bottom: 0.125rem;
          
          .news-list-item-label {
            font-weight: 600;
            width: 70px;
            flex-shrink: 0;
          }
          
          .news-list-item-value {
            flex: 1;
          }
        }
      }
    }
  }
}

/* Search input specific (Global) */
#news-search-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--uwsp-card-border);
  border-radius: 4px;
  font-size: 0.875rem;
}